/* Moonpool, design direction A: dark petrol water, rose action colour, Big Shoulders Display + Sofia Sans.
   Dark-only by design. No cream, no orange, no italics. */

/* Script subsets for the 15 languages (fonts/LICENSE.txt): each unicode-range face downloads only when
   its script is on screen. Big Shoulders has Vietnamese but no Cyrillic: Cyrillic display text falls
   through to Sofia Sans Extra Condensed. Arabic script (ar fa ur): Vazirmatn. Hindi: Noto Sans Devanagari.
   Chinese / Japanese: system fonts (--cjk). Vietnamese body text: system font (Sofia Sans has no Vietnamese). */
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url(fonts/big-shoulders-display-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Sofia Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/sofia-sans-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Sofia Sans Extra Condensed'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url(fonts/sofia-sans-extra-condensed-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/vazirmatn-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+200C-200F, U+2010-2011, U+FD3E-FD3F; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/noto-sans-devanagari.woff2) format('woff2');
  unicode-range: U+0900-097F, U+200C-200D, U+20B9, U+25CC; }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url(fonts/big-shoulders-display-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url(fonts/big-shoulders-display-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sofia Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/sofia-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sofia Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/sofia-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --abyss: #03161b;
  --deep: #072a31;
  --night: #010e12;
  --panel: rgba(5, 31, 38, .82);
  --pearl: #e8f1ef;
  --fog: #86a5a6;
  --mist: rgba(232, 241, 239, .1);
  --rose: #f2496a;
  --rose-ink: #1d0409;
  --teal: #8ff3e2;
  /* other scripts fall through the stack to their unicode-range face (above) or the system CJK fonts */
  --cjk: 'PingFang SC', 'Hiragino Sans', 'Noto Sans CJK SC', 'Microsoft YaHei', 'Source Han Sans SC';
  --scripts: 'Vazirmatn', 'Noto Sans Devanagari', var(--cjk);
  --display: 'Big Shoulders Display', 'Sofia Sans Extra Condensed', var(--scripts), 'Arial Narrow', sans-serif;
  --text: 'Sofia Sans', var(--scripts), system-ui, sans-serif;
  /* Telegram fullscreen: Android WebView reports env() as 0, so Telegram's own insets win when larger */
  --safe-bottom: max(var(--mp-inset-bottom, 0px), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)), env(safe-area-inset-bottom, 0px));
  --safe-top: max(var(--mp-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)), env(safe-area-inset-top, 0px));
  color-scheme: dark;
}
/* Japanese prefers its own CJK faces; Vietnamese body text uses the system font (Sofia Sans lacks it) */
:root:lang(ja) { --cjk: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Yu Gothic UI', 'Meiryo'; }
:root:lang(vi) { --text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--night); color: var(--pearl); font-family: var(--text); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
html.kb-open, html.kb-open body { overflow: auto; height: auto; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--pearl); outline-offset: 2px; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
ul { list-style: none; }

.app { height: var(--app-h, 100dvh); display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; padding-top: var(--safe-top); background: var(--night); position: relative; }

/* ------------------------------------------------------------------ banner slots */
.ad { flex: none; display: flex; justify-content: center; background: var(--night); overflow: hidden; }
.ad-top { height: 58px; padding-top: 4px; }
.ad-bottom { height: 66px; padding-top: 4px; } /* 12 px clear gap above the tab bar: no stray ad taps */
.ad.is-empty { display: none; }
.slot { position: relative; width: 320px; max-width: calc(100% - 24px); height: 50px; border-radius: 8px; overflow: hidden; }
.house, .ra-slot, .tagds-host { position: absolute; inset: 0; }
.ra-slot, .tagds-host { display: none; background: var(--night); }
.slot.is-richads .ra-slot, .slot.is-tagds .tagds-host { display: block; }
.slot.is-richads .house, .slot.is-tagds .house, .slot.is-tagds .ra-slot { visibility: hidden; }
.ra-slot #richadsBanner, .tagds-host > * { max-width: 100%; max-height: 50px; margin: 0 auto; }
.house-ad { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0; padding-inline: 8px 14px; width: 100%; text-align: start;
  background: linear-gradient(100deg, #0c2b32 0%, #082229 70%); border-radius: 8px; transition: opacity .3s ease .2s, transform .3s cubic-bezier(.2, .8, .3, 1) .2s; }
/* sponsor image banner (728×90): whole image visible, centred on the dark strip */
.house-ad.sponsor { padding: 0; justify-content: center; background: #020d10; }
.house-ad.sponsor img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* sequential swap (banners.js): the leaving banner fades out first (.18 s), the new one fades in after it */
.house-ad.out { opacity: 0; transform: translateY(3px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.h-ico { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(232, 241, 239, .06); }
.h-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--pearl); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.h-ico.rose { background: rgba(242, 73, 106, .16); }
.h-ico.rose svg { stroke: var(--rose); }
.h-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.h-txt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-txt small { font-size: 12px; color: var(--fog); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-go { flex: none; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--rose); letter-spacing: .02em; }
.h-go svg { display: block; width: 9px; height: 14px; fill: none; stroke: var(--fog); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ stage + screens */
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; }
.screen-aq { display: flex; flex-direction: column; }

/* tank: the hero of the main screen. It ends in its own bottom edge (dark trim + glass highlight);
   the HUD and the oyster bar float on the water instead of taking rows of their own. */
.tank { position: relative; flex: 1; min-height: 150px; overflow: hidden; background: #020b0f; }
#tankGL { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.scrim-top { position: absolute; inset: 0 0 auto; height: 96px; background: linear-gradient(rgba(3, 22, 27, .92) 0%, rgba(3, 22, 27, .5) 50%, transparent); pointer-events: none; }
.tank-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none;
  background: linear-gradient(rgba(1, 14, 18, 0), rgba(1, 14, 18, .55)); }
.tank::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none; z-index: 4;
  background: var(--night); box-shadow: 0 -1px 0 rgba(232, 241, 239, .2), 0 -6px 14px -6px rgba(94, 195, 207, .18); }

/* compact HUD: live balance + TON/h on the left, power chip on the right */
.hud { position: absolute; top: 8px; inset-inline: 14px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; z-index: 2; }
.hud-bal { min-width: 0; }
.brand { display: flex; align-items: center; gap: 1.5px; font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: .03em; line-height: 1; }
.brand .o { width: .5em; height: .72em; margin: 0 .03em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.balance { display: flex; align-items: baseline; gap: 5px; }
.bal-num { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: .95; letter-spacing: 0; white-space: nowrap; text-shadow: 0 1px 14px rgba(1, 14, 18, .55); }
.bal-num .d { display: inline-block; width: .5em; text-align: center; }
.bal-num .p { display: inline-block; width: .22em; text-align: center; }
.bal-num .dim { color: var(--fog); opacity: .9; }
.bal-num.stopped .dim { opacity: .5; }
.bal-unit { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--fog); }
.rate { margin-top: 3px; font-size: 12px; color: var(--fog); min-height: 15px; white-space: nowrap; text-shadow: 0 1px 8px rgba(1, 14, 18, .6); }
.rate b { color: var(--pearl); font-weight: 600; }
.rate.full { color: var(--rose); font-weight: 600; }
.power { position: relative; flex: none; display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px 0 10px; border-radius: 15px;
  background: rgba(1, 14, 18, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.power b { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1; color: var(--pearl); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.power svg { width: 9px; height: 13px; fill: var(--pearl); }
.pow-plus { position: absolute; right: 100%; margin-right: 6px; top: 5px; white-space: nowrap; font-style: normal; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--rose); opacity: 0; }
.pow-plus.go { animation: powPlus 1.6s ease-out forwards; }
@keyframes powPlus { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: translateY(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.power.bump b { animation: bump .5s ease-out; }
.hud-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.tools { display: flex; gap: 8px; pointer-events: auto; }
/* 32 px glass dots; the tap area around each is 42 px (::after), so the look stays small */
.tool { position: relative; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: var(--pearl);
  background: rgba(1, 14, 18, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, box-shadow .2s; }
.tool::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; }
.tool:active { transform: scale(.92); }
.tool[aria-pressed="true"] { background: rgba(242, 73, 106, .2); box-shadow: inset 0 0 0 1px rgba(242, 73, 106, .45); }
.tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tool .snd-body { fill: currentColor; stroke: none; }
.tool .snd-off { display: none; }
.tool[aria-pressed="false"] { color: var(--fog); }
.tool[aria-pressed="false"] .snd-on { display: none; }
.tool[aria-pressed="false"] .snd-off { display: inline; }
.tool-lang span { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .04em; line-height: 1; }
@keyframes bump { 40% { transform: scale(1.18); color: #fff; } }

/* oyster: one slim glass bar on the bottom edge of the water */
.oyster { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 2; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  padding: 7px; padding-inline-start: 13px; border-radius: 18px; background: rgba(3, 22, 27, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.oy-main { min-width: 0; }
.oy-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--fog); margin-bottom: 5px; white-space: nowrap; }
.oy-head b { color: var(--pearl); font-weight: 600; font-variant-numeric: tabular-nums; }
.oy-head .full { color: var(--rose); font-weight: 600; }
.ticks { display: flex; justify-content: space-between; height: 10px; align-items: flex-end; }
.ticks i { width: 2px; height: 5px; border-radius: 1px; background: rgba(232, 241, 239, .18); }
.ticks i:nth-child(5n + 1) { height: 10px; }
.ticks i.on { background: var(--pearl); }
.ticks i.now { background: var(--rose); height: 10px; box-shadow: 0 0 8px var(--rose); }
.collect { position: relative; height: 40px; padding: 0 18px; border-radius: 20px; background: var(--pearl); color: var(--abyss); font-weight: 700; font-size: 15px; transition: opacity .2s, transform .1s; }
.collect:active:not(:disabled) { transform: scale(.97); }
.collect:disabled { opacity: .4; }
.collect.full::after { content: ''; position: absolute; inset: -3px; border-radius: 23px; border: 2px solid var(--rose); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.more { position: absolute; inset-inline-start: 12px; bottom: 74px; z-index: 2; height: 24px; padding: 0 10px; border-radius: 12px; background: rgba(1, 14, 18, .62); display: flex; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--pearl); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* tapped fish */
.reticle { position: absolute; left: 0; top: 0; width: 80px; height: 80px; pointer-events: none; display: none; z-index: 1; }
.reticle i { position: absolute; width: 12px; height: 12px; border: 2px solid var(--pearl); }
.reticle i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.reticle i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.reticle i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.reticle i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
/* it marks the tap, then fades: the fish card already names the fish, and a frame left on open water
   (fish swam on, low-fps WebView) reads as a bug (UI-SCAN m8) */
.reticle.open { display: block; animation: reticle 1.5s ease forwards; }
@keyframes reticle { 0% { opacity: 0; } 12% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }
/* sheets cover the oyster bar while open (they close themselves / with the x) */
.sheet { position: absolute; left: 10px; right: 10px; bottom: 12px; display: none; background: rgba(5, 31, 38, .94); border-radius: 18px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 3; }
.sheet.open { display: block; animation: sheetIn .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px); } }
/* the fish card opens above the oyster bar (54 px + gaps): Collect stays visible and tappable */
.fishcard { padding: 12px 14px 12px; bottom: 74px; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6); }
.fc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.fc-name { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: .01em; }
.fc-sub { font-size: 12px; color: var(--fog); margin-top: 3px; }
.fc-x { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; background: rgba(232, 241, 239, .08); display: grid; place-items: center; margin: -4px 0 0; margin-inline-end: -5px; }
.fc-x::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; } /* 44 px tap area */
.fc-x:active { transform: scale(.94); }
.fc-x svg { width: 11px; height: 11px; stroke: var(--pearl); stroke-width: 2; }
.fc-stats { display: grid; grid-template-columns: auto auto 1fr; gap: 16px; margin-top: 10px; align-items: end; }
.fc-stats > div { font-size: 11px; color: var(--fog); min-width: 0; }
.fc-stats b { display: block; font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--pearl); line-height: 1.05; font-variant-numeric: tabular-nums; }
.life { height: 3px; border-radius: 2px; background: rgba(232, 241, 239, .14); margin-top: 5px; overflow: hidden; }
.life i { display: block; height: 100%; background: var(--pearl); transition: width 1s linear; }

/* fish result */
.result.open { display: flex; }
.result { align-items: center; gap: 10px; padding: 10px; padding-inline-start: 8px; }
.res-pic { flex: none; width: 64px; height: 40px; }
.result.none .res-pic { display: none; }
.result.none { padding-inline-start: 14px; }
.res-txt { flex: 1; min-width: 0; }
.res-kicker { font-size: 12px; font-weight: 600; color: var(--rose); letter-spacing: .02em; }
.res-title { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.02; margin-top: 2px; letter-spacing: .01em; }
.res-sub { font-size: 12px; color: var(--fog); margin-top: 3px; }
.res-x { align-self: flex-start; margin: 0; }

/* arrival ripple */
.ripples { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.ripple { position: absolute; width: 0; height: 0; }
.ripple i { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%; border: 2px solid rgba(232, 241, 239, .75); animation: ring 1.3s ease-out forwards; }
.ripple i + i { animation-delay: .18s; border-color: rgba(242, 73, 106, .7); }
.ripple b { position: absolute; left: 0; top: -12px; transform: translateX(-50%); font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--pearl); white-space: nowrap;
  text-shadow: 0 1px 8px rgba(1, 14, 18, .8); animation: rise 1.8s ease-out forwards; }
@keyframes ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -32px); } }

/* ------------------------------------------------------------------ dock: three compact cards */
.dock { flex: none; position: relative; padding: 8px 10px 8px; background: var(--abyss); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; position: relative; }
.card { background: var(--panel); border-radius: 14px; padding: 7px; min-width: 0; display: flex; flex-direction: column; transition: opacity .25s; }
.c-top { display: flex; align-items: center; gap: 4px; height: 32px; min-width: 0; }
.c-top canvas { flex: none; width: 48px; height: 32px; display: block; }
.c-meta { min-width: 0; line-height: 1; }
.c-power { display: flex; align-items: center; gap: 3px; font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1; white-space: nowrap; }
.c-power svg { width: 8px; height: 12px; fill: var(--fog); flex: none; }
.c-ads { margin-top: 2px; font-size: 11px; color: var(--fog); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The visible pill is 34 px; a 4 px transparent border (background clipped to the padding box) makes the
   tap target 42 px and reaches into the card's own padding, while long labels stay clipped to the pill. */
.c-act { margin: 2px -4px -4px; height: 42px; width: calc(100% + 8px); border: 4px solid transparent; border-radius: 21px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; padding: 0 6px; overflow: hidden; }
.ready .c-act { background: var(--rose); color: var(--rose-ink); }
.ready .c-act:active { transform: scale(.97); }
.cooldown .c-act { background: rgba(232, 241, 239, .07); color: var(--pearl); font-weight: 600; }
.cooldown .c-act svg { width: 14px; height: 14px; flex: none; }
.cooldown .c-act b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.progress .c-act { background: rgba(242, 73, 106, .14); color: var(--rose); padding: 0 3px; gap: 4px; }
.resume .c-act { background: rgba(242, 73, 106, .14); color: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose); }
.card .c-act { background-clip: padding-box; } /* after the state rules: their background shorthand resets it */
.card.dim { opacity: .42; }
.seg { flex: none; display: flex; gap: 2px; }
.seg i { width: 6px; height: 4px; border-radius: 2px; background: rgba(242, 73, 106, .3); }
.seg i.on { background: var(--rose); }
.seg i.live { background: linear-gradient(90deg, var(--rose) 55%, rgba(242, 73, 106, .3) 55%); background-size: 200% 100%; animation: segLive 1.4s linear infinite; }
@keyframes segLive { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* the ring sits on the transparent border, right around the visible pill */
.house-pulse .c-act { animation: cardPulse 1s ease-in-out 2; outline: 4px solid transparent; outline-offset: -4px; }
@keyframes cardPulse { 50% { outline-color: rgba(242, 73, 106, .35); } }

.cap { display: none; }
.capped .card { visibility: hidden; }
.capped .cap { display: flex; position: absolute; inset: 0; border-radius: 14px; background: var(--deep); align-items: center; gap: 12px; padding: 0 14px; }
.cap b { flex: none; font-family: var(--display); font-weight: 800; font-size: 38px; line-height: .9; letter-spacing: -.01em; white-space: nowrap; }
.cap-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--fog); line-height: 1.3; }
.cap-txt strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--pearl); font-weight: 600; font-size: 13px; line-height: 1.2; margin-bottom: 2px; }
.cap em { flex: none; font-style: normal; font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--pearl); letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ tabs (3 or 4 items) */
.tabs { flex: none; height: calc(56px + var(--safe-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--night); padding-bottom: var(--safe-bottom);
  box-shadow: inset 0 1px 0 rgba(232, 241, 239, .06); }
.tabs button { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--fog); font-weight: 500; }
.tabs button span { max-width: calc(100% - 6px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs .on { color: var(--pearl); }

/* ------------------------------------------------------------------ sub screens */
.screen-sub { background: var(--abyss); z-index: 4; }
.sub-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 18px 28px; overscroll-behavior: contain; }
.sub-title { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: .01em; }
.sub-lead { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--fog); max-width: 34em; }
.sub-lead b { color: var(--pearl); font-weight: 600; }
.sub-h { margin-top: 26px; font-size: 13px; font-weight: 600; color: var(--fog); letter-spacing: .02em; }
.f-label { display: block; font-size: 13px; font-weight: 600; color: var(--fog); margin-bottom: 8px; }
.field { margin-top: 22px; }
.inrow { display: flex; align-items: center; gap: 8px; height: 48px; padding-inline: 14px 4px; border-radius: 14px; background: rgba(232, 241, 239, .06); }
.inrow:focus-within { box-shadow: inset 0 0 0 1.5px rgba(232, 241, 239, .5); }
.inrow input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 15px; }
.inrow input::placeholder { color: rgba(134, 165, 166, .7); }
.in-unit { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--fog); }
.f-err { margin-top: 6px; font-size: 13px; color: var(--rose); }
.f-err:empty { display: none; }
/* wallet change lock (wallet.js): a calm notice, not an error */
.w-lock { display: flex; gap: 8px; margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(134, 165, 166, .1); font-size: 13px; line-height: 1.4; color: var(--fog); }
.w-lock::before { content: ''; flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--rose); }
.ghost-btn { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(232, 241, 239, .09); font-size: 13px; font-weight: 700; color: var(--pearl); }
.ghost-btn:disabled { opacity: .4; }
.primary-btn { width: 100%; height: 50px; margin-top: 14px; border-radius: 25px; background: var(--rose); color: var(--rose-ink); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .2s, transform .1s; }
.primary-btn:active:not(:disabled) { transform: scale(.98); }
.primary-btn:disabled { opacity: .45; }
.primary-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--rose-ink); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }

