﻿:root {
  --bg: #090b13;
  --bg-2: #12172a;
  --ink: #f4f7fb;
  --muted: #aeb9d1;
  --line: rgba(255,255,255,.13);
  --glass: rgba(20, 27, 48, .74);
  --hot: #ffb05c;
  --cyan: #78e7ff;
  --green: #69e093;
  --danger: #ff6f91;
  --shadow: 0 24px 80px rgba(0,0,0,.44);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", Verdana, sans-serif;
  background:
    radial-gradient(circle at 20% 12%, rgba(120,231,255,.20), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(255,176,92,.18), transparent 24rem),
    linear-gradient(135deg, var(--bg), #121525 58%, #1a1522);
}
button, input { font: inherit; }
button {
  border: 0;
  border-radius: 16px;
  padding: .9rem 1.1rem;
  color: var(--ink);
  background: rgba(255,255,255,.10);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
button:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.28); }
button.primary { background: linear-gradient(135deg, #ff9f45, #e8cf67 52%, #7bf0c0); color: #111521; font-weight: 800; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.08);
  color: var(--ink);
  outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(120,231,255,.12); }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero-shell { min-height: 100vh; display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center; }
.hero-card h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(4rem, 12vw, 9rem); line-height: .82; margin: 0 0 1rem; letter-spacing: -.08em; }
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .18em; font-size: .76rem; font-weight: 800; }
.lede { color: var(--muted); max-width: 640px; font-size: clamp(1.1rem, 2vw, 1.45rem); }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.form-panel { margin-top: 2rem; padding: 22px; display: grid; gap: 12px; max-width: 560px; }
.form-panel label { color: var(--muted); font-weight: 700; }
.join-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.status { min-height: 1.4em; color: var(--muted); }
.status.error { color: var(--danger); }
.leaderboard-card { padding: 26px; }
.leaderboard-card h2, .side-panel h2 { margin-top: 0; }
.leaderboard, .players { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.leaderboard li, .player-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.07); }
.leaderboard strong { color: var(--hot); }
.reveal { animation: rise .6s ease both; }
.reveal.late { animation-delay: .12s; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px min(4vw, 34px); }
.brand { color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.4rem; letter-spacing: -.04em; }
.room-pill { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px; }
.room-pill button { padding: .45rem .75rem; border-radius: 999px; }
.game-layout { width: min(1240px, calc(100% - 24px)); margin: 0 auto 28px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.board-wrap { padding: 16px; display: grid; place-items: center; overflow: hidden; }
canvas { max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 18px; border: 1px solid rgba(255,255,255,.09); }
.side-panel { padding: 20px; align-self: start; display: grid; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-grid div { padding: 14px; border-radius: 18px; background: rgba(0,0,0,.22); }
.stat-grid span { display: block; color: var(--muted); font-size: .85rem; }
.stat-grid strong { font-size: 1.7rem; }
.player-row { display: grid; grid-template-columns: 1fr; }
.player-row.me { outline: 1px solid rgba(120,231,255,.55); }
.player-row small { display: block; color: var(--muted); }
.progress { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.hint { color: var(--muted); }
.mobile-controls { display: none; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; width: 100%; }
.result-modal { color: var(--ink); background: #131a2b; border: 1px solid var(--line); border-radius: 24px; padding: 24px; min-width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.result-modal::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(5px); }
.result-modal[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .hero-shell, .game-layout { grid-template-columns: 1fr; }
  .hero-shell { padding: 42px 0; }
  .mobile-controls { display: grid; }
  .topbar { align-items: flex-start; }
}
@media (max-width: 520px) {
  .join-grid { grid-template-columns: 1fr; }
  .hero-card h1 { font-size: 4.2rem; }
  .board-wrap, .side-panel { border-radius: 20px; }
}
