/* =============================================================
   Topbar
   ============================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.logo {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  font-variation-settings: 'wdth' 80;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.logo:hover { opacity: 0.85; }
.logo .pink { color: var(--pink); }
.logo .tag {
  font-family: var(--body);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--ink-3);
  padding: 3px 7px;
  border: 1px solid var(--hair-2);
  border-radius: 4px;
}
.user { display: flex; align-items: center; gap: 10px; }

/* Guest CTA — same pink pill, sign-in entry point. */
.daily {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--pink);
  color: white;
  border: 0;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-pink);
  transition: all .18s;
}
.daily:hover { transform: translateY(-1px); box-shadow: var(--shadow-deep); }

/* Wallet pill — primary status surface (balance), always visible. */
a.wallet { text-decoration: none; color: inherit; cursor: pointer; }
a.wallet:hover { border-color: var(--pink); }
.wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--hair-2);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  transition: all .3s;
}
.wallet.flash { background: var(--pink-veil); border-color: var(--pink); }
.wallet .ccy { color: var(--ink-3); font-size: 11px; letter-spacing: 1px; }
.wallet .sub-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--green-veil);
}

/* User menu — <details> dropdown anchored under the avatar. */
.user-menu {
  position: relative;
}
.user-menu summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.user-menu[open] summary.avatar { transform: scale(1.05); box-shadow: 0 0 0 3px var(--pink-veil); }
.user-menu summary.avatar:hover { transform: scale(1.05); }
.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--hair-2);
  border-radius: var(--r-card);
  box-shadow: 0 12px 32px -8px rgba(10,10,10,0.18);
  padding: 6px 0;
  z-index: 60;
  font-family: var(--body);
}
.user-menu-head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 4px;
}
.user-menu-head strong { display: block; font-size: 14px; color: var(--ink); }
.user-menu-head .small { font-size: 11px; color: var(--ink-3); letter-spacing: 0.3px; }
.user-menu-link {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .12s;
}
.user-menu-link:hover { background: var(--paper-2); color: var(--ink); }
.user-menu-link.admin { color: var(--pink-2); font-weight: 700; }
.user-menu-divider { height: 1px; background: var(--hair); margin: 4px 0; }
.user-menu-lang {
  display: flex;
  gap: 4px;
  padding: 6px 14px;
  align-items: center;
}
.user-menu-logout { margin: 0; padding: 4px 14px 8px; }
.user-menu-logout button {
  width: 100%;
  background: transparent;
  border: 1px solid var(--hair-2);
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.user-menu-logout button:hover { background: var(--ink); color: white; border-color: var(--ink); }

/* Language pills — used inline (guest topbar) and inside the menu. */
.lang-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink-3);
  text-decoration: none;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair-2);
  background: var(--paper);
  transition: all .15s;
  line-height: 1;
}
.lang-pill:hover:not(.active) { color: var(--ink); border-color: var(--ink-3); }
.lang-pill.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.lang-pill.solo {
  /* Guest header — single pill that toggles to the other language. */
  border-color: var(--hair-2);
}

/* =============================================================
   Game filter
   ============================================================= */
.games-bar {
  position: sticky;
  top: 65px;
  z-index: 40;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.games-scroll {
  display: flex;
  gap: 6px;
  padding: 11px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.games-scroll::-webkit-scrollbar { display: none; }

.game-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--hair-2);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all .15s;
}
.game-pill:hover { color: var(--ink); border-color: var(--ink-3); }
.game-pill.active { background: var(--ink); color: white; border-color: var(--ink); }
.game-pill .count {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
}

/* =============================================================
   Two-column shell
   ============================================================= */
.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

/* =============================================================
   Season strip
   ============================================================= */
.season {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.season-text { color: var(--ink-2); }
.season-text b { color: var(--ink); font-weight: 700; }
.season-text .pink { color: var(--pink-2); font-weight: 700; }
.season-bar {
  width: 160px;
  height: 6px;
  background: var(--paper-3);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.season-bar div { height: 100%; width: 62%; background: linear-gradient(90deg, var(--pink), var(--green)); }

main { padding: 32px 0 24px; }

/* =============================================================
   Footer
   ============================================================= */
footer {
  border-top: 1px solid var(--hair);
  padding: 56px 24px 40px;
  text-align: center;
  margin-top: 60px;
}
.m8win {
  font-family: var(--display);
  font-size: clamp(64px, 12vw, 120px);
  font-weight: 800;
  font-variation-settings: 'wdth' 75;
  letter-spacing: -5px;
  color: var(--pink);
  line-height: 0.9;
  margin-bottom: 12px;
}
.foot-tag { font-style: italic; font-size: 16px; color: var(--ink-2); margin-bottom: 24px; font-weight: 500; }
.foot-signoff {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 14px;
}
.foot-signoff::before, .foot-signoff::after {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--hair-2);
}
.foot-legal {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.2px;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto 10px;
}
.foot-legal-nav {
  font-size: 11px;
  margin: 14px 0 4px;
  color: var(--ink-3);
}
.foot-legal-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  margin: 0 4px;
}
.foot-legal-nav a:hover { color: var(--pink-2); }
.foot-legal-nav span { opacity: 0.5; }

.foot-copyright {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.5px;
  margin-top: 20px;
}
.foot-copyright a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 700;
}
.foot-copyright a:hover { color: var(--pink-2); }

/* =============================================================
   Mobile (<= 980px) — layout shell, topbar, games bar
   Touch-target minimums (44px) follow Apple HIG / Material guidelines.
   .games-bar `top` matches the mobile topbar height so the sticky bar sits
   flush against it without a content-bleed gap (12 + 44 + 12 + 1px border).
   ============================================================= */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .topbar { padding: 12px 16px; }
  .games-bar { top: 69px; }
  .games-scroll { padding: 10px 16px; }
  .daily { min-height: 44px; }
  .wallet { min-height: 44px; }
  .game-pill { min-height: 44px; }
  .user-menu summary.avatar { width: 44px; height: 44px; }
  .logo { font-size: 22px; }
  .logo .tag { display: none; }

  /* Mobile dropdown adjustments — anchor to viewport edge with a small gap. */
  .user-menu-panel {
    right: -4px;
    min-width: 240px;
  }
}

@media (max-width: 540px) {
  /* On the tightest screens, drop the "GC" suffix from the wallet pill to
     save horizontal room. The number itself is unambiguous. */
  .wallet .ccy { display: none; }
}