.fr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.fr-big { background: var(--panel); border-radius: 16px; padding: 14px 14px 12px; }
.fr-big b { display: block; font-family: var(--display); font-weight: 800; font-size: 52px; line-height: .95; font-variant-numeric: tabular-nums; }
.fr-big span { display: block; margin-top: 4px; font-size: 13px; color: var(--fog); }
.fr-big:last-child b { color: var(--rose); }
.fr-invited { margin-top: 8px; font-size: 12px; color: var(--fog); }
.linkbox { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px; padding-inline-start: 14px; border-radius: 14px; background: rgba(232, 241, 239, .06); }
.linkbox > span { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox > span.muted { color: var(--fog); white-space: normal; font-size: 13px; }
/* friends.js: middle ellipsis, the referral id at the end never hides */
#frLink:not(.muted) { display: flex; }
#frLink .lk-head { flex: 0 1 auto; min-width: 2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#frLink .lk-tail { flex: none; white-space: nowrap; }

.rows { margin-top: 8px; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; box-shadow: inset 0 -1px 0 rgba(232, 241, 239, .06); }
.rows li:last-child { box-shadow: none; }
.rows .r-main { flex: 1; min-width: 0; }
.rows .r-t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .r-s { font-size: 12px; color: var(--fog); margin-top: 2px; }
.rows .r-s.warn { color: var(--rose); }
.rows .r-amt { font-family: var(--display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.rows .empty { color: var(--fog); font-size: 14px; line-height: 1.45; box-shadow: none; }
.chip { flex: none; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }
/* a status, not a button: text with a soft pulsing dot, no pill (the "Change" ghost button is a pill) */
.chip.pending { background: none; padding: 0 2px; gap: 7px; color: var(--pearl); font-weight: 600; }
.chip.pending::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 3px rgba(242, 73, 106, .18); animation: pendDot 2.2s ease-in-out infinite; }
@keyframes pendDot { 50% { box-shadow: 0 0 0 5px rgba(242, 73, 106, .06); } }
.chip.approved, .chip.counts { background: rgba(94, 240, 216, .12); color: var(--teal); }
.chip.rejected { background: rgba(242, 73, 106, .14); color: var(--rose); }
.chip.waiting { background: rgba(134, 165, 166, .12); color: var(--fog); }

.w-avail { margin-top: 18px; background: var(--panel); border-radius: 18px; padding: 14px 16px 14px; }
.w-bal { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 42px; line-height: 1; white-space: nowrap; }
.w-bal small { font-size: 18px; color: var(--fog); font-weight: 600; }
.w-bal .dim { color: var(--fog); opacity: .75; }
.w-hint { margin-top: 8px; font-size: 13px; color: var(--fog); line-height: 1.4; }
.w-hint b { color: var(--pearl); font-weight: 600; }
.w-pending { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; box-shadow: inset 0 1px 0 rgba(232, 241, 239, .08); font-size: 13px; color: var(--fog); }
.w-pending b { color: var(--pearl); font-weight: 700; }
.w-dev { margin-top: 12px; font-size: 13px; color: var(--fog); padding: 10px 12px; border-radius: 12px; background: rgba(242, 73, 106, .08); line-height: 1.4; }
.addr-saved { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px; padding-inline-start: 14px; border-radius: 14px; background: rgba(232, 241, 239, .06); }
.addr-saved span { flex: 1; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.w-rules { margin-top: 10px; font-size: 13px; color: var(--fog); line-height: 1.45; }
.w-quote { margin-top: 6px; font-size: 14px; color: var(--fog); min-height: 20px; }
.w-quote b { color: var(--pearl); font-weight: 700; }
.w-note { margin-top: 10px; font-size: 12px; color: var(--fog); text-align: center; }

/* ------------------------------------------------------------------ tasks */
.tabs button { position: relative; }
.nav-badge { position: absolute; top: 6px; inset-inline-start: calc(50% + 7px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: var(--rose-ink);
  font-style: normal; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--night); }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bolt { width: .4em; height: .58em; fill: currentColor; margin-inline-start: 2px; flex: none; }
.streak { margin-top: 16px; padding: 14px 14px 12px; border-radius: 20px; background: linear-gradient(160deg, #0d3a45 0%, #072a31 55%, #05222a 100%); }
.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.st-kicker { font-size: 12px; font-weight: 700; color: var(--rose); letter-spacing: .04em; }
.st-title { margin-top: 3px; font-family: var(--display); font-weight: 800; font-size: 25px; line-height: 1; letter-spacing: .01em; }
.st-reward { flex: none; display: flex; align-items: baseline; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; }
.st-reward .bolt { fill: var(--fog); }
.st-reward .ltr { display: inline-flex; align-items: baseline; }
.st-reward small { margin-inline-start: 5px; font-family: var(--text); font-size: 12px; font-weight: 500; color: var(--fog); }
.st-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 13px; }
.st-days li { height: 46px; border-radius: 11px; background: rgba(232, 241, 239, .07); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; }
.st-days b { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1; display: grid; place-items: center; height: 17px; }
.st-days b svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-days span { font-size: 10.5px; color: var(--fog); white-space: nowrap; }
.st-days li.got { background: var(--pearl); color: var(--abyss); }
.st-days li.got span { color: rgba(3, 22, 27, .65); }
.st-days li.today { box-shadow: inset 0 0 0 1.5px var(--rose); }
.st-days li.today b { color: var(--rose); }
.st-days li.today.ready { background: var(--rose); box-shadow: none; }
.st-days li.today.ready b, .st-days li.today.ready span { color: var(--rose-ink); }
.st-progress { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; font-size: 13px; color: var(--fog); }
.st-progress b { color: var(--pearl); font-weight: 700; }
.st-seg { display: flex; gap: 4px; }
.st-seg i { width: 20px; height: 5px; border-radius: 3px; background: rgba(232, 241, 239, .14); }
.st-seg i.on { background: var(--rose); }
.streak .primary-btn { margin-top: 12px; height: 44px; font-size: 15px; }
.streak .primary-btn .bolt { width: 9px; height: 13px; }
.ghost-btn.wide { width: 100%; height: 44px; margin-top: 12px; border-radius: 22px; font-size: 15px; }
.tk-wait { margin-top: 12px; min-height: 44px; padding: 6px 14px; border-radius: 22px; background: rgba(232, 241, 239, .06); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--fog); text-align: center; }
.tk-wait b { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--pearl); font-variant-numeric: tabular-nums; }
.st-rule { margin-top: 10px; font-size: 12px; color: var(--fog); line-height: 1.4; }
.tk-card { margin-top: 8px; padding: 12px; border-radius: 16px; background: var(--panel); }
.tk-row { display: flex; align-items: center; gap: 12px; }
.tk-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(232, 241, 239, .06); }
.tk-ico svg { width: 21px; height: 21px; fill: none; stroke: var(--pearl); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tk-main { flex: 1; min-width: 0; }
.tk-t { font-size: 15px; font-weight: 600; line-height: 1.25; }
.tk-s { margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--fog); overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tk-tag { display: inline-block; vertical-align: 2px; margin-inline-start: 4px; padding: 1px 6px; border-radius: 4px; background: var(--fog); color: var(--abyss); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tk-btn { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; background: var(--rose); color: var(--rose-ink); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }
.tk-btn:disabled { opacity: .45; }
.tk-btn .bolt { width: 8px; height: 12px; }
.tk-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tk-acts > * { height: 40px; justify-content: center; }
.tk-msg { margin-top: 9px; font-size: 12.5px; line-height: 1.4; color: var(--rose); }
.tk-msg.muted { color: var(--fog); }
.tk-msg b { color: var(--pearl); font-family: var(--display); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.approved svg { width: 11px; height: 11px; margin-inline-end: 3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inv-list { margin-top: 8px; }
.inv-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; box-shadow: inset 0 1px 0 rgba(232, 241, 239, .06); }
.inv-main { flex: 1; min-width: 0; }
.inv-t { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; line-height: 20px; }
.inv-t span { font-size: 12px; font-weight: 500; color: var(--fog); font-variant-numeric: tabular-nums; }
.inv-bar { margin-top: 6px; height: 4px; border-radius: 2px; background: rgba(232, 241, 239, .12); overflow: hidden; }
.inv-bar i { display: block; height: 100%; border-radius: 2px; background: var(--pearl); }
.inv-row.claimable .inv-bar i { background: var(--rose); }
.inv-row.done .inv-bar i { background: var(--teal); }
/* on the title row of its milestone (same 20 px line), not centred on title + bar */
.inv-rew { flex: none; align-self: flex-start; line-height: 20px; min-width: 52px; text-align: right; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--fog); }
.ag-host { margin-top: 10px; }
/* collapsed (not display:none) while Adsgram has not rendered a task yet: it must still lay out to be measured */
.ag-host.pending { height: 0; margin-top: 0; overflow: hidden; }
.ag-host.empty { display: none; }
.ag-reward { font-size: 12px; color: var(--fog); }
.ag-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--rose); color: var(--rose-ink); font-size: 13px; font-weight: 700; }
.ag-btn.done { background: rgba(94, 240, 216, .12); color: var(--teal); }

/* ------------------------------------------------------------------ toast */
.toast { position: absolute; left: 50%; top: 64px; z-index: 30; /* under the HUD: never over the balance digits */ max-width: calc(100% - 32px); transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 14px; background: var(--pearl); color: var(--abyss); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font-size: 14px; font-weight: 700; line-height: 1.3;
  transition: opacity .25s, transform .25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--rose); color: var(--rose-ink); }

