/* =========================================================
   MiniGames.mobile - mobile-first theme
   Base styles target phones (360-430px); min-width queries scale up.
   ========================================================= */
:root {
  --bg: #0f1226;
  --surface: #1a2044;
  --surface-2: #252c58;
  --surface-3: #343d74;
  --deep: #0a0d1d;
  --ink: #ffffff;
  --text: #e6e9ff;
  --muted: #9ba4d6;
  --mint: #3ef0b5;
  --mint-d: #17a576;
  --violet: #8b7bff;
  --coral: #ff6f61;
  --sun: #ffd23f;
  --sky: #4cc9ff;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 60px;
  --drop: 0 4px 0 rgba(0, 0, 0, .3);
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; font-weight: 500;
  color: var(--text); background-color: var(--bg); overflow-x: hidden;
  background-image:
    radial-gradient(520px 340px at 0% -6%, rgba(62, 240, 181, .16), transparent 65%),
    radial-gradient(560px 380px at 100% 0%, rgba(139, 123, 255, .2), transparent 65%);
  background-repeat: no-repeat;
}
img { max-width: 100%; display: block; }
a { color: var(--mint); text-decoration: none; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.lead { font-size: 1.02rem; color: #c9cff3; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sun); color: #2b2000; padding: 8px 14px; border-radius: 10px; z-index: 300; font-weight: 700; }
.skip:focus { left: 8px; }
.section { padding-top: 22px; padding-bottom: 22px; }
body.no-scroll { overflow: hidden; }
.grad { background: linear-gradient(90deg, var(--mint), var(--sky) 55%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (hover: hover) { a:hover { text-decoration: underline; } }
@media (min-width: 768px) {
  :root { --header-h: 68px; }
  h1 { font-size: 2.3rem; }
  h2 { font-size: 1.55rem; }
  .section { padding-top: 30px; padding-bottom: 30px; }
}

/* ===== Header: logo | breadcrumb (wide screens only) | search ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(15, 18, 38, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .07); padding-top: env(safe-area-inset-top); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; }
.logo:hover { text-decoration: none; }
.logo img { width: 36px; height: 36px; }
.logo__text { font-weight: 800; font-size: 1.08rem; color: var(--ink); letter-spacing: -.02em; }
.logo__text b { color: var(--mint); font-weight: 700; }
.header-crumbs { display: none; }
.hsearch { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; margin-left: auto; }
.hsearch svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.hsearch input { width: 100%; min-width: 0; height: 44px; border-radius: 999px; border: 2px solid transparent; background: var(--surface-2); color: var(--ink); padding: 0 12px 0 38px; font: inherit; font-size: 16px; outline: none; transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none; }
.hsearch input::placeholder { color: var(--muted); }
.hsearch input:focus { border-color: var(--mint); background: var(--surface); }
@media (max-width: 349px) { .logo__text { display: none; } }
@media (min-width: 768px) {
  .header-inner { gap: 18px; }
  .logo img { width: 42px; height: 42px; }
  .logo__text { font-size: 1.35rem; }
  .header-crumbs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; }
  .header-crumbs a { color: var(--muted); flex: none; }
  .header-crumbs a:hover { color: var(--ink); text-decoration: none; }
  .header-crumbs .sep { opacity: .5; flex: none; }
  .header-crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
  .hsearch { flex: 0 1 340px; }
  .hsearch svg { left: 16px; }
  .hsearch input { height: 46px; padding-left: 44px; }
}

/* ===== Buttons / pills / flags ===== */
.btn { --btn-shadow: rgba(0, 0, 0, .35); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 1rem; border: 0; cursor: pointer; box-shadow: 0 4px 0 var(--btn-shadow); transition: transform .1s, box-shadow .1s, filter .15s; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-shadow); }
.btn--primary { background: var(--mint); color: #05291c; --btn-shadow: var(--mint-d); }
.btn--ghost { background: var(--surface-2); color: var(--ink); --btn-shadow: var(--deep); }
.pill { --c: var(--violet); display: inline-flex; align-items: center; gap: 5px; min-height: 28px; font-size: .8rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); white-space: nowrap; }
a.pill { min-height: 32px; }
a.pill:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 28%, transparent); }
.pill--muted { --c: var(--muted); }
.flag { display: inline-block; font-weight: 800; font-size: .68rem; letter-spacing: .06em; line-height: 1; padding: 5px 7px 4px; border-radius: 7px; color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.flag--hot { background: var(--coral); }
.flag--new { background: var(--mint); color: #05291c; }
.icon-btn { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer; box-shadow: 0 4px 0 var(--deep); transition: transform .1s, box-shadow .1s, background .15s; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--deep); }

/* ===== Home: welcome + featured ===== */
.welcome { padding-top: 18px; padding-bottom: 14px; }
.welcome h1 { margin-bottom: .25em; }
.welcome .lead { margin: 0; }
.hero { display: grid; gap: 12px; }
.hero-main { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, #1a2044), #4b3bd6 80%); box-shadow: var(--drop); isolation: isolate; }
.hero-main::before { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, .12); z-index: -1; }
.hero-main:hover { text-decoration: none; }
.hero-main:active { transform: scale(.985); }
.hero-main__art { flex: none; width: 112px; border-radius: 18px; overflow: hidden; transform: rotate(-4deg); border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.hero-main__art img { width: 100%; height: auto; }
.hero-main__text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.hero-main__title { font-weight: 800; font-size: 1.45rem; line-height: 1.1; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.hero-main__desc { font-size: .92rem; line-height: 1.45; color: rgba(255, 255, 255, .9); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-main .btn { margin-top: 4px; min-height: 44px; padding: 0 18px; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-tile { display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 76px; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--drop); border: 2px solid transparent; transition: transform .15s, border-color .2s; }
.hero-tile:hover { text-decoration: none; border-color: var(--c); }
.hero-tile:active { transform: scale(.97); }
.hero-tile img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none; }
.hero-tile__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.hero-tile__text strong { font-weight: 700; font-size: .98rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-tile__text small { color: var(--c); font-weight: 600; font-size: .8rem; }
.hero-tile__go { display: none; }
@media (min-width: 768px) {
  .welcome { padding-top: 30px; padding-bottom: 20px; }
  .lead { font-size: 1.1rem; }
  .hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
  .hero-main { gap: 28px; padding: 28px; min-height: 280px; border-radius: 28px; }
  .hero-main::before { width: 340px; height: 340px; }
  .hero-main__art { width: 220px; border-width: 4px; border-radius: 26px; }
  .hero-main__title { font-size: 2.5rem; }
  .hero-main__desc { font-size: 1.05rem; max-width: 420px; }
  .hero-main .btn { min-height: 50px; padding: 0 26px; font-size: 1.08rem; }
  .hero-side { grid-template-columns: 1fr; gap: 18px; grid-auto-rows: 1fr; }
  .hero-tile { gap: 14px; padding: 14px; }
  .hero-tile img { width: 88px; height: 88px; border-radius: 16px; }
  .hero-tile__text strong { font-size: 1.2rem; }
  .hero-tile__go { display: block; margin-top: 6px; font-weight: 700; font-size: .85rem; color: var(--mint); }
  .hero-tile__go::after { content: " \2192"; }
}

/* ===== Category chips (horizontal scroll on phones) ===== */
.cat-chips { display: flex; gap: 8px; overflow-x: auto; margin: -4px -16px 16px; padding: 4px 16px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 6px; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .92rem; border: 2px solid transparent; box-shadow: 0 3px 0 rgba(0, 0, 0, .28); transition: transform .15s, border-color .15s, background .15s; }
.cat-chip:hover { text-decoration: none; border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.cat-chip:active { transform: scale(.96); }
.cat-chip__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: rgba(10, 13, 29, .85); flex: none; }
.cat-chip__n { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: .75rem; background: var(--surface-2); color: var(--muted); }
.cat-chip.is-active { background: var(--c); color: #0a0d1d; border-color: transparent; }
.cat-chip.is-active .cat-chip__icon { background: rgba(255, 255, 255, .45); }
.cat-chip.is-active .cat-chip__n { background: rgba(0, 0, 0, .15); color: #0a0d1d; }

/* ===== Row heading ===== */
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.row-h { display: flex; align-items: center; gap: 10px; margin: 0; }
.row-h__icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--c); color: rgba(10, 13, 29, .85); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); flex: none; }
.center-cta { text-align: center; margin: 24px 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* ===== Game cards: 2 columns on phones ===== */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; } }
.card { --c: var(--sky); display: block; padding: 6px; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--drop); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), box-shadow .2s; }
.card:hover { text-decoration: none; }
.card:active { transform: scale(.97); }
.card[hidden] { display: none; }
.card__thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 13px; overflow: hidden; background: var(--surface-2); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card__flags { position: absolute; bottom: 6px; left: 6px; display: flex; gap: 4px; }
.card__ratio { position: absolute; right: 6px; bottom: 6px; font-size: .66rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(10, 13, 29, .7); color: #fff; }
.card__play { display: none; }
.card__body { padding: 8px 4px 2px; }
.card__title { font-size: .98rem; margin: 0 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__cat { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--c); }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--c), 0 14px 28px rgba(0, 0, 0, .45); }
  .card:hover .card__thumb img { transform: scale(1.07); }
  .card__play { display: grid; position: absolute; inset: 0; place-items: center; background: rgba(10, 13, 29, .35); opacity: 0; transition: opacity .2s; }
  .card__play > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #05291c; box-shadow: 0 4px 0 var(--mint-d); transform: scale(.6); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .card:hover .card__play { opacity: 1; }
  .card:hover .card__play > span { transform: scale(1); }
}
@media (min-width: 768px) { .card { padding: 8px; } .card__title { font-size: 1.05rem; } }

