/* wot-stats.html: page-specific styles (tokens.css load first). */
:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --card:      #1c2128;
  --border:    #30363d;
  --accent:    #f0a500;
  --accent-lo: rgba(240,165,0,0.12);
  --text:      #e6edf3;
  --muted:     #8b949e;
  --green:     #3fb950;
  --red:       #f85149;
  --blue:      #58a6ff;
  --purple:    #a371f7;
  --orange:    #f0883e;
  --cyan:      #39d0d8;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; min-height: 100vh; }
a { color: var(--accent); }

/* NAV (mirrors community.html / wot-tracker.html) */
nav { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0 20px; height: 54px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 200; }
.nav-left { display: flex; align-items: center; gap: 10px; }
.nav-back { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.nav-back:hover { color: var(--text); border-color: var(--muted); }
.nav-brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; color: var(--text); text-decoration: none; }
.nav-brand:hover { color: var(--accent); }
.nav-logo { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; display: block; }
.nav-mark { width: 30px; height: 30px; border-radius: 6px; background: var(--accent-lo) url(../iconer/HAKOO.png) center/cover no-repeat; display: none; align-items: center; justify-content: center; font-size: 0; }
.nav-brand em { color: var(--accent); font-style: normal; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.btn { padding: 6px 13px; border-radius: 7px; border: 1px solid var(--border); cursor: pointer; font-size: 12px; font-weight: 600; transition: all .15s; background: transparent; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { color: var(--text); border-color: var(--muted); }
.btn-primary { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 800; }
.btn-primary:hover { filter: brightness(1.08); color: #1a1200; }
.lang-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-flag { padding: 0; border: 2px solid transparent; border-radius: 5px; background: none; cursor: pointer; line-height: 0; opacity: .55; transition: opacity .15s; }
.lang-flag img { width: 28px; height: 21px; border-radius: 3px; display: block; }
.lang-flag:hover { opacity: 1; }
.lang-flag.active { opacity: 1; border-color: var(--accent); }

/* LAYOUT */
.wrap { padding: 20px; max-width: 1200px; margin: 0 auto; }
.sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 4px 0 9px; }

/* INTRO */
.intro { background: linear-gradient(135deg, var(--card), #1a2410); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; }
.intro h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.intro h1 .tag { color: var(--accent); }
.intro p { color: var(--muted); font-size: 13px; line-height: 1.55; margin-top: 8px; max-width: 760px; }

/* CONTROL BAR */
.ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ctrl .meta { font-size: 12px; color: var(--muted); }
.ctrl .meta b { color: var(--text); font-weight: 700; }
.ctrl .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 4px 11px; font-size: 11px; font-weight: 700; color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.pill.stale .dot { background: var(--orange); }

/* SUMMARY CARDS */
.summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.s-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; position: relative; overflow: hidden; }
.s-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, var(--accent), #ffd04e); }
.s-card.b::before { background: linear-gradient(90deg, var(--blue), #79c0ff); }
.s-card.g::before { background: linear-gradient(90deg, var(--green), #56d364); }
.s-card.c::before { background: linear-gradient(90deg, var(--cyan), #6ee7eb); }
.s-card .sl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 4px; }
.s-card .sv { font-size: 24px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.s-card.gold .sv { color: var(--accent); }
.s-card.b .sv { color: var(--blue); }
.s-card.g .sv { color: var(--green); }
.s-card.c .sv { color: var(--cyan); }

/* HERO / MEMBER OF THE MOMENT */
.hero { background: linear-gradient(135deg, var(--card), color-mix(in srgb,var(--bg) 88%,var(--accent))); border: 1px solid var(--accent); border-radius: 14px; padding: 18px 22px; margin-bottom: 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); background: var(--accent-lo); border: 1px solid var(--accent); border-radius: 20px; padding: 3px 11px; }
.hero-av { width: 60px; height: 60px; border-radius: 12px; background: var(--accent-lo); border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; color: var(--accent); flex-shrink: 0; }
.hero-main { flex: 1; min-width: 200px; }
.hero-main .hn { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.hero-main .hr { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-stat .hv { font-size: 20px; font-weight: 800; }
.hero-stat .hl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 1px; }
.hv.rating { color: var(--orange); }
.hv.wr { color: var(--green); }
.hv.dmg { color: var(--blue); }

/* LEADERBOARD TABLE */
.lb-panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.lb-head { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lb-head h3 { font-size: 14px; font-weight: 700; }
.lb-head .hint { font-size: 11px; color: var(--muted); }
.lb-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
thead tr { background: var(--bg2); }
th { padding: 10px 12px; text-align: right; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
th.txt { text-align: left; }
th:hover { color: var(--text); }
th.sorted { color: var(--accent); }
th .arrow { font-size: 9px; opacity: .8; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; text-align: right; }
td.txt { text-align: left; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 34px; }
.pname { font-weight: 700; }
.prole { font-size: 10px; color: var(--muted); font-weight: 600; }
.top-cell { color: var(--accent); font-weight: 800; position: relative; }
.top-cell::after { content:'★'; font-size: 9px; margin-left: 4px; color: var(--accent); vertical-align: top; }
.val-wr { color: var(--green); font-weight: 700; }
.val-rating { color: var(--orange); font-weight: 700; }
.val-boxes { color: var(--accent); font-weight: 700; }
.p-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 5px var(--green); vertical-align: middle; }
.hv.boxes { color: var(--accent); }
.muted-val { color: var(--muted); }

/* HONESTY NOTE */
.note { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.note b { color: var(--text); }

/* TOOLS ROW */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tool { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color .15s; }
.tool:hover { border-color: var(--accent); }
.tool .tt { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.tool .td { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.tool .ext { color: var(--muted); font-weight: 400; margin-left: auto; font-size: 12px; }

/* STATES */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 10px; color: var(--muted); font-size: 13px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.empty .ei { font-size: 30px; margin-bottom: 8px; }
.empty.err { color: var(--red); }

footer { padding: 24px 22px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
footer a { color: var(--muted); }

/* RESPONSIVE — single column under 900px (same breakpoint as community.html) */
@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .hero { gap: 14px; }
  .hero-stats { gap: 16px; width: 100%; }
}
@media (max-width: 560px) {
  .nav-right .btn.hide-sm { display: none; }
  .intro h1 { font-size: 20px; }
}
