html, body { height: 100%; margin: 0; }
body {
  font-family: "Outfit", sans-serif;
  background: radial-gradient(circle at 50% 0%, #1b1f2a 0%, #0b0d12 60%, #050608 100%);
  color: #111;
  overscroll-behavior: none;
}

/* ── Navigation ─────────────────────────────────── */

.nav {
  background: rgba(11,13,18,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  width: min(1200px, 92vw);
  margin: 0 auto;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
}
.nav-logo {
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: block;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 5px 13px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.13); }

.nav-burger {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  cursor: pointer;
  padding: 7px 9px;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.88);
  border-radius: 2px;
}

/* ── Page layout ─────────────────────────────────── */

.page {
  width: min(1200px, 92vw);
  margin: 16px auto 28px;
}
.hero h1 {
  margin: 0 0 4px 0;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: clamp(20px, 3vw, 34px);
}
.chapo {
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-weight: 600;
  line-height: 1.4;
  max-width: 66ch;
  font-size: clamp(13px, 1.2vw, 15px);
}
.game-wrap { margin-top: 10px; }

/* ── Shared buttons ─────────────────────────────── */

.start-btn {
  margin-top: 12px;
  width: 100%;
  height: 50px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #fff;
  font-weight: 900;
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.start-btn:hover { opacity: 0.85; }
.start-btn--ghost {
  background: rgba(17,24,39,0.08);
  color: #111827;
  border: 1px solid rgba(17,24,39,0.18);
}

/* ── Footer ──────────────────────────────────────── */

.footer {
  width: min(1200px, 92vw);
  margin: 0 auto 28px;
  padding-top: 12px;
  display: flex;
  justify-content: center;
}
.footer-link {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.footer-link:hover { color: rgba(255,255,255,0.85); }

/* ── Page modals (welcome, confirm) ─────────────── */

.page-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
}
.page-modal-card {
  width: min(460px, 92vw);
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.40);
  text-align: center;
}
.page-modal-title {
  font-weight: 900;
  font-size: 26px;
  color: #111827;
  letter-spacing: 0.02em;
}
.page-modal-sub {
  font-weight: 700;
  font-size: 13px;
  color: rgba(17,24,39,0.65);
  margin-top: 6px;
  line-height: 1.45;
}
.welcome-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.welcome-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(17,24,39,0.18);
  background: rgba(17,24,39,0.04);
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.welcome-input:focus { border-color: rgba(249,115,22,0.7); }
.welcome-input--error { border-color: #ef4444 !important; }
.welcome-error {
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  text-align: left;
  margin-top: -4px;
}
.start-btn--danger {
  background: #ef4444;
  color: #fff;
}
.start-btn--danger:hover { opacity: 0.88; }

/* ── 404 page ─────────────────────── */

.not-found-wrap {
  text-align: center;
  padding: 32px 16px 80px;
}
.not-found-code {
  font-size: 120px;
  font-weight: 900;
  color: #f97316;
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -4px;
}
.not-found-msg {
  font-size: 16px;
  color: rgba(17,24,39,0.55);
  margin-bottom: 32px;
}
.not-found-btn {
  display: inline-block;
  text-decoration: none;
  width: auto;
  padding: 0 40px;
}

/* ── Homepage games grid ─────────────────────────── */

.games-byline {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.48);
}
.games-byline a {
  color: rgba(255,255,255,0.70);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.game-card {
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
a.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.34);
  border-color: rgba(255,255,255,0.18);
}

.game-card-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #d97706 0%, #f97316 55%, #ea580c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.game-card-thumb--soon {
  background: linear-gradient(135deg, #1a1f2e 0%, #252d3d 100%);
}
.game-card-thumb-label {
  font-size: 44px;
  opacity: 0.55;
  user-select: none;
  -webkit-user-select: none;
}

.game-card-body {
  padding: 14px 16px 16px;
}
.game-card-title {
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  letter-spacing: 0.01em;
}
.game-card-desc {
  font-weight: 600;
  font-size: 13px;
  color: rgba(255,255,255,0.52);
  margin-top: 5px;
  line-height: 1.45;
}
.game-card-cta {
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
  font-size: 13px;
  color: #f97316;
  letter-spacing: 0.02em;
}

.game-card--soon {
  opacity: 0.32;
  pointer-events: none;
  cursor: default;
}

