:root {
  --bg: #0c0d14;
  --bg2: #151621;
  --bg3: #1e2030;
  --line: #262838;
  --text: #f1f1f7;
  --muted: #9a9cb5;
  --accent: #7c5cff;
  --accent2: #ff5ca8;
  --live: #1fd286;
  --top: 64px;
  --side: 232px;
  --radius: 12px;
  /* Nunito is self-hosted for latin / latin-ext / vietnamese only; Cyrillic, Thai and CJK glyphs fall through
     to the system fonts below (per glyph), so no extra font files are downloaded for those languages. */
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Thai', 'Noto Sans CJK SC',
    'Hiragino Sans', 'Microsoft YaHei', sans-serif;
}
/* CJK / Thai: put the right regional system font first so kanji/hanzi/hangul use the local glyph forms */
:root:lang(ja) { --font: 'Nunito', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Yu Gothic UI', Meiryo, system-ui, sans-serif; }
:root:lang(ko) { --font: 'Nunito', 'Apple SD Gothic Neo', 'Noto Sans CJK KR', 'Malgun Gothic', system-ui, sans-serif; }
:root:lang(zh) { --font: 'Nunito', 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', 'Hiragino Sans GB', system-ui, sans-serif; }
:root:lang(th) { --font: 'Nunito', 'Noto Sans Thai', Thonburi, 'Leelawadee UI', Tahoma, system-ui, sans-serif; }
:root:lang(ja) body, :root:lang(ko) body, :root:lang(zh) body, :root:lang(th) body { line-break: strict; }
:root:lang(ko) body { word-break: keep-all; }
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-weight: 700;
  overflow-wrap: break-word; /* long German / Russian compounds never push the layout wider */
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------ accessibility */
:focus-visible { outline: 3px solid #b7a8ff; outline-offset: 2px; }
.card:focus-visible { outline: none; }
.card:focus-visible .card-thumb { outline: 3px solid #b7a8ff; outline-offset: 2px; }
.search input:focus-visible { outline: none; } /* border colour change is the indicator */
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 60; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 900;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------ top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: rgba(12, 13, 20, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--side) - 60px); }
.brand-mark {
  display: none; width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: url(../img/icon-192.png) center / cover no-repeat; box-shadow: 0 4px 16px rgba(124, 92, 255, .4);
}
.brand-logo { display: block; height: 48px; width: auto; }
.search { position: relative; flex: 1; min-width: 0; max-width: 560px; margin: 0 auto; display: flex; }
.search input { min-width: 0; }
.brand, .top-actions, .menu-toggle { flex: none; }
.search input {
  flex: 1; height: 42px; border-radius: 21px; border: 1px solid var(--line); background: var(--bg3);
  color: var(--text); padding: 0 48px 0 20px; font: inherit; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search > button { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; }
.suggest {
  position: absolute; top: 48px; left: 0; right: 0; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
}
.suggest a { display: flex; gap: 10px; align-items: center; padding: 10px 16px; }
.suggest a:hover { background: var(--bg3); }
.suggest small { margin-left: auto; color: var(--muted); }
.suggest .empty { padding: 12px 16px; color: var(--muted); }
.top-actions { display: flex; gap: 10px; align-items: center; }
/* language picker: native <select> inside a globe pill (keyboard / screen reader / mobile picker for free) */
.lang-pick {
  position: relative; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 6px 0 12px;
  border-radius: 21px; background: var(--bg3); cursor: pointer;
}
.lang-pick:hover { background: #2a2d42; }
.lang-pick:focus-within { outline: 3px solid #b7a8ff; outline-offset: 2px; }
.lp-globe { font-size: 17px; }
.lp-code { display: none; font-size: 12px; font-weight: 900; letter-spacing: .5px; }
.lang-pick select {
  appearance: none; -webkit-appearance: none; border: 0; outline: none; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; padding: 0 22px 0 0; height: 100%; cursor: pointer; max-width: 150px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 9px center, right 4px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.lang-pick option { background: var(--bg2); color: var(--text); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg3);
  display: grid; place-items: center; font-size: 18px;
}
.icon-btn:hover { background: #2a2d42; }
.acct-slot { position: relative; display: flex; align-items: center; min-height: 42px; }

/* ------------------------------------------------ accounts: sign-in button (Google "G" + label) */
.signin-wrap { position: relative; display: inline-flex; border-radius: 21px; }
.btn-login {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px 0 5px; white-space: nowrap;
  border-radius: 21px; border: 0; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), #5b3cff); box-shadow: 0 4px 16px rgba(124, 92, 255, .32);
  transition: filter .15s ease, transform .15s ease;
}
.g-badge { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; flex: none; }
.g-mark { display: block; }
.signin-wrap:hover .btn-login { filter: brightness(1.1); }
.signin-wrap:active .btn-login { transform: scale(.97); }
/* Google's real button sits on top, practically invisible: every click / key press is a genuine GIS click */
.gis-host { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; opacity: .01; z-index: 1; }
.gis-host iframe { margin: -2px 0 0 -2px !important; }
.signin-wrap.gis-ready:focus-within { outline: 3px solid #b7a8ff; outline-offset: 2px; }
/* no client id yet: disabled look + "coming soon" tooltip */
.signin-wrap.off .btn-login { opacity: .6; cursor: help; box-shadow: none; filter: saturate(.7); }
.tip {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: max-content; max-width: 240px;
  padding: 7px 12px; border-radius: 10px; background: #2a2d45; border: 1px solid #3a3d5c; color: #fff; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.signin-wrap:hover .tip, .signin-wrap:focus-within .tip { opacity: 1; transform: none; }

/* ------------------------------------------------ accounts: avatar button + dropdown */
.acct-ph { width: 42px; height: 42px; border-radius: 50%; background: var(--bg3); }
.acct { position: relative; }
.acct-btn {
  position: relative; display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px 0 4px; max-width: 220px;
  border-radius: 21px; border: 1px solid var(--line); background: var(--bg3);
}
.acct-btn:hover, .acct-btn[aria-expanded="true"] { background: #2a2d42; border-color: #3a3d5c; }
.acct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.avatar {
  --s: 34px; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2));
  font-weight: 900; font-size: calc(var(--s) * .45); color: #fff;
}
.avatar::before { content: attr(data-initial); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acct-dot {
  position: absolute; left: 30px; bottom: 4px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--bg3); background: var(--muted);
}
[data-status="synced"].acct-dot, .am-status[data-status="synced"] i { background: var(--live); }
[data-status="syncing"].acct-dot, [data-status="off"].acct-dot, .am-status[data-status="syncing"] i, .am-status[data-status="off"] i { background: #ffc34d; animation: pulse 1.2s ease-in-out infinite; }
[data-status="error"].acct-dot, .am-status[data-status="error"] i { background: #ff6b6b; }
@keyframes pulse { 50% { opacity: .35; } }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 45; width: 290px; max-width: calc(100vw - 20px);
  padding: 8px; border-radius: 16px; background: var(--bg2); border: 1px solid #33354d; box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: menu-in .14s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
.am-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.am-id { min-width: 0; }
.am-id b, .am-id small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-id small { color: var(--muted); font-size: 13px; }
.am-status {
  display: flex; align-items: center; gap: 9px; margin: 0 0 6px; padding: 9px 12px; border-radius: 10px;
  background: var(--bg3); font-size: 13px; color: #d7d8e6;
}
.am-status i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.am-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; text-align: left; font-size: 14px; color: #e4e5f2;
}
.am-item span { width: 20px; text-align: center; }
.am-item:hover, .am-item:focus-visible { background: var(--bg3); color: #fff; }

/* ------------------------------------------------ accounts: action toasts (reload game / sign-in nudge) */
.action-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 55; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: min(460px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; border-radius: 16px;
  background: #22243a; border: 1px solid #3a3d5c; box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(16px); transition: opacity .2s ease, transform .2s ease;
}
.action-toast.show { opacity: 1; transform: none; }
.at-ic { font-size: 22px; }
.at-msg { flex: 1 1 180px; min-width: 0; line-height: 1.35; font-size: 14px; }
.at-btn { height: 38px; padding: 0 16px; border-radius: 19px; border: 0; font-weight: 900; background: var(--bg3); }
.at-btn.primary { background: linear-gradient(135deg, var(--accent), #5b3cff); color: #fff; }
.at-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.at-x:hover { background: var(--bg3); color: #fff; }
.action-toast .btn-login { height: 38px; }
.action-toast .g-badge { width: 28px; height: 28px; }

/* ------------------------------------------------ privacy page */
.privacy { max-width: 760px; }
.priv-intro { font-size: 17px; line-height: 1.6; color: #d7d8e6; margin: 0 0 8px; }
.priv-sec { margin-top: 14px; padding: 18px 22px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; line-height: 1.6; color: #c9cbe0; }
.priv-sec h2 { margin: 0 0 6px; font-size: 19px; color: #fff; }
.priv-sec p { margin: 0; }
.priv-account { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.priv-note { margin: 10px 0 0; color: var(--muted); }
.priv-account .priv-note { margin: 0; flex: 1 1 200px; }
.priv-sec a { color: #b7a8ff; }
.btn-danger {
  height: 42px; padding: 0 20px; border-radius: 21px; border: 1px solid rgba(255, 107, 107, .55); font-weight: 900;
  background: rgba(255, 107, 107, .12); color: #ffb3b3;
}
.btn-danger:hover { background: #e5484d; border-color: #e5484d; color: #fff; }
.btn-danger:disabled { opacity: .6; cursor: progress; }
.btn-soft {
  height: 42px; padding: 0 20px; border-radius: 21px; border: 1px solid var(--line); font-weight: 900;
  background: var(--bg3); color: var(--text);
}
.btn-soft:hover { background: #2c2f46; }
.priv-sec p + p { margin-top: 10px; }
.menu-toggle { display: none; }

/* ------------------------------------------------ sidebar */
.sidebar {
  position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); z-index: 20;
  background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 10px 20px;
  scrollbar-width: thin;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #d7d8e6; }
.side-link:hover { background: var(--bg3); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(124, 92, 255, .28), rgba(124, 92, 255, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.si { flex: none; width: 22px; text-align: center; }
.sl { min-width: 0; line-height: 1.2; }
.cnt { flex: none; }
.cnt { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg3); padding: 1px 8px; border-radius: 8px; }
.side-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.side-foot a:hover { color: #fff; }
.scrim { display: none; }

/* ------------------------------------------------ content */
.content { margin-left: var(--side); padding: calc(var(--top) + 20px) 28px 60px; min-height: 100vh; }

.hero { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); gap: 20px; margin-bottom: 18px; }
.hero-main {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); border-radius: 18px; overflow: hidden;
  background: linear-gradient(135deg, #22164a, #141629 60%); border: 1px solid #33285e; min-height: 300px;
  transition: transform .2s, box-shadow .2s;
}
.hero-main:hover { transform: translateY(-2px); box-shadow: 0 16px 50px rgba(124, 92, 255, .25); }
.hero-thumb { position: relative; overflow: hidden; }
.hero-thumb .thumb-img, .hero-thumb .thumb-gen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left bottom; }
.hero-info { padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hero-info h1 { margin: 0; font-size: 34px; line-height: 1.05; font-weight: 900; }
.hero-info p { margin: 0; color: #c9cbe0; line-height: 1.45; }
.btn-play {
  align-self: flex-start; margin-top: 6px; padding: 12px 28px; border-radius: 26px; font-weight: 900; font-size: 18px; border: 0; color: #fff;
  background: linear-gradient(135deg, #22d97f, #0fa968); box-shadow: 0 6px 20px rgba(31, 210, 134, .35);
}
.btn-play.big { font-size: 22px; padding: 14px 40px; align-self: center; }
.btn-play.alt { background: linear-gradient(135deg, var(--accent), #5b3cff); box-shadow: 0 6px 20px rgba(124, 92, 255, .35); }
.hero-side { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.hero-side h3 { margin: 0 0 2px; font-size: 18px; }
.mini { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; padding: 4px; border-radius: 10px; }
.mini:hover { background: var(--bg3); }
.mini-thumb { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; }
.mini-thumb .thumb-img, .mini-thumb .thumb-gen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-thumb .thumb-gen .tg-title { display: none; }
.mini-thumb .thumb-gen .tg-emoji { font-size: 30px; transform: none; }
.mini b { display: block; font-size: 15px; line-height: 1.2; }
.mini small { color: var(--muted); }
.more { color: #b7a8ff; font-size: 14px; font-weight: 800; }
.more:hover { color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #d8d9ea; }
a.chip:hover { background: var(--accent); color: #fff; }

.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.cat-pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none; padding: 8px 14px; border-radius: 20px; background: var(--bg2); border: 1px solid var(--line);
  font-size: 14px; white-space: nowrap; font-weight: 800;
}
.pill:hover, .pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------ rows & cards */
.row { margin: 14px 0 22px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.row-head .more { flex: none; }
.row-head h2 { margin: 0; font-size: 20px; font-weight: 900; }
.row-scroller { position: relative; }
.row-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 216px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 8px; scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
.row-track .card { scroll-snap-align: start; }
.scroll-btn {
  position: absolute; top: calc(50% - 32px); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(20, 21, 33, .92); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); font-size: 26px; line-height: 1;
}
.scroll-btn.left { left: -14px; } .scroll-btn.right { right: -14px; }
.scroll-btn:hover { background: var(--accent); }

.card { display: block; min-width: 0; }
.card-thumb {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg3);
  transition: transform .18s ease, box-shadow .18s ease; outline: 2px solid transparent;
}
.card:hover .card-thumb { transform: scale(1.045); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); outline-color: var(--accent); }
.card-thumb .thumb-img, .card-thumb .thumb-gen { width: 100%; height: 100%; object-fit: cover; }
.card-title { margin-top: 7px; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e4e5f2; }
.card.planned .card-thumb { filter: saturate(.85); }
.badge {
  position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, .65); letter-spacing: .3px;
}
.badge.live { background: var(--live); color: #04281a; top: auto; bottom: 8px; } /* bottom: v2 covers carry their logo top-left */
.hero-info .badge { position: static; align-self: flex-start; }

.thumb-gen {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, hsla(var(--h), 90%, 70%, .55), transparent 55%),
    radial-gradient(circle at 80% 90%, hsla(calc(var(--h) + 50), 90%, 55%, .5), transparent 60%),
    linear-gradient(135deg, hsl(var(--h), 62%, 38%), hsl(calc(var(--h) + 35), 60%, 18%));
}
.thumb-gen::before {
  content: ''; position: absolute; inset: 0; opacity: .12;
  background: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 14px);
}
.tg-emoji { font-size: 54px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); transform: translateY(-8px); }
.tg-title {
  position: absolute; left: 10px; right: 10px; bottom: 8px; text-align: center; font-weight: 900; font-size: 14px; line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .7);
}
.thumb-gen.big .tg-emoji { font-size: 110px; }
.thumb-gen.big .tg-title { font-size: 26px; bottom: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 14px; }
.list-head { margin-bottom: 18px; }
.list-head h1 { margin: 0 0 4px; font-size: 30px; font-weight: 900; }
.list-head p { margin: 0; color: var(--muted); }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); background: var(--bg2); border-radius: 16px; }
.empty-state a { color: #b7a8ff; }
.about { margin-top: 30px; padding: 22px 26px; background: var(--bg2); border-radius: 16px; border: 1px solid var(--line); color: #c9cbe0; line-height: 1.6; }
.about h2 { margin: 0 0 6px; color: #fff; }
.about a { color: #b7a8ff; }

/* ------------------------------------------------ game page */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; max-width: 1500px; }
.player {
  position: relative; aspect-ratio: 16/9; max-height: calc(100vh - var(--top) - 110px); width: 100%;
  background: #000; border-radius: 14px 14px 0 0; overflow: hidden; margin: 0 auto;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.shop-player { aspect-ratio: auto; height: min(780px, calc(100dvh - var(--top) - 20px)); min-height: 590px; max-height: none; }
.player:fullscreen { border-radius: 0; max-height: none; }
.player.shop-player:fullscreen { height: 100%; min-height: 0; }
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; }
.cover-bg { position: absolute; inset: -20px; filter: blur(18px) brightness(.45); background: center / cover no-repeat; }
.cover-bg > * { width: 100%; height: 100%; object-fit: cover; }
.cover-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 20px; }
.cover-thumb { width: min(360px, 60vw); aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); border: 2px solid rgba(255, 255, 255, .15); }
.cover-thumb > * { width: 100%; height: 100%; object-fit: cover; }
.cover-inner h1 { margin: 0; font-size: 30px; font-weight: 900; text-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.soon-note { margin: 0; padding: 6px 14px; border-radius: 12px; background: rgba(0, 0, 0, .55); color: #ffd98a; }
.game-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px;
  background: var(--bg2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px;
}
.gb-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gb-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-title small { color: var(--muted); font-size: 12px; }
.gb-icon { font-size: 26px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--bg3); border-radius: 10px; }
.gb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gb-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--bg3); font-size: 17px; }
.gb-btn:hover { background: #2c2f46; }
.gb-btn.on { background: var(--accent); }
.game-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.game-action { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid #8274cf; border-radius: 11px; background: #272340; color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.game-action:hover, .game-action:focus-visible { background: #3b3265; }
.game-action-dialog { width: min(440px, calc(100vw - 28px)); max-height: min(86dvh, 680px); padding: 22px; border: 1px solid #665d8b; border-radius: 18px; background: #202033; color: #fff; box-shadow: 0 24px 80px #0009; }
.game-action-dialog::backdrop { background: #070711ba; }
.game-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.game-dialog-head h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.game-dialog-head button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: #38364e; color: #fff; font-size: 24px; cursor: pointer; }
.game-action-dialog p { color: #d4d2e9; line-height: 1.5; }
.game-install-hint { padding: 14px 16px; border-radius: 12px; background: #332d52; font-weight: 800; }
.game-dialog-link { display: block; overflow-wrap: anywhere; color: #c4b9ff; }
.game-qr { display: grid; place-items: center; width: min(260px, 100%); aspect-ratio: 1; margin: 12px auto 18px; padding: 8px; border-radius: 14px; background: #fff; }
.game-qr svg { display: block; width: 100%; height: 100%; }
.game-share-link { display: flex; gap: 8px; }
.game-share-link input { min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid #70688e; border-radius: 9px; background: #151522; color: #fff; }
.game-share-link button, .game-native-share { min-height: 44px; padding: 9px 14px; border: 0; border-radius: 9px; background: #a993ff; color: #181126; font: inherit; font-weight: 900; cursor: pointer; }
.game-native-share { width: 100%; margin-top: 10px; }
@media (display-mode: standalone) {
  .page-game .topbar, .page-game .sidebar, .page-game .related, .page-game .play-next,
  .page-game .game-info, .page-game .ad-slot { display: none; }
  .page-game .content { margin: 0; padding: 0; }
  .page-game .game-layout { display: block; max-width: none; }
  .page-game .player { height: calc(100dvh - 142px); min-height: min(420px, 50dvh); max-height: none; aspect-ratio: auto; border-radius: 0; }
  .page-game .game-bar { border-radius: 0; }
  .page-game .game-quick-actions { margin: 0; padding: 8px 12px; background: var(--bg2); }
}
.game-info { margin-top: 18px; padding: 20px 24px; background: var(--bg2); border-radius: 14px; border: 1px solid var(--line); color: #cfd1e4; line-height: 1.55; }
.game-info h2 { margin: 0 0 8px; color: #fff; }
.game-info h3 { margin: 16px 0 4px; color: #fff; font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 0; }
.facts div { background: var(--bg3); border-radius: 10px; padding: 8px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; color: #fff; }
.related h3 { margin: 0 0 10px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.related-grid .card-title { font-size: 12px; }
.related-grid .tg-emoji { font-size: 34px; }
.related-grid .tg-title { font-size: 11px; }
.related-grid .badge { font-size: 9px; padding: 2px 6px; }
body.theater .sidebar { transform: translateX(-100%); }
body.theater .content { margin-left: 0; }
body.theater .game-layout { grid-template-columns: 1fr; max-width: none; }
body.theater .player { max-height: calc(100vh - var(--top) - 80px); }
body.theater .related-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ------------------------------------------------ roadmap */
.progress { height: 10px; border-radius: 5px; background: var(--bg3); margin-top: 12px; overflow: hidden; max-width: 520px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--live), #7cf2c2); min-width: 8px; }
.engines { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.engine { text-align: left; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); }
.engine b { font-size: 22px; color: #b7a8ff; min-width: 28px; }
.engine span { font-size: 13px; line-height: 1.2; }
.engine.on, .engine:hover { border-color: var(--accent); background: rgba(124, 92, 255, .15); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.phase h2 { margin: 26px 0 2px; }
.muted { color: var(--muted); margin: 0 0 10px; }
.table { display: flex; flex-direction: column; gap: 6px; }
.tr {
  display: grid; grid-template-columns: 48px 40px minmax(0, 1fr) 210px 190px 110px; gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
}
.tr:hover { border-color: var(--accent); }
.tr.live { background: linear-gradient(90deg, rgba(31, 210, 134, .16), var(--bg2) 50%); border-color: rgba(31, 210, 134, .45); }
.tr .rk { color: var(--muted); font-weight: 900; }
.tr .ic { font-size: 24px; text-align: center; }
.tr .tt b { display: block; }
.tr .tt small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; line-height: 1.35; }
.tr .tg { display: flex; flex-wrap: wrap; gap: 4px; }
.tr .tg i { font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--bg3); }
.tr .en { font-size: 13px; color: #c7b9ff; }
.tr .st { font-size: 13px; text-align: right; }
.tr .en, .tr .st { min-width: 0; }

/* ------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 50;
  background: #22243a; border: 1px solid #3a3d5c; padding: 12px 20px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: all .25s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------ loading skeleton (static HTML, replaced by JS) */
.skel { display: flex; flex-direction: column; gap: 14px; }
.sk { display: block; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg2) 0 40%, var(--bg3) 50%, var(--bg2) 60% 100%) 0 0 / 300% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skel-hero { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); gap: 20px; }
.sk-hero, .sk-side { min-height: 300px; border-radius: 18px; }
.sk-pills { height: 36px; max-width: 900px; border-radius: 20px; }
.sk-h { height: 22px; width: 220px; margin-top: 8px; }
.sk-title { height: 34px; width: 320px; }
.skel-row { display: grid; grid-auto-flow: column; grid-auto-columns: 216px; gap: 14px; overflow: hidden; }
.sk-card { aspect-ratio: 16/9; }
.skel-game { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; max-width: 1500px; }
.sk-player { aspect-ratio: 16/9; max-height: calc(100vh - var(--top) - 110px); border-radius: 14px 14px 0 0; }
.sk-bar { height: 60px; margin-top: 2px; border-radius: 0 0 14px 14px; }
.sk-info { height: 180px; margin-top: 18px; }
.skel-related { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; align-content: start; }
.skel-list { display: flex; flex-direction: column; gap: 6px; }
.sk-tr { height: 58px; }
.noscript { padding: 24px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); color: #ffd98a; }

/* ------------------------------------------------ ads (assets/js/gff-ads.js — only rendered when ADSENSE_CLIENT is set)
   Every slot reserves its exact size (--aw × --ah) before anything loads, so filling it never shifts the page.
   The slot is a size container: the box picks the largest standard size that fits the column it sits in (never
   cropped), and gff-ads.js reads that size when it initialises the slot (only once it is displayed + near view). */
.ad-slot { container-type: inline-size; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 18px 0; }
.ad-label { font-size: 10px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .8; }
.ad-box { width: var(--aw); height: var(--ah); overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.ad-box ins.adsbygoogle { display: block; width: var(--aw); height: var(--ah); }
.ad-slot.ad-off, .ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
/* game page — Google asks for ≥150 px between display ads and the game: the side slot is a 3rd column right of
   "Related games" (only where the game keeps ≥ ~800 px: viewport ≥1760 px), the other one sits under the game
   description (728×90, or 320×100 when the column is narrower). */
.ad-side { display: none; margin: 0; align-self: start; }
.ad-side .ad-box { --aw: 300px; --ah: 250px; }
@media (min-height: 900px) { .ad-side .ad-box { --ah: 600px; } }
@media (min-width: 1760px) {
  .game-layout:has(> .ad-side) { grid-template-columns: minmax(0, 1fr) 320px 300px; max-width: 1860px; }
  .ad-side { display: flex; }
}
.ad-below { margin: 18px 0 0; }
.ad-below .ad-box { --aw: 728px; --ah: 90px; }
@container (max-width: 727.98px) { .ad-below .ad-box { --aw: 320px; --ah: 100px; } }
/* home rows / list grids: in-feed, 728×90 or 300×250 */
.ad-feed { margin: 8px 0 24px; }
.ad-feed .ad-box { --aw: 728px; --ah: 90px; }
@container (max-width: 727.98px) { .ad-feed .ad-box { --aw: 300px; --ah: 250px; } }
.grid > .ad-feed { grid-column: 1 / -1; margin: 6px 0; }
body.theater .ad-side { display: none; }
body.theater .game-layout:has(> .ad-side) { grid-template-columns: 1fr; }
.btn-play.busy { opacity: .7; pointer-events: none; }

/* ------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-main:hover, .card:hover .card-thumb { transform: none; }
  .sk { animation: none; }
}

/* ------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .hero, .skel-hero { grid-template-columns: 1fr; }
  .sk-side { display: none; }
  .game-layout, .skel-game { grid-template-columns: 1fr; }
  .skel-related { display: none; }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .tr { grid-template-columns: 44px 36px minmax(0, 1fr) 150px 110px; }
  .tr .en { display: none; }
}
@media (max-width: 900px) {
  :root { --side: 250px; }
  .menu-toggle { display: grid; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 15; }
  .content { margin-left: 0; padding: calc(var(--top) + 14px) 16px 40px; }
  .brand { min-width: 0; }
  .brand-logo { display: none; }
  .brand-mark { display: block; }
  /* compact account controls: the "G" badge / avatar only */
  .btn-login { padding: 0 5px; gap: 0; }
  .topbar .bl-text, .acct-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .acct-btn { padding: 0 4px; border-color: transparent; }
  .acct-dot { left: 32px; }
  .action-toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .hero-main { grid-template-columns: 1fr; }
  .hero-thumb { aspect-ratio: 16/9; }
  .hero-info h1 { font-size: 26px; }
  .row-track, .skel-row { grid-auto-columns: 170px; }
  .scroll-btn { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tr { grid-template-columns: 38px 30px minmax(0, 1fr) 84px; }
  .lang-pick { padding: 0 12px; gap: 4px; }
  .lang-pick select { position: absolute; inset: 0; opacity: 0; width: 100%; max-width: none; padding: 0; }
  .lp-code { display: inline; }
  .tr .tg { display: none; }
  .game-bar { flex-direction: column; align-items: stretch; }
  .game-action { flex: 1 1 150px; }
}
@media (max-width: 480px) {
  .top-actions .icon-btn { display: none; }
  .topbar { gap: 10px; padding: 0 10px; }
  .lang-pick { padding: 0 9px; }
  .search input { padding: 0 38px 0 14px; }
  .lp-globe { font-size: 15px; }
  .tr .tt small { display: none; }
}