/* ===== Features ===== */
.features { display: grid; gap: 12px; margin-bottom: 18px; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--drop); }
.feature__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c); color: rgba(10, 13, 29, .85); margin-bottom: 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.feature p { margin: 0; color: var(--muted); }
@media (min-width: 768px) { .features { grid-template-columns: repeat(3, 1fr); gap: 18px; } .feature { padding: 22px; } }

/* ===== Panels / prose ===== */
.panel { background: var(--surface); border-radius: 20px; padding: 20px 18px; box-shadow: var(--drop); }
@media (min-width: 768px) { .panel { border-radius: 26px; padding: 26px 30px; } }
.prose > :first-child { margin-top: 0; }
.prose h2 { display: flex; align-items: center; gap: 10px; margin-top: 1.4em; }
.prose h2::before { content: ""; flex: none; width: 7px; height: 24px; border-radius: 4px; background: linear-gradient(var(--mint), var(--violet)); }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.3em; }
.prose ul li::marker { color: var(--mint); }
.prose li { margin: .35em 0; }
.prose ol { list-style: none; counter-reset: step; padding: 0; }
.prose ol li { counter-increment: step; position: relative; padding-left: 42px; margin: 12px 0; min-height: 30px; }
.prose ol li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--mint); color: #05291c; font-weight: 700; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.prose a { text-decoration: underline; }
.page { margin: 18px 0 8px; }
.page-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 0 18px; max-width: 900px; }
.page-head h1 { margin-bottom: .2em; }
.page-head .lead { margin: 0; }
.page-head__icon { flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--c); color: rgba(10, 13, 29, .85); box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.page-head__icon svg { width: 28px; height: 28px; }
@media (min-width: 768px) { .page-head { align-items: center; gap: 20px; padding: 28px 0 24px; } .page-head__icon { width: 84px; height: 84px; border-radius: 28px; } .page-head__icon svg { width: 40px; height: 40px; } }
.page-404 { padding: 32px 16px; }
.page-404 .grid { margin: 24px 0; }

