/* Lumen: one material (smoked glass), one light (warm white), the players' own colors.
   Shared by the big screen and the phones. */

@font-face {
  font-family: "Lumen";
  src: url("../fonts/roboto-var.woff") format("woff");
  font-weight: 100 900;
  font-stretch: 75% 100%;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --void: #06080b;
  --ink: #0b0e13;
  --glass: rgba(16, 20, 27, 0.78);
  --glass-solid: #12161d;
  --hair: rgba(244, 239, 228, 0.1);
  --hair2: rgba(244, 239, 228, 0.2);
  --light: #f4efe4;
  --dim: rgba(244, 239, 228, 0.6);
  --faint: rgba(244, 239, 228, 0.32);
  --energy: #ffc56e;
  --laser: #ff4a3a;
  --coral: #ff7a6b;
  --violet: #b99bff;
  --mint: #5fe3b8;
  --sky: #7aa8ff;
  --me: var(--light);
  --font: Lumen, Roboto, "Segoe UI", system-ui, sans-serif;
  /* names the framework's example games expect */
  --text: var(--light);
  --muted: var(--dim);
  --accent: var(--light);
  --panel: var(--glass);
  --line: var(--hair);
  --display: var(--font);
  color-scheme: dark;
}

html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-weight: 300;
  color: var(--light);
  line-height: 1.4;
  background: radial-gradient(120% 90% at 50% 20%, #121821 0%, #090c11 55%, var(--void) 100%) fixed, var(--void);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 200; line-height: 1; }
button, input { font: inherit; color: inherit; }

.muted { color: var(--dim); }
.small { font-size: 0.85em; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* The wordmark: thin, tracked capitals. */
.wordmark {
  font-weight: 200;
  font-size: 1.3rem;
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  text-transform: uppercase;
  color: var(--light);
  white-space: nowrap;
}
.wordmark b { font-weight: 500; }

/* Buttons: light on glass. The main action is a solid disc or pill of light. */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: 0 1.6em;
  border: 1px solid var(--hair2);
  border-radius: 999px;
  background: rgba(20, 25, 33, 0.7);
  color: var(--light);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s, background 0.3s, border-color 0.3s, opacity 0.3s, box-shadow 0.3s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { background: var(--light); border-color: var(--light); color: var(--ink); font-weight: 500; box-shadow: 0 0 2rem rgba(244, 239, 228, 0.25); }
.btn:disabled { opacity: 0.3; cursor: default; box-shadow: none; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: none; border-color: transparent; color: var(--dim); }
.btn.secondary { background: rgba(20, 25, 33, 0.7); }
.btn .lm-g { width: 1.4em; height: 1.4em; }

/* Glyphs are lines of light; sized by their container. */
.lm-g { display: block; width: 1.5rem; height: 1.5rem; }
.lm-bot { display: block; overflow: visible; }

/* Cards: lit slides (programming), coral (SPAM), violet (Haywire). Used by the lobby, the race and the phones. */
.lm-card {
  display: inline-grid; place-items: center; flex: none;
  width: 3.2rem; height: 4.1rem; border-radius: .55rem; color: #15181d; background: var(--light);
  box-shadow: 0 0 1.2rem rgba(244, 239, 228, .35), inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.lm-card .lm-g { width: 74%; height: 74%; }
.lm-card.t-pu { color: #c98a12; }
.lm-card.spam { background: var(--coral); box-shadow: 0 0 1.2rem rgba(255, 122, 107, .45); }
.lm-card.hay { background: var(--violet); box-shadow: 0 0 1.2rem rgba(185, 155, 255, .45); }
.lm-hw { display: flex; align-items: center; justify-content: center; gap: 0; width: 92%; }
.lm-hw .lm-g.sm { width: 1.1rem; height: 1.1rem; flex: none; }
.lm-hw b { font-weight: 600; font-size: .85rem; line-height: 1; }


/* Seconds left (the framework fills these in). */
.timer { font-variant-numeric: tabular-nums; font-weight: 300; }
.timer.deadline-low { color: var(--energy); }

/* A thin ring that turns while something loads. */
.spinner {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1.5px solid var(--hair);
  border-top-color: var(--light);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Connection trouble: a quiet band at the top. */
.offline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  background: rgba(255, 122, 107, 0.16);
  border-bottom: 1px solid rgba(255, 122, 107, 0.45);
  color: var(--light);
  backdrop-filter: blur(8px);
}
.error-toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 1rem;
  align-items: center;
  max-width: min(90vw, 50rem);
  padding: 0.7rem 0.8rem 0.7rem 1.2rem;
  border-radius: 1rem;
  background: rgba(30, 14, 14, 0.92);
  border: 1px solid rgba(255, 122, 107, 0.5);
  font-size: 0.9rem;
}
.error-close { appearance: none; border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 1rem; }
.stage-error { margin: 2rem; padding: 1.5rem; border-radius: 1rem; background: var(--glass); border: 1px solid rgba(255, 122, 107, 0.5); display: grid; gap: 0.8rem; }
.stage-error pre { white-space: pre-wrap; margin: 0; color: var(--coral); }

dialog {
  border: 1px solid var(--hair2);
  border-radius: 1.2rem;
  background: var(--glass-solid);
  color: var(--light);
  padding: 1.6rem;
  max-width: min(32rem, 92vw);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
dialog input {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid var(--hair2);
  background: rgba(0, 0, 0, 0.35);
}
dialog label { display: block; font-size: 0.9rem; color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
