html, body {
  height: 100%;
  margin: 0;
  background: #000;
  color: #eee;
  font: 16px/1.4 system-ui, sans-serif;
}

body {
  display: grid;
  place-items: center;
}

body > * {
  animation: drop 1.2s ease-out both;
}

form, main {
  display: grid;
  gap: 0.75rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-weight: normal;
}

input, select, button {
  padding: 0.6rem 0.8rem;
  background: transparent;
  color: inherit;
  border: 1px solid #444;
  border-radius: 4px;
  font: inherit;
  outline: none;
}

input {
  width: 14rem;
  text-align: center;
  letter-spacing: 0.2em;
}

input:focus, button:hover {
  border-color: #aaa;
}

button {
  cursor: pointer;
}

select option {
  background: #000;
}

.note {
  margin: 0;
  color: #999;
}

.code {
  margin: 0;
  font: 1.5rem/1 monospace;
  letter-spacing: 0.1em;
  user-select: all;
}

.qr {
  width: 14rem;
  height: 14rem;
  margin: 0 auto;
  border-radius: 4px;
}

/* A row of controls: the mint form, the chat composer. */

.row {
  display: flex;
  gap: 0.5rem;
}

.row input {
  flex: 1;
  width: auto;
  text-align: left;
  letter-spacing: normal;
}

/* Room */

.room iframe {
  width: min(40rem, 100vw - 2rem);
  height: 50vh;
  border: 1px solid #222;
  border-radius: 4px;
  background: #000;
}

body.messages {
  display: flex;
  flex-direction: column-reverse;   /* newest message at the bottom, scrolled into view */
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  padding: 2.2rem 0.75rem 0;   /* room for the fixed "Here:" line */
  box-sizing: border-box;
  overflow-y: auto;
}

body.messages > * {
  animation: none;
  margin: 0.25rem 0;
}

body.messages b {
  color: #999;
  font-weight: normal;
  margin-right: 0.5rem;
}

body.messages .here {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.4rem 0.75rem;
  background: #000;
  border-bottom: 1px solid #222;
  color: #999;
  font-size: 0.85rem;
}

body.messages .here form {
  display: inline;
}

body.messages .here button {
  padding: 0 0.4rem;
  margin-left: 0.3rem;
  font-size: 0.75rem;
  color: #999;
}

body.messages .system {
  color: #777;
  font-style: italic;
}

body.messages time {
  color: #777;
  font: 0.8rem/1 monospace;
  margin-right: 0.6rem;
}

/* Admin */

.admin {
  width: min(64rem, 100% - 2rem);
  text-align: left;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #222;
  text-align: left;
}

td form {
  display: inline;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-2rem); }
  to   { opacity: 1; transform: none; }
}
