:root {
  --bg: #0e0f1f;
  --panel: #181a33;
  --panel-2: #212447;
  --line: #2c2f58;
  --text: #eef0ff;
  --muted: #9aa0c8;
  --accent: #7b5cff;
  --accent-2: #19c3ff;
  --ok: #2fd17f;
  --danger: #ff5470;
  --radius: 14px;
  --topbar: 60px;
  --font: ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
img { display: block; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }
[hidden] { display: none !important; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.muted { color: var(--muted); font-size: 14px; }

/* ---- page shell: [ad rail] content [ad rail] ---- */
.page { width: 100%; max-width: 1920px; margin: 0 auto; padding: 18px 20px 40px; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.page.admin-page { max-width: 1400px; }
.content { min-width: 0; }
.ad-rail { display: none; }
.ad-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6d7299; text-align: center; margin-bottom: 4px; }
.ad-img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; }
.ad-inline { margin: 4px 0 30px; }
@media (min-width: 1200px) {
  .page.with-rails { --rail: 160px; grid-template-columns: var(--rail) minmax(0, 1fr) var(--rail); }
  .with-rails .ad-rail { display: block; align-self: stretch; }
  .with-rails .ad-inline { display: none; }
  .ad-sticky { position: sticky; top: calc(var(--topbar) + 16px); }
}
@media (min-width: 1700px) {
  .page.with-rails { --rail: 300px; }
}

/* ---- top bar + category bar ---- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; height: var(--topbar); padding: 0 20px; background: rgba(14, 15, 31, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { flex: none; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo img { display: block; height: 38px; width: auto; }
.logo.small img { height: 26px; }
.logo small { font-size: 12px; color: var(--muted); font-weight: 700; }
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search .ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 10px 18px 10px 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.search input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.admin-nav { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.admin-nav a { color: var(--muted); text-decoration: none; }

.catbar { border-bottom: 1px solid var(--line); background: #11122a; }
/* the fade on the right hints that more categories scroll in */
.catbar-inner { max-width: 1920px; margin: 0 auto; display: flex; gap: 8px; overflow-x: auto; padding: 10px 48px 10px 20px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.catbar-inner::-webkit-scrollbar { display: none; }
.nav-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 12px; background: var(--panel); border: 1px solid transparent; color: #c4c8ec; font-weight: 800; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background .15s, color .15s; }
.nav-chip .ico { width: 18px; height: 18px; }
.nav-chip:hover { background: var(--panel-2); color: #fff; }
.nav-chip.on { background: linear-gradient(90deg, var(--accent), #5a7dff); color: #fff; }
.nav-sep { flex: none; width: 1px; margin: 4px 4px; background: var(--line); }

.footer { border-top: 1px solid var(--line); padding: 22px 20px; color: var(--muted); font-size: 14px; }
.footer-inner { max-width: 1920px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }

/* ---- featured block: 1 big + 4 small cards ---- */
.hero { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; aspect-ratio: 32 / 9; margin-bottom: 30px; }
.hero.few { grid-template-columns: 2fr 1fr; aspect-ratio: 8 / 3; }
.hero-card { position: relative; display: block; min-height: 0; overflow: hidden; border-radius: 18px; background: var(--panel); text-decoration: none; isolation: isolate; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: box-shadow .15s; }
.hero-card.big { grid-row: 1 / span 2; }
.hero-card:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 0 0 2px var(--accent); }
.hero-bg { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hero-bg.icon-crop { object-position: 50% 30%; }
.hero-bg.blur { inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); filter: blur(28px) saturate(1.4) brightness(.75); }
.hero-card:hover .hero-bg { transform: scale(1.05); }
.hero-art { position: absolute; z-index: -2; right: 7%; top: 50%; height: 76%; aspect-ratio: 1; object-fit: cover; border-radius: 22%; transform: translateY(-50%) rotate(5deg); box-shadow: 0 22px 50px rgba(0, 0, 0, .55); transition: transform .3s; }
.hero-card:hover .hero-art { transform: translateY(-50%) rotate(2deg) scale(1.04); }
.hero-card:not(.big) .hero-art { display: none; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 9, 20, .92) 0%, rgba(8, 9, 20, .35) 48%, transparent 78%); }
.hero-card.big.has-cover .hero-shade { background: linear-gradient(90deg, rgba(8, 9, 20, .82) 0%, rgba(8, 9, 20, .45) 45%, transparent 75%), linear-gradient(to top, rgba(8, 9, 20, .85) 0%, transparent 60%); }
.hero-card.big.no-cover .hero-shade { background: linear-gradient(90deg, rgba(8, 9, 20, .8) 0%, rgba(8, 9, 20, .3) 55%, transparent 80%), linear-gradient(to top, rgba(8, 9, 20, .75), transparent 55%); }
.hero-info { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; }
.big .hero-info { gap: 16px; padding: 22px 24px; }
.hero-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }
.big .hero-icon { width: 80px; height: 80px; border-radius: 20px; }
.big.no-cover .hero-icon { display: none; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; color: #ffd166; font-weight: 900; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.hero-title { font-weight: 900; font-size: 16px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.big .hero-title { font-size: clamp(24px, 2.4vw, 40px); white-space: normal; margin-top: 2px; }
.hero-blurb { margin-top: 4px; max-width: 44ch; color: #d9dcf7; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-cat { color: #c0c4e6; font-size: 12.5px; font-weight: 700; }
.btn.play-sm { align-self: flex-start; margin-top: 12px; padding: 10px 22px; font-size: 16px; border: 0; background: linear-gradient(90deg, #ffb019, #ff6a3d); box-shadow: 0 6px 18px rgba(255, 106, 61, .4); }

/* ---- rows, tiles, grid ---- */
.row, .cats-section, .all-games { margin-bottom: 30px; }
.row-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.row-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 21px; }
.ico.head { width: 24px; height: 24px; color: var(--accent-2); }
.row.hot .ico.head { color: #ff7a3d; }
.see-all { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 14px; font-weight: 800; text-decoration: none; }
.see-all:hover { color: var(--text); }
.row-nav { margin-left: auto; display: flex; gap: 6px; }
.arrow { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.arrow:hover:not(:disabled) { border-color: var(--accent); }
.arrow:disabled { opacity: .3; cursor: default; }
.row-track { --tile: 156px; display: grid; grid-auto-flow: column; grid-auto-columns: var(--tile); gap: 16px; overflow-x: auto; padding: 6px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; }

.tile { min-width: 0; display: flex; flex-direction: column; text-decoration: none; }
.tile-img { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 18px; background: var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transition: transform .15s, box-shadow .15s; }
.tile-img > img, .tile-img > .thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile-img { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, .45), 0 0 0 2px var(--accent); }
.tile-name { margin-top: 8px; font-size: 14.5px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.ico.flame { width: 14px; height: 14px; color: #ff7a3d; }
.tag { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .05em; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.tag .ico { width: 12px; height: 12px; }
.tag.hot { background: linear-gradient(90deg, #ff3d3d, #ff8a00); }
.tag.new { background: linear-gradient(90deg, #12b5ff, #6c5cff); }
.row.hot .tag { display: none; }
.rank { position: absolute; left: 8px; bottom: 0; font-size: 52px; font-weight: 900; font-style: italic; line-height: 1; color: #fff; -webkit-text-stroke: 2px rgba(10, 10, 30, .6); paint-order: stroke fill; text-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.thumb-fallback { display: grid; place-items: center; font-size: 56px; font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.empty { color: var(--muted); padding: 30px 0; }

/* ---- categories ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cat-card { position: relative; display: flex; align-items: center; gap: 11px; height: 84px; padding: 0 74px 0 14px; overflow: hidden; border-radius: 16px; text-decoration: none; background: linear-gradient(120deg, var(--c1), var(--c2)); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transition: transform .15s, box-shadow .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .4); }
.cat-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: rgba(255, 255, 255, .22); color: #fff; }
.cat-icon .ico { width: 26px; height: 26px; }
.cat-text { min-width: 0; display: flex; flex-direction: column; }
.cat-name { font-size: 16px; font-weight: 900; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.cat-count { font-size: 12.5px; font-weight: 800; opacity: .9; }
.cat-thumbs { position: absolute; right: 12px; top: 50%; display: flex; transform: translateY(-50%); }
.cat-thumbs img, .cat-thumbs .thumb-fallback { width: 54px; height: 54px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .75); object-fit: cover; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); font-size: 22px; }
.cat-thumbs > * { transform: rotate(8deg); transition: transform .2s; }
.cat-card:hover .cat-thumbs > * { transform: rotate(0deg) scale(1.06); }

/* ---- list pages (category / hot / new / search) ---- */
.list-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding: 18px 20px; border-radius: 18px; background: linear-gradient(120deg, var(--c1), var(--c2)); }
.list-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .22); color: #fff; }
.list-icon .ico { width: 30px; height: 30px; }
.list-text h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.list-text p { margin: 2px 0 0; font-weight: 700; opacity: .9; }
.sorts { margin-left: auto; display: flex; gap: 8px; }
.list-head .chip { background: rgba(0, 0, 0, .22); border-color: transparent; color: #fff; }
.list-head .chip.on { background: #fff; color: #1b1d3a; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 700; color: var(--muted); }
.chip:hover, .chip.on { color: var(--text); border-color: var(--accent); background: var(--panel-2); }

/* ---- game page ---- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 26px; }
.game-layout.portrait:not(.solo) { grid-template-columns: auto minmax(0, 1fr); }
/* .stage = player + title bar, as wide as the player fits the screen height */
.stage { --ar: 16 / 9; --arn: 1.7778; width: min(100%, calc((100vh - 190px) * var(--arn))); margin: 0 auto; }
.stage.portrait { --ar: 9 / 16; --arn: .5625; }
.game-layout.portrait:not(.solo) .stage { width: max(320px, calc((100vh - 190px) * var(--arn))); max-width: 100%; }
.player { position: relative; width: 100%; aspect-ratio: var(--ar); background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player:fullscreen { width: 100vw; height: 100vh; max-width: none; aspect-ratio: auto; border-radius: 0; }
.cover { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.cover-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(18px) brightness(.45); }
.cover-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; text-align: center; }
.cover-thumb { width: min(180px, 40vw); aspect-ratio: 1; object-fit: cover; border-radius: 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.cover-title { font-size: 24px; font-weight: 900; }
.game-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel); }
.bar-icon { flex: none; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.bar-text { flex: 1; min-width: 0; }
.bar-text h1 { margin: 0; font-size: 19px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.bar-meta .chip { padding: 2px 10px; font-size: 12.5px; }
.bar-meta .muted { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.ico.tiny { width: 13px; height: 13px; }
.save-state { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 13px; font-weight: 700; white-space: nowrap; }
.save-state.err { color: var(--danger); }
.stage.portrait .save-state span { display: none; }
#fs-btn, #share-btn { flex: none; }
/* portrait player = narrow bar: icon-only buttons (the label stays as the tooltip) */
.stage.portrait .game-bar .btn { padding: 9px 11px; }
.stage.portrait .game-bar .btn span { display: none; }
.bar-meta .muted { white-space: nowrap; }
.side-games h2 { margin: 0 0 12px; font-size: 18px; }
.side-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px 12px; }
.about { max-width: 900px; margin-bottom: 28px; }
.about h2 { margin: 0 0 6px; font-size: 20px; }
.desc { color: #cfd3f5; }
.desc p { margin: 0 0 10px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.primary { background: linear-gradient(90deg, var(--accent), #5a7dff); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn.play { font-size: 24px; padding: 14px 50px 14px 42px; background: linear-gradient(90deg, #ffb019, #ff6a3d); border: 0; box-shadow: 0 8px 22px rgba(255, 106, 61, .45); }
.btn.play:hover { transform: scale(1.05); }
.btn.play .ico, .btn.play-sm .ico { fill: currentColor; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }

.notice { padding: 10px 16px; border-radius: 10px; background: #3a2f00; border: 1px solid #806800; margin-bottom: 14px; }
.notice.ok { background: #0f3324; border-color: #1f7a50; }
.notice.err { background: #3d1220; border-color: #a33050; }
.error-page { text-align: center; padding: 80px 0; }
.error-page .code { font-size: 80px; font-weight: 900; color: var(--accent); }

/* ---- admin ---- */
h1 { font-size: 26px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; }
.panel h1, .panel h2 { margin-top: 0; }
.panel.narrow { max-width: 420px; margin: 60px auto; }
.panel label { display: block; margin-bottom: 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.panel label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
.panel input:not([type=checkbox]), .panel select, .panel textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 400; }
.panel input[type=file] { padding: 7px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.err-text { color: var(--danger); }
.field-static { margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.table a { text-decoration: none; }
.table .live-row { background: rgba(47, 209, 127, .07); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-cell form { margin: 0; }
.inline-form { margin-top: 12px; }
img.mini { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.previews { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.thumb-preview { width: 120px; height: 120px; object-fit: cover; border-radius: 16px; margin-bottom: 14px; }
.cover-preview { height: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; vertical-align: middle; }
.badge.live { background: rgba(47, 209, 127, .18); color: var(--ok); }
.badge.off { background: rgba(154, 160, 200, .18); color: var(--muted); }
.badge.feat { background: rgba(255, 209, 102, .16); color: #ffd166; }
.danger-zone { border-color: rgba(255, 84, 112, .4); }
#up-progress { margin-top: 14px; }
.bar { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.bar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .2s; }
#up-status { margin-top: 6px; }

/* ---- header: daily gift, Xu balance, account ---- */
.top-actions { flex: none; display: flex; align-items: center; gap: 10px; }
.search + .top-actions { margin-left: 0; }
.icon-btn { display: none; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--panel); color: var(--text); }
.icon-btn .ico { width: 19px; height: 19px; }
.daily-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px 6px 9px; border: 0; border-radius: 999px; background: linear-gradient(90deg, #ff4f8b, #ff8a3d); color: #fff; font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 14px rgba(255, 79, 139, .4); animation: gift-wiggle 2.4s ease-in-out infinite; }
.daily-btn .ico { width: 18px; height: 18px; }
.daily-btn:disabled { opacity: .6; animation: none; }
@keyframes gift-wiggle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-7deg); } 90% { transform: rotate(7deg); } 94% { transform: rotate(-4deg); } }
.xu-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px 4px 5px; border-radius: 999px; background: #1d1f3d; border: 1px solid #3a3d70; text-decoration: none; font-weight: 900; font-size: 15px; color: #ffd166; font-variant-numeric: tabular-nums; }
.xu-chip:hover { border-color: #ffd166; }
.xu-chip img { width: 24px; height: 24px; }
.bump { animation: bump .5s ease-out; }
@keyframes bump { 30% { transform: scale(1.25); color: #fff3b0; } }
.xu-chip span { display: inline-block; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 900; text-decoration: none; }
.avatar.big { width: 48px; height: 48px; font-size: 20px; flex: none; }

.toast { position: fixed; z-index: 50; left: 50%; top: calc(var(--topbar) + 14px); transform: translateX(-50%); max-width: min(92vw, 520px); padding: 11px 20px; border-radius: 14px; background: #24275a; border: 1px solid #3a3d70; color: var(--text); font-weight: 800; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: toast-in .25s ease-out; }
.toast.gold { background: linear-gradient(90deg, #6b4a00, #8a5a00); border-color: #ffd166; color: #fff3c4; }
.toast.err { background: #4a1426; border-color: #a33050; }
.toast a { color: #ffd166; font-weight: 900; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---- account page ---- */
.account { max-width: 980px; margin: 0 auto; display: grid; gap: 18px; }
.account > .notice { margin: 0; }
.panel-card, .wallet-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.panel-card h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: 20px; }
.ico.flip { transform: scaleX(-1); }
.wallet-card { background: radial-gradient(120% 140% at 0% 0%, #3b2f8a 0%, #1d1f45 55%, #181a33 100%); border-color: #3f3a8a; }
.wallet-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wallet-top img { width: 64px; height: 64px; filter: drop-shadow(0 6px 14px rgba(255, 190, 40, .35)); }
.wallet-label { color: #c9c4ff; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.wallet-balance { font-size: 44px; font-weight: 900; line-height: 1.05; color: #ffd166; font-variant-numeric: tabular-nums; }
.wallet-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.wallet-text { color: #d5d8f5; margin: 14px 0; }
.wallet-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wallet-actions form { margin: 0 0 0 auto; }
.wallet-actions .btn.play-sm { margin-top: 0; }
.guest-note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); color: #d5d8f5; font-size: 14px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.auth label { display: block; margin: 0 0 12px; color: var(--muted); font-size: 14px; font-weight: 700; }
.auth input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.auth input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.auth .btn { width: 100%; margin-top: 4px; padding: 11px; }
.gold { color: #ffd166; }
.xu-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14.5px; }
.xu-table th, .xu-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.xu-table th { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.xu-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xu-table .plus { color: var(--ok); font-weight: 800; }
.xu-table .minus { color: var(--danger); font-weight: 800; }
.xu-table a { font-weight: 800; text-decoration: none; }
.page-search { display: none; margin: 0 0 16px; max-width: none; }

.saved-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.saved-game { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--bg); text-decoration: none; }
.saved-game:hover { outline: 1px solid var(--accent); }
.saved-game img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.saved-game > span { display: flex; flex-direction: column; min-width: 0; }
.saved-game .muted { font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.settings .btn { width: auto; }
.danger { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.danger summary { display: inline-flex; align-items: center; gap: 7px; color: var(--danger); font-weight: 800; cursor: pointer; }
.danger summary .ico { width: 17px; height: 17px; }
.danger form { margin-top: 10px; }

/* ---- info pages, footer links ---- */
.info-page { max-width: 820px; margin: 0 auto; padding: 8px 0 20px; color: #d5d8f5; line-height: 1.65; }
.info-page h1 { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 30px; margin: 8px 0 18px; }
.info-page h1 .ico { width: 30px; height: 30px; }
.info-page h2 { color: var(--text); font-size: 20px; margin: 28px 0 8px; }
.info-page a { color: var(--accent-2); }
.info-page ul { padding-left: 22px; }
.info-page li { margin-bottom: 8px; }
.contact-email { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.contact-email .ico { width: 26px; height: 26px; color: var(--accent-2); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 700; }
.footer-links a:hover { color: var(--text); }
.legal-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.legal-note a { color: var(--accent-2); }

/* ---- smaller screens ---- */
@media (max-width: 900px) {
  .game-layout.portrait:not(.solo) { grid-template-columns: minmax(0, 1fr); }
  .game-layout.portrait:not(.solo) .stage, .stage { width: min(100%, calc((100vh - 140px) * var(--arn))); }
}
@media (max-width: 700px) {
  :root { --topbar: 54px; }
  .page { padding: 12px 12px 30px; }
  .topbar { padding: 0 12px; gap: 12px; }
  .logo img { height: 30px; }
  .catbar-inner { padding: 8px 12px; gap: 6px; }
  .nav-chip { padding: 6px 11px; font-size: 13px; }
  .hero { grid-template-columns: 1fr 1fr; grid-template-rows: none; aspect-ratio: auto; gap: 10px; margin-bottom: 24px; }
  .hero.few { grid-template-columns: 1fr 1fr; aspect-ratio: auto; }
  .hero-card.big { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16 / 9; }
  .hero-card:not(.big) { aspect-ratio: 16 / 10; }
  .big .hero-info { gap: 12px; padding: 14px; }
  .big .hero-title { font-size: 22px; }
  .hero-blurb { display: none; }
  .hero-kicker { font-size: 11px; }
  .hero-icon { width: 36px; height: 36px; border-radius: 10px; }
  .hero-title { font-size: 14px; }
  .btn.play-sm { margin-top: 8px; padding: 7px 14px; font-size: 14px; }
  .row-head h2 { font-size: 18px; }
  .row-nav { display: none; }
  .row-track { --tile: 112px; gap: 10px; }
  .grid, .side-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 14px 10px; }
  .tile-img { border-radius: 14px; }
  .tile-name { margin-top: 6px; font-size: 13px; }
  .tile-meta { font-size: 11.5px; }
  .rank { font-size: 38px; }
  .tag { top: 6px; left: 6px; font-size: 10px; padding: 1px 6px; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-card { height: 62px; gap: 9px; padding: 0 10px; }
  .cat-icon { width: 38px; height: 38px; border-radius: 11px; }
  .cat-icon .ico { width: 21px; height: 21px; }
  .cat-name { font-size: 15px; }
  .cat-thumbs { display: none; }
  .list-head { padding: 14px; gap: 12px; }
  .list-icon { width: 44px; height: 44px; border-radius: 13px; }
  .list-text h1 { font-size: 21px; }
  #fs-btn span, #share-btn span { display: none; }
  .search:not(.page-search) { display: none; }
  .page-search { display: block; }
  .icon-btn { display: grid; }
  .topbar .top-actions { margin-left: auto; gap: 7px; }
  .daily-btn { padding: 5px 9px 5px 7px; font-size: 13px; }
  .xu-chip { padding: 3px 10px 3px 4px; font-size: 14px; }
  .xu-chip img { width: 22px; height: 22px; }
  .sign-in { padding: 5px 10px; font-size: 13px; }
  .auth-grid, .settings-grid { grid-template-columns: 1fr; }
  .auth-grid[data-tab=login] .auth.first { order: -1; }
  .wallet-balance { font-size: 36px; }
  .wallet-user { margin-left: 0; }
  .xu-table th:nth-child(4), .xu-table td:nth-child(4) { display: none; }
  .two { grid-template-columns: 1fr; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
}

/* admin dashboard stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 6px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-value { font-size: 28px; font-weight: 900; line-height: 1.1; }
.stat-label { color: var(--muted); font-weight: 700; font-size: 14px; }
.stat-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.usage { margin: 10px 0 16px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.usage-head span { color: var(--muted); }
.usage.warn .bar .fill { background: linear-gradient(90deg, #ffb019, #ff8a3d); }
.usage.full .bar .fill { background: linear-gradient(90deg, #ff5470, #ff3d3d); }

/* admin players page: inputs outside .panel */
.admin-page .table input, .admin-page form.two > input { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
