:root {
  --bg: #15122b; --bg2: #2a2150; --panel: rgba(255, 255, 255, 0.06); --line: rgba(255, 255, 255, 0.12);
  --fg: #fff; --muted: rgba(255, 255, 255, 0.68); --accent: #ff7ab6; --card: rgba(22, 18, 46, 0.96);
  --top-h: 52px; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--fg); line-height: 1.55;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); background-image: radial-gradient(120% 60% at 50% 0%, var(--bg2), var(--bg) 70%); background-attachment: fixed;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus:not(:focus-visible) { outline: none; }
button:disabled { opacity: .45; cursor: default; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; color: var(--fg); text-decoration: none; letter-spacing: -0.3px; white-space: nowrap; }
.brand i { font-style: normal; font-size: 22px; }
.brand span { color: var(--accent); }
.topbar .gname { flex: 1; text-align: center; font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.topbar .spacer { flex: 1; }
.tbtn { height: 38px; min-width: 38px; padding: 0 10px; border: 0; border-radius: 11px; background: var(--panel); font-size: 17px; font-weight: 800; text-decoration: none; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tbtn.lvl { font-size: 13px; }

/* ---------- game page ---------- */
.gstage { position: relative; width: 100%; height: calc(100vh - var(--top-h)); height: calc(100svh - var(--top-h)); min-height: 420px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.gstage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.ghud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 12px; pointer-events: none; z-index: 2; }
.ghud .big { font-size: 34px; font-weight: 900; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.ghud .small { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ghud button, .ghud a { pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.35); font-weight: 800; font-size: 14px; backdrop-filter: blur(4px); }
.gcenter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; z-index: 3; }
.gcenter[hidden] { display: none; }
.gtitle { font-size: clamp(34px, 8vw, 60px); font-weight: 900; letter-spacing: -1px; line-height: 1.05; text-shadow: 0 4px 30px rgba(0,0,0,.5); margin: 0 0 8px; }
.ghint { color: var(--muted); font-weight: 700; margin: 6px 0 18px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.bob { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
.scroll-cue { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 12.5px; color: var(--muted); text-decoration: none; z-index: 2; white-space: nowrap; }

/* ---------- buttons / overlay ---------- */
.a-btn { display: block; width: 100%; margin: 8px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.07); font-size: 17px; font-weight: 800; text-align: center; text-decoration: none; color: var(--fg); transition: transform .08s ease; }
.a-btn small { display: block; font-size: 12.5px; font-weight: 600; opacity: .75; margin-top: 2px; }
.a-btn:active { transform: scale(.97); }
.a-btn.primary, .cta { background: var(--accent); color: #170c22; border-color: transparent; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 40%, transparent); }
.a-btn.inline { display: inline-block; width: auto; padding: 12px 26px; }
.a-ghost { display: block; margin-top: 10px; color: var(--muted); font-weight: 700; text-decoration: none; font-size: 14px; }
.a-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .18s ease; }
.a-overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.a-card { position: relative; width: 100%; max-width: 410px; max-height: calc(100svh - 32px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px 16px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .2s ease; }
.a-card h2 { margin: 0 0 6px; font-size: 25px; line-height: 1.2; }
.a-sub { color: var(--muted); margin: 2px 0 10px; font-size: 14.5px; }
.a-score { font-size: 58px; font-weight: 900; letter-spacing: -2px; line-height: 1.05; margin: 4px 0; font-variant-numeric: tabular-nums; }
.a-newbest { display: inline-block; padding: 4px 12px; border-radius: 99px; background: #ffd84d; color: #3a2400; font-weight: 900; font-size: 13px; animation: pop .4s ease; }
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 10px 0; }
.a-stats div { padding: 8px; border-radius: 12px; background: var(--panel); }
.a-stats small { display: block; color: var(--muted); font-size: 11.5px; }
.a-stats b { font-size: 18px; }
.a-xp { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.a-xp i { flex: 1; height: 7px; border-radius: 7px; background: var(--panel); overflow: hidden; }
.a-xp i b { display: block; height: 100%; background: linear-gradient(90deg, #ffd84d, var(--accent)); }
.a-more { margin-top: 14px; text-align: left; }
.a-more-h { font-weight: 800; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.a-more-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.a-mini { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; text-decoration: none; color: var(--fg); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 35%, transparent), var(--panel)); border: 1px solid var(--line); text-align: center; line-height: 1.2; }
.a-mini span { font-size: 26px; }
.a-mini b { font-size: 12.5px; margin-top: 4px; }
.a-mini small { font-size: 10.5px; color: var(--muted); }
.a-toast { position: fixed; left: 50%; top: 12px; z-index: 60; transform: translate(-50%, -30px); opacity: 0; padding: 10px 18px; border-radius: 99px; background: #fff; color: #222; font-weight: 800; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: all .3s ease; pointer-events: none; white-space: nowrap; }
.a-toast.show { transform: translate(-50%, 0); opacity: 1; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel); gap: 2px; flex-wrap: wrap; justify-content: center; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-weight: 800; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--accent); color: #170c22; }

/* ---------- hub ---------- */
.hub { max-width: 1180px; margin: 0 auto; padding: 18px 16px 10px; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.hero-main { position: relative; border-radius: 24px; overflow: hidden; min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; text-decoration: none; color: #fff;
  background: #222 center/cover no-repeat; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.hero-main::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.75)); }
.hero-main > * { position: relative; }
.hero-main .tag { align-self: flex-start; padding: 4px 10px; border-radius: 99px; background: var(--accent); color: #170c22; font-weight: 900; font-size: 12px; margin-bottom: 8px; }
.hero-main h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.1; }
.hero-main p { margin: 6px 0 12px; color: rgba(255,255,255,.85); }
.hero-main .cta { align-self: flex-start; padding: 11px 22px; border-radius: 14px; font-weight: 900; text-decoration: none; }
.hero-side { display: flex; flex-direction: column; gap: 12px; }
.profile-card { padding: 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.profile-card h3 { margin: 0 0 8px; font-size: 16px; }
.pc-row { display: flex; gap: 10px; }
.pc-row div { flex: 1; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); text-align: center; }
.pc-row small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.pc-row b { font-size: 22px; }
.recent { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.recent a { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.07); color: var(--fg); text-decoration: none; font-weight: 800; font-size: 13.5px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.filters button { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-weight: 800; font-size: 14px; }
.filters button.on { background: var(--fg); color: var(--bg); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gcard { position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--fg); background: var(--panel); border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.gcard:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.gcard .thumb { aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--c) 30%, #111) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 54px; }
.gcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .meta { padding: 10px 12px 12px; }
.gcard b { display: block; font-size: 16px; }
.gcard small { color: var(--muted); font-size: 13px; }
.gcard .badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; }
.badge { padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 900; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(4px); }
.badge.new { background: #ffd84d; color: #3a2400; }
.badge.d3 { background: #22e3ff; color: #00222b; }
.gcard .best { position: absolute; top: 8px; right: 8px; }

/* ---------- content / SEO ---------- */
.content { max-width: 780px; margin: 0 auto; padding: 34px 18px 40px; }
.content h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; letter-spacing: -0.5px; margin: 0 0 12px; }
.content h2 { font-size: 24px; margin: 34px 0 10px; line-height: 1.25; }
.content h3 { font-size: 18px; margin: 22px 0 6px; }
.content p, .content li { color: rgba(255,255,255,.86); font-size: 16.5px; }
.content .lead { font-size: 18px; }
.content ol, .content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.content .cta { display: inline-block; margin: 8px 0; padding: 12px 22px; border-radius: 14px; font-weight: 900; text-decoration: none; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 800; font-size: 17px; }
details p { margin: 8px 0 0; }
.ad-slot { margin: 26px auto; min-height: 100px; text-align: center; }
.ad-slot:empty { display: none; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
footer { max-width: 1180px; margin: 0 auto; padding: 24px 18px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.portal .content, .portal footer, .portal .scroll-cue, .portal .ad-slot, .portal .brand-link { display: none !important; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; } .hero-main { min-height: 180px; padding: 16px; }
  .hero-main p { display: none; } .hero-side { gap: 10px; } .profile-card { padding: 12px; } .profile-card h3 { font-size: 14px; margin-bottom: 6px; }
  .pc-row div { padding: 6px; } .pc-row b { font-size: 18px; } .new-player #profileCard { display: none; }
}
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .gcard b { font-size: 14px; } .gcard small { font-size: 11.5px; } .gcard .thumb { font-size: 40px; } .brand b { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.gposter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111 center/cover no-repeat; }
.gposter::before { content: ""; position: absolute; inset: 0; background: rgba(10, 8, 25, .55); }
.gposter > * { position: relative; }
.dailies { margin: 4px 0 14px; }
.dailies h2 { font-size: 17px; margin: 0 0 8px; }
.daily-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.daily { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; text-decoration: none; color: var(--fg); background: linear-gradient(150deg, rgba(255,122,182,.22), var(--panel)); border: 1px solid var(--line); }
.daily span { font-size: 24px; } .daily b { font-size: 14.5px; line-height: 1.2; } .daily small { color: var(--muted); font-size: 12px; font-weight: 700; }
.daily.done { background: linear-gradient(150deg, rgba(95,224,160,.25), var(--panel)); }
.daily.done::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: #5fe0a0; color: #0b2a1b; font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: 14px; }
@media (max-width: 560px) { .daily-row { grid-template-columns: 1fr; gap: 6px; } .daily { flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; } .daily span { font-size: 20px; } .daily small { margin-left: auto; } }
.search { width: 100%; padding: 12px 16px; margin: 0 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: 600 16px system-ui, sans-serif; outline: none; }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.gp:fullscreen .topbar, .gp:fullscreen .content, .gp:fullscreen footer { display: none; }
.gp:fullscreen .gstage { height: 100vh; }
.hubpage .brand b { display: inline; }