/* ------------------------------------------------------------------ ad layer (chain progress + simulator) */
.adlayer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(1, 10, 13, .9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.chainbar { text-align: center; padding: 24px; }
.cb-kicker { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .02em; }
.cb-seg { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.cb-seg i { width: 34px; height: 5px; border-radius: 3px; background: rgba(242, 73, 106, .25); }
.cb-seg i.on { background: var(--rose); }
.cb-seg i.live { background: linear-gradient(90deg, var(--rose) 50%, rgba(242, 73, 106, .25) 50%); background-size: 200% 100%; animation: segLive 1.4s linear infinite; }
.cb-msg { margin-top: 14px; font-size: 14px; color: var(--fog); display: flex; align-items: center; gap: 8px; justify-content: center; }
.cb-msg::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(232, 241, 239, .2); border-top-color: var(--pearl); animation: spin .8s linear infinite; }
.cb-msg.done::before { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.sim { position: fixed; inset: 0; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 18px);
  background: repeating-linear-gradient(135deg, #072830 0 14px, #08303a 14px 28px); }
.sim-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sim-tag { font-weight: 700; font-size: 12px; color: var(--abyss); background: var(--fog); border-radius: 4px; padding: 3px 7px; letter-spacing: .06em; text-transform: uppercase; }
.sim-x { display: flex; align-items: center; gap: 8px; height: 36px; padding-inline: 12px 14px; border-radius: 18px; background: rgba(1, 14, 18, .55); font-size: 13px; font-weight: 600; }
.sim-x svg { width: 11px; height: 11px; stroke: var(--pearl); stroke-width: 2; }
.sim-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.sim-of { font-size: 14px; font-weight: 600; color: var(--rose); letter-spacing: .03em; }
.sim-seg { margin: 10px 0 4px; }
.sim.inter .sim-seg { display: none; }
.sim-net { margin-top: 6px; font-family: var(--display); font-weight: 800; font-size: 56px; line-height: .95; letter-spacing: .01em; }
.sim-ring { position: relative; width: 150px; height: 150px; margin-top: 28px; }
.sim-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sim-ring circle { fill: none; stroke-width: 6; }
.sr-bg { stroke: rgba(232, 241, 239, .12); }
.sr-fg { stroke: var(--pearl); stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; }
.sim-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 64px; font-variant-numeric: tabular-nums; }
.sim-hint { margin-top: 22px; font-size: 14px; color: var(--fog); }
.sim-hint.ok { color: var(--teal); font-weight: 600; }
.sim-foot { text-align: center; }
.sim-foot p { font-size: 12px; color: var(--fog); }
.sim-nofill { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--pearl); text-decoration: underline; text-underline-offset: 3px; opacity: .8; padding: 6px; }
.sim.inter .sim-of, .sim.inter .sim-nofill { display: none; }

/* ------------------------------------------------------------------ boot */
.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--abyss); transition: opacity .4s; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-in { text-align: center; padding: 24px; max-width: 320px; }
.boot-brand { justify-content: center; font-size: 34px; }
.boot p { margin-top: 14px; font-size: 14px; color: var(--fog); line-height: 1.45; min-height: 20px; }
.boot .primary-btn { margin-top: 18px; }

