/* ==========================================================================
   Inner pages
   ========================================================================== */

/* ---------- Page hero ---------- */
.page-hero {
  position: relative; isolation: isolate;
  width: min(100% - 2 * var(--gutter), var(--content));
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
  display: grid; gap: 14px; justify-items: start;
}
.page-hero h1 { font-size: var(--fs-3xl); max-width: 18ch; }
.page-hero > p:not(.eyebrow) { color: var(--text-soft); font-size: var(--fs-lg); max-width: 60ch; }
.page-hero__glow {
  position: absolute; z-index: -1; left: -10%; top: -40%;
  width: min(760px, 90vw); aspect-ratio: 1.6; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 106 77 / 0.16), rgb(111 220 191 / 0.06) 60%, transparent);
  pointer-events: none;
}
.page-hero--games { padding-bottom: 28px; }

/* ---------- Game detail ---------- */
.game-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 80px); }
.game-hero__backdrop { position: absolute; inset: 0; z-index: -1; }
.game-hero__backdrop picture, .game-hero__backdrop img { width: 100%; height: 100%; object-fit: cover; }
.game-hero__backdrop img { filter: blur(60px) saturate(1.3); transform: scale(1.3); opacity: 0.5; }
.game-hero__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(6 20 24 / 0.5), var(--bg) 96%), radial-gradient(60% 80% at 80% 50%, rgb(6 20 24 / 0.7), transparent); }
.game-hero__inner {
  width: min(100% - 2 * var(--gutter), 1200px); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center;
}
.breadcrumbs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text); }
.game-hero__art { position: relative; border-radius: var(--r-xl); transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--t-slow) var(--ease-out); }
.game-hero__art picture { border-radius: inherit; overflow: hidden; box-shadow: 0 0 0 1px rgb(255 224 166 / 0.3), var(--shadow-3), 0 0 90px -20px var(--glow); }
.game-hero__art img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.game-hero__copy { display: grid; gap: 18px; justify-items: start; }
.game-hero__copy h1 { font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4.4rem); line-height: 0.98; }
.game-hero__desc { font-size: var(--fs-lg); color: var(--text-soft); max-width: 48ch; }
.tag-new { color: var(--sea-200); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; width: 100%; max-width: 560px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.facts > div { padding: 14px 18px; background: rgb(10 30 35 / 0.9); }
.facts dt { font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.facts dd { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-weight: 600; }
.facts dd a { color: var(--sea-200); text-decoration: none; }
.facts dd a:hover { text-decoration: underline; }
.game-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.fine-print { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- Documents ---------- */
.document-layout { width: min(100% - 2 * var(--gutter), 1120px); margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; padding-bottom: 40px; }
.doc-toc { position: sticky; top: calc(var(--header-h) + 24px); padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.doc-toc p { font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; margin-bottom: 10px; }
.doc-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.doc-toc a { display: block; padding: 6px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-soft); text-decoration: none; }
.doc-toc a:hover { background: rgb(196 246 230 / 0.06); color: var(--text); }
.document { display: grid; gap: 12px; max-width: 72ch; }
.document > section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.document > section:first-child { padding-top: 0; }
.document h2 { display: flex; align-items: baseline; gap: 14px; font-size: var(--fs-xl); margin-bottom: 12px; }
.document h2 span { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; color: var(--coral-400); letter-spacing: 0.08em; }
.document p { color: var(--text-soft); }
.document a { color: var(--sea-200); }
.document .panel { margin-top: 20px; }
.document .panel h2 { margin-bottom: 12px; }
.care-controls .stack-form { margin-top: 16px; max-width: 460px; }
.document-contact { margin-top: 20px; font-size: var(--fs-sm); color: var(--text-muted) !important; }

/* ---------- Auth pages ---------- */
.auth-page { position: relative; isolation: isolate; display: grid; place-items: center; min-height: calc(100dvh - var(--header-h) - var(--tabbar-h)); padding: 40px 16px; }
.auth-page__glow { position: absolute; z-index: -1; inset: 0; background: radial-gradient(50% 50% at 50% 30%, rgb(255 106 77 / 0.14), transparent 70%), radial-gradient(40% 40% at 70% 80%, rgb(111 220 191 / 0.08), transparent 70%); }
.auth-card { width: min(480px, 100%); padding: 36px clamp(20px, 4vw, 36px); border-radius: var(--r-xl); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-3); display: grid; gap: 14px; }
.auth-card > .brand-mark { justify-self: center; }
.auth-card > p { color: var(--text-soft); text-align: center; }
.auth-card > a:not(.button) { justify-self: center; color: var(--sea-200); font-size: var(--fs-sm); }
.local-notice { padding: 12px 14px; border-radius: var(--r-md); background: rgb(255 224 166 / 0.08); border: 1px solid rgb(255 224 166 / 0.25); color: var(--butter-200) !important; font-size: var(--fs-sm); }

/* ---------- Profile ---------- */
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; width: 100%; }
.profile-head h1 { font-size: var(--fs-3xl); }
.profile-head p:not(.eyebrow) { color: var(--text-muted); }
.profile-head__signout { margin-left: auto; }
.avatar { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--coral-400), var(--coral-600)); color: var(--coral-ink); font-family: var(--font-display); font-size: 2rem; font-weight: 700; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px rgb(255 138 110 / 0.5); }
.profile-layout { width: min(100% - 2 * var(--gutter), var(--content)); margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-balance { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; grid-column: 1 / -1; background: radial-gradient(60% 120% at 0% 50%, rgb(255 224 166 / 0.1), transparent 60%), var(--surface); }
.profile-balance__coin { width: 72px; height: 72px; }
.profile-balance strong { display: block; font-family: var(--font-display); font-size: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); line-height: 1; color: var(--butter-200); font-variant-numeric: tabular-nums; margin: 6px 0; }
.profile-balance p { color: var(--text-muted); font-size: var(--fs-sm); }
.profile-balance .button { margin-left: auto; }
.profile-display { display: grid; gap: 12px; align-content: start; }
.profile-display > p:not(.eyebrow) { color: var(--text-muted); }
.scene-radios { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.scene-radios legend { font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); margin-bottom: 8px; }
.scene-radios label { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.scene-radios label:has(input:checked) { border-color: var(--coral-400); background: rgb(255 106 77 / 0.06); }
.scene-radios input { accent-color: var(--coral-500); width: 18px; height: 18px; }
.scene-radios strong { display: block; font-size: var(--fs-sm); }
.swatch { width: 40px; height: 40px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); }
.swatch--amethyst { background: radial-gradient(circle at 70% 70%, var(--coral-500), transparent 55%), linear-gradient(135deg, #0e282e, #061418); }
.swatch--midnight { background: radial-gradient(circle at 70% 70%, rgb(255 106 77 / 0.5), transparent 50%), linear-gradient(135deg, #071519, #02080a); }
.swatch--sunrise { background: radial-gradient(circle at 70% 70%, #ffb199, transparent 60%), linear-gradient(135deg, #30262a, #161214); }
.activity-panel { grid-row: span 2; }
.activity-list { display: grid; margin-top: 16px; }
.activity-list article { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-list article > div { display: grid; gap: 2px; }
.activity-list article > div:last-child { text-align: right; }
.credit-change { font-variant-numeric: tabular-nums; }
.credit-change.is-up { color: var(--sea-300); }
.credit-change.is-down { color: var(--text-soft); }
.pagination { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 16px; font-size: var(--fs-sm); }
.pagination a { color: var(--sea-200); }
.profile-care { display: grid; gap: 10px; justify-items: start; }
.profile-care p { color: var(--text-muted); }

/* ---------- Support ---------- */
.support-layout { width: min(100% - 2 * var(--gutter), var(--content)); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.support-layout > div:first-child { display: grid; gap: 10px; }
.support-layout > div:first-child > h2 { margin-bottom: 8px; }
.support-layout details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color var(--t-fast); }
.support-layout details[open] { border-color: var(--line-strong); }
.support-layout summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.support-layout summary::-webkit-details-marker { display: none; }
.support-layout summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--sea-300); transition: transform var(--t-med) var(--ease-out); }
.support-layout details[open] summary::after { transform: rotate(45deg); }
.support-layout details p, .support-layout details a { padding: 0 18px 16px; color: var(--text-soft); display: block; }
.support-layout details a { color: var(--sea-200); }
.contact-line { margin-top: 12px; color: var(--text-muted); }
.support-form { display: grid; gap: 12px; }
.support-form > p { color: var(--text-muted); }

/* ---------- Play page & game-player bridge ---------- */
.page-play .site-footer { margin-top: 24px; }
.play-bar { width: min(100% - 2 * var(--gutter), 1360px); margin: 16px auto 0; display: flex; align-items: center; gap: 16px; }
.play-bar__back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--text-soft); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; }
.play-bar__back:hover { color: var(--text); border-color: var(--line-strong); }
.play-bar__back .icon { width: 16px; height: 16px; }
.play-bar__note { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); }
.play-bar__note a { color: var(--sea-200); }
.play-bar .gcard__fav { position: static; opacity: 1; }
.game-loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--text-soft); }
.game-loading__orb { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgb(196 246 230 / 0.15); border-top-color: var(--coral-400); animation: spin 900ms linear infinite; }
/* Imported players read these legacy variables; map them onto the new palette. */
.game-player-wrap { --gold: var(--butter-300); --gold-bright: var(--butter-200); --line: rgb(196 246 230 / 0.16); --muted: var(--text-muted); --scene: var(--ink-750); --scene-light: var(--sea-400); }
.game-player-wrap .slot-machine { border-color: rgb(196 246 230 / 0.2) !important; }
.game-player-wrap [role="alert"] { margin-bottom: 12px; }
.game-player-wrap .button-gold { background: var(--coral-500); color: var(--coral-ink); border: 0; border-radius: var(--r-pill); min-height: 48px; padding: 0 22px; font-weight: 600; }

@media (max-width: 860px) {
  .game-hero__inner { grid-template-columns: 1fr; }
  .game-hero__art { max-width: 420px; width: 100%; justify-self: center; }
  .document-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
  .profile-layout, .support-layout { grid-template-columns: 1fr; }
  .activity-panel { grid-row: auto; }
  .play-bar__note { display: none; }
  .play-bar { justify-content: space-between; }
}
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div { padding: 12px 14px; }
  .game-hero__actions .button { width: 100%; }
  .profile-balance .button { margin-left: 0; width: 100%; }
  .profile-head__signout { margin-left: 0; }
}
@media (max-width: 560px) {
  .page-hero { padding: 28px 0 20px; gap: 10px; }
  .page-hero > p:not(.eyebrow) { font-size: var(--fs-md); }
}
@media (hover: none) { .search-field kbd { display: none; } .search-field input { padding-right: 16px; } }