@media (max-width: 640px) {
  .games-grid { gap: 10px; margin-top: 14px; }
  .game-card-thumb-label { font-size: 32px; }
  .game-card-body { padding: 10px 12px 12px; }
  .game-card-title { font-size: 15px; }
  .game-card-desc { font-size: 12px; margin-top: 3px; }
  .game-card-cta { margin-top: 8px; font-size: 12px; }
}

/* ── Hall of Fame ────────────────────────────────── */

.hof-section {
  width: min(1200px, 92vw);
  margin: 20px auto 0;
  padding: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-sizing: border-box;
}
.hof-header { margin-bottom: 14px; }
.hof-title {
  margin: 0;
  color: #fff;
  font-weight: 900;
  font-size: clamp(18px, 2.5vw, 26px);
  letter-spacing: 0.02em;
}
.hof-meta {
  margin-top: 4px;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  font-weight: 600;
}
#hof-player-tag { margin-bottom: 12px; }
.hof-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249,115,22,0.14);
  border: 1px solid rgba(249,115,22,0.28);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.hof-player-link, .hof-link {
  color: #f97316;
  text-decoration: none;
  font-weight: 800;
}
.hof-player-link:hover, .hof-link:hover { text-decoration: underline; }
.hof-empty {
  color: rgba(255,255,255,0.40);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}
.hof-list { display: flex; flex-direction: column; gap: 4px; }
.hof-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.hof-row--top {
  background: rgba(249,115,22,0.07);
  border-color: rgba(249,115,22,0.16);
}
.hof-row--me {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.20);
}
.hof-rank {
  font-weight: 900;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  text-align: center;
  line-height: 1;
}
.hof-name {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hof-link { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-score {
  color: rgba(255,255,255,0.90);
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
}
.hof-char {
  color: rgba(249,115,22,0.85);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  background: rgba(249,115,22,0.12);
  border-radius: 6px;
  padding: 2px 7px;
}
.hof-date {
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.hof-change-btn {
  margin-top: 16px;
  padding: 8px 20px;
  height: auto;
  width: auto;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.50);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  font-family: "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.hof-change-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.80);
}
.hof-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.hof-actions .hof-change-btn { margin-top: 0; }
.hof-change-btn--danger {
  color: rgba(239,68,68,0.70);
  border-color: rgba(239,68,68,0.20);
}
.hof-change-btn--danger:hover {
  background: rgba(239,68,68,0.10);
  color: rgba(239,68,68,1);
  border-color: rgba(239,68,68,0.40);
}

/* ── Tablet ──────────────────────────────────────── */

@media (max-width: 900px) {
  .nav-inner { height: 46px; gap: 16px; }
  .nav-link { font-size: 13px; padding: 4px 10px; }
  .page { margin: 12px auto 20px; }
  .hero h1 { font-size: clamp(18px, 3.5vw, 28px); }
  .hof-section { padding: 16px; margin-top: 16px; }
  .start-btn { height: 46px; font-size: 14px; }
}

/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 640px) {
  /* Nav */
  .nav-inner {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
    gap: 0;
  }
  .nav-logo { margin-right: auto; font-size: 14px; }
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11,13,18,0.98);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 4px 0 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .nav-links.nav-links--open { display: flex; }
  .nav-link { padding: 10px 18px; border-radius: 0; font-size: 14px; }

  /* Page */
  .page { width: 100%; margin: 8px auto 12px; padding: 0 8px; box-sizing: border-box; }
  .hero h1 { font-size: clamp(16px, 5vw, 22px); margin-bottom: 3px; }
  .chapo { display: none; }
  .game-wrap { margin-top: 8px; }

  .start-btn { height: 40px; font-size: 13px; }

  .footer { margin-bottom: 12px; }

  /* Hall of Fame */
  .hof-section { padding: 12px 10px; margin-top: 12px; }
  .hof-row { grid-template-columns: 28px 1fr auto auto; gap: 5px; padding: 7px 8px; }
  .hof-date { display: none; }
  .hof-score { font-size: 12px; }
  .hof-rank { font-size: 12px; }
  .hof-name { font-size: 13px; }
  .hof-title { font-size: clamp(16px, 4vw, 20px); }
  .hof-meta { font-size: 11px; }

  /* Page modals */
  .page-modal-card { padding: 18px 14px; }
  .page-modal-title { font-size: 20px; }
  .welcome-input { font-size: 14px; padding: 10px 12px; }
}
