:root {
  color-scheme: dark;
  font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
  background: #121415;
  color: #f3f3ec;
  --accent: #ebfb88;
  --line: #3a3d36;
  --muted: #b9beb5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }

header {
  min-height: 4.5rem;
  padding: .75rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  color: var(--accent);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: .22em;
  text-decoration: none;
}

#lobby {
  width: min(100% - 2rem, 30rem);
  margin: clamp(2rem, 12vh, 8rem) auto 0;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  background: #202321;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
}

h1 {
  margin: 0;
  font-weight: 750;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.04em;
}

p { color: var(--muted); }
form { display: grid; margin-top: .5rem; gap: .4rem; }
label { font-weight: 600; }

input, button, select, .button {
  font: inherit;
  border-radius: .25rem;
  padding: .62rem .8rem;
}

input {
  width: 100%;
  margin-bottom: .65rem;
  color: inherit;
  background: #131614;
  border: 1px solid #686d60;
}

button, .button {
  color: #1c230e;
  background: var(--accent);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
}

.button { display: inline-block; margin-top: .65rem; text-decoration: none; }
button:hover, .button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

nav { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
nav button { color: inherit; background: #202321; border-color: var(--line); }

.game-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem 1.5rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
}

.game-toolbar p { margin: 0; flex: 1 1 19rem; }

#reload {
  color: inherit;
  background: #202321;
  border-color: var(--line);
}

#screen {
  object-fit: contain;
  background: #080909;
  border: 0;
  display: block;
  width: 100%;
  height: max(22rem, calc(100dvh - 9.5rem));
}

.game-area { position: relative; display: flex; align-items: flex-start; }
.game-area #screen { min-width: 0; }
.game-area:fullscreen #screen { height: 100%; }
h2 { margin: 0; font-size: 1.35rem; }

@media (max-width: 680px) {
  header { gap: .5rem; align-items: flex-start; }
  .game-area { display: block; }
}

#status {
  margin: 1rem auto;
  padding: 0 1rem;
  text-align: center;
  color: var(--accent);
}

#status:empty { display: none; }