/* ------------------------------------------------------------------ tutorial (tutorial.js) — coach marks over the real screen.
   The veil is an SVG mask (two cut-outs for step 2); bubble/caret get physical left/top from JS (they follow
   getBoundingClientRect, already mirrored in RTL); everything inside the bubble is logical. */
.tut { position: fixed; inset: 0; z-index: 45; opacity: 0; pointer-events: none; touch-action: none; transition: opacity .34s ease; }
.tut.on { opacity: 1; pointer-events: auto; }
.tut-veil { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tut-dim { fill: rgba(1, 9, 12, .8); }
.tut-mark { transition: opacity .3s ease; }
.tut-mark.solo { opacity: 0; }
.tut-ring { fill: none; stroke: var(--pearl); stroke-opacity: .88; stroke-width: 1.5; }
.tut-glow { fill: none; stroke: var(--pearl); stroke-opacity: .13; stroke-width: 9; animation: tutGlow 2.8s ease-in-out infinite; }
@keyframes tutGlow { 50% { stroke-opacity: .04; } }
.tut-tip { position: absolute; left: 0; top: 0; width: 340px; padding: 15px 16px 14px; border-radius: 20px; color: var(--pearl); text-align: start; outline: none;
  background: linear-gradient(172deg, #0d3742 0%, #072a31 100%);
  box-shadow: inset 0 1px 0 rgba(232, 241, 239, .08), 0 24px 48px -14px rgba(0, 0, 0, .75);
  transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .3, 1); }
.tut-tip.glide { transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .3, 1), left .22s ease, top .22s ease; }
.tut-tip.out { opacity: 0; transform: translateY(6px); }
.tut-tip[data-side="below"].out { transform: translateY(-6px); }
.tut-caret { position: absolute; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 3px; transform: rotate(45deg); }
.tut-tip[data-side="above"] .tut-caret { bottom: -6px; background: #072a31; }
.tut-tip[data-side="below"] .tut-caret { top: -6px; background: #0d3742; }
.tut-kick { position: relative; display: flex; align-items: center; gap: 10px; }
.tut-count { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: .06em; color: var(--fog); font-variant-numeric: tabular-nums; }
.tut-count b { color: var(--rose); font-weight: 800; }
.tut-seg { display: flex; gap: 4px; margin-inline-start: auto; }
.tut-seg i { width: 14px; height: 4px; border-radius: 2px; background: rgba(232, 241, 239, .14); transition: width .3s ease, background-color .3s ease; }
.tut-seg i.on { background: rgba(242, 73, 106, .5); }
.tut-seg i.now { width: 24px; background: var(--rose); }
.tut-title { position: relative; margin-top: 10px; font-family: var(--display); font-weight: 800; font-size: 25px; line-height: 1; letter-spacing: .01em; }
.tut-body { position: relative; margin-top: 7px; font-size: 14px; line-height: 1.45; color: var(--fog); }
.tut-body b { color: var(--pearl); font-weight: 700; white-space: nowrap; }
.tut-acts { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tut-skip { height: 44px; min-width: 44px; padding-inline: 2px 12px; font-size: 14px; font-weight: 600; color: var(--fog); }
.tut-next { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding-inline: 18px 15px; border-radius: 20px;
  background: var(--pearl); color: var(--abyss); font-size: 15px; font-weight: 700; white-space: nowrap; transition: background-color .25s, color .25s, transform .1s; }
.tut-next svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .tut-next svg { transform: scaleX(-1); }
.tut-next.go { padding-inline: 22px; background: var(--rose); color: var(--rose-ink); }
.tut-next:active, .tut-skip:active { transform: scale(.97); }
.tut-safe { position: fixed; top: 0; left: 0; width: 0; height: 0; padding: var(--safe-top) 0 var(--safe-bottom); visibility: hidden; pointer-events: none; }
@media (max-width: 370px) { .tut-title { font-size: 23px; } .tut-body { font-size: 13.5px; } }
@media (prefers-reduced-motion: reduce) { .tut-glow { animation: none; } .tut-tip.out, .tut-tip[data-side="below"].out { transform: none; } }

/* ------------------------------------------------------------------ language sheet (langsheet.js): bottom sheet over the app */
.langsheet { position: fixed; inset: 0; z-index: 46; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: calc(var(--safe-top) + 16px) 10px calc(var(--safe-bottom) + 10px); }
.ls-scrim { position: absolute; inset: 0; background: rgba(1, 9, 12, .7); opacity: 0; transition: opacity .26s ease; }
.ls-panel { position: relative; width: 100%; max-width: 500px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; outline: none;
  padding: 16px 12px 12px; border-radius: 18px; background: rgba(5, 31, 38, .97); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(232, 241, 239, .07), 0 24px 48px -14px rgba(0, 0, 0, .75);
  opacity: 0; transform: translateY(14px); transition: opacity .2s ease, transform .28s cubic-bezier(.2, .8, .3, 1); }
.langsheet.on .ls-scrim, .langsheet.on .ls-panel { opacity: 1; }
.langsheet.on .ls-panel { transform: none; }
.ls-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline-start: 4px; margin-bottom: 12px; }
.ls-title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: .01em; }
.ls-x { margin: 0; margin-inline-end: 2px; }
.ls-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ls-opt { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; height: 46px; padding-inline: 14px 10px; border-radius: 14px;
  background: rgba(232, 241, 239, .06); color: var(--pearl); text-align: start; transition: background-color .18s, color .18s, transform .1s; }
.ls-opt:active { transform: scale(.97); }
.ls-opt:last-child:nth-child(odd) { grid-column: 1 / -1; } /* 15 languages: no orphan cell */
/* each name in the phone's own font for its script: opening the list fetches no webfont */
.ls-name { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.15;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif; font-size: 15px; font-weight: 600; letter-spacing: 0; }
/* CJK system fallbacks differ in default weight (中文 bold, 日本語 regular): pin one */
.ls-name:is(:lang(zh), :lang(ja)) { font-weight: 500; font-family: var(--cjk), system-ui, sans-serif; }
@media (max-width: 370px) { .ls-name { font-size: 14px; } .ls-opt { padding-inline: 12px 8px; } }
.ls-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.ls-mark svg { width: 13px; height: 13px; fill: none; stroke: var(--pearl); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ls-opt[aria-checked="true"] { background: var(--pearl); color: var(--abyss); }
.ls-opt[aria-checked="true"] .ls-mark { background: var(--abyss); }
@media (prefers-reduced-motion: reduce) { .ls-panel { transform: none; } }

/* ------------------------------------------------------------------ right to left (ar fa ur): <html dir="rtl"> mirrors the layout, never the
   3D tank. Signed numbers, TON amounts and the balance stay left to right, isolated: i18n.js wraps "+{p}" and
   "{v} TON" placeholders, ltr() the numbers set from code, and these rules the number-only elements. */
.ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] :is(.balance, .bal-num, .w-bal, .power, .c-power, .pow-plus, #oyAmt, .st-days span, .inv-rew, .inv-row .chip, .h-go, .ag-reward,
  #addrShort, #frLink:not(.muted), .inrow input) { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] :is(.balance, .w-bal) { justify-content: flex-end; }
[dir="rtl"] :is(#addrShort, #frLink:not(.muted), .inrow input) { text-align: right; }
[dir="rtl"] .inv-rew { text-align: left; }
[dir="rtl"] .pow-plus { right: auto; left: 100%; margin: 0 0 0 6px; }
[dir="rtl"] :is(.h-go svg, .seg i.live, .cb-seg i.live) { transform: scaleX(-1); }
/* joined scripts: letter-spacing would tear Arabic joins and the Devanagari headline */
:root:is(:lang(ar), :lang(fa), :lang(ur), :lang(hi)) body * { letter-spacing: 0 !important; }

/* ------------------------------------------------------------------ compact phones */
@media (max-width: 370px) {
  .bal-num { font-size: 29px; }
  .c-top canvas { width: 42px; }
  .c-power { font-size: 19px; }
  .c-act { font-size: 12px; }
  .collect { padding: 0 15px; }
  .cap b { font-size: 32px; }
  .cap { gap: 10px; padding: 0 12px; }
  .fr-big b { font-size: 44px; }
}

/* 320 px class phones: the ad count ("1 reklam", "2 Videos", "1 विज्ञापन") is the key fact of a card and
   tutorial step 1 points at it. It gets its own line under portrait + power instead of an ellipsis. */
@media (max-width: 340px) {
  .c-top { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 30px auto; column-gap: 4px; align-items: center; height: auto; }
  .c-meta { display: contents; }
  .c-top canvas { width: 40px; height: 30px; }
  .c-ads { grid-column: 1 / -1; margin-top: 3px; padding-inline-start: 2px; line-height: 1.2; }
}

/* Short screens (index.html sets vh-680 from the usable height). Chrome gets out of the way of content:
   slimmer top slot and tab bar, and one banner is enough on the scrolling sub tabs. */
html.vh-680 .ad-top { height: 54px; padding-top: 2px; }
html.vh-680 .tabs { height: calc(50px + var(--safe-bottom)); }
html.vh-680 .tabs button { gap: 2px; }
html.vh-680 .tabs svg { width: 20px; height: 20px; }
html.vh-680 .nav-badge { top: 4px; }
html.vh-680 .dock { padding-block: 6px; }
html.vh-680 .stage:has(.screen-sub:not([hidden])) ~ .ad-bottom { display: none; }
/* Very short (320×568, or Telegram fullscreen where its own controls take ~70 px): the bottom banner goes
   on every tab, so the tank keeps open water above the oyster. Not while typing (the keyboard shrinks
   the window, the layout must not jump). */
@media (max-height: 600px) { html:not(.kb-open) .ad-bottom { display: none; } }
html.tg-fullscreen.vh-680 .ad-bottom { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
