/* ==========================================================================
   BALL KNOWLEDGE — App Stylesheet
   Design system: light, card-based, green accent (Figma reference)
   ========================================================================== */

:root{
  /* Brand */
  --green:        #16a34a;
  --green-2:      #22c55e;
  --green-dark:   #0e7a3b;
  --green-tint:   #e9f9ef;
  --green-line:   #bdeccb;

  --purple:       #7c3aed;
  --purple-tint:  #f2ecfd;
  --amber:        #d97706;
  --amber-tint:   #fef3e0;
  --red:          #dc2626;
  --red-tint:     #fdecec;
  --blue:         #2563eb;
  --blue-tint:    #eaf1fe;

  /* Neutrals */
  --ink:          #0d1117;
  --ink-soft:     #1c2430;
  --text:         #131826;
  --text-2:       #5b6472;
  --text-3:       #8b93a1;
  --line:         #e7e9ee;
  --line-soft:    #f0f1f4;
  --bg:           #f5f6f8;
  --card:         #ffffff;

  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:       0 4px 16px rgba(15,23,42,.07);
  --shadow-lg:    0 12px 32px rgba(15,23,42,.12);

  --font-head:    'Manrope', 'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; overflow-x:hidden; }
body{
  margin:0;
  font-family:var(--font-body);
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  padding-bottom:0;
  overflow-x:hidden;
  width:100%;
}
h1,h2,h3,h4{ font-family:var(--font-head); font-weight:800; line-height:1.15; margin:0 0 .4em; color:var(--ink); }
p{ margin:0 0 1em; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; }
ul{ margin:0; padding:0; list-style:none; }

.container{ max-width:1240px; margin:0 auto; padding:0 24px; }
.container--narrow{ max-width:520px; }
.text-muted{ color:var(--text-2); }
.section-title{ font-family:var(--font-head); font-size:1.4rem; font-weight:800; margin:0 0 18px; }
@media (max-width:480px){
  .container{ padding:0 16px; }
}

/* ── Small-screen safety net: nothing should ever overflow the viewport ── */
@media (max-width:600px){
  html, body{ max-width:100%; overflow-x:hidden; }
  .btn{ padding:10px 16px; font-size:.86rem; white-space:normal; text-align:center; }
  .btn--sm{ padding:8px 13px; font-size:.78rem; }
  .btn--lg{ padding:12px 20px; font-size:.92rem; }
  .nav-right{ gap:6px; flex-wrap:wrap; justify-content:flex-end; }
  .nav-right .btn{ padding:8px 12px; font-size:.8rem; }
  .nav-user-pill{ padding:5px 10px 5px 5px; gap:6px; }
  .nav-user-pill__sub{ display:none; }
  .nav-logo__text{ max-width:120px; }
  .wallet-pill{ flex-wrap:wrap; justify-content:center; padding:8px 12px; }
}
@media (max-width:400px){
  .nav-logo__text{ max-width:84px; font-size:.95rem; }
  .nav-search{ width:34px; height:34px; min-width:34px; }
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:999px; border:none; cursor:pointer;
  font-weight:700; font-size:.95rem; font-family:var(--font-body);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn--primary,.btn--green{
  background:var(--green); color:#fff; box-shadow:0 6px 16px rgba(22,163,74,.25);
}
.btn--primary:hover,.btn--green:hover{ background:var(--green-dark); }
.btn--ghost{
  background:#16a34a; color:var(--text); border:1.5px solid var(--line);
}
.btn--ghost:hover{ border-color:var(--green); color:var(--green-dark); }
.btn--ghost-nav{
  background:transparent; color:var(--text); padding:10px 18px;
}
.btn--ghost-nav:hover{ color:var(--green-dark); }
.btn--sm{ padding:9px 16px; font-size:.85rem; }
.btn--lg{ padding:14px 28px; font-size:1rem; }
.btn--full{ width:100%; }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn--danger{ background:var(--red); color:#fff; }
.btn--danger:hover{ background:#b91c1c; }
.mt-4{ margin-top:16px; }

/* ── Top navigation ───────────────────────────────────────────────────── */
.navbar{
  position:sticky; top:0; z-index:40; background:#fff;
  border-bottom:1px solid var(--line); backdrop-filter:blur(6px);
}
.nav-inner{
  max-width:1240px; margin:0 auto; padding:14px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
}
.nav-logo{ display:flex; align-items:center; gap:10px; font-family:var(--font-head); font-weight:800; font-size:1.15rem; color:var(--ink); flex-shrink:0; min-width:0; }
.nav-logo__icon{
  width:38px; height:38px; min-width:38px; min-height:38px; border-radius:50%; background:var(--ink);
  display:flex; align-items:center; justify-content:center; font-size:1.15rem; flex-shrink:0; aspect-ratio:1/1; line-height:1;
}
.nav-logo__text{ letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-logo__text b, .nav-logo__text{ color:var(--ink); }
.nav-links{ display:flex; align-items:center; gap:30px; flex:1; justify-content:center; min-width:0; }
.nav-links a{
  font-size:.82rem; font-weight:700; letter-spacing:.04em; color:var(--text-2);
  padding:8px 0; border-bottom:2px solid transparent; transition:color .15s; white-space:nowrap;
}
.nav-links a:hover{ color:var(--ink); border-color:var(--green); }
.nav-right{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.nav-search{
  width:38px; height:38px; border-radius:50%; border:1px solid var(--line);
  background:#fff; display:flex; align-items:center; justify-content:center; color:var(--text-2); cursor:pointer;
}
.nav-search:hover{ border-color:var(--green); color:var(--green-dark); }
.nav-user-pill{
  display:flex; align-items:center; gap:10px; padding:6px 14px 6px 6px;
  border-radius:999px; background:var(--bg); border:1px solid var(--line);
}
.nav-user-pill__avatar{ width:30px; height:30px; border-radius:50%; object-fit:cover; }
.nav-user-pill__info{ display:flex; flex-direction:column; line-height:1.2; }
.nav-user-pill__name{ font-size:.82rem; font-weight:700; color:var(--ink); }
.nav-user-pill__sub{ font-size:.68rem; color:var(--text-2); }
.nav-logout-btn{ font-size:.82rem; font-weight:600; color:var(--text-2); padding:8px 6px; }
.nav-logout-btn:hover{ color:var(--red); }

/* ── Flash messages ───────────────────────────────────────────────────── */
.flash-wrap{ max-width:1240px; margin:14px auto 0; padding:0 24px; display:flex; flex-direction:column; gap:8px; }
.flash{ padding:12px 18px; border-radius:var(--radius-sm); font-weight:600; font-size:.9rem; }
.flash--success{ background:var(--green-tint); color:var(--green-dark); border:1px solid var(--green-line); }
.flash--error{ background:var(--red-tint); color:var(--red); border:1px solid #f6c9c9; }
.flash--info,.flash--warning{ background:var(--amber-tint); color:#92450a; border:1px solid #f4d9a8; }
.alert{ padding:12px 16px; border-radius:var(--radius-sm); font-size:.88rem; font-weight:600; margin-bottom:14px; }
.alert--error{ background:var(--red-tint); color:var(--red); border:1px solid #f6c9c9; }

.main-content{ min-height:60vh; padding-bottom:56px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer{ background:var(--ink); color:#fff; padding:26px 0; margin-top:60px; }
.footer-inner{ max-width:1240px; margin:0 auto; padding:0 24px; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.footer-brand{ font-family:var(--font-head); font-weight:800; letter-spacing:.08em; color:#fff; opacity:.85; font-size:.85rem; }
.footer-social{ display:flex; gap:14px; }
.footer-social a{ width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.08); display:flex; align-items:center; justify-content:center; color:#fff; }
.footer-social a:hover{ background:var(--green); }
.footer-copy{ color:rgba(255,255,255,.55); font-size:.8rem; }

/* ── Mobile bottom nav ────────────────────────────────────────────────── */
.mobile-nav{ display:none; }
@media (max-width:760px){
  .mobile-nav{
    display:block; position:fixed; bottom:0; left:0; right:0; z-index:50;
    background:#fff; border-top:1px solid var(--line); box-shadow:0 -4px 16px rgba(15,23,42,.08);
    padding-bottom:env(safe-area-inset-bottom);
  }
  .mobile-nav__inner{ display:flex; }
  .mobile-nav__item{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
    padding:9px 2px 8px; font-size:.65rem; font-weight:700; color:var(--text-2);
  }
  .mobile-nav__icon{ font-size:1.15rem; }
  .mobile-nav__item:active{ color:var(--green-dark); }
  .main-content{ padding-bottom:78px; }
  .nav-links{ display:none; }
}

/* ==========================================================================
   HOME PAGE v2 — dashboard-style layout (hero/ad, stats, tournaments,
   how-it-works, announcement + sidebar: profile card, live battles, top players)
   ========================================================================== */
.pg-home2{ background:var(--bg); padding:20px 0 50px; }

/* ── Hero / ad banner ─────────────────────────────────────────────────── */
.home2-hero{
  position:relative; border-radius:var(--radius-lg); overflow:hidden;
  background:url('../img/hero-banner.jpg') center/cover no-repeat, #0a1a10;
  color:#fff; padding:36px 44px; display:flex; align-items:center; min-height:260px;
  box-shadow:var(--shadow);
}
.home2-hero::before{
  content:""; position:absolute; inset:0; z-index:1;
  background:linear-gradient(90deg, rgba(4,12,7,.92) 0%, rgba(4,12,7,.72) 32%, rgba(4,12,7,.2) 60%, rgba(4,12,7,.05) 100%);
}
.home2-hero__copy{ position:relative; z-index:2; max-width:560px; }
.home2-hero__copy h1{ font-size:2.2rem; line-height:1.08; margin:0 0 12px; font-style:italic; font-weight:800; color:#fff; text-shadow:0 2px 12px rgba(0,0,0,.4); }
.home2-hero__copy h1 em{ font-style:italic; color:#5de24f; }
.home2-hero__copy p{ font-size:1rem; margin:0 0 20px; color:rgba(255,255,255,.85); }
.home2-hero__actions{ display:flex; gap:12px; flex-wrap:wrap; }

/* ── Stat cards ────────────────────────────────────────────────────────── */
.home2-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin:20px 0; }
.home2-stat{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:18px; display:flex; align-items:center; gap:14px; min-width:0;
}
.home2-stat__icon{
  width:52px; height:52px; min-width:52px; border-radius:50%; background:var(--green-tint); color:var(--green-dark);
  display:flex; align-items:center; justify-content:center; font-size:1.4rem; flex-shrink:0;
}
.home2-stat__body{ min-width:0; }
.home2-stat__lbl{ display:block; font-size:.78rem; color:var(--text-2); font-weight:600; }
.home2-stat__val{ display:block; font-family:var(--font-head); font-weight:800; font-size:1.4rem; color:var(--ink); margin:2px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.home2-stat__delta{ font-size:.72rem; color:var(--green-dark); font-weight:700; }
.home2-stat__delta span{ color:var(--text-3); font-weight:500; }

/* ── Two-column layout ────────────────────────────────────────────────── */
.home2-layout{ display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:22px; align-items:start; }
.home2-main{ min-width:0; }
.home2-panel{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:20px; margin-bottom:18px;
}
.home2-panel__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.home2-panel__head h2{ font-size:1.02rem; margin:0; }
.home2-panel__head a{ font-size:.82rem; font-weight:700; color:var(--green-dark); }

/* ── Featured tournaments (uses real trophy images already in assets/img) ─ */
.home2-tourns{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.home2-tcard{ border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; display:flex; flex-direction:column; }
.home2-tcard__img{ height:100px; position:relative; overflow:hidden; flex-shrink:0; }
.home2-tcard__img img{ width:100%; height:100%; object-fit:cover; }
.home2-tcard__tag{
  position:absolute; top:8px; left:8px; z-index:2; font-size:.62rem; font-weight:800; letter-spacing:.02em;
  padding:4px 8px; border-radius:5px; color:#fff; background:var(--green);
}
.home2-tcard__tag--live{ background:var(--red); display:flex; align-items:center; gap:4px; }
.home2-tcard__tag--live .dot{ width:5px; height:5px; border-radius:50%; background:#fff; animation:pulse 1.2s ease-in-out infinite; }
.home2-tcard__tag--finished{ background:#fff; color:#222; }
.home2-tcard h3{ font-size:.86rem; margin:12px 12px 4px; }
.home2-tcard p{ font-size:.72rem; color:var(--text-2); margin:0 12px 12px; }
.home2-tcard__meta{ display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:0 12px 12px; font-size:.68rem; color:var(--text-2); }
.home2-tcard__meta strong{ display:block; font-size:.86rem; color:var(--green-dark); margin-top:3px; font-family:var(--font-head); }
.home2-tcard .btn{ margin:0 12px 12px; }

/* ── How it works ─────────────────────────────────────────────────────── */
.home2-steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.home2-step{ display:flex; gap:12px; align-items:center; padding-right:10px; border-right:1px solid var(--line-soft); min-width:0; }
.home2-step:last-child{ border-right:none; }
.home2-step__icon{
  width:44px; height:44px; min-width:44px; border-radius:50%; background:var(--green-tint); color:var(--green-dark);
  display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0;
}
.home2-step strong{ display:block; font-size:.85rem; font-family:var(--font-head); }
.home2-step span{ font-size:.74rem; color:var(--text-2); line-height:1.4; }

/* ── Announcement ─────────────────────────────────────────────────────── */
.home2-announce{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.home2-announce__badge{ font-size:.68rem; font-weight:800; background:var(--green-tint); color:var(--green-dark); padding:4px 9px; border-radius:5px; }
.home2-announce strong{ font-size:.85rem; white-space:nowrap; }
.home2-announce p{ flex:1; min-width:180px; margin:0; font-size:.82rem; color:var(--text-2); }
.home2-announce small{ color:var(--text-3); font-size:.76rem; }

/* ── Sidebar: profile card ────────────────────────────────────────────── */
.home2-sidebar{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.home2-profile{
  background:linear-gradient(160deg, #101513, #182a1c); color:#fff; border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow);
}
.home2-profile__top{ display:flex; align-items:center; gap:12px; }
.home2-profile__avatar{
  width:54px; height:54px; min-width:54px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background:linear-gradient(145deg,#f0d2ba,#593b2f); display:flex; align-items:center; justify-content:center;
  font-weight:800; color:#fff;
}
.home2-profile__avatar img{ width:100%; height:100%; object-fit:cover; }
.home2-profile__name{ font-size:.98rem; margin:0 0 5px; color:#fff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home2-profile__tag{ font-size:.68rem; color:#8bea7c; background:#183b20; padding:4px 8px; border-radius:5px; }
.home2-profile__ball{ margin-left:auto; font-size:1.9rem; flex-shrink:0; }
.home2-xp{ margin-top:16px; }
.home2-xp__row{ display:flex; justify-content:space-between; font-size:.72rem; margin-bottom:6px; }
.home2-xp__row span{ color:#c9d2cc; }
.home2-xp__bar{ height:6px; background:#343b37; border-radius:5px; overflow:hidden; }
.home2-xp__bar i{ display:block; height:100%; background:var(--green-2); border-radius:5px; }
.home2-profile__stats{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:16px; }
.home2-profile__stat b{ display:block; font-size:.86rem; }
.home2-profile__stat small{ display:block; font-size:.66rem; color:#a7b3ac; margin-top:3px; }
.home2-profile-cta{ text-align:center; padding:26px 18px; }
.home2-profile-cta p{ font-size:.82rem; color:var(--text-2); margin:0 0 14px; }

/* ── Sidebar: live battles ────────────────────────────────────────────── */
.home2-battle{
  display:grid; grid-template-columns:32px 1fr auto 1fr 32px; align-items:center; gap:6px;
  border-bottom:1px solid var(--line-soft); padding:12px 0; position:relative;
}
.home2-battle:last-child{ border-bottom:none; }
.home2-battle__avatar{
  width:32px; height:32px; min-width:32px; border-radius:50%; overflow:hidden;
  background:linear-gradient(145deg,#f0d2ba,#593b2f); display:flex; align-items:center; justify-content:center;
  font-size:.62rem; font-weight:800; color:#fff;
}
.home2-battle__avatar img{ width:100%; height:100%; object-fit:cover; }
.home2-battle__avatar--opp{ border:2px solid var(--red); }
.home2-battle__p{ display:flex; flex-direction:column; min-width:0; }
.home2-battle__p--right{ text-align:right; align-items:flex-end; }
.home2-battle__p b{ font-size:.76rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home2-battle__p strong{ font-size:.92rem; font-family:var(--font-head); }
.home2-battle__p strong small{ font-size:.62rem; font-weight:600; color:var(--text-3); }
.home2-battle__vs{
  font-size:.68rem; font-weight:800; background:var(--line-soft); border-radius:50%; width:30px; height:30px;
  display:flex; align-items:center; justify-content:center; color:var(--text-2);
}
.home2-battle__live{
  position:absolute; left:50%; bottom:-2px; transform:translateX(-50%); background:var(--red); color:#fff;
  border-radius:4px; padding:2px 6px; font-size:.58rem; font-weight:800;
}
.home2-empty{ text-align:center; padding:24px 10px; color:var(--text-2); font-size:.85rem; }

/* ── Sidebar: top players ─────────────────────────────────────────────── */
.home2-rank{
  display:grid; grid-template-columns:30px 30px 1fr auto; align-items:center; gap:8px;
  padding:10px 0; border-bottom:1px solid var(--line-soft);
}
.home2-rank:last-child{ border-bottom:none; }
.home2-rank__pos{ font-size:.78rem; font-weight:700; }
.home2-rank__avatar{
  width:30px; height:30px; min-width:30px; border-radius:50%; overflow:hidden;
  background:linear-gradient(145deg,#f0d2ba,#593b2f); display:flex; align-items:center; justify-content:center;
  font-size:.6rem; font-weight:800; color:#fff;
}
.home2-rank__avatar img{ width:100%; height:100%; object-fit:cover; }
.home2-rank__name{ font-size:.82rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home2-rank__pts{ font-weight:700; color:var(--green-dark); font-size:.84rem; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width:1100px){
  .home2-layout{ grid-template-columns:1fr; }
  .home2-sidebar{ display:grid; grid-template-columns:repeat(2,1fr); align-items:start; }
  .home2-stats{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:760px){
  .home2-hero{ padding:26px 22px; min-height:230px; text-align:center; justify-content:center; background-position:72% center; }
  .home2-hero::before{ background:linear-gradient(180deg, rgba(4,12,7,.55) 0%, rgba(4,12,7,.78) 55%, rgba(4,12,7,.88) 100%); }
  .home2-hero__copy{ max-width:none; }
  .home2-hero__copy h1{ font-size:1.6rem; }
  .home2-hero__actions{ justify-content:center; }
  .home2-stats{ grid-template-columns:1fr 1fr; }
  .home2-stat{ padding:14px; }
  .home2-stat__icon{ width:42px; height:42px; min-width:42px; font-size:1.1rem; }
  .home2-stat__val{ font-size:1.15rem; }
  .home2-tourns{ grid-template-columns:1fr; }
  .home2-steps{ grid-template-columns:1fr 1fr; }
  .home2-step{ border-right:none; border-bottom:1px solid var(--line-soft); padding:10px 0; }
  .home2-announce{ text-align:center; justify-content:center; }
  .home2-announce p{ flex-basis:100%; }
  .home2-sidebar{ grid-template-columns:1fr; }
}
@media (max-width:420px){
  .home2-stats{ grid-template-columns:1fr; }
  .home2-steps{ grid-template-columns:1fr; }
}

/* ==========================================================================
   Tournament cards (shared: home + tournaments page)
   ========================================================================== */
.tourn-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.tourn-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:12px;
  position:relative; overflow:hidden;
}
.tourn-card::before{
  content:""; position:absolute; top:0; left:0; right:0; height:86px;
  background:linear-gradient(120deg, var(--ink), #23314a); opacity:.94; z-index:0;
}
.tourn-card--live::before{ background:linear-gradient(120deg,#2c0e3d,#3b1660); }
.tourn-card > *{ position:relative; z-index:1; }
.tourn-card__head{ display:flex; align-items:center; justify-content:space-between; padding-top:2px; }
.tourn-status-tag{ font-size:.68rem; font-weight:800; letter-spacing:.03em; padding:5px 10px; border-radius:999px; background:rgba(255,255,255,.16); color:#fff; }
.tourn-status-tag--live{ background:#dc2626; }
.tourn-status-tag--open{ background:var(--green); }
.tourn-status-tag--finished{ background:var(--text-3); }
.tourn-fee--free{ font-size:.68rem; font-weight:800; color:#fff; background:rgba(255,255,255,.16); padding:5px 10px; border-radius:999px; }
.tourn-card__name{ color:#fff; font-size:1.05rem; margin:34px 0 0; }
.tourn-card__desc{ color:var(--text-2); font-size:.85rem; margin:0; }
.tourn-card__meta{ display:flex; flex-direction:column; gap:8px; padding:14px; background:var(--bg); border-radius:var(--radius-sm); }
.tourn-meta-row{ display:flex; align-items:center; justify-content:space-between; font-size:.82rem; color:var(--text-2); }
.tourn-meta-row strong{ color:var(--ink); font-weight:700; }
.tourn-fill-bar{ height:6px; border-radius:999px; background:var(--line-soft); overflow:hidden; }
.tourn-fill-bar__inner{ height:100%; background:var(--green); border-radius:999px; }
.tourn-spots{ font-size:.78rem; color:var(--text-2); margin:0; font-weight:600; }
.tourn-empty{ text-align:center; padding:60px 20px; color:var(--text-2); }
.tourn-empty span{ font-size:2.4rem; display:block; margin-bottom:10px; }
.tourn-recent-list{ display:flex; flex-direction:column; gap:10px; }
.tourn-recent-row{
  display:flex; align-items:center; gap:16px; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius-sm); padding:14px 18px; flex-wrap:wrap;
}
.tourn-recent-name{ font-weight:700; flex:1; min-width:140px; }
.tourn-recent-players,.tourn-recent-prize{ font-size:.82rem; color:var(--text-2); }
.pg-tournaments{ padding:32px 0 60px; }
.tourn-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:30px; flex-wrap:wrap; }
.wallet-pill{ display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--line); padding:8px 8px 8px 16px; border-radius:999px; font-size:.85rem; }

@media (max-width:900px){ .tourn-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .tourn-grid{ grid-template-columns:1fr; } }

/* ==========================================================================
   TOURNAMENTS PAGE — row-list layout
   ========================================================================== */
.tourn-page-head{ margin-bottom:22px; }
.tourn-page-head h1{ font-size:1.7rem; display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.tourn-page-head p{ color:var(--text-2); margin:0; font-size:.92rem; }

.tourn-toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin:22px 0 20px; flex-wrap:wrap;
}
.tourn-tabs{ display:flex; gap:22px; flex-wrap:wrap; }
.tourn-tab{
  background:none; border:none; cursor:pointer; padding:6px 0 10px; font-family:var(--font-body);
  font-size:.9rem; font-weight:700; color:var(--text-2); border-bottom:2px solid transparent;
}
.tourn-tab:hover{ color:var(--ink); }
.tourn-tab--active{ color:var(--green-dark); border-color:var(--green); }
.tourn-cat-select{
  border:1px solid var(--line); border-radius:var(--radius-sm); padding:9px 14px;
  font-size:.85rem; font-family:inherit; font-weight:600; color:var(--text); background:#fff;
  cursor:pointer;
}

.tourn-rows{ display:flex; flex-direction:column; gap:16px; }
.tourn-row{
  display:flex; align-items:center; gap:20px; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:16px; box-shadow:var(--shadow-sm); flex-wrap:wrap;
}
.tourn-row__thumb{
  position:relative; width:96px; height:96px; border-radius:var(--radius-sm); overflow:hidden;
  flex-shrink:0; background:var(--ink);
}
.tourn-row__thumb img{ width:100%; height:100%; object-fit:cover; }
.tourn-row__ribbon{
  position:absolute; top:6px; left:6px; font-size:.6rem; font-weight:800; letter-spacing:.03em;
  padding:3px 7px; border-radius:5px; color:#fff; display:flex; align-items:center; gap:3px;
}
.tourn-row__ribbon--live{ background:#dc2626; }
.tourn-row__ribbon--live .dot{ width:5px; height:5px; border-radius:50%; background:#fff; animation:pulse 1.2s ease-in-out infinite; }
.tourn-row__ribbon--upcoming{ background:#7c3aed; }
.tourn-row__ribbon--finished{ background:var(--text-3); }

.tourn-row__body{ flex:1 1 220px; min-width:180px; }
.tourn-row__name{ font-size:1.02rem; margin:0 0 4px; }
.tourn-row__sub{ font-size:.8rem; color:var(--text-2); display:flex; align-items:center; gap:5px; margin:0; }

.tourn-row__stat{ text-align:left; min-width:78px; }
.tourn-row__stat-lbl{ display:block; font-size:.7rem; color:var(--text-2); font-weight:600; margin-bottom:3px; }
.tourn-row__stat-val{ display:block; font-weight:800; color:var(--green-dark); font-family:var(--font-head); font-size:.98rem; }
.tourn-row__stat-val--muted{ color:var(--text-3); font-weight:700; }

.tourn-countdown{ text-align:center; min-width:120px; }
.tourn-countdown__lbl{ font-size:.72rem; color:var(--text-2); font-weight:600; margin-bottom:4px; }
.tourn-countdown__digits{ display:flex; align-items:center; gap:4px; justify-content:center; }
.tourn-countdown__seg{ text-align:center; }
.tourn-countdown__num{
  display:block; font-family:var(--font-head); font-weight:800; font-size:1.1rem; color:var(--ink);
  background:var(--bg); border-radius:6px; padding:3px 6px; min-width:34px;
}
.tourn-countdown__unit{ display:block; font-size:.58rem; color:var(--text-3); font-weight:700; margin-top:2px; letter-spacing:.03em; }
.tourn-countdown__sep{ font-weight:800; color:var(--text-3); }

.tourn-row__players{ font-size:.8rem; color:var(--text-2); font-weight:600; min-width:80px; text-align:center; }
.tourn-row__cta{ flex-shrink:0; }

.tourn-load-more{ text-align:center; margin-top:28px; }

@media (max-width:760px){
  .tourn-row{ flex-direction:column; align-items:stretch; text-align:left; gap:14px; }
  .tourn-row__thumb{ width:100%; height:130px; }
  .tourn-row__stats-line{ display:flex; gap:24px; flex-wrap:wrap; }
  .tourn-countdown{ text-align:left; }
  .tourn-countdown__digits{ justify-content:flex-start; }
  .tourn-row__players{ text-align:left; }
  .tourn-row__cta{ width:100%; }
  .tourn-row__cta .btn{ width:100%; }
}

/* ==========================================================================
   PLAYER DASHBOARD
   ========================================================================== */
.pg-dashboard{ padding:32px 0 60px; }
.db-tournament-match-banner{
  display:block; background:linear-gradient(90deg, var(--green-dark), var(--green));
  color:#fff; font-weight:700; padding:14px 22px; border-radius:var(--radius); margin-bottom:22px;
  box-shadow:var(--shadow-sm);
}
.db-hero{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:26px 30px; display:flex; align-items:center; justify-content:space-between; gap:20px;
  margin-bottom:24px; box-shadow:var(--shadow-sm); flex-wrap:wrap;
}
.db-hero__left{ display:flex; align-items:center; gap:18px; }
.db-avatar{ position:relative; width:76px; height:76px; border-radius:50%; overflow:hidden; background:var(--ink); flex-shrink:0; }
.db-avatar img{ width:100%; height:100%; object-fit:cover; }
.db-avatar__initials{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:1.4rem; font-family:var(--font-head); }
.db-avatar__tier{
  position:absolute; bottom:-4px; left:50%; transform:translateX(-50%); white-space:nowrap;
  font-size:.6rem; font-weight:800; padding:2px 8px; border-radius:999px; background:var(--green); color:#fff;
}
.db-hero__info h1{ font-size:1.4rem; margin-bottom:2px; }
.db-level{ color:var(--text-2); font-weight:600; font-size:.88rem; margin-bottom:10px; }
.xp-bar-wrap{ min-width:220px; }
.xp-bar{ height:8px; border-radius:999px; background:var(--line-soft); overflow:hidden; }
.xp-bar__fill{ height:100%; background:linear-gradient(90deg,var(--green-dark),var(--green-2)); border-radius:999px; }
.xp-bar__label{ font-size:.72rem; color:var(--text-2); font-weight:600; }

.stat-grid{ display:grid; grid-template-columns:repeat(6,1fr); gap:14px; margin-bottom:26px; }
.stat-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px 16px; text-align:center; box-shadow:var(--shadow-sm);
}
.stat-card__val{ display:block; font-family:var(--font-head); font-size:1.5rem; font-weight:800; color:var(--ink); }
.stat-card__lbl{ font-size:.72rem; color:var(--text-2); font-weight:600; }
.stat-card--green .stat-card__val{ color:var(--green-dark); }
.stat-card--purple .stat-card__val{ color:var(--purple); }

.db-cols{ display:grid; grid-template-columns:1.5fr 1fr; gap:20px; margin-bottom:26px; }
.db-panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow-sm); }
.db-panel__title{ font-size:1.02rem; display:flex; align-items:center; gap:8px; }
.db-panel__link{ display:inline-block; margin-top:14px; font-weight:700; font-size:.85rem; color:var(--green-dark); }
.db-empty{ text-align:center; padding:32px 10px; color:var(--text-2); }
.db-empty span{ font-size:1.8rem; display:block; margin-bottom:8px; }

.match-list{ display:flex; flex-direction:column; gap:10px; }
.match-row{ display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:var(--radius-sm); background:var(--bg); flex-wrap:wrap; }
.match-result-tag{ font-size:.65rem; font-weight:800; padding:4px 9px; border-radius:6px; background:var(--text-3); color:#fff; }
.match-row--win .match-result-tag{ background:var(--green); }
.match-row--loss .match-result-tag{ background:var(--red); }
.match-row--draw .match-result-tag{ background:var(--amber); }
.match-row__info{ display:flex; flex-direction:column; flex:1; min-width:110px; }
.match-opp{ font-weight:700; font-size:.87rem; }
.match-cat{ font-size:.72rem; color:var(--text-2); }
.match-scores{ display:flex; align-items:center; gap:5px; font-weight:800; font-family:var(--font-head); }
.match-score--mine{ color:var(--green-dark); }
.match-score--opp{ color:var(--text-3); }
.match-date{ font-size:.72rem; color:var(--text-3); min-width:44px; text-align:right; }

.badge-count{ background:var(--green-tint); color:var(--green-dark); border-radius:999px; padding:2px 10px; font-size:.75rem; }
.badge-grid{ display:flex; flex-wrap:wrap; gap:10px; }
.badge-chip{ display:flex; align-items:center; gap:8px; background:var(--bg); border-radius:999px; padding:8px 14px; font-size:.8rem; font-weight:700; }
.badge-chip__icon{ font-size:1rem; }

.quick-actions{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.qa-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:20px 16px;
  text-align:center; box-shadow:var(--shadow-sm); transition:transform .15s, box-shadow .15s;
}
.qa-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--green-line); }
.qa-card span{ font-size:1.7rem; display:block; margin-bottom:8px; }
.qa-card strong{ display:block; font-family:var(--font-head); font-size:.9rem; margin-bottom:3px; }
.qa-card p{ font-size:.76rem; color:var(--text-2); margin:0; }

@media (max-width:900px){
  .db-cols{ grid-template-columns:1fr; }
  .stat-grid{ grid-template-columns:repeat(3,1fr); }
  .quick-actions{ grid-template-columns:repeat(2,1fr); }
  .db-hero{ flex-direction:column; align-items:flex-start; }
}
@media (max-width:520px){ .stat-grid{ grid-template-columns:repeat(2,1fr); } }

/* ==========================================================================
   BATTLE ARENA — dark theme, two-column (arena + sidebar)
   ========================================================================== */
.pg-battle{ padding:0 0 60px; background:#0b1220; min-height:100vh; color:#fff; }
.battle-topbar{
  display:flex; align-items:center; justify-content:space-between; padding:16px 24px;
  color:#fff;
}
.battle-topbar__back{ font-size:.85rem; font-weight:700; color:rgba(255,255,255,.7); display:flex; align-items:center; gap:6px; }
.battle-topbar__back:hover{ color:#fff; }
.battle-topbar__title{ font-weight:800; display:flex; align-items:center; gap:8px; font-size:.95rem; }
.battle-live-pill{ background:var(--red); font-size:.62rem; font-weight:800; padding:3px 8px; border-radius:999px; display:inline-flex; align-items:center; gap:4px; }
.battle-live-pill .dot{ width:5px; height:5px; border-radius:50%; background:#fff; animation:pulse 1.2s ease-in-out infinite; }
.battle-topbar__leave{ font-size:.82rem; font-weight:700; color:#f87171; }

.battle-scoreboard{
  background:linear-gradient(120deg, #0e2a1a, #16233d 55%, #241238);
  color:#fff; padding:20px 24px; display:flex; align-items:center; justify-content:center;
  gap:24px; flex-wrap:wrap; border-radius:var(--radius-lg); margin:0 24px 20px; max-width:1160px; margin-left:auto; margin-right:auto;
  box-shadow:0 8px 24px rgba(0,0,0,.3);
}
.bscore{ display:flex; align-items:center; gap:12px; order:1; }
.bscore--opp{ flex-direction:row-reverse; text-align:right; order:3; }
.battle-vs{
  order:2; flex-shrink:0; width:56px; height:56px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #3b2166, #14091f 70%);
  border:2px solid rgba(255,255,255,.18);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 0 4px rgba(124,58,237,.15), 0 6px 18px rgba(0,0,0,.35);
}
.battle-vs__text{
  font-family:var(--font-head); font-weight:800; font-size:1rem; letter-spacing:.03em; color:#fff;
}
.battle-timer-mini{ order:2; text-align:center; }
.battle-timer-mini__lbl{ display:block; font-size:.66rem; color:rgba(255,255,255,.6); font-weight:700; margin-bottom:2px; }
.battle-timer-mini__val{ display:block; font-family:var(--font-head); font-weight:800; font-size:1.3rem; color:#fbbf24; }
.battle-progress{
  order:4; width:100%; text-align:center; font-weight:700; font-size:.85rem;
  background:rgba(255,255,255,.12); padding:8px 16px; border-radius:999px; margin-top:4px;
}
.bscore__avatar{
  width:52px; height:52px; border-radius:50%; overflow:hidden; background:rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:center; font-weight:800; border:2px solid var(--green);
  box-shadow:0 0 0 3px rgba(34,197,94,.2);
}
.bscore--opp .bscore__avatar{ border-color:#f87171; box-shadow:0 0 0 3px rgba(248,113,113,.2); }
.bscore__avatar img{ width:100%; height:100%; object-fit:cover; }
.bscore__info{ display:flex; flex-direction:column; }
.bscore__name{ font-size:.82rem; font-weight:700; opacity:.85; }
.bscore__score{ font-family:var(--font-head); font-size:1.7rem; font-weight:800; }
.sudden-death-banner{
  background:var(--red); color:#fff; text-align:center; font-weight:800; padding:10px; letter-spacing:.02em; font-size:.85rem;
}

.battle-layout{ max-width:1160px; margin:0 auto; padding:0 24px; display:grid; grid-template-columns:1fr 300px; gap:24px; align-items:start; }
.battle-arena{ max-width:none; margin:0; padding:0; }
.timer-wrap{ position:relative; height:8px; border-radius:999px; background:rgba(255,255,255,.1); margin-bottom:10px; overflow:visible; }
.timer-bar{ height:100%; border-radius:999px; background:var(--green); transition:width .1s linear; }
.timer-bar--urgent{ background:var(--red); }
.timer-count{ position:absolute; right:0; top:-26px; font-family:var(--font-head); font-weight:800; color:#fff; }
.question-card{
  background:#141c2e; border:1px solid rgba(255,255,255,.08); border-radius:var(--radius-lg); box-shadow:0 8px 24px rgba(0,0,0,.25);
  padding:30px 28px; text-align:left; margin-bottom:18px;
}
.question-progress{ font-size:.8rem; color:rgba(255,255,255,.55); font-weight:700; margin-bottom:10px; }
.question-text{ font-size:1.2rem; font-weight:700; color:#fff; margin:0; }
.options-grid{ display:flex; flex-direction:column; gap:12px; margin-bottom:18px; }
.option-btn{
  display:flex; align-items:center; gap:12px; background:#141c2e; border:1.5px solid rgba(255,255,255,.1);
  border-radius:var(--radius); padding:15px 18px; text-align:left; cursor:pointer; font-size:.95rem;
  font-weight:600; color:#e5e7eb; transition:border-color .15s, background .15s, transform .1s;
}
.option-btn:hover:not(:disabled){ border-color:var(--green); background:rgba(34,197,94,.1); }
.option-letter{
  width:28px; height:28px; border-radius:50%; background:rgba(255,255,255,.08); display:flex; align-items:center;
  justify-content:center; font-weight:800; font-family:var(--font-head); flex-shrink:0; font-size:.82rem; color:#fff;
}
.option-btn--selected{ border-color:var(--green); background:rgba(34,197,94,.16); }
.option-btn--correct{ border-color:var(--green); background:rgba(34,197,94,.2); }
.option-btn--correct .option-letter{ background:var(--green); color:#fff; }
.option-btn--wrong{ border-color:var(--red); background:rgba(220,38,38,.18); }
.option-btn--wrong .option-letter{ background:var(--red); color:#fff; }
.answer-feedback{
  margin-top:0; display:flex; align-items:center; justify-content:center; gap:10px;
  font-weight:800; font-size:1rem; background:#1c2740; color:#fff; padding:14px; border-radius:var(--radius);
  margin-bottom:18px;
}
.feedback-pts{ color:var(--green-2); }

/* ── Streak bar ───────────────────────────────────────────────────────── */
.streak-bar{
  background:#141c2e; border:1px solid rgba(255,255,255,.08); border-radius:var(--radius);
  padding:14px 18px; display:flex; align-items:center; gap:16px;
}
.streak-bar__label{ font-size:.82rem; font-weight:700; color:#fff; display:flex; align-items:center; gap:6px; white-space:nowrap; }
.streak-bar__count{ color:#fbbf24; }
.streak-bar__track{ flex:1; height:8px; border-radius:999px; background:rgba(255,255,255,.1); overflow:hidden; }
.streak-bar__fill{ height:100%; border-radius:999px; background:linear-gradient(90deg,#22c55e,#eab308,#ef4444); transition:width .3s ease; }
.streak-bar__hint{ font-size:.76rem; color:rgba(255,255,255,.5); white-space:nowrap; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.battle-sidebar{ display:flex; flex-direction:column; gap:16px; }
.bside-panel{ background:#141c2e; border:1px solid rgba(255,255,255,.08); border-radius:var(--radius); padding:18px; }
.bside-panel__title{ font-size:.82rem; font-weight:800; color:rgba(255,255,255,.55); text-transform:uppercase; letter-spacing:.04em; margin:0 0 14px; }
.bside-row{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.bside-row:last-child{ margin-bottom:0; }
.bside-row__lbl{ font-size:.78rem; color:rgba(255,255,255,.5); }
.bside-row__val{ font-size:.86rem; font-weight:700; color:#fff; }
.bside-row__val--green{ color:#4ade80; }
.bside-players{ display:flex; flex-direction:column; gap:10px; }
.bside-player{ display:flex; align-items:center; gap:10px; }
.bside-player__rank{
  width:22px; height:22px; border-radius:50%; background:rgba(255,255,255,.08); display:flex; align-items:center;
  justify-content:center; font-size:.7rem; font-weight:800; color:#fbbf24; flex-shrink:0;
}
.bside-player__avatar{ width:30px; height:30px; border-radius:50%; overflow:hidden; background:rgba(255,255,255,.1); flex-shrink:0; }
.bside-player__avatar img{ width:100%; height:100%; object-fit:cover; }
.bside-player__name{ flex:1; font-size:.84rem; font-weight:600; color:#fff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bside-player__score{ font-size:.84rem; font-weight:800; color:#4ade80; }
.bside-spectators{ display:flex; align-items:center; }
.bside-spectator{
  width:28px; height:28px; border-radius:50%; overflow:hidden; border:2px solid #141c2e; margin-left:-8px;
  background:rgba(255,255,255,.12); display:flex; align-items:center; justify-content:center; font-size:.65rem; font-weight:800; color:#fff;
}
.bside-spectator:first-child{ margin-left:0; }
.bside-spectator--more{ background:rgba(255,255,255,.2); }

.battle-waiting{ max-width:480px; margin:60px auto; padding:0 20px; }
.waiting-card{ background:#141c2e; border:1px solid rgba(255,255,255,.08); border-radius:var(--radius-lg); box-shadow:0 8px 24px rgba(0,0,0,.25); padding:44px 30px; text-align:center; color:#fff; }
.waiting-card--error{ border-color:#f6c9c9; }
.waiting-card p.text-muted{ color:rgba(255,255,255,.55); }
.waiting-spinner{ font-size:2.6rem; margin-bottom:14px; animation:pulse 1.6s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:1;} 50%{ opacity:.5; } }
.join-code-display{
  display:flex; align-items:center; justify-content:center; gap:12px; font-family:var(--font-head);
  font-size:1.6rem; font-weight:800; letter-spacing:.1em; background:rgba(255,255,255,.06); border-radius:var(--radius);
  padding:16px; margin:14px 0; color:#fff;
}
.copy-btn{ background:var(--green); color:#fff; border:none; border-radius:999px; padding:8px 14px; font-size:.75rem; font-weight:700; cursor:pointer; }
.waiting-hint{ font-size:.82rem; color:rgba(255,255,255,.4); }

@media (max-width:900px){
  .battle-layout{ grid-template-columns:1fr; }
  .battle-sidebar{ flex-direction:row; flex-wrap:wrap; }
  .bside-panel{ flex:1 1 220px; }
}
@media (max-width:600px){
  .battle-layout{ padding:0 14px; }
  .battle-scoreboard{ padding:14px 12px; gap:10px; margin:0 14px 16px; }
  .bscore__avatar{ width:40px; height:40px; }
  .bscore__score{ font-size:1.3rem; }
  .bscore__name{ font-size:.72rem; max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .battle-vs{ width:44px; height:44px; }
  .battle-vs__text{ font-size:.85rem; }
  .question-card{ padding:22px 18px; }
  .streak-bar{ flex-wrap:wrap; }
  .streak-bar__hint{ width:100%; text-align:center; }
}

/* ── Ad slot ───────────────────────────────────────────────────────────── */
.ad-slot{
  position:relative; margin:28px auto; max-width:640px; background:var(--card);
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm);
  padding:14px; display:flex; align-items:center; gap:14px; overflow:hidden;
}
.ad-slot__label{
  position:absolute; top:8px; right:12px; font-size:.65rem; font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; color:var(--text-3);
}
.ad-slot__link{ display:flex; align-items:center; gap:14px; flex:1; min-width:0; text-decoration:none; }
.ad-slot__img{
  width:120px; height:64px; border-radius:var(--radius-sm); object-fit:cover; flex-shrink:0; background:var(--bg);
}
.ad-slot__title{ font-weight:700; color:var(--text); font-size:.95rem; line-height:1.3; }
.ad-slot__upgrade{
  flex-shrink:0; font-size:.75rem; font-weight:700; color:var(--purple); text-decoration:none;
  white-space:nowrap; margin-left:auto; padding-left:10px;
}
@media (max-width:600px){
  .ad-slot{ flex-wrap:wrap; padding:12px; }
  .ad-slot__img{ width:88px; height:52px; }
  .ad-slot__upgrade{ width:100%; margin-left:0; padding-left:0; text-align:center; }
}

/* ── Battle lobby ─────────────────────────────────────────────────────── */
.pg-battle-lobby{ padding:40px 0 60px; }
.lobby-header{ text-align:center; margin-bottom:34px; }
.lobby-header h1{ font-size:1.9rem; }
.lobby-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; max-width:1000px; margin:0 auto; }
.lobby-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:26px; box-shadow:var(--shadow-sm); }
.lobby-card__head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.lobby-card__icon{ font-size:1.6rem; width:46px; height:46px; border-radius:12px; background:var(--green-tint); display:flex; align-items:center; justify-content:center; }
.lobby-form{ display:flex; flex-direction:column; gap:14px; }
.lf-group{ display:flex; flex-direction:column; gap:6px; }
.lf-group label{ font-size:.78rem; font-weight:700; color:var(--text-2); }
.lf-select,.lf-code-input{
  border:1.5px solid var(--line); border-radius:var(--radius-sm); padding:11px 14px; font-size:.9rem; font-family:inherit;
}
.lf-pills{ display:flex; gap:8px; flex-wrap:wrap; }
.lf-pill{ padding:8px 14px; border-radius:999px; background:var(--bg); border:1.5px solid transparent; font-size:.8rem; font-weight:700; cursor:pointer; }
.lf-pill--active{ background:var(--green-tint); border-color:var(--green); color:var(--green-dark); }
.lobby-divider{ text-align:center; color:var(--text-3); font-size:.78rem; font-weight:700; margin:16px 0; position:relative; }
.lobby-steps{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.lobby-card__head p{ color:var(--text-2); font-size:.85rem; margin:0; }
.lobby-info h3{ font-size:.9rem; margin-bottom:10px; }
.lobby-steps{ list-style:decimal; padding-left:18px; display:flex; flex-direction:column; gap:8px; }
.lobby-info{ color:var(--text-2); font-size:.85rem; }
@media (max-width:900px){ .lobby-grid{ grid-template-columns:1fr; } }

/* ── Results page ─────────────────────────────────────────────────────── */
.pg-results{ padding:40px 0 60px; }
.result-banner{ text-align:center; padding:38px 20px; border-radius:var(--radius-lg); margin-bottom:26px; color:#fff; }
.result-banner--win{ background:linear-gradient(120deg,var(--green-dark),var(--green-2)); }
.result-banner--loss{ background:linear-gradient(120deg,#3a3f4b,#232830); }
.result-banner--draw{ background:linear-gradient(120deg,var(--amber),#f2a93a); }
.result-banner__icon{ font-size:2.6rem; display:block; margin-bottom:8px; }
.result-banner__title{ font-size:1.7rem; color:#fff; margin-bottom:4px; }
.result-banner__sub{ color:rgba(255,255,255,.85); margin:0; }
.result-scores{ display:flex; align-items:center; justify-content:center; gap:26px; margin-bottom:30px; flex-wrap:wrap; }
.result-player{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:20px; text-align:center; min-width:150px; box-shadow:var(--shadow-sm); position:relative; }
.result-player--winner{ border-color:var(--green); box-shadow:0 0 0 3px var(--green-tint); }
.result-player__avatar{ width:60px; height:60px; border-radius:50%; margin:0 auto 10px; overflow:hidden; background:var(--bg); display:flex; align-items:center; justify-content:center; font-weight:800; }
.result-player__avatar img{ width:100%; height:100%; object-fit:cover; }
.result-player__crown{ position:absolute; top:-14px; left:50%; transform:translateX(-50%); font-size:1.3rem; }
.result-player__name{ font-weight:700; font-size:.88rem; display:block; margin-bottom:4px; }
.result-player__score{ font-family:var(--font-head); font-size:1.8rem; font-weight:800; }
.result-accuracy{ font-size:.78rem; color:var(--text-2); }
.result-rounds{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:22px; margin-bottom:24px; }
.round-row{ display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line-soft); flex-wrap:wrap; }
.round-row:last-child{ border-bottom:none; }
.round-num{ font-weight:800; color:var(--text-3); width:26px; }
.round-q{ flex:1; min-width:180px; font-size:.85rem; }
.round-pts--earned{ color:var(--green-dark); font-weight:700; }
.result-actions{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.new-badges{ text-align:center; margin:26px 0; }
.new-badges__title{ font-weight:700; margin-bottom:10px; }

/* ==========================================================================
   TOURNAMENT SHOW / BRACKET
   ========================================================================== */
.pg-tournament-show{ padding:32px 0 60px; }
.ts-header{
  background:linear-gradient(120deg, var(--ink), #23314a);
  color:#fff; border-radius:var(--radius-lg); padding:30px; margin-bottom:24px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:20px; flex-wrap:wrap;
}
.ts-header__left h1{ color:#fff; font-size:1.7rem; margin-bottom:6px; }
.ts-desc{ color:rgba(255,255,255,.75); max-width:520px; }
.ts-status-row{ display:flex; gap:10px; margin-top:10px; }
.ts-stats{ display:flex; gap:14px; flex-wrap:wrap; }
.ts-stat{ background:rgba(255,255,255,.08); border-radius:var(--radius-sm); padding:14px 18px; text-align:center; min-width:100px; }
.ts-stat__icon{ display:block; font-size:1.2rem; margin-bottom:4px; }
.ts-stat__val{ display:block; font-family:var(--font-head); font-weight:800; font-size:1.2rem; }
.ts-stat__lbl{ font-size:.7rem; color:rgba(255,255,255,.65); }
.ts-stat--prize .ts-stat__val{ color:var(--green-2); }
.ts-cols{ display:grid; grid-template-columns:2fr 1fr; gap:20px; }
.ts-panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:22px; margin-bottom:20px; box-shadow:var(--shadow-sm); }
.ts-panel__title{ font-size:1rem; margin-bottom:16px; }
.ts-enter-card{ text-align:center; }
.ts-enter-fee{ font-family:var(--font-head); font-size:1.4rem; font-weight:800; margin-bottom:14px; }
.ts-entered{ background:var(--green-tint); color:var(--green-dark); border-radius:var(--radius-sm); padding:12px; font-weight:700; text-align:center; }
.ts-prize-note{ font-size:.78rem; color:var(--text-2); text-align:center; margin-top:10px; }
.entrant-list{ display:flex; flex-direction:column; gap:8px; }
.entrant-row{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--radius-sm); }
.entrant-row--me{ background:var(--green-tint); }
.entrant-num{ width:22px; color:var(--text-3); font-weight:700; font-size:.78rem; }
.entrant-avatar{ width:32px; height:32px; border-radius:50%; background:var(--bg); overflow:hidden; flex-shrink:0; }
.entrant-avatar img{ width:100%; height:100%; object-fit:cover; }
.entrant-name{ flex:1; font-weight:600; font-size:.85rem; }
.entrant-level{ font-size:.72rem; color:var(--text-2); }

/* ── Tournament draw / bracket — dark theme ────────────────────────────── */
.ts-panel--bracket{
  overflow:hidden; background:#0e1420; border-color:rgba(255,255,255,.08);
}
.ts-panel--bracket .ts-panel__title{ color:#fff; }
.wcb-scroll{ overflow-x:auto; padding-bottom:10px; }
.wcb-bracket{ display:flex; gap:26px; min-width:640px; }
.wcb-col{ display:flex; flex-direction:column; gap:10px; min-width:180px; }
.wcb-col__label{ text-align:center; font-size:.72rem; font-weight:800; color:rgba(255,255,255,.5); text-transform:uppercase; letter-spacing:.05em; margin-bottom:2px; }
.wcb-col__matches{ display:flex; flex-direction:column; justify-content:space-around; gap:14px; flex:1; height:100%; }
.wcb-match{ display:flex; flex-direction:column; gap:2px; }
.wcb-slot{
  display:flex; align-items:center; gap:8px; background:#141c2e; border:1px solid rgba(255,255,255,.1);
  padding:8px 10px; font-size:.78rem; color:#e5e7eb;
}
.wcb-slot:first-child{ border-radius:var(--radius-sm) var(--radius-sm) 0 0; }
.wcb-slot:last-child{ border-radius:0 0 var(--radius-sm) var(--radius-sm); border-top:none; }
.wcb-slot--winner{ background:rgba(34,197,94,.16); border-color:rgba(34,197,94,.4); font-weight:700; color:#fff; }
.wcb-slot--out{ opacity:.4; }
.wcb-slot--tbd{ color:rgba(255,255,255,.35); font-style:italic; }
.wcb-slot__avatar{ width:22px; height:22px; border-radius:50%; background:rgba(255,255,255,.1); flex-shrink:0; overflow:hidden; }
.wcb-slot__avatar img{ width:100%; height:100%; object-fit:cover; }
.wcb-slot__name{ flex:1; font-weight:600; }
.wcb-col--final{ justify-content:center; }
.wcb-final-match{ text-align:center; }
.wcb-trophy{ text-align:center; margin-top:12px; }
.wcb-trophy__icon{ font-size:2rem; display:block; }
.wcb-trophy__champ{ font-weight:800; font-family:var(--font-head); color:#fbbf24; }
.wcb-trophy__prize{ font-size:.78rem; color:#4ade80; font-weight:700; }
.wcb-hint{ font-size:.75rem; color:rgba(255,255,255,.4); margin-top:8px; }

@media (max-width:900px){ .ts-cols{ grid-template-columns:1fr; } }

/* ==========================================================================
   LEADERBOARD
   ========================================================================== */
.pg-leaderboard{ padding:32px 0 60px; }
.lb-header{ text-align:center; margin-bottom:30px; }
.lb-header h1{ font-size:1.9rem; }
.podium{ display:flex; align-items:flex-end; justify-content:center; gap:16px; margin-bottom:40px; }
.podium__place{ text-align:center; position:relative; width:150px; }
.podium__place--1{ order:2; }
.podium__place--2{ order:1; }
.podium__place--3{ order:3; }
.podium__avatar{ width:56px; height:56px; border-radius:50%; margin:0 auto 8px; background:var(--bg); overflow:hidden; }
.podium__avatar--1{ width:72px; height:72px; }
.podium__avatar img{ width:100%; height:100%; object-fit:cover; }
.podium__avatar span{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-weight:800; color:var(--text-2); }
.podium__crown{ position:absolute; top:-18px; left:50%; transform:translateX(-50%); font-size:1.4rem; }
.podium__name{ font-weight:700; font-size:.85rem; margin:0; }
.podium__xp{ font-size:.75rem; color:var(--text-2); margin:0 0 10px; }
.podium__block{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius) var(--radius) 0 0;
  box-shadow:var(--shadow-sm); font-family:var(--font-head); font-weight:800; font-size:1.2rem; color:var(--text-3);
  padding:14px 0 16px;
}
.podium__block--1{ padding-top:32px; background:linear-gradient(180deg,var(--green-tint),var(--card)); border-color:var(--green-line); color:var(--green-dark); }
.podium__block--2{ padding-top:18px; }
.podium__block--3{ padding-top:10px; }
.lb-table-wrap{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm);
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
}
.lb-table{ width:100%; min-width:560px; border-collapse:collapse; }
.lb-table thead th{
  text-align:left; padding:12px 18px; font-size:.72rem; font-weight:800; color:var(--text-2);
  text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--line); white-space:nowrap;
}
.lb-table thead th:nth-child(4),.lb-table td.lb-xp{ text-align:right; }
.lb-table tr{ border-bottom:1px solid var(--line-soft); }
.lb-table tr:last-child{ border-bottom:none; }
.lb-table td{ padding:13px 18px; font-size:.88rem; white-space:nowrap; }
.lb-row--me{ background:var(--green-tint); }
.lb-rank{ font-weight:800; color:var(--text-3); width:40px; }
.lb-player{ display:flex; align-items:center; gap:12px; }
.lb-player__avatar{ width:34px; height:34px; min-width:34px; border-radius:50%; background:var(--bg); flex-shrink:0; overflow:hidden; }
.lb-level{ color:var(--text-2); font-size:.8rem; }
.lb-xp{ font-weight:800; text-align:right; color:var(--ink); font-family:var(--font-head); }
.rank-medal{ font-size:1.1rem; }
.lb-scroll-hint{ display:none; text-align:center; font-size:.76rem; color:var(--text-3); margin-top:8px; }

@media (max-width:600px){
  .podium{ gap:8px; }
  .podium__block{ padding:14px; }
  .lb-table td{ padding:10px 12px; }
  .lb-scroll-hint{ display:block; }
}

/* ==========================================================================
   PROFILE
   ========================================================================== */
.pg-profile{ padding:32px 0 60px; }
.prof-header{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:26px 30px; display:flex; align-items:center; gap:20px; box-shadow:var(--shadow-sm); margin-bottom:24px; flex-wrap:wrap;
}
.prof-avatar{ width:84px; height:84px; border-radius:50%; overflow:hidden; background:var(--ink); flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.prof-avatar img{ width:100%; height:100%; object-fit:cover; }
.prof-avatar__initials{ color:#fff; font-weight:800; font-size:1.6rem; font-family:var(--font-head); }
.prof-name-row{ display:flex; align-items:center; gap:10px; }
.prof-name-row h1{ margin:0; font-size:1.4rem; }
.prof-level{ background:var(--green-tint); color:var(--green-dark); font-size:.72rem; font-weight:800; padding:4px 10px; border-radius:999px; }
.prof-meta{ color:var(--text-2); font-size:.85rem; margin-top:4px; }
.prof-since{ color:var(--text-3); font-size:.78rem; }
.badge-showcase{ margin-bottom:24px; display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:12px; }
.badge-item{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; text-align:center; position:relative; }
.badge-item--locked{ opacity:.45; }
.badge-item__icon{ font-size:1.8rem; display:block; margin-bottom:8px; }
.badge-item__name{ font-size:.78rem; font-weight:700; }
.badge-item__lock{ position:absolute; top:8px; right:10px; }
.accuracy-stats{ display:flex; align-items:center; gap:18px; }
.acc-stat{ text-align:center; }
.acc-stat__val{ display:block; font-family:var(--font-head); font-weight:800; font-size:1.3rem; }
.acc-stat--green .acc-stat__val{ color:var(--green-dark); }
.acc-stat--red .acc-stat__val{ color:var(--red); }
.acc-stat__lbl{ font-size:.72rem; color:var(--text-2); }

@media (max-width:600px){ .prof-header{ flex-direction:column; text-align:center; } }

/* ==========================================================================
   PROFILE PAGE v2 — dark banner + tabs + achievement badges
   ========================================================================== */
.prof-back{ display:inline-flex; align-items:center; gap:6px; font-size:.85rem; font-weight:700; color:var(--text-2); margin-bottom:14px; }
.prof-back:hover{ color:var(--ink); }

.prof-banner{
  position:relative; border-radius:var(--radius-lg); overflow:hidden; padding:28px 30px;
  background:linear-gradient(120deg, #08331c, #0e7a3b 55%, #14532d);
  color:#fff; display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
}
.prof-banner::before{
  content:""; position:absolute; inset:0;
  background:radial-gradient(circle at 85% 15%, rgba(255,255,255,.12), transparent 55%);
  pointer-events:none;
}
.prof-banner__left{ display:flex; align-items:center; gap:18px; position:relative; z-index:1; }
.prof-banner__avatar{
  position:relative; width:84px; height:84px; border-radius:50%; flex-shrink:0;
  border:3px solid rgba(255,255,255,.55); overflow:hidden; background:rgba(255,255,255,.15);
  display:flex; align-items:center; justify-content:center;
}
.prof-banner__avatar img{ width:100%; height:100%; object-fit:cover; }
.prof-banner__avatar-initials{ font-weight:800; font-size:1.5rem; font-family:var(--font-head); color:#fff; }
.prof-banner__avatar-edit{
  position:absolute; bottom:-2px; right:-2px; width:26px; height:26px; border-radius:50%;
  background:var(--green-2); border:2px solid #0e7a3b; display:flex; align-items:center; justify-content:center;
  color:#fff;
}
.prof-banner__name{ color:#fff; font-size:1.3rem; margin:0 0 6px; }
.prof-banner__tag{
  display:inline-flex; align-items:center; gap:5px; background:rgba(255,255,255,.16);
  padding:4px 11px; border-radius:999px; font-size:.72rem; font-weight:800; margin-bottom:8px;
}
.prof-banner__meta{ display:block; font-size:.8rem; color:rgba(255,255,255,.8); margin:0 0 2px; }
.prof-banner__actions{ display:flex; gap:10px; position:relative; z-index:1; flex-wrap:wrap; }
.prof-banner__actions .btn--ghost{ background:rgba(255,255,255,.14); color:#fff; border-color:rgba(255,255,255,.3); }
.prof-banner__actions .btn--ghost:hover{ background:rgba(255,255,255,.24); border-color:#fff; }
.prof-banner__actions .btn--white{ background:#fff; color:var(--green-dark); }
.prof-banner__actions .btn--white:hover{ background:#eafff1; }

.prof-stat-strip{
  display:grid; grid-template-columns:repeat(4,1fr); background:var(--card); border:1px solid var(--line);
  border-top:none; border-radius:0 0 var(--radius-lg) var(--radius-lg); box-shadow:var(--shadow-sm);
  margin:0 0 22px; overflow:hidden;
}
.prof-stat{ text-align:center; padding:18px 10px; border-right:1px solid var(--line-soft); }
.prof-stat:last-child{ border-right:none; }
.prof-stat__lbl{ display:block; font-size:.74rem; color:var(--text-2); font-weight:600; margin-bottom:4px; }
.prof-stat__val{ display:block; font-family:var(--font-head); font-weight:800; font-size:1.3rem; color:var(--ink); }

.prof-tabs{ display:flex; gap:26px; border-bottom:1px solid var(--line); margin-bottom:22px; flex-wrap:wrap; }
.prof-tab{
  background:none; border:none; cursor:pointer; padding:10px 0 12px; font-family:var(--font-body);
  font-size:.9rem; font-weight:700; color:var(--text-2); border-bottom:2px solid transparent; margin-bottom:-1px;
}
.prof-tab:hover{ color:var(--ink); }
.prof-tab--active{ color:var(--green-dark); border-color:var(--green); }
.prof-tabpanel{ display:none; }
.prof-tabpanel--active{ display:block; }

.ach-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.ach-head h2{ font-size:1.02rem; margin:0; }
.ach-head a{ font-size:.85rem; font-weight:700; color:var(--green-dark); }

.ach-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.ach-tile{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:20px 14px;
  text-align:center; box-shadow:var(--shadow-sm); position:relative;
}
.ach-tile--locked{ background:var(--bg); }
.ach-badge{
  width:58px; height:58px; border-radius:50%; margin:0 auto 12px; position:relative;
  background:radial-gradient(circle at 35% 30%, #26313f, #0d1117 70%);
  border:2px solid #caa24a; display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 0 4px rgba(202,162,74,.12), 0 6px 14px rgba(0,0,0,.25);
}
.ach-badge svg{ width:26px; height:26px; color:#e8c766; }
.ach-tile--locked .ach-badge{
  background:radial-gradient(circle at 35% 30%, #e2e5ea, #cfd3da 70%); border-color:var(--line);
  box-shadow:none;
}
.ach-tile--locked .ach-badge svg{ color:var(--text-3); }
.ach-lock{
  position:absolute; top:10px; right:10px; width:22px; height:22px; border-radius:50%;
  background:#fff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--text-3);
}
.ach-lock svg{ width:12px; height:12px; }
.ach-name{ font-weight:800; font-size:.86rem; margin:0 0 4px; color:var(--ink); }
.ach-desc{ font-size:.74rem; color:var(--text-2); margin:0; line-height:1.35; }
.ach-tile--locked .ach-name,.ach-tile--locked .ach-desc{ color:var(--text-3); }

@media (max-width:900px){
  .prof-stat-strip{ grid-template-columns:repeat(2,1fr); }
  .prof-stat:nth-child(2){ border-right:none; }
  .prof-stat:nth-child(1),.prof-stat:nth-child(2){ border-bottom:1px solid var(--line-soft); }
  .ach-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:600px){
  .prof-banner{ flex-direction:column; text-align:center; padding:24px 20px; }
  .prof-banner__left{ flex-direction:column; }
  .prof-banner__actions{ width:100%; justify-content:center; }
  .ach-grid{ grid-template-columns:1fr 1fr; gap:10px; }
  .ach-tile{ padding:16px 8px; }
}

/* ==========================================================================
   WALLET
   ========================================================================== */
.pg-wallet{ padding:32px 0 60px; }
.wallet-balance-card{
  background:linear-gradient(120deg, var(--green-dark), var(--green-2));
  color:#fff; border-radius:var(--radius-lg); padding:28px 30px; display:flex; align-items:center; gap:18px;
  margin-bottom:26px; box-shadow:var(--shadow);
}
.wallet-balance-card__icon{ font-size:2.2rem; }
.wallet-balance-card__lbl{ font-size:.8rem; opacity:.85; }
.wallet-balance-card__val{ font-family:var(--font-head); font-size:2rem; font-weight:800; }
.wallet-section-title{ font-size:1.05rem; margin-bottom:14px; }
.wallet-topup-panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:22px; margin-bottom:26px; box-shadow:var(--shadow-sm); }
.topup-presets{ display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.preset-btn{ padding:9px 16px; border-radius:999px; background:var(--bg); font-weight:700; font-size:.85rem; border:1.5px solid transparent; cursor:pointer; }
.preset-btn:hover{ border-color:var(--green); }
.topup-input-row{ display:flex; align-items:center; gap:10px; }
.topup-currency{ font-weight:800; color:var(--text-2); }
.topup-input{ flex:1; border:1.5px solid var(--line); border-radius:var(--radius-sm); padding:12px 14px; font-size:1rem; }
.wallet-history{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); }
.wallet-history > .wallet-section-title{ padding:20px 18px 4px; }
.tx-row{ display:flex; align-items:center; gap:14px; padding:14px 18px; border-bottom:1px solid var(--line-soft); }
.tx-row:last-child{ border-bottom:none; }
.tx-icon{ width:38px; height:38px; border-radius:50%; background:var(--bg); display:flex; align-items:center; justify-content:center; }
.tx-info{ flex:1; }
.tx-note{ display:block; font-weight:700; font-size:.85rem; }
.tx-date{ font-size:.72rem; color:var(--text-3); }
.tx-amount{ font-weight:800; font-family:var(--font-head); }
.tx-amount--credit{ color:var(--green-dark); }
.tx-amount--debit{ color:var(--red); }
.tx-status{ font-size:.68rem; font-weight:700; padding:3px 8px; border-radius:6px; }
.tx-status--pending{ background:var(--amber-tint); color:#92450a; }
.tx-status--completed{ background:var(--green-tint); color:var(--green-dark); }
.tx-status--failed{ background:var(--red-tint); color:var(--red); }

/* ==========================================================================
   AUTH (login / register / forgot-password)
   ========================================================================== */
.auth-page{ min-height:70vh; display:flex; align-items:center; justify-content:center; padding:50px 20px; }
.auth-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:38px 34px; width:100%; max-width:420px; }
.auth-header{ text-align:center; margin-bottom:24px; }
.auth-logo{ font-size:2rem; margin-bottom:8px; }
.auth-header h1{ font-size:1.4rem; }
.auth-form{ display:flex; flex-direction:column; gap:16px; }
.form-group{ display:flex; flex-direction:column; gap:6px; }
.form-group label{ font-size:.82rem; font-weight:700; color:var(--text-2); }
.form-group input,.form-group select,.form-group textarea{
  border:1.5px solid var(--line); border-radius:var(--radius-sm); padding:12px 14px; font-size:.92rem; font-family:inherit;
}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{ outline:none; border-color:var(--green); }
.form-group--error input{ border-color:var(--red); }
.form-error{ color:var(--red); font-size:.76rem; font-weight:600; }
.label-link{ float:right; font-weight:600; color:var(--green-dark); font-size:.78rem; }
.auth-switch{ text-align:center; margin-top:18px; font-size:.85rem; color:var(--text-2); }
.auth-switch a{ color:var(--green-dark); font-weight:700; }
.auth-card--error{ border-color:#f6c9c9; }
.error-icon{ font-size:2.2rem; text-align:center; display:block; margin-bottom:10px; }

/* ── Generic tags reused across pages ─────────────────────────────────── */
.tag-free{ background:var(--bg); color:var(--text-2); font-size:.68rem; font-weight:700; padding:3px 9px; border-radius:6px; }
.tag-premium{ background:var(--purple-tint); color:var(--purple); font-size:.68rem; font-weight:700; padding:3px 9px; border-radius:6px; }

/* Misc coming-soon / error partials */
.state-block{ text-align:center; padding:80px 20px; color:var(--text-2); }

/* ==========================================================================
   EDIT PROFILE
   ========================================================================== */
.pg-edit-profile{ padding:40px 0 60px; }
.page-title{ font-size:1.6rem; margin-bottom:24px; }
.panel-form{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:28px; box-shadow:var(--shadow-sm); }
.form-section{ margin-bottom:26px; }
.form-section__title{ font-size:.95rem; margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--line-soft); }
.avatar-upload{ display:flex; align-items:center; gap:18px; }
.avatar-preview{ width:74px; height:74px; border-radius:50%; overflow:hidden; background:var(--ink); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.avatar-preview img{ width:100%; height:100%; object-fit:cover; }
.avatar-preview__initials{ color:#fff; font-weight:800; font-family:var(--font-head); font-size:1.3rem; }
.avatar-upload__hint{ font-size:.76rem; color:var(--text-3); margin:6px 0 0; }
.form-actions{ display:flex; gap:10px; margin-top:6px; }
.info-note{ text-align:center; margin-top:18px; font-size:.82rem; color:var(--text-2); }

/* ==========================================================================
   PREMIUM / PRO (legacy — still routed)
   ========================================================================== */
.pg-premium{ padding:40px 0 60px; }
.premium-hero{ text-align:center; max-width:560px; margin:0 auto 30px; }
.hero-eyebrow{ font-size:.8rem; font-weight:800; color:var(--purple); text-transform:uppercase; letter-spacing:.06em; }
.premium-hero__sub{ color:var(--text-2); }
.premium-active-notice{
  display:flex; align-items:center; gap:14px; background:var(--purple-tint); border:1px solid #ddc8fb;
  border-radius:var(--radius); padding:18px 22px; margin-bottom:30px;
}
.plan-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-bottom:50px; }
.plan-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:26px; position:relative; box-shadow:var(--shadow-sm); }
.plan-card--featured{ border-color:var(--purple); box-shadow:0 0 0 3px var(--purple-tint); }
.plan-card__badge{ position:absolute; top:-12px; left:50%; transform:translateX(-50%); background:var(--purple); color:#fff; font-size:.68rem; font-weight:800; padding:5px 12px; border-radius:999px; white-space:nowrap; }
.plan-card__name{ font-size:1.05rem; margin-bottom:6px; }
.plan-card__price{ display:flex; align-items:baseline; gap:2px; }
.plan-card__currency{ font-weight:700; }
.plan-card__amount{ font-family:var(--font-head); font-size:2rem; font-weight:800; }
.plan-card__period{ color:var(--text-2); font-size:.85rem; }
.plan-card__note{ font-size:.76rem; color:var(--text-3); }
.plan-features{ list-style:none; padding:0; margin:18px 0; display:flex; flex-direction:column; gap:10px; font-size:.85rem; }
.plan-check{ margin-right:4px; }
.plan-current{ text-align:center; padding:10px; background:var(--bg); border-radius:var(--radius-sm); font-weight:700; font-size:.85rem; }
.compare-table-wrap{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:24px; overflow-x:auto; }
.compare-table{ width:100%; border-collapse:collapse; }
.compare-table th,.compare-table td{ padding:12px 16px; border-bottom:1px solid var(--line-soft); text-align:left; }
.compare-cell{ text-align:center !important; }
.compare-cell--pro{ background:var(--purple-tint); }
@media (max-width:900px){ .plan-grid{ grid-template-columns:1fr; } }

/* ==========================================================================
   BATTLE RESULTS — extra detail classes
   ========================================================================== */
.result-player__pts{ font-size:.72rem; color:var(--text-2); }
.result-rounds__title{ font-size:1rem; margin-bottom:14px; }
.round-meta{ display:flex; gap:10px; font-size:.72rem; color:var(--text-3); }
.round-answers{ display:flex; gap:16px; font-size:.78rem; color:var(--text-2); }
.round-correct{ color:var(--green-dark); font-weight:700; }
.round-your{ font-weight:700; }
.round-time{ color:var(--text-3); }
.round-detail{ flex:1; min-width:200px; }
.match-score{ font-family:var(--font-head); font-weight:800; }
.match-score__sep{ color:var(--text-3); }
.confetti-wrap{ position:fixed; inset:0; pointer-events:none; z-index:80; overflow:hidden; }
.confetti-piece{ position:absolute; top:-10px; width:8px; height:14px; opacity:.9; animation:confetti-fall 3.2s linear forwards; }
@keyframes confetti-fall{ to{ transform:translateY(105vh) rotate(360deg); opacity:0; } }
.feedback-icon,.feedback-msg{ display:inline-block; }

/* Extras used across a few pages */
.rank-num{ font-weight:800; color:var(--text-3); }
.tier--free{ background:var(--green); }
.tourn-fee{ font-size:.68rem; font-weight:800; padding:5px 10px; border-radius:999px; }
.stat-grid--4{ grid-template-columns:repeat(4,1fr); }
.ts-cta{ text-align:center; }
.ts-play-match-btn{ width:100%; }
.wallet-balance-card__info{ display:flex; flex-direction:column; }
.badge-chip__desc{ font-size:.72rem; color:var(--text-2); display:block; }
.tx-list{ display:flex; flex-direction:column; }
.topup-form{ display:flex; flex-direction:column; gap:14px; }
.accuracy-ring{ width:70px; height:70px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:conic-gradient(var(--green) calc(var(--pct,0) * 1%), var(--line-soft) 0); }
.accuracy-val{ background:#fff; width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:.85rem; }
.accuracy-lbl{ font-size:.72rem; color:var(--text-2); margin-top:6px; text-align:center; }
