/* Three Daily Games — hub (SPEC §5.1, §13). Tokens on :root, dark set under the Telegram / system scheme. */
:root {
  --bg: #F4F2FF; --bg2: #E6E9FF; --surface: rgba(255,255,255,.78); --surface2: rgba(255,255,255,.92); --line: rgba(23,20,46,.10);
  --ink: #17142E; --muted: #5D5A7C; --primary: #6C4DFF; --primary-2: #9B7BFF; --on-primary: #FFFFFF;
  --flame: #FF7A3D; --gold: #FFC23D; --silver: #B8C2D6; --bronze: #E0915B; --success: #19B37D; --danger: #E5484D; --sup: #2EC5FF;
  --shadow: 0 18px 40px rgba(40,30,110,.14); --shadow-sm: 0 6px 18px rgba(40,30,110,.10); --hi: inset 0 1px 0 rgba(255,255,255,.6);
  --tdg-safe-top: var(--tgb-safe-top, env(safe-area-inset-top, 0px));
  --tdg-safe-right: var(--tgb-safe-right, env(safe-area-inset-right, 0px));
  --tdg-safe-bottom: var(--tgb-safe-bottom, env(safe-area-inset-bottom, 0px));
  --tdg-safe-left: var(--tgb-safe-left, env(safe-area-inset-left, 0px));
  --pad: 20px; --tabh: 64px; --r: 24px;
  --ease: cubic-bezier(.22,1,.36,1); --back: cubic-bezier(.34,1.56,.64,1);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
html[data-scheme="dark"] {
  --bg: #0E0C24; --bg2: #17123A; --surface: rgba(255,255,255,.06); --surface2: rgba(30,26,70,.92); --line: rgba(255,255,255,.12);
  --ink: #F3F1FF; --muted: #A8A4CC; --primary: #8A70FF; --primary-2: #B49CFF;
  --flame: #FF8F57; --gold: #FFD25E; --silver: #C9D3E6; --bronze: #F0A673; --success: #3DDC97; --danger: #FF6B6B; --sup: #5BD8FF;
  --shadow: 0 18px 40px rgba(0,0,0,.35); --shadow-sm: 0 6px 18px rgba(0,0,0,.25); --hi: inset 0 1px 0 rgba(255,255,255,.08);
  color-scheme: dark;
}
html[data-gold="1"] { --primary: #E0A526; --primary-2: #FFC23D; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 600 16px/1.35 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--primary-2); outline-offset: 2px; }
.num, .tab-num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* background */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%); }
.bgfx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bgfx i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(60px); opacity: .45; }
.bgfx i:nth-child(1) { left: -20vmax; top: -25vmax; background: radial-gradient(circle, rgba(108,77,255,.35), transparent 60%); }
.bgfx i:nth-child(2) { right: -25vmax; top: 20vh; background: radial-gradient(circle, rgba(46,197,255,.25), transparent 60%); }
.bgfx i:nth-child(3) { left: 10vw; bottom: -30vmax; background: radial-gradient(circle, rgba(255,122,61,.22), transparent 60%); }
html[data-scheme="dark"] .bgfx i { opacity: .7; }

/* screens */
#screens { position: relative; flex: 1; min-height: 0; }
/* QA2-5: the scroll box starts below the top safe band (status bar + Telegram's own Close / ⋯ row in full screen), so
   scrolled content never slides under them; the band keeps the app background */
.screen { position: absolute; inset: var(--tdg-safe-top) 0 0 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 12px calc(var(--pad) + var(--tdg-safe-right)) calc(var(--tdg-safe-bottom) + var(--tabh) + 24px) calc(var(--pad) + var(--tdg-safe-left)); }
.screen.enter { animation: scrIn .2s var(--ease); }
@keyframes scrIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.col { max-width: 480px; margin: 0 auto; }
@media (max-width: 370px) { :root { --pad: 16px; } }
@media (min-width: 768px) { .card, .glass-card { padding-left: 4px; padding-right: 4px; } }

