:root {
  color-scheme: dark;
  --bg: #10101d;
  --bg-raised: #171728;
  --surface: #1d1d31;
  --surface-2: #24243a;
  --surface-glass: rgba(29, 29, 49, .88);
  --ink: #f5f3ff;
  --muted: #aaa9c4;
  --line: rgba(194, 187, 255, .15);
  --purple: #8b5cf6;
  --purple-bright: #a78bfa;
  --gold: #f59e0b;
  --gold-bright: #ffc247;
  --gold-deep: #7e3f09;
  --green: #39d6a0;
  --red: #fb7185;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
  --sidebar: 244px;
  --footer-reserve: 116px;
  --font-body: 'Chakra Petch', system-ui, sans-serif;
  --font-display: 'Russo One', 'Chakra Petch', sans-serif;
  font: 16px/1.5 var(--font-body);
  background: var(--bg);
  color: var(--ink);
  padding-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-padding-top: 20px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 14% -8%, rgba(139, 92, 246, .22), transparent 68%),
    radial-gradient(620px 360px at 88% 10%, rgba(245, 158, 11, .08), transparent 72%),
    linear-gradient(160deg, #10101d 0%, #151426 55%, #10101d 100%);
  background-attachment: fixed;
}
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}
a { color: var(--purple-bright); }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; border-radius: 10px; background: var(--gold-bright); color: #281503; font-weight: 700; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
svg { display: block; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 400; }
h2 { font-size: 1.25rem; margin-bottom: .35rem; }
h3 { font-size: 1.1rem; margin-bottom: .4rem; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.app-shell { min-height: 100vh; min-height: 100dvh; }
html[data-theme='light'] {
  color-scheme: light;
  --bg: #241811;
  --bg-raised: #2f2018;
  --surface: #3a2920;
  --surface-2: #473326;
  --surface-glass: rgba(58, 41, 32, .9);
  --ink: #f8ecdf;
  --muted: #d3b89f;
  --line: rgba(255, 214, 170, .2);
  --purple: #c98a4b;
  --purple-bright: #e8ad70;
  --gold: #f0a93c;
  --gold-bright: #ffc670;
  --gold-deep: #6b3a0c;
  --green: #74d1a3;
  --red: #ff9b86;
  --shadow: 0 18px 48px rgba(18, 9, 4, .42);
}
html[data-theme='light'] body {
  background:
    radial-gradient(900px 520px at 14% -8%, rgba(201, 138, 75, .26), transparent 68%),
    radial-gradient(620px 360px at 88% 10%, rgba(240, 169, 60, .14), transparent 72%),
    linear-gradient(160deg, #241811 0%, #311f15 55%, #1e130d 100%);
}
html[data-theme='light'] .sidebar,
html[data-theme='light'] .topbar,
html[data-theme='light'] .ad-footer { background: rgba(43, 29, 21, .94); }
html[data-theme='light'] .card,
html[data-theme='light'] .dialog,
html[data-theme='light'] .game-tile { border-color: var(--line); background: linear-gradient(160deg, rgba(62, 44, 33, .96), rgba(48, 34, 25, .96)); }
html[data-theme='light'] .dialog { background: #35251b; }
html[data-theme='light'] input,
html[data-theme='light'] select { background: rgba(32, 21, 15, .8); }
html[data-theme='light'] .segment-control,
html[data-theme='light'] .game-cell,
html[data-theme='light'] .tier-grid div,
html[data-theme='light'] .rate-tile,
html[data-theme='light'] .pick-button,
html[data-theme='light'] .streak-day,
html[data-theme='light'] .balance-chip { background: var(--surface); }
html[data-theme='light'] .merge-front { background: var(--surface-2); }
html[data-theme='light'] .merge-back { background: linear-gradient(145deg, #c9823f, #8a4e1c); box-shadow: 0 3px 0 #5a2f0c; }
html[data-theme='light'] .crate-art { background: linear-gradient(145deg, #e8b98a, #a05c22); box-shadow: 0 6px 0 #5d3110; }
html[data-theme='light'] .garden-stage { border-color: rgba(255, 205, 150, .3); }
html[data-theme='light'] .ad-slot { background: rgba(58, 41, 32, .55); border-color: rgba(255, 214, 170, .26); }
html[data-theme='light'] .ad-placeholder { color: #cbb09a; }
html[data-theme='light'] .ad-placeholder strong { color: #f0ddcb; }
html[data-theme='light'] .nav-button { color: #d8bfa8; }
html[data-theme='light'] .nav-button.active { color: #fff3e6; }
html[data-theme='light'] .sidebar-label,
html[data-theme='light'] .eyebrow,
html[data-theme='light'] .ad-label { color: #c2a68e; }
html[data-theme='light'] .button { background: linear-gradient(180deg, #cf8c45, #9c5a1d); box-shadow: 0 4px 0 #5e320f, 0 10px 22px rgba(156, 90, 29, .22); color: #fff6ea; }
html[data-theme='light'] .button:active:not(:disabled) { box-shadow: 0 1px 0 #5e320f; }
html[data-theme='light'] .button.primary-gold { background: linear-gradient(180deg, #ffd36b, #f0a93c); box-shadow: 0 4px 0 #8a4c08, 0 10px 22px rgba(240, 169, 60, .2); color: #321b04; }
html[data-theme='light'] .button.ghost { background: rgba(255, 229, 200, .06); color: var(--ink); }
html[data-theme='light'] .button.ghost:hover:not(:disabled) { border-color: rgba(232, 173, 112, .5); background: rgba(232, 173, 112, .1); }
html[data-theme='light'] .nav-button:hover { background: rgba(232, 173, 112, .12); }
html[data-theme='light'] .nav-button.active { border-color: rgba(232, 173, 112, .22); background: linear-gradient(100deg, rgba(201, 138, 75, .3), rgba(201, 138, 75, .08)); box-shadow: inset 3px 0 var(--purple-bright); }
html[data-theme='light'] .segment-control button.active { background: linear-gradient(180deg, #cf8c45, #9c5a1d); }
html[data-theme='light'] .pick-symbol.energy,
html[data-theme='light'] .balance-icon.energy { background: linear-gradient(145deg, #e8c39a, #a3621f); color: #fff6ea; }
html[data-theme='light'] .upgrade-icon { background: rgba(232, 173, 112, .16); }
html[data-theme='light'] .tip-card .upgrade-icon { background: rgba(240, 169, 60, .18); }

.sidebar {
  position: fixed;
  z-index: 20;
  inset: env(safe-area-inset-top, 0px) auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: var(--sidebar);
  padding: 22px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  bottom: var(--footer-reserve);
  border-right: 1px solid var(--line);
  background: rgba(17, 17, 31, .88);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 50px; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffe08a, #f59e0b 58%, #b85b0a);
  box-shadow: 0 4px 0 #753904, 0 8px 20px rgba(245, 158, 11, .24);
  color: #281503;
  font: 1.35rem var(--font-display);
  animation: coin-turn 5s ease-in-out infinite;
}
.brand-name { font: 1.3rem var(--font-display); letter-spacing: -.03em; }
.sidebar-label, .eyebrow { margin: 13px 0 0; color: #8f8eab; font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
.primary-nav { display: grid; gap: 7px; }
.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  width: 100%;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.nav-button:hover { transform: translateX(3px); background: rgba(167, 139, 250, .1); color: var(--ink); }
.nav-button.active { border-color: rgba(167, 139, 250, .15); background: linear-gradient(100deg, rgba(139, 92, 246, .26), rgba(139, 92, 246, .07)); color: var(--ink); box-shadow: inset 3px 0 var(--purple-bright); }
.nav-button.active svg { color: var(--purple-bright); }
.nav-button svg { display: block; flex: 0 0 auto; }
.nav-badge { display: grid; place-items: center; min-width: 22px; height: 22px; margin-left: auto; padding: 0 5px; border-radius: 99px; background: var(--gold); color: #281503; font-size: .78rem; font-weight: 700; }
.nav-badge[hidden] { display: none; }
.sidebar-spacer { flex: 1; }
.boost-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(110deg, #ffc247, #ff963b);
  box-shadow: 0 5px 0 #984607;
  color: #321b04;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease;
}
.boost-mini:hover { transform: translateY(-2px); }
.boost-mini:active { transform: translateY(3px); box-shadow: 0 1px 0 #984607; }
.boost-mini-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(50, 27, 4, .14); font-size: 1.65rem; font-weight: 700; }
.boost-mini strong, .boost-mini small { display: block; }
.boost-mini strong { font: 1rem var(--font-display); }
.boost-mini small { margin-top: 2px; color: #5a3109; }

.workspace { min-height: 100vh; min-height: 100dvh; margin-left: var(--sidebar); }
.main-column { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 12px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 16, 29, .82);
  backdrop-filter: blur(18px);
}
.page-heading { min-width: 0; }
.page-heading .eyebrow { margin: 0 0 2px; }
.page-heading h1 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.25; }
.balance-group { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.balance-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 5px 14px 5px 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  color: var(--ink);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease;
}
.balance-chip:hover { transform: translateY(-2px); border-color: rgba(245, 158, 11, .48); }
.balance-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, #ffe08a, #f59e0b); color: #321b04; }
.balance-icon.energy { background: linear-gradient(145deg, #c4b5fd, #7c3aed); color: white; }
.balance-icon.shard { background: linear-gradient(145deg, #ff7777, #c91f36); color: #fff; }
.balance-copy small { display: block; color: var(--muted); line-height: 1.05; font-size: .69rem; }
.balance-value { display: block; font-size: .98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); transition: transform .2s ease, border-color .2s ease, color .2s ease; }
.icon-button:hover { transform: rotate(12deg); border-color: var(--purple-bright); color: var(--purple-bright); }
.settings-button svg { width: 21px; height: 21px; }
.content-wrap { width: min(100%, 1120px); margin: 0 auto; padding: 22px clamp(16px, 3vw, 42px) var(--footer-reserve); }

.card { margin-bottom: 16px; padding: clamp(17px, 2.2vw, 24px); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(160deg, rgba(34, 34, 56, .94), rgba(25, 25, 43, .9)); box-shadow: var(--shadow); animation: card-enter .34s cubic-bezier(.2, .75, .25, 1) both; }
.card:nth-child(2) { animation-delay: 35ms; }
.card:nth-child(3) { animation-delay: 70ms; }
.card p:last-child { margin-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading p { margin: 4px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.pill.gold { border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .12); color: var(--gold-bright); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(180deg, #a277ff, #7643e8);
  box-shadow: 0 4px 0 #4e249e, 0 10px 22px rgba(118, 67, 232, .18);
  color: #fff;
  font-size: .98rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #4e249e; }
.button:disabled, .button[aria-disabled='true'], .lantern-button[aria-disabled='true'] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.button[aria-disabled='true']:hover { transform: none; filter: none; }
.button.primary-gold { background: linear-gradient(180deg, #ffd36b, #f59e0b); box-shadow: 0 4px 0 #8e4a07, 0 10px 22px rgba(245, 158, 11, .18); color: #321b04; }
.button.primary-gold:active:not(:disabled) { box-shadow: 0 1px 0 #8e4a07; }
.button.ghost { border-color: var(--line); background: rgba(255,255,255,.025); box-shadow: none; color: var(--ink); }
.button.ghost:hover:not(:disabled) { border-color: rgba(167, 139, 250, .48); background: rgba(167,139,250,.08); }
.button.price-button { display: grid; gap: 0; min-height: 46px; padding: 5px 14px; text-align: right; line-height: 1.15; }
.price-button small { font-size: .68rem; font-weight: 500; opacity: .88; }
.inline-feedback { min-height: 1.35em; margin: 5px 0 0; color: var(--red); font-size: .82rem; }
.empty-state { padding: 26px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }

.boost-card { position: relative; display: flex; align-items: center; gap: 18px; overflow: hidden; margin-bottom: 16px; padding: 22px; border: 1px solid rgba(255, 215, 136, .4); border-radius: 23px; background: linear-gradient(118deg, #ffc247, #f78b38 75%, #e6733b); box-shadow: 0 7px 0 #88420b, 0 20px 46px -22px rgba(245, 158, 11, .7); color: #321b04; animation: card-enter .4s both; }
.boost-card::after { position: absolute; top: -20%; bottom: -20%; left: -40%; width: 25%; content: ''; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); animation: shimmer 4.5s ease-in-out infinite; pointer-events: none; }
.boost-card.live { box-shadow: 0 7px 0 #88420b, 0 0 34px rgba(255, 194, 71, .35); }
.boost-symbol { display: grid; flex: 0 0 auto; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: rgba(49, 27, 4, .9); color: #ffd36b; font-size: 2rem; }
.boost-copy { min-width: 0; flex: 1; }
.boost-copy h2 { margin: 0; font-size: 1.35rem; }
.boost-copy p { margin: 3px 0 9px; color: #55310d; }
.boost-steps { display: flex; gap: 5px; max-width: 260px; }
.boost-steps i { height: 7px; flex: 1; border-radius: 8px; background: rgba(49, 27, 4, .2); }
.boost-steps i.on { background: #321b04; }
.boost-card .button { position: relative; z-index: 1; flex: 0 0 auto; background: #321b04; box-shadow: 0 4px 0 #100900; color: #ffd36b; }

.garden-stage { position: relative; height: clamp(365px, 43vw, 490px); overflow: hidden; isolation: isolate; margin-bottom: 16px; border: 1px solid rgba(167, 139, 250, .28); border-radius: 28px; background: #15113e; box-shadow: 0 26px 56px -28px #000; }
.garden-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.parallax-layer { transform: translate(calc(var(--px, 0) * var(--depth, 0) * 1px), calc(var(--py, 0) * var(--depth, 0) * .55px)); transition: transform .25s ease-out; }
.star { fill: #fff; animation: twinkle 3s ease-in-out infinite; }
.cloud { animation: cloud-drift 70s linear infinite; }
.firefly { position: absolute; z-index: 1; width: 5px; height: 5px; border-radius: 50%; background: #fff3a0; box-shadow: 0 0 10px 3px rgba(255, 214, 90, .65); animation: firefly-drift 8s ease-in-out infinite alternate, twinkle 3s ease-in-out infinite; }
.garden-post { position: absolute; z-index: 2; top: 26px; bottom: 0; width: 14px; border-radius: 7px 7px 0 0; background: linear-gradient(90deg, #2c1d12, #8a6036, #2c1d12); box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.garden-post::before { content: ''; position: absolute; top: -8px; left: -6px; width: 26px; height: 12px; border-radius: 6px; background: linear-gradient(#a97a45, #5a3a1c); }
.garden-stage::before { content: ''; position: absolute; z-index: 0; right: 0; bottom: 0; left: 0; height: 28%; background: radial-gradient(120% 90% at 50% 100%, #1d3b24 0 45%, transparent 46%), radial-gradient(60% 70% at 15% 100%, #14301c 0 50%, transparent 51%), radial-gradient(60% 70% at 85% 100%, #14301c 0 50%, transparent 51%); pointer-events: none; }
.garden-stage::after { content: ''; position: absolute; z-index: 1; inset: 0; background: radial-gradient(70% 55% at 50% 30%, rgba(255, 190, 90, .16), transparent 70%), linear-gradient(180deg, rgba(0,0,0,.25), transparent 30%); pointer-events: none; }
.garden-rope { position: absolute; z-index: 2; top: 36px; right: 3%; left: 3%; height: 5px; border-radius: 4px; background: repeating-linear-gradient(115deg, #d9b26a 0 5px, #8c6630 5px 9px); box-shadow: 0 3px 8px rgba(0,0,0,.45), 0 0 14px rgba(255, 196, 90, .3); }
.lantern-row { position: absolute; z-index: 3; top: 38px; right: 3%; left: 3%; display: flex; align-items: flex-start; justify-content: space-around; }
.lantern-button { position: relative; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; min-width: 0; max-width: 124px; padding: 0 2px 6px; border: 0; background: none; color: #fff; transform-origin: 50% 0; animation: lantern-sway 5.5s ease-in-out infinite; }
.lantern-button:nth-child(2n) { animation-delay: -1.3s; }
.lantern-button:nth-child(3n) { animation-delay: -2.6s; }
.lantern-svg { position: relative; z-index: 1; display: block; width: clamp(47px, 7.5vw, 91px); height: auto; margin-top: -1px; overflow: visible; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); transition: transform .25s ease; }
.lantern-button:hover .lantern-svg { transform: scale(1.07); }
.lantern-halo { position: absolute; top: 37%; left: 50%; width: 180%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,196,80,.55), rgba(255,140,60,.17) 45%, transparent 70%); opacity: 0; transform: translate(-50%, -50%); transition: opacity .35s ease; pointer-events: none; }
.lantern-button.ready .lantern-halo { opacity: 1; animation: halo-pulse 2s ease-in-out infinite; }
.lantern-core { opacity: var(--core-opacity, 0); transform-box: fill-box; transform-origin: 50% 60%; }
.lantern-button.ready .lantern-core { animation: flame-flicker 1.3s ease-in-out infinite; }
.lantern-level { position: relative; z-index: 2; display: inline-flex; gap: 4px; align-items: center; margin-top: 5px; padding: 2px 8px; border: 1px solid rgba(255, 213, 128, .45); border-radius: 99px; background: rgba(10,8,36,.78); color: #ffe9b8; font-size: .72rem; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.lantern-status { position: relative; z-index: 2; min-height: 20px; margin-top: 3px; color: #ffe9b8; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.lantern-button.ready .lantern-status { color: #ffd36b; }
.lantern-button.ghost .lantern-svg { opacity: .28; filter: grayscale(1); }
.lantern-plus { position: absolute; top: 43%; z-index: 2; left: 50%; color: #ffe9b8; transform: translate(-50%,-50%); }

.progress-dots { display: flex; gap: 3px; margin: 7px 0; }
.progress-dots i { height: 6px; flex: 1; border-radius: 6px; background: rgba(194,187,255,.14); }
.progress-dots i.on { background: linear-gradient(90deg, var(--gold), #ff963b); box-shadow: 0 0 8px rgba(245,158,11,.4); }
.upgrade-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; }
.upgrade-row + .upgrade-row { border-top: 1px solid var(--line); }
.upgrade-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(139,92,246,.16); color: var(--purple-bright); }
.upgrade-description { min-width: 0; }
.upgrade-description strong { font-size: .97rem; }
.upgrade-description small { display: block; color: var(--muted); }
.upgrade-description .progress-dots { max-width: 240px; }
.segment-control { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.segment-control button { flex: 1; min-height: 44px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font-weight: 700; }
.segment-control button.active { background: linear-gradient(180deg, #a277ff, #7643e8); color: #fff; }
.metric-row { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 10px; }
.metric small { display: block; color: var(--muted); }
.metric strong { font: 1.45rem var(--font-display); font-variant-numeric: tabular-nums; }
.metric-max { color: var(--muted); font-size: .75rem; font-weight: 600; }
.field-grid { display: grid; gap: 12px; }
.field-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.field-label { display: grid; flex: 1 1 180px; gap: 5px; color: var(--muted); font-size: .83rem; font-weight: 600; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18,18,32,.72); color: var(--ink); }
input::placeholder { color: #7f7e99; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.status-tag { padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .78rem; }
.status-tag.paid { color: var(--green); }
.status-tag.rejected { color: var(--red); }
.referral-link { overflow-wrap: anywhere; margin: 9px 0; padding: 11px 13px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(255,255,255,.025); font-weight: 700; }
.tier-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.tier-grid div { padding: 10px 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-align: center; }
.tier-grid strong { display: block; color: var(--gold-bright); font: 1.2rem var(--font-display); }
.tier-grid small { color: var(--muted); }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 300px); margin: 16px auto; }
.game-cell { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 4px 0 rgba(194,187,255,.11); }
.game-cell:active { transform: translateY(3px); box-shadow: none; }
.game-coin { width: 58%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe27a, #ffc24a 60%, #e0a600); box-shadow: 0 3px 0 #b87f00; }
.ad-rectangle { display: grid; place-items: center; width: 300px; min-width: 120px; max-width: 100%; height: 250px; min-height: 25px; margin: 14px auto; overflow: hidden; border: 1px dashed var(--line); border-radius: 14px; background: rgba(255,255,255,.02); color: var(--muted); text-align: center; }
.progress-bar { height: 8px; overflow: hidden; margin: 10px 0; border-radius: 8px; background: rgba(194,187,255,.15); }
.progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #ff963b); transition: width 1s linear; }

.overlay[hidden] { display: none; }
.overlay { position: fixed; z-index: 60; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6,4,20,.72); backdrop-filter: blur(7px); }
.dialog { position: relative; width: min(100%, 500px); max-height: min(92dvh, 880px); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 26px; background: #19192b; box-shadow: 0 28px 80px rgba(0,0,0,.52); animation: dialog-enter .25s cubic-bezier(.2,.8,.2,1) both; }
.dialog-close { position: sticky; float: right; top: 0; width: 40px; height: 40px; margin: -9px -9px 4px 10px; border-radius: 12px; font-size: 1.45rem; line-height: 1; }
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.pick-button { display: grid; justify-items: center; gap: 7px; min-height: 150px; padding: 17px 10px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); color: var(--ink); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.pick-button:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 16px 30px -18px var(--gold); }
.pick-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(145deg, #ffd36b, #ff963b); color: #321b04; }
.pick-symbol.energy { background: linear-gradient(145deg, #c4b5fd, #7c3aed); color: #fff; }
.pick-button strong { font: 1.3rem var(--font-display); }
.pick-button small { color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.settings-section { padding-top: 12px; }
.settings-section + .settings-section { margin-top: 15px; border-top: 1px solid var(--line); }
.check-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); }
.check-row input { width: 20px; min-height: 20px; accent-color: var(--purple); }
.toast { position: fixed; z-index: 80; top: calc(env(safe-area-inset-top, 0px) + 96px); left: 50%; max-width: calc(100vw - 32px); padding: 11px 20px; border: 1px solid rgba(255,255,255,.24); border-radius: 99px; background: linear-gradient(110deg, #ffc247, #ff963b); box-shadow: 0 14px 34px rgba(245, 158, 11, .3); color: #321b04; font-weight: 700; text-align: center; transform: translate(-50%, -12px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.particle-layer { position: fixed; z-index: 75; inset: 0; overflow: hidden; pointer-events: none; }
.particle { position: absolute; width: 9px; height: 9px; border-radius: 50%; animation: particle-burst .95s cubic-bezier(.2,.7,.3,1) forwards; }

.tip-card { display: flex; align-items: center; gap: 14px; }
.tip-card .upgrade-icon { flex: 0 0 auto; background: rgba(245,158,11,.14); color: var(--gold-bright); }
.tip-card small { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .14em; }
.tip-card p { margin: 2px 0 0; }
.pill svg { width: 14px; height: 14px; }
.upgrade-nav { position: sticky; top: 100px; z-index: 5; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--card, rgba(20, 16, 40, .92)); backdrop-filter: blur(10px); }
.upgrade-chips { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; min-width: 0; }
.upgrade-chips .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: inherit; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.upgrade-chips .chip:hover { border-color: var(--gold); background: rgba(245, 158, 11, .14); }
.upgrade-chips .chip:active { transform: scale(.96); }
.upgrade-chips .chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.info-button { gap: 6px; min-height: 40px; padding: 6px 14px; }
.card[id^="up-"] { scroll-margin-top: 190px; }
.info-scroll { overflow-x: auto; margin: 8px 0 16px; }
.info-table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.info-table th, .info-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.info-table th:first-child, .info-table td:first-child { text-align: left; }
.info-table th { color: var(--gold-bright); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.info-table tr.total td { font-weight: 700; color: var(--gold-bright); }
#dialog-content h3 { margin: 14px 0 0; font-size: .95rem; }
.streak-card .section-heading { align-items: center; }
.streak-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.streak-day { display: grid; gap: 2px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.streak-day small { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.streak-day strong { font: 1rem var(--font-display); font-variant-numeric: tabular-nums; }
.streak-day em { color: var(--muted); font-size: .66rem; font-style: normal; }
.streak-day.done { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .14); }
.streak-day.done strong { color: var(--gold-bright); }
.streak-day.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 24px -16px var(--gold); }
.streak-card > .muted:last-child { margin: 0; }
.nav-sub { margin-left: 0; }
.upgrade-chips .chip.active { border-color: var(--gold); background: rgba(245, 158, 11, .22); }

.game-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.game-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; aspect-ratio: 1; overflow: hidden; padding: 14px 10px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(160deg, rgba(34, 34, 56, .94), rgba(25, 25, 43, .9)); box-shadow: var(--shadow); color: var(--ink); text-align: center; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; animation: card-enter .34s cubic-bezier(.2, .75, .25, 1) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.game-tile:hover { transform: translateY(-4px); border-color: var(--tile); box-shadow: 0 20px 36px -22px var(--tile); }
.game-tile:active { transform: translateY(1px) scale(.985); }
.tile-art { display: grid; place-items: center; width: 38%; aspect-ratio: 1; border-radius: 28%; background: var(--tile); box-shadow: 0 5px 0 rgba(0,0,0,.28); color: #1a1030; }
.tile-art svg { width: 56%; height: 56%; stroke-width: 1.7; }
.tile-name { max-width: 100%; font: 1.02rem/1.2 var(--font-display); }
.tile-hint { max-width: 100%; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.tile-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 3px 13px; border-radius: 99px; background: linear-gradient(180deg, #ffd36b, #f59e0b); color: #321b04; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-chip.wait { background: rgba(194,187,255,.13); color: var(--muted); }
.tile-chip svg { width: 13px; height: 13px; stroke-width: 2.2; }
.game-tile.locked .tile-art { filter: grayscale(1); opacity: .42; }
.game-tile.locked .tile-name { color: var(--muted); }
.game-tile.locked .tile-chip { background: rgba(139,92,246,.2); color: var(--purple-bright); }
html[data-theme='light'] .tile-chip.wait { background: rgba(255, 214, 170, .14); }
html[data-theme='light'] .game-tile.locked .tile-chip { background: rgba(201, 138, 75, .22); }
.flappy-canvas { display: block; width: min(100%, 340px); aspect-ratio: 1; margin: 14px auto; border: 1px solid var(--line); border-radius: 18px; cursor: pointer; touch-action: manipulation; }
.flap-button { width: 100%; touch-action: manipulation; }
.merge-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 8px; max-width: 400px; margin: 16px auto 6px; perspective: 800px; }
.merge-card { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 14px; background: none; transform-style: preserve-3d; transition: transform .32s cubic-bezier(.3, .7, .3, 1); }
.merge-card.flipped { transform: rotateY(180deg); }
.merge-face { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.merge-back { background: linear-gradient(145deg, #8b5cf6, #5b2fd0); box-shadow: 0 3px 0 #3d1c8f; color: rgba(255,255,255,.5); }
.merge-front { background: var(--surface); color: var(--gold-bright); transform: rotateY(180deg); }
.merge-face svg { width: 46%; height: 46%; }
.merge-card.matched { pointer-events: none; animation: merge-pop .55s ease both; }
.merge-card.matched .merge-front { border-color: var(--green); background: rgba(57,214,160,.14); color: var(--green); }
.rate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; margin-top: 14px; }
.rate-tile { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rate-tile small { display: block; color: var(--muted); }
.rate-tile strong { color: var(--gold-bright); font: 1.08rem var(--font-display); font-variant-numeric: tabular-nums; }
.field-row .referral-link { flex: 1 1 220px; margin: 0; }
.crate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.crate-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.crate-card h2, .crate-card p { margin: 0; }
.crate-art { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 8px; border-radius: 26px; background: linear-gradient(145deg, #c4b5fd, #7c3aed); box-shadow: 0 6px 0 #4e249e; color: #fff; animation: crate-float 3.4s ease-in-out infinite; }
.crate-art.gold { background: linear-gradient(145deg, #ffe08a, #f59e0b); box-shadow: 0 6px 0 #8e4a07; color: #321b04; }
.crate-art svg { width: 52px; height: 52px; }
.crate-card .price-button { width: 100%; margin-top: 8px; text-align: center; }

body:not([data-tab='games']):not([data-tab='shop']) { --footer-reserve: 0px; }
body:not([data-tab='games']):not([data-tab='shop']) .ad-footer { display: none; }
.desktop-rail { display: none; }
.ad-label { color: #8f8eab; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; }
.ad-slot { display: grid; place-items: center; min-width: 120px; min-height: 25px; overflow: hidden; border: 1px dashed rgba(194,187,255,.22); border-radius: 12px; background: rgba(29,29,49,.46); color: var(--muted); }
.ad-slot iframe { display: block; border: 0; }
.ad-slot.skyscraper { width: 160px; height: 600px; border-radius: 10px; }
.ad-placeholder { display: grid; justify-items: center; gap: 4px; padding: 8px; color: #8e8da8; font-size: .72rem; text-align: center; }
.ad-placeholder strong { color: #b6b4d0; font-size: .77rem; }
.ad-footer { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; justify-items: center; gap: 3px; min-height: var(--footer-reserve); padding: 7px 12px calc(7px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(17,17,31,.94); backdrop-filter: blur(16px); }
.ad-slot.leaderboard { width: 728px; max-width: 100%; height: 90px; }
.ad-slot.mobile-banner { display: none; width: 320px; max-width: 100%; height: 50px; }

@media (max-width: 1099px) {
  :root { --sidebar: 82px; }
  .sidebar { align-items: center; padding-right: 10px; padding-left: 10px; }
  .brand { justify-content: center; }
  .brand-name, .sidebar-label, .nav-button span, .boost-mini > span:not(.boost-mini-icon) { display: none; }
  .primary-nav { width: 100%; margin-top: 10px; }
  .nav-button { justify-content: center; padding: 0; }
  .nav-button.active { box-shadow: inset 0 0 0 1px rgba(167,139,250,.22); }
  .nav-button.active::before { position: absolute; inset: auto auto -1px 50%; width: 18px; height: 3px; border-radius: 4px; background: var(--purple-bright); content: ''; transform: translateX(-50%); }
  .nav-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: .68rem; }
  .boost-mini { justify-content: center; width: 52px; height: 52px; min-height: 52px; padding: 6px; }
  .boost-mini-icon { width: 38px; height: 38px; }
}
@media (min-width: 768px) {
  .ad-footer { min-height: 112px; }
  body:not([data-tab='games']):not([data-tab='shop']) .content-wrap { padding-bottom: 28px; }
  :root { --footer-reserve: 128px; }
}
@media (min-width: 1280px) {
  .workspace { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 22px; padding: 20px 20px 0; }
  .main-column { grid-column: 2; }
  .desktop-rail { display: flex; flex-direction: column; align-items: center; gap: 9px; }
  .left-rail { grid-column: 1; grid-row: 1; }
  .right-rail { grid-column: 3; grid-row: 1; }
}
@media (min-width: 1280px) and (min-height: 800px) {
  .desktop-rail { position: sticky; top: 24px; align-self: start; }
}
@media (min-width: 1280px) and (max-height: 799px) {
  .desktop-rail { align-self: start; }
  .workspace { padding-bottom: 30px; }
}
.nav-settings { display: none; }
@media (max-width: 767px) {
  :root { --sidebar: 0px; --footer-reserve: 102px; --nav-h: 128px; }
  .app-shell, .workspace, .main-column, .topbar, .content-wrap, #view { width: 100%; max-width: 100vw; min-width: 0; }
  .sidebar { position: fixed; inset: auto 0 var(--footer-reserve); z-index: 35; display: block; width: 100%; height: var(--nav-h); padding: 5px max(8px, env(safe-area-inset-left, 0px)) 5px max(8px, env(safe-area-inset-right, 0px)); border: 0; border-top: 1px solid var(--line); background: rgba(17,17,31,.96); backdrop-filter: blur(18px); overflow: hidden; }
  .brand, .sidebar-label, .sidebar-spacer, .boost-mini, .legal-links { display: none; }
  .primary-nav { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); grid-template-rows: 1fr 1fr; gap: 2px; width: 100%; height: 100%; margin: 0; overflow: hidden; }
  .nav-button, .nav-settings { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 0; padding: 2px; border-radius: 12px; font-size: .56rem; }
  .nav-button svg { width: 21px; height: 21px; }
  .nav-button span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-button.active { box-shadow: none; }
  .nav-button.active::before { inset: 0 auto auto 50%; width: 24px; transform: translateX(-50%); }
  .nav-badge { top: 1px; right: calc(50% - 25px); min-width: 16px; height: 16px; padding: 0 3px; font-size: .62rem; }
  .workspace { margin-left: 0; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; gap: 8px; padding: 9px 12px; }
  .page-heading, .settings-button { display: none; }
  .page-heading h1 { font-size: 1.02rem; }
  .balance-group { grid-column: 1 / -1; grid-row: 1; display: flex; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; margin-left: 0; }
  .balance-chip, .balance-copy { min-width: 0; }
  .balance-chip { flex: 1 1 0; min-height: 42px; gap: 4px; padding: 4px 5px 4px 3px; border-radius: 13px; }
  .balance-icon { width: 27px; height: 27px; border-radius: 9px; }
  .balance-copy small { display: none; }
  .balance-value { font-size: .72rem; white-space: nowrap; }
  .settings-button { grid-column: 2; grid-row: 1; width: 38px; height: 40px; }
  .settings-button svg { width: 19px; height: 19px; }
  .content-wrap { padding: 13px 12px calc(var(--footer-reserve) + var(--nav-h) + 10px + env(safe-area-inset-bottom, 0px)); }
  .card { margin-bottom: 12px; border-radius: 18px; }
  .boost-card { flex-wrap: wrap; gap: 12px; padding: 16px; border-radius: 19px; }
  .boost-symbol { width: 46px; height: 46px; border-radius: 14px; font-size: 1.6rem; }
  .boost-copy h2 { font-size: 1.1rem; }
  .boost-copy p { font-size: .85rem; }
  .boost-card .button { width: 100%; }
  .garden-stage { height: 385px; border-radius: 22px; }
  .garden-rope { top: 38px; }
  .lantern-row { top: 38px; right: 3%; left: 3%; display: flex; justify-content: center; gap: 0; }
  .lantern-button { flex: 0 0 20%; width: 20%; max-width: none; animation-duration: 6.5s; }
  .lantern-svg { width: clamp(47px, 15vw, 69px); }
  .lantern-status { max-width: 100%; min-height: 2em; font-size: .58rem; line-height: 1.15; white-space: normal; }
  .lantern-level { padding-right: 4px; padding-left: 4px; font-size: .59rem; }
  .upgrade-row { grid-template-columns: 40px minmax(0,1fr) auto; gap: 9px; }
  .upgrade-icon { width: 40px; height: 40px; }
  .button.price-button { min-width: 92px; padding: 5px 8px; font-size: .83rem; }
  .field-row .button { flex: 1 1 100%; }
  .metric-row { gap: 17px; }
  .metric strong { font-size: 1.12rem; }
  .dialog { max-height: calc(100dvh - 24px); margin: auto; padding: 21px 17px; border-radius: 22px; }
  .ad-footer { left: 0; min-height: 102px; padding: 5px 10px calc(5px + env(safe-area-inset-bottom, 0px)); }
  .ad-slot.leaderboard { display: none; }
  .ad-slot.mobile-banner { display: grid; height: 50px; }
  .ad-notice { left: 8px; right: 8px; transform: none; max-width: none; flex-wrap: wrap; bottom: calc(var(--footer-reserve) + var(--nav-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 40; }
  body:not([data-tab='games']):not([data-tab='shop']) .ad-notice { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
  .ad-notice .button { min-height: 44px; flex: 1 1 120px; }
  .overlay { align-items: flex-start; overflow-y: auto; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dialog-close { width: 44px; height: 44px; }
  .dialog .ad-rectangle { max-width: 100%; margin-inline: auto; }
  .game-tiles { gap: 8px; }
  .game-tile { gap: 4px; padding: 8px 4px; border-radius: 16px; }
  .tile-art { width: 34%; }
  .tile-name { font-size: .74rem; }
  .tile-hint { display: none; }
  .tile-chip { min-height: 22px; padding: 2px 8px; font-size: .64rem; }
  .crate-grid { gap: 10px; }
  .crate-art { width: 72px; height: 72px; border-radius: 20px; }
  .crate-art svg { width: 38px; height: 38px; }
  .streak-card .section-heading { flex-direction: column; align-items: stretch; gap: 8px; }
  .streak-card h2 { font-size: 1rem; }
  .streak-card p { font-size: .76rem; line-height: 1.35; }
  .streak-track { gap: 4px; }
  .streak-day { padding: 6px 1px; border-radius: 10px; }
  .streak-day small { font-size: .52rem; }
  .streak-day strong { font-size: .68rem; }
  .streak-day em { font-size: .5rem; }
  .upgrade-chips { display: none; }
  .upgrade-nav { top: 8px; gap: 6px; padding: 6px; }
  .upgrade-nav .info-button { flex: 1; min-height: 34px; padding: 4px 8px; font-size: .74rem; }
  .upgrade-chips.earn-chips { display: flex; }
  .upgrade-chips.earn-chips .chip { min-height: 36px; padding: 4px 11px; font-size: .78rem; }
  .up-count { display: block; font-size: .85em; opacity: .8; }
  .nav-button[data-tab='games'] { grid-column: 3; grid-row: 1 / 3; gap: 5px; border-radius: 18px; border: 1px solid rgba(255, 196, 90, .55); background: linear-gradient(180deg, rgba(245, 158, 11, .32), rgba(139, 92, 246, .28)); box-shadow: 0 0 14px rgba(245, 158, 11, .25); font-size: .72rem; font-weight: 700; }
  .nav-button[data-tab='games'] svg { width: 32px; height: 32px; }
}
@media (max-width: 380px) {
  .topbar { gap: 6px; padding-right: 8px; padding-left: 9px; }
  .page-heading h1 { font-size: .9rem; }
  .balance-chip { gap: 3px; padding-right: 4px; }
  .balance-icon { width: 25px; height: 25px; }
  .balance-value { font-size: .68rem; }
  .settings-button { width: 34px; height: 36px; }
  .garden-stage { height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@keyframes coin-turn { 0%, 88%, 100% { transform: rotateY(0); } 94% { transform: rotateY(180deg); } }
@keyframes card-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes shimmer { 0%, 55% { left: -40%; } 90%, 100% { left: 140%; } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes cloud-drift { from { transform: translateX(-120px); } to { transform: translateX(920px); } }
@keyframes firefly-drift { to { transform: translate(35px, -55px); } }
@keyframes lantern-sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes halo-pulse { 50% { opacity: .72; transform: translate(-50%, -50%) scale(1.13); } }
@keyframes flame-flicker { 0%, 100% { transform: scale(1); } 33% { transform: scale(1.08,.96); } 66% { transform: scale(.96,1.06); } }
@keyframes particle-burst { from { opacity: 1; transform: translate(-50%,-50%) scale(.6); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4); } }
@keyframes merge-pop { 0% { transform: rotateY(180deg) scale(1); } 45% { transform: rotateY(180deg) scale(1.14); } 100% { opacity: .55; transform: rotateY(180deg) scale(.94); } }
@keyframes crate-float { 50% { transform: translateY(-6px) rotate(-2deg); } }

.game-shell { width: min(94vw, 90dvh, 720px); aspect-ratio: 1; }
.game-frame { display: block; width: 100%; height: 100%; border: 0; background: #1c120d; }
.dialog:has(.game-shell) { width: auto; max-height: none; padding: 0; overflow: hidden; }
.dialog:has(.game-shell) .dialog-close { position: absolute; top: 8px; right: 8px; z-index: 10; margin: 0; float: none; }

.provider-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 140px)); gap: 12px; margin-top: 12px; }
.provider-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1 / 1; min-height: 0; padding: 8px; text-align: center; font-size: 1.05rem; }
.provider-card small { font-size: .78rem; opacity: .85; }
.provider-card.locked { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }

.crate-card { position: relative; }
.chest-info { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--line, rgba(255,255,255,.25)); background: transparent; color: inherit; }
.chest-info:hover, .chest-info:focus-visible { background: rgba(255,255,255,.12); }
.crate-card.opening .crate-art { animation: chest-shake .5s ease-in-out infinite; }
.crate-card.won .crate-art { animation: chest-pop .6s ease-out; }
@keyframes chest-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes chest-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .crate-card.opening .crate-art, .crate-card.won .crate-art { animation: none; } }

.legal-links{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px;font-size:.78rem}
.legal-links button{background:none;border:0;padding:4px 0;color:inherit;opacity:.75;text-decoration:underline;cursor:pointer;min-height:32px}
.legal-links button:hover,.legal-links button:focus-visible{opacity:1}
.legal-text{max-height:50vh;overflow:auto;margin:12px 0;padding-right:6px;line-height:1.5}
.legal-text h3{margin:14px 0 4px;font-size:1rem}
.ad-notice{position:fixed;left:50%;transform:translateX(-50%);bottom:16px;z-index:60;display:flex;gap:12px;align-items:center;max-width:min(560px,calc(100vw - 24px));padding:10px 14px;border-radius:12px;background:var(--card,#3a2a20);color:var(--text,#f5e6d3);border:1px solid rgba(255,255,255,.18);box-shadow:0 8px 24px rgba(0,0,0,.35);font-size:.88rem}


/* ---------- landing / auth / admin (new; game styles above are untouched) ---------- */
[hidden] { display: none; }
.landing { min-height: 100vh; min-height: 100dvh; padding: 14px 16px 32px; }
.land-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 1100px; margin: 0 auto 8px; }
.land-top .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.land-actions { display: flex; gap: 8px; }
.land-actions .button { min-height: 44px; padding: 8px 16px; }
.land-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 1100px; margin: 0 auto; }
.land-main { display: grid; gap: 18px; min-width: 0; max-width: 640px; margin: 0 auto; width: 100%; }
.land-rail { display: none; }
#frame, #frame-2463533, #frame-2463531, .ad-rectangle { min-width: 120px; min-height: 25px; }
.hero { text-align: center; padding: 12px 0 4px; }
.hero h1 { font-size: clamp(1.8rem, 7vw, 2.9rem); line-height: 1.1; margin: 10px 0; }
.hero h1 span { color: var(--gold-bright); }
.hero-lantern { position: relative; display: grid; place-items: center; height: 250px; }
.hero-lantern svg { position: relative; z-index: 2; width: 150px; height: 225px; animation: hero-sway 5s ease-in-out infinite; transform-origin: 50% 0; filter: drop-shadow(0 0 22px rgba(255, 190, 70, .65)); }
.hero-halo { position: absolute; z-index: 1; width: 290px; height: 290px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 90, .5), rgba(245, 158, 11, .12) 55%, transparent 70%); animation: hero-pulse 3.2s ease-in-out infinite; }
.fly { position: absolute; z-index: 3; width: 6px; height: 6px; border-radius: 50%; background: #fff3a0; box-shadow: 0 0 12px 4px rgba(255, 214, 90, .7); animation: hero-fly 7s ease-in-out infinite alternate; }
.fly.f1 { left: 22%; top: 30%; } .fly.f2 { left: 74%; top: 24%; animation-delay: -2s; } .fly.f3 { left: 30%; top: 70%; animation-delay: -4s; } .fly.f4 { left: 68%; top: 64%; animation-delay: -1s; } .fly.f5 { left: 50%; top: 8%; animation-delay: -3s; }
@keyframes hero-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes hero-pulse { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes hero-fly { from { transform: translate(0, 0); opacity: .3; } to { transform: translate(24px, -30px); opacity: 1; } }
.callout { display: inline-block; margin: 6px 0 16px; padding: 10px 18px; border: 1px solid rgba(255, 196, 90, .5); border-radius: 14px; background: rgba(245, 158, 11, .12); font-size: 1.1rem; }
.callout strong { color: var(--gold-bright); font-family: var(--font-display); font-weight: 400; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-cta .button { min-height: 48px; min-width: 150px; }
.auth-card, .convert { padding: 18px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-tabs button { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-weight: 700; }
.auth-tabs button[aria-selected='true'] { background: rgba(245, 158, 11, .2); border-color: var(--gold); }
#auth-form { display: grid; gap: 12px; }
#auth-form label, .admin-panel label { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
#auth-form input, .admin-panel input { min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .25); color: var(--ink); }
.form-error { min-height: 1.2em; margin: 0; color: var(--red); font-size: .88rem; }
#auth-form .button { min-height: 48px; }
.convert h2 { margin-bottom: 12px; }
.convert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.convert-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.convert-grid b { display: block; color: var(--gold-bright); font-family: var(--font-display); font-weight: 400; }
.convert-grid small { color: var(--muted); }
.land-ad-mobile { display: grid; justify-items: center; gap: 4px; }
.land-ad-mobile .ad-slot { display: grid; width: 320px; max-width: 100%; height: 50px; }
.land-legal { text-align: center; color: var(--muted); font-size: .8rem; }
@media (min-width: 1000px) {
  .land-grid { grid-template-columns: minmax(0, 1fr) 160px; gap: 28px; }
  .land-main { max-width: none; margin: 0; grid-template-columns: 1fr 1fr; }
  .hero { grid-column: 1 / -1; }
  .convert { grid-column: 1 / -1; }
  .land-ad-mobile { display: none; }
  .land-rail { display: block; position: sticky; top: 16px; align-self: start; }
  .land-rail .ad-slot { display: grid; width: 160px; height: 600px; }
}
@media (prefers-reduced-motion: reduce) { .hero-lantern svg, .hero-halo, .fly { animation: none; } }
.account-box { display: grid; gap: 6px; padding: 8px 4px 0; }
.account-box small { color: var(--muted); }
.account-box .button { min-height: 40px; }
@media (max-width: 767px) { .account-box { display: none; } }
.admin-panel { position: fixed; z-index: 90; inset: 0; overflow-y: auto; padding: 16px; background: var(--bg); }
.admin-inner { display: grid; gap: 16px; max-width: 1100px; margin: 0 auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; }
.admin-panel .card { padding: 16px; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.admin-panel table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-panel th, .admin-panel td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.admin-panel td.addr { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.admin-panel .link { border: 0; background: none; color: var(--gold-bright); text-decoration: underline; padding: 0; }
.grant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 10px; }