:root {
  --bg: #0b1340;
  --panel: #11225e;
  --accent: #ffcc00;
  --text: #ffffff;
  --muted: #8a92b8;
  --good: #6fe07a;
  --bad: #ff7676;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--panel);
  border-bottom: 2px solid var(--accent);
}
header h1 { margin: 0; font-size: 1.5rem; }
header h1 a { color: var(--accent); text-decoration: none; letter-spacing: 1px; }

nav a, nav .user { color: var(--text); margin-left: 1rem; text-decoration: none; }
nav a:hover { color: var(--accent); }
nav .user { color: var(--muted); }

main { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }

.score { font-size: 1.1rem; }

.board { width: 100%; border-collapse: separate; border-spacing: 8px; table-layout: fixed; }
.board th {
  background: var(--accent);
  color: var(--bg);
  padding: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  font-size: 0.95rem;
  line-height: 1.15;
}
.board td.cell {
  background: var(--panel);
  text-align: center;
  height: 90px;
  border-radius: 6px;
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}
.board td.cell a {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--accent); text-decoration: none;
}
.board td.cell a:hover { background: #1a2f7a; border-radius: 6px; }
.board td.cell.solved { background: #06082a; color: var(--muted); font-size: 1.5rem; }
.board td.cell.empty { background: transparent; }

@media (max-width: 640px) {
  header { padding: 0.75rem 1rem; }
  header h1 { font-size: 1.1rem; }
  nav a, nav .user { margin-left: 0.5rem; font-size: 0.85rem; }
  main { margin: 1rem auto; padding: 0 0.5rem; }
  .board { border-spacing: 3px; }
  .board th {
    padding: 0.3rem 0.15rem;
    font-size: 0.6rem;
    letter-spacing: 0;
  }
  .board td.cell { height: 52px; font-size: 1.1rem; }
  .board td.cell.solved { font-size: 0.85rem; }
}

.challenge {
  background: var(--panel);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  max-width: 720px;
  margin: 0 auto;
}
.challenge .crumbs a { color: var(--muted); text-decoration: none; }
.challenge h2 { color: var(--accent); margin-top: 0.25rem; }
.challenge .question { font-size: 1.25rem; line-height: 1.5; }
.challenge audio { width: 100%; margin: 1rem 0; }
.challenge .clue-image {
  display: block; max-width: 100%; max-height: 480px;
  margin: 1rem auto; border-radius: 6px;
}
.challenge .clue-video {
  display: block; width: 100%; max-height: 480px;
  margin: 1rem auto; border-radius: 6px;
  background: #000;
}

.answer { display: flex; gap: 0.5rem; align-items: end; margin-top: 1rem; }
.answer label { display: flex; flex-direction: column; flex: 1; }
.answer input {
  padding: 0.6rem; border: 1px solid var(--muted);
  background: var(--bg); color: var(--text);
  border-radius: 4px; font-size: 1rem;
}

button {
  padding: 0.6rem 1.2rem; background: var(--accent); color: var(--bg);
  border: none; border-radius: 4px; font-size: 1rem; font-weight: bold; cursor: pointer;
}
button:hover { background: #ffd633; }

.result { padding: 0.6rem 0.8rem; border-radius: 4px; margin-top: 1rem; }
.result.good { background: #143a1a; color: var(--good); }
.result.bad  { background: #3a1414; color: var(--bad); }

.login {
  max-width: 420px; margin: 3rem auto;
  background: linear-gradient(160deg, #1a2f7a 0%, var(--panel) 60%, #0a1546 100%);
  padding: 2.25rem 2rem 1.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 204, 0, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(255, 204, 0, 0.08);
  position: relative;
  overflow: hidden;
}
.login::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0 2px,
      transparent 2px 4px
    );
  pointer-events: none;
}
.login h2 {
  color: var(--accent); margin: 0 0 0.5rem;
  text-align: center; font-size: 2rem; letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 204, 0, 0.45), 0 2px 0 #000;
}
.login-sub {
  text-align: center; color: var(--muted); margin: 0 0 1.25rem;
  font-size: 0.95rem; line-height: 1.45;
}
.login-foot {
  text-align: center; color: var(--muted); margin: 1.25rem 0 0;
  font-size: 0.8rem; font-style: italic; opacity: 0.85;
}
.login form { display: flex; flex-direction: column; gap: 0.85rem; position: relative; }
.login input {
  padding: 0.7rem 0.85rem; border: 1px solid var(--muted);
  background: rgba(6, 8, 42, 0.85); color: var(--text);
  border-radius: 6px; font-size: 1rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.login input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.25);
}
.login label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.85rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}
.login button {
  margin-top: 0.4rem; padding: 0.75rem 1.2rem;
  letter-spacing: 1.5px; text-transform: uppercase;
  box-shadow: 0 4px 0 #b38f00, 0 10px 18px rgba(0, 0, 0, 0.4);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.login button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b38f00, 0 4px 10px rgba(0, 0, 0, 0.4);
}

.login-art {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem;
  height: 70px; margin-bottom: 1rem;
  background: #06082a;
  border: 2px solid #000;
  border-radius: 8px;
  box-shadow: 0 4px 0 #000, inset 0 0 0 4px #2a3a8a;
}
.login-art .reel {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at center, #1a1a1a 0 8px, #555 8px 11px, #1a1a1a 11px);
  box-shadow: inset 0 0 0 2px #888;
  animation: spin 4s linear infinite;
}
.login-art .tape {
  color: var(--accent); font-weight: bold; font-size: 0.85rem;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
}
@keyframes spin { to { transform: rotate(360deg); } }

.scoreboard {
  width: 100%; border-collapse: collapse;
  background: var(--panel); border-radius: 8px; overflow: hidden;
}
.scoreboard th, .scoreboard td {
  padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #1a2f7a;
}
.scoreboard th { background: var(--accent); color: var(--bg); }
.scoreboard tr.me { background: #1a2f7a; }

.grid-title {
  margin: 2rem 0 0.75rem; color: var(--accent);
  letter-spacing: 1px; text-transform: uppercase; font-size: 1.1rem;
}
.grid-wrap { overflow-x: auto; border-radius: 8px; }
.solve-grid {
  border-collapse: collapse;
  background: var(--panel);
  width: 100%;
  font-size: 0.9rem;
}
.solve-grid th, .solve-grid td {
  padding: 0.5rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid #1a2f7a;
  border-right: 1px solid #1a2f7a;
}
.solve-grid th {
  background: rgba(255, 204, 0, 0.12);
  color: var(--accent);
  font-weight: bold;
}
.solve-grid th.cat {
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--accent);
}
.solve-grid th.player-col, .solve-grid td.player-col {
  text-align: left;
  background: #1a2f7a;
  color: var(--text);
  font-weight: bold;
  position: sticky;
  left: 0;
  z-index: 1;
}
.solve-grid td.solved { color: var(--good); font-weight: bold; font-size: 1.05rem; }
.solve-grid td.unsolved { color: var(--muted); opacity: 0.5; }
.solve-grid tr.me td.player-col { background: var(--accent); color: var(--bg); }