/* glass */
.glass { background: var(--surface); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--line); box-shadow: var(--shadow-sm), var(--hi); }
.glass-card { background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow), var(--hi); padding: 16px; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; gap: 4px;
  padding: 8px calc(12px + var(--tdg-safe-right)) calc(8px + var(--tdg-safe-bottom)) calc(12px + var(--tdg-safe-left)); border-width: 1px 0 0; border-radius: 22px 22px 0 0; }
.tab { flex: 1; max-width: 116px; height: 48px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 800; transition: transform .12s, background .2s, color .2s; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-selected="true"] { color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 16px rgba(108,77,255,.35); }
.tab:active, .press:active { transform: scale(.97); }

/* home */
.topline { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.streak { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 999px; font-weight: 800; font-size: 17px; }
.flame { width: 22px; height: 22px; color: var(--flame); animation: breathe 2.4s ease-in-out infinite; }
.streak.gold .flame { color: var(--gold); }
@keyframes breathe { 50% { transform: scale(1.12); } }
.streak .lbl { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--flame); }
.streak.gold .dots i.on { background: var(--gold); }
.avatar { --a: #6C4DFF; --b: #2EC5FF; width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: var(--shadow-sm); }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.hero { text-align: center; padding: 10px 0 18px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.daily { font-size: 44px; font-weight: 800; line-height: 1.05; margin: 6px 0 4px; letter-spacing: -.01em; }
.next { font-size: 15px; color: var(--muted); }
.first { margin-top: 8px; font-size: 15px; color: var(--muted); }
.banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; font-size: 14px; background: rgba(255,170,40,.16); color: #8A5A00; border: 1px solid rgba(255,170,40,.35); }
html[data-scheme="dark"] .banner { color: #FFD48A; }
.cards { display: flex; flex-direction: column; gap: 14px; }
.gcard { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 112px; padding: 14px 14px 14px 18px; border-radius: 24px; color: #fff; text-align: left; overflow: hidden; box-shadow: 0 16px 34px rgba(20,10,60,.22), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .12s var(--ease); }
.gcard:active { transform: scale(.97); }
.gcard[data-g="floe"] { background: linear-gradient(135deg, #BFE3FF, #5CA0FF); color: #0B2A55; }
.gcard[data-g="orbit-pop"] { background: radial-gradient(120% 140% at 85% 20%, rgba(255,122,198,.35), transparent 50%), linear-gradient(135deg, #2A1C66, #1B1347); }
.gcard[data-g="loophole"] { background: radial-gradient(120% 140% at 90% 10%, rgba(77,243,255,.22), transparent 50%), linear-gradient(135deg, #0E0E22, #07070F); box-shadow: 0 16px 34px rgba(20,10,60,.22), inset 0 0 0 1px rgba(77,243,255,.25); }
.gcard .gi { flex: 1; min-width: 0; }
.gcard .gt { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.gcard .gs { margin-top: 6px; font-size: 15px; opacity: .92; }
.gico { display: inline-flex; flex: none; width: 1.15em; height: 1.15em; vertical-align: -.22em; }
.gico svg, .gs .st svg { width: 100%; height: 100%; display: block; }
.gcard .gt .gico { width: 30px; height: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.gs .st { display: inline-block; width: 1.12em; height: 1.12em; vertical-align: -.2em; margin-left: .08em; }
.gs .sts { white-space: nowrap; }
.gcard .chip { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 800; background: rgba(255,255,255,.22); }
.gcard[data-g="floe"] .chip { background: rgba(11,42,85,.12); }
.art { width: 88px; height: 88px; flex: none; border-radius: 20px; background-size: cover; background-position: center; box-shadow: 0 10px 24px rgba(0,0,0,.25); animation: drift 6s ease-in-out infinite; }
@keyframes drift { 50% { transform: translateY(-2px); } }
.play { position: absolute; right: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #fff, #E9E4FF); color: var(--primary); box-shadow: 0 8px 18px rgba(0,0,0,.25), inset 0 -2px 0 rgba(0,0,0,.08); }
.play svg { width: 22px; height: 22px; margin-left: 3px; }
.play.done { background: linear-gradient(180deg, #5FF0B4, #19B37D); color: #fff; }
.play.done svg { margin-left: 0; }
.gcard .art { margin-right: 52px; }
.stagger .gcard { animation: cardIn .26s var(--back) both; }
.stagger .gcard:nth-child(2) { animation-delay: .06s; } .stagger .gcard:nth-child(3) { animation-delay: .12s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
/* trio progress under the cards: the three game marks light up as the dailies are done */
.trio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 18px auto 0; padding: 0 8px; max-width: 420px; font-size: 14px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.35; }
.trio-dots { display: inline-flex; gap: 4px; flex: none; }
.trio > span:last-child { text-wrap: balance; }
.trio-dots .gico { width: 20px; height: 20px; opacity: .5; filter: grayscale(1); transition: opacity .3s, filter .3s, transform .3s var(--back); }
.trio-dots .gico.on { opacity: 1; filter: none; transform: scale(1.08); }
.peek { margin-top: 16px; }
.peek-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.peek-h button { text-transform: none; letter-spacing: 0; color: var(--primary); font-size: 15px; min-height: 44px; padding: 0 4px; }
.peek-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.peek-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.peek-foot { margin-top: 6px; font-size: 13px; color: var(--muted); }
.coach { position: relative; margin: 0 0 10px; padding: 10px 14px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 14px; box-shadow: var(--shadow-sm); animation: cardIn .26s var(--back); }

/* titles, buttons */
.title { font-size: 28px; font-weight: 800; margin: 6px 0 4px; }
.sub { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 16px; font-weight: 800; font-size: 16px; transition: transform .12s; }
.btn:active { transform: scale(.97); }
.btn.primary { color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 22px rgba(108,77,255,.32); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); }
.btn.danger { color: var(--danger); background: var(--surface); border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { color: var(--primary); font-weight: 700; min-height: 44px; padding: 0 6px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* segmented + chips */
.seg { display: flex; padding: 4px; border-radius: 16px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; min-height: 44px; border-radius: 12px; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 8px; }
.seg button[aria-pressed="true"] { background: var(--surface2); color: var(--ink); box-shadow: var(--shadow-sm); }
.chips { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.gchip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 800; font-size: 15px; background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 400px) { .chips { gap: 6px; } .gchip { flex: 1 1 auto; padding: 0 10px; font-size: 14px; white-space: nowrap; } }  /* QA2-2: all three game chips fit at 360 px */
.gchip[aria-pressed="true"][data-g="floe"] { background: linear-gradient(135deg, #BFE3FF, #5CA0FF); color: #0B2A55; border-color: transparent; }
.gchip[aria-pressed="true"][data-g="orbit-pop"] { background: linear-gradient(135deg, #6B3FD1, #2A1C66); color: #fff; border-color: transparent; }
.gchip[aria-pressed="true"][data-g="loophole"] { background: linear-gradient(135deg, #1A1A3A, #07070F); color: #4DF3FF; border-color: rgba(77,243,255,.4); }
.daytog { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.daytog .seg { flex: 1; margin: 0; }
.final { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--gold); color: #3A2600; }

/* boards */
.blist { list-style: none; margin: 0; padding: 6px; }
.brow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 10px; border-radius: 16px; }
.brow + .brow { margin-top: 2px; }
.brow.me { background: linear-gradient(135deg, rgba(108,77,255,.16), rgba(155,123,255,.10)); box-shadow: inset 0 0 0 1.5px rgba(108,77,255,.45); }
.brow.sticky { position: sticky; bottom: 0; background: var(--surface2); }
.rank { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank.m1 { background: var(--gold); color: #3A2600; } .rank.m2 { background: var(--silver); color: #222B3D; } .rank.m3 { background: var(--bronze); color: #3D1C05; }
.bname { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; line-height: 1.25; font-weight: 700; }  /* names wrap to 2 lines before any ellipsis (QA D58) */
.badge-sup { display: inline-block; margin-left: 4px; filter: drop-shadow(0 0 4px var(--sup)); }
.bstat { font-weight: 800; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 15px; }
.gap { text-align: center; color: var(--muted); font-weight: 800; padding: 2px 0; }
.empty { text-align: center; padding: 22px 12px; }
.empty .podium { display: flex; justify-content: center; align-items: flex-end; gap: 8px; height: 96px; margin-bottom: 12px; }
.empty .podium i { width: 56px; border-radius: 14px 14px 6px 6px; background: var(--surface2); border: 1px solid var(--line); display: flex; justify-content: center; font-style: normal; font-size: 26px; padding-top: 8px; }
.empty .podium i:nth-child(1) { height: 64px; } .empty .podium i:nth-child(2) { height: 88px; } .empty .podium i:nth-child(3) { height: 50px; }
.empty p { color: var(--muted); margin: 0 0 14px; }
.skel { height: 56px; border-radius: 16px; margin: 4px 0; background: linear-gradient(90deg, var(--line), rgba(255,255,255,.18), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.foot { margin-top: 12px; font-size: 14px; color: var(--muted); text-align: center; }
.consent-inline { margin-bottom: 12px; }
.consent-inline p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.retry-chip { display: inline-flex; margin: 0 auto 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; background: rgba(229,72,77,.12); color: var(--danger); font-weight: 800; }

/* shop */
.sup { position: relative; overflow: hidden; border-radius: 26px; padding: 18px; color: #3A2600; background: linear-gradient(135deg, #FFE29A 0%, #FFC23D 45%, #E0A526 100%); box-shadow: 0 18px 40px rgba(224,165,38,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.sup::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 45%, transparent 60%); transform: translateX(-100%); animation: shine 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.sup .k { font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.sup .t { font-size: 22px; font-weight: 800; margin: 4px 0; }
.sup .d { font-size: 15px; opacity: .85; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.price { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pack { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin-top: 12px; border-radius: 22px; text-align: left; }
.pack canvas { width: 96px; height: 64px; flex: none; border-radius: 14px; box-shadow: var(--shadow-sm); }
.pack .pi { flex: 1; min-width: 0; }
.pack .pt { font-weight: 800; font-size: 17px; }
.pack .pd { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pack .price { font-size: 17px; }
.owned { color: var(--success); font-weight: 800; white-space: nowrap; }
.shop-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin-top: 18px; }
.sheet-preview { width: 100%; max-width: 320px; aspect-ratio: 16 / 10; display: block; margin: 0 auto 14px; border-radius: 20px; box-shadow: var(--shadow); }
.items { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.items > span { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }

/* me */
.mehead { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.mehead .n { font-size: 22px; font-weight: 800; }
.mehead .s { font-size: 14px; color: var(--muted); line-height: 1.45; }
.mehead .s .link { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; vertical-align: baseline; }  /* 44 px target inside a text line */
.list { border-radius: 22px; overflow: hidden; margin-bottom: 14px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--line); }
.item .l { flex: 1; min-width: 0; }
.item .l small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 44px; flex: none; border-radius: 16px; background: none; }  /* 44 px tap target, 32 px track (QA D59) */
.switch::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 32px; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 9px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch[aria-checked="true"]::before { background: var(--success); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .4; cursor: default; }  /* QA2-15: a switch that depends on another one looks inactive */
.hours { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.hours button, .langs button { min-width: 48px; min-height: 44px; padding: 0 10px; border-radius: 12px; font-weight: 800; background: var(--surface2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.hours button[aria-pressed="true"], .langs button[aria-pressed="true"] { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.langs { display: flex; gap: 6px; }
.invite .code { font-size: 14px; color: var(--muted); margin: 6px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 10px 12px; border-radius: 12px; background: var(--line); font-variant-numeric: tabular-nums; }
.ver { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* layer: sheets, overlays */
.layer { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.veil { position: absolute; inset: 0; background: rgba(8,6,30,.45); opacity: 0; transition: opacity .26s; pointer-events: auto; }
.veil.on { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--tdg-safe-top) - 24px); overflow-y: auto; pointer-events: auto;
  margin: 0 auto; max-width: 520px; padding: 10px calc(20px + var(--tdg-safe-right)) calc(20px + var(--tdg-safe-bottom)) calc(20px + var(--tdg-safe-left));
  border-radius: 28px 28px 0 0; background: var(--surface2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); box-shadow: 0 -20px 50px rgba(0,0,0,.25);
  transform: translateY(24px); opacity: 0; transition: transform .26s var(--back), opacity .2s; }
.sheet.on { transform: none; opacity: 1; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet h2 { font-size: 22px; font-weight: 800; margin: 4px 0 8px; text-align: center; }
.sheet p { margin: 0 0 12px; color: var(--muted); text-align: center; }
.sheet .x { position: absolute; top: 10px; left: 12px; width: 44px; height: 44px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 22px; color: var(--muted); }
html[data-tg="0"] .sheet .x, html[data-noback="1"] .sheet .x { display: flex; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sharecard { display: block; width: 62%; max-width: 280px; margin: 4px auto 12px; border-radius: 20px; box-shadow: var(--shadow); transform: rotate(3deg); transition: transform .3s var(--back); background: var(--line); aspect-ratio: 4 / 5; object-fit: cover; }
.sharecard.on { transform: none; }
.sharecap { text-align: center; font-weight: 800; margin-bottom: 12px; }
.namechips { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.namechips button { min-height: 52px; border-radius: 16px; padding: 0 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.namechips button[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.input { width: 100%; min-height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 14px; font: inherit; font-size: 17px; outline: none; }
.input:focus { border-color: var(--primary); }
.err { color: var(--danger); font-size: 14px; margin: 6px 0 0; text-align: center; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; padding: 24px; pointer-events: auto; background: rgba(10,8,32,.84); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: #fff; text-align: center; animation: fadeIn .2s; }
.overlay .pv { width: 280px; height: 170px; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.45); animation: popIn .36s cubic-bezier(.34,1.56,.64,1); }
.overlay .pv canvas { width: 100%; height: 100%; display: block; }
@keyframes popIn { from { transform: scale(.86); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay .big { font-size: 24px; font-weight: 800; max-width: 340px; line-height: 1.25; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
.fullimg { max-width: 92%; max-height: 70%; border-radius: 18px; box-shadow: var(--shadow); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tdg-safe-bottom) + var(--tabh) + 22px); z-index: 2147483600; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 16px; background: rgba(23,20,46,.92); color: #fff; font-weight: 700; font-size: 15px; text-align: center; transition: opacity .2s, transform .2s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.in-game .toast { bottom: calc(var(--tdg-safe-bottom) + 28px); }

/* player */
.player { position: fixed; inset: 0; z-index: 1000; background: var(--pbg, #000); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
@media (min-width: 768px) { .player iframe { left: 50%; width: min(100vw, 520px); transform: translateX(-50%); } }
.p-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity .2s; }
.p-load i { width: 72px; height: 72px; border-radius: 22px; background-size: cover; background-position: center; animation: pulse 1s ease-in-out infinite; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.p-load.off { opacity: 0; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.player.enter { animation: fadeIn .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation: none !important; transition-duration: .001ms !important; }
.avatar-btn { padding: 0; border: 0; background: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; flex: none; -webkit-tap-highlight-color: transparent; }
.avatar-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