/* ===== Game page ===== */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 0; }
@media (min-width: 641px) { .game-layout { padding-top: 16px; } }
@media (min-width: 1100px) { .game-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; } .game-side { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; } }
.seo-text p, .seo-text li { color: var(--muted); }
.seo-text h3 { margin-top: 1.4em; }
.game-about__lead { font-size: 1rem; color: var(--muted); margin: 14px 2px 0; }
.side-box { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--drop); margin-bottom: 18px; }
.side-h { font-size: 1.1rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini { display: flex; align-items: center; gap: 12px; padding: 7px; border-radius: 14px; color: var(--text); transition: background .15s; }
.mini:hover { background: var(--surface-2); text-decoration: none; }
.mini img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.mini span { display: flex; flex-direction: column; line-height: 1.3; }
.mini strong { font-weight: 700; color: var(--ink); }
.mini small { color: var(--muted); font-weight: 600; }

/* Mobile overlay player (opened straight from a game link, no page load) */
.game-overlay { position: fixed; inset: 0; z-index: 1000; background: #000; }
.game-overlay .frame { background: var(--deep); }

/* ===== Player ===== */
/* Game shape: --ar-w / --ar-h (e.g. 16/9, 9/16, 4/3). Set per game by the build; these are fallbacks. */
/* --avail-h = square size: screen height minus header + top gap (16) + title bar (76). */
.player { --ar-w: 16; --ar-h: 9; --avail-h: calc(100vh - var(--header-h) - 92px); }
.player--portrait { --ar-w: 9; --ar-h: 16; }
@supports (height: 100svh) { .player { --avail-h: calc(100svh - var(--header-h) - 92px); } }
.stage { position: relative; display: flex; align-items: center; justify-content: center; background: var(--deep); }
.frame { position: relative; background: #000; overflow: hidden; max-width: 100%; aspect-ratio: var(--ar-w) / var(--ar-h); }
/* Narrow screens (not fullscreen): the player runs edge to edge as a square. */
.stage:not(.is-fs) { width: calc(100% + 32px); margin: 0 -16px; aspect-ratio: 1 / 1; }
.stage:not(.is-fs) .frame { width: min(100%, calc(100% * var(--ar-w) / var(--ar-h))); }
/* Wider screens: a framed SQUARE box sized to the window (side = available height, or the
   column width if smaller). The game keeps its own ratio inside it, centred. */
@media (min-width: 641px) {
  .stage { padding: 12px; border-radius: 26px; border: 3px solid transparent; background: linear-gradient(var(--deep), var(--deep)) padding-box, linear-gradient(135deg, var(--mint), var(--violet) 55%, var(--coral)) border-box; box-shadow: 0 8px 0 rgba(0, 0, 0, .3), 0 0 60px rgba(139, 123, 255, .16); }
  .stage:not(.is-fs) { width: min(100%, max(var(--avail-h), 280px)); margin: 0 auto; }
  .frame { border-radius: 16px; }
}
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--deep); opacity: 0; transition: opacity .3s ease; }
.frame.is-loaded iframe { opacity: 1; }
/* Loading screen shown while the game loads (prevents a blank white flash) */
.frame-loader { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; color: #fff; background: var(--deep); overflow: hidden; transition: opacity .3s ease, visibility .3s; }
.frame-loader::before { content: ""; position: absolute; inset: -30px; background: var(--thumb) center / cover no-repeat; filter: blur(24px) brightness(.45); }
.frame-loader > * { position: relative; }
.frame-loader img { width: 96px; height: 96px; border-radius: 24px; object-fit: cover; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.frame-loader strong { font-weight: 700; font-size: 1.2rem; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--mint); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.frame.is-loaded .frame-loader { opacity: 0; visibility: hidden; }
.play-cover { position: absolute; inset: 0; z-index: 2; border: 0; padding: 0; cursor: pointer; background-color: #000; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: #fff; }
.play-cover::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(15, 18, 38, .35), rgba(10, 13, 29, .82)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.play-cover__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; text-align: center; }
.play-btn { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #05291c; box-shadow: 0 6px 0 var(--mint-d), 0 0 0 10px rgba(62, 240, 181, .18); animation: pulse 1.6s ease-in-out infinite; }
.play-btn svg { width: 32px; height: 32px; margin-left: 4px; }
.play-cover:hover .play-btn { animation-duration: .8s; }
.play-cover__title { font-weight: 800; font-size: 1.5rem; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); margin-top: 8px; }
.play-cover__hint { font-weight: 600; color: rgba(255, 255, 255, .75); font-size: .95rem; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .play-btn { animation: none; } }
@media (min-width: 641px) { .play-btn { width: 96px; height: 96px; } .play-btn svg { width: 40px; height: 40px; } .play-cover__title { font-size: 2rem; } }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 6px; }
.player-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.player-title h1 { font-size: 1.5rem; margin: 0 6px 0 0; }
.player-actions { display: flex; gap: 10px; flex: none; }
@media (min-width: 641px) { .player-bar { flex-wrap: nowrap; padding: 20px 2px 10px; } .player-title h1 { font-size: 2rem; } }
.fs-exit { display: none; position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

/* Fullscreen (native, or CSS fallback for iPhone) */
.stage.is-fs { position: fixed; inset: 0; z-index: 1000; margin: 0; padding: 0; border: 0; border-radius: 0; background: #000; box-shadow: none; width: 100vw; height: 100vh; height: 100dvh; }
.stage.is-fs .frame { border-radius: 0; min-width: 0; }
.stage.is-fs .frame { width: min(100vw, calc(100vh * var(--ar-w) / var(--ar-h))); width: min(100vw, calc(100dvh * var(--ar-w) / var(--ar-h))); }
.stage.is-fs .fs-exit { display: flex; align-items: center; justify-content: center; }
/* Landscape game on a phone held upright: rotate the game 90deg to fill the screen
   (we never lock orientation). Touch input inside the iframe stays correct.
   If the device actually rotates to landscape, this no longer applies. */
@media (orientation: portrait) and (pointer: coarse) {
  .player--landscape .stage.is-fs .frame {
    flex: none;
    max-width: none;
    width: min(100vh, calc(100vw * var(--ar-w) / var(--ar-h)));
    width: min(100dvh, calc(100vw * var(--ar-w) / var(--ar-h)));
    transform: rotate(90deg);
  }
  .player--landscape .stage.is-fs .fs-exit { top: auto; bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* ===== Ads ===== */
.ad { margin: 24px auto; text-align: center; min-height: 90px; overflow: hidden; }
.ad__label { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad--gameSidebar { margin-top: 0; min-height: 250px; }
.ad--placeholder { display: none; }
.show-ad-placeholders .ad--placeholder { display: flex; align-items: center; justify-content: center; margin: 24px auto; border: 2px dashed var(--surface-3); border-radius: var(--radius-sm); color: var(--muted); font-size: .85rem; font-weight: 600; min-height: 100px; text-align: center; padding: 8px; }
.show-ad-placeholders .ad--placeholder::after { content: "Ad slot: " attr(data-slot) " (local preview only)"; }
.show-ad-placeholders .ad--gameSidebar.ad--placeholder { min-height: 250px; margin-top: 0; }
@media (max-width: 1099px) { .ad--gameSidebar { display: none !important; } }

/* ===== Footer ===== */
.site-footer { position: relative; margin-top: 40px; background: var(--deep); padding: 32px 0 calc(22px + env(safe-area-inset-bottom)); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--mint), var(--sky), var(--violet), var(--coral), var(--sun)); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; }
.footer-grid > :first-child { grid-column: 1 / -1; }
.footer-grid p { margin: 10px 0 0; max-width: 360px; }
.footer-h { font-size: 1rem; margin-bottom: 4px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; }
.footer-links a { display: flex; align-items: center; min-height: 40px; color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--muted); font-size: .85rem; }
@media (min-width: 768px) {
  .site-footer { margin-top: 56px; padding-top: 44px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
  .footer-grid > :first-child { grid-column: auto; }
  .footer-links a { min-height: 32px; }
}
