/* ==========================================================================
   BLOXHUNT — styles
   1. Tokens   2. Base   3. Layout   4. Header & tab bar   5. Elements
   6. Cards    7. Screens
   ========================================================================== */

/* 1. Tokens -------------------------------------------------------------- */
:root {
  --bg: #08090A;
  --surface-1: #0F1012;
  --surface-2: #15171A;
  --surface-3: #1C1F23;
  --surface-4: #272A30;
  --line: #1B1E22;
  --line-2: #2A2E34;
  --text-1: #F3F4F6;
  --text-2: #A1A7B0;
  --text-3: #666C75;
  --text-4: #3E434A;

  --accent: #CCFF4A;
  --accent-ink: #0D1203;
  --accent-dim: rgba(204, 255, 74, .10);
  --accent-line: rgba(204, 255, 74, .45);

  --lime: #CCFF4A; --gold: #FFC53D; --red: #FF4053; --blue: #3E8BFF; --violet: #9B6BFF;
  --orange: #FF8A3D; --pink: #FF5CD0; --cyan: #4DE1FF; --green: #48D597; --gray: #A1A7B0; --amber: #FFB224;

  --chroma: linear-gradient(90deg, #FF5C7A, #FFB547, #D4FF4A, #4DE1FF, #8E7BFF, #FF5CD0);

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Onest', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --app-width: 430px;
  --header-h: 64px;
  --tabbar-h: 86px;
  --gutter: 16px;
}

/* rarity colour, set via data-rarity on any element */
[data-rarity="common"]    { --r: #8C929B; }
[data-rarity="uncommon"]  { --r: #48D597; }
[data-rarity="rare"]      { --r: #3E8BFF; }
[data-rarity="legendary"] { --r: #FF4053; }
[data-rarity="godly"]     { --r: #FF52CF; }
[data-rarity="ancient"]   { --r: #FFB224; }
[data-rarity="chroma"]    { --r: #C49BFF; }

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: #050506;
  color: var(--text-1);
  font: 500 15px/1.35 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: inherit; font-size: inherit; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* utilities */
.c-lime { color: var(--lime); } .c-gold { color: var(--gold); } .c-red { color: var(--red); } .c-blue { color: var(--blue); }
.c-violet { color: var(--violet); } .c-pink { color: var(--pink); } .c-gray { color: var(--gray); }
.c-text2 { color: var(--text-2); } .c-muted { color: var(--text-3); }
.muted { color: var(--text-3); font-size: 12.5px; }
.mono { font: 500 11px/1.3 var(--font-mono); color: var(--text-3); }
.overline { display: block; font: 700 10.5px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.label { display: flex; align-items: center; gap: 6px; font: 600 13.5px/1 var(--font-body); color: var(--text-2); }
.note { margin-top: 10px; text-align: center; font-size: 11.5px; color: var(--text-3); }
.lead { color: var(--text-2); margin: 4px 0 18px; }
.center { display: flex; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(204, 255, 74, .18); flex-shrink: 0; }
.dot--sm { width: 6px; height: 6px; box-shadow: none; }

/* 3. Layout -------------------------------------------------------------- */
.app {
  position: relative;
  max-width: var(--app-width);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}
.main { display: block; }
.container { padding: 0 var(--gutter); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.page-title h1 { font: 800 26px/1 var(--font-display); letter-spacing: -.02em; }
.page-title > span:not(.mono) { margin-right: auto; font-weight: 700; color: var(--text-3); }

/* 4. Header & tab bar ---------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  background: var(--bg);
}
.header__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.game-sound__icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#game-sound { color: var(--text-2); }
#game-sound.is-muted { color: var(--accent); }
#game-sound .game-sound__cross, #game-sound.is-muted .game-sound__waves { display: none; }
#game-sound.is-muted .game-sound__cross { display: initial; }
.header__title { font: 700 17px/1 var(--font-body); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo__text { font: 800 15px/1 var(--font-display); letter-spacing: .02em; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn--sm { width: 34px; height: 34px; border-radius: 10px; }
.balance { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 13px; }
.balance__value { font: 700 15px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.balance__cur { color: var(--accent); margin-left: 3px; }
.balance__plus { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22); }
.balance__plus .icon { stroke-width: 2.6; }

.tabbar {
  position: fixed; left: 50%; bottom: 0; z-index: 30;
  width: 100%; max-width: var(--app-width);
  transform: translateX(-50%);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  display: flex;
  background: #0A0B0C; border-top: 1px solid var(--line);
}
.tabbar__item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 13px; font: 600 10.5px/1 var(--font-body); color: var(--text-3); }
.tabbar__item .glyph { color: #5E646D; }
.tabbar__item.is-active { color: var(--text-1); }
.tabbar__item.is-active .glyph { color: var(--accent); }
.tabbar__item.is-active::before { content: ''; position: absolute; top: -1px; width: 20px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar__avatar { width: 25px; height: 25px; opacity: .55; filter: grayscale(1); }
.tabbar__item.is-active .tabbar__avatar { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--accent); }
.tabbar__badge { position: absolute; top: 7px; left: 50%; margin-left: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; border: 2px solid #0A0B0C; box-sizing: content-box; background: var(--red); color: #fff; font: 800 9.5px/16px var(--font-body); text-align: center; }

/* 5. Elements ------------------------------------------------------------ */
/* glyph tiles */
.tile {
  --c: var(--lime);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--c);
  background: linear-gradient(155deg, color-mix(in srgb, var(--c) 20%, transparent), color-mix(in srgb, var(--c) 5%, transparent) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.tile .glyph { width: 52%; height: 52%; }
.tile--sm { width: 28px; height: 28px; border-radius: 8px; }
.tile--md { width: 40px; height: 40px; border-radius: 12px; }
.tile--lg { width: 44px; height: 44px; border-radius: 13px; }
.tile--xl { width: 76px; height: 76px; border-radius: 22px; }
.tile--lime { --c: var(--lime); } .tile--gold { --c: var(--gold); } .tile--red { --c: var(--red); } .tile--blue { --c: var(--blue); }
.tile--violet { --c: var(--violet); } .tile--orange { --c: var(--orange); } .tile--pink { --c: var(--pink); } .tile--cyan { --c: var(--cyan); }
.tile--green { --c: var(--green); } .tile--gray { --c: var(--gray); }

/* section heading */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-head__title { display: flex; align-items: center; gap: 10px; font: 700 18px/1 var(--font-body); letter-spacing: -.015em; }
.section-head__aside, .section-head__aside a { display: flex; align-items: center; gap: 4px; font: 500 13px/1 var(--font-body); color: var(--text-3); }

/* buttons */
.btn {
  height: 54px; padding: 0 18px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 16px/1 var(--font-body); white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn--secondary { background: var(--surface-3); color: var(--text-1); border: 1px solid var(--line-2); font-weight: 700; font-size: 15px; }
.btn--ghost { background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; height: 44px; }
.btn--locked { background: transparent; color: var(--text-3); border: 1px dashed var(--line-2); }
.btn--block { width: 100%; }
.btn--md { height: 44px; font-size: 14px; border-radius: 12px; }
.btn--sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; font-weight: 700; }
.btn--tall { height: 62px; flex-direction: column; gap: 5px; }
.btn--tall small { font: 600 13px/1 var(--font-body); opacity: .55; }
.btn:disabled { background: var(--surface-3); color: var(--text-3); box-shadow: none; cursor: default; }
.btn:active:not(:disabled) { filter: brightness(.94); }

/* badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 8px; font: 800 10px/1 var(--font-body); letter-spacing: .08em; white-space: nowrap; }
.badge--lime { background: var(--accent); color: var(--accent-ink); }
.badge--orange { background: #2B1709; color: #FF9A4A; box-shadow: inset 0 0 0 1px rgba(255, 122, 26, .5); letter-spacing: .02em; }
.badge--ice { background: #0F2531; color: #9FE2FF; box-shadow: inset 0 0 0 1px rgba(127, 216, 255, .5); }
.badge--gold { background: #2A220C; color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 197, 61, .5); }
.badge--chroma { background: var(--chroma); color: #120C1F; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; font: 700 12px/1 var(--font-body); white-space: nowrap; }
.chip--lime { background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.chip--red { background: rgba(255, 64, 83, .14); color: #FF6B7A; box-shadow: inset 0 0 0 1px rgba(255, 64, 83, .4); }
.chip--gold { background: rgba(255, 178, 36, .12); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255, 178, 36, .35); }
.chips { display: flex; gap: 6px; }
.chips--scroll { overflow-x: auto; margin: 16px calc(var(--gutter) * -1) 12px; padding: 0 var(--gutter); scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip-btn { flex: 1; height: 32px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font: 600 13px/1 var(--font-body); color: var(--text-2); }

/* filters (radio pills) */
.filter { flex-shrink: 0; cursor: pointer; }
.filter input { position: absolute; opacity: 0; pointer-events: none; }
.filter span { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font: 600 13px/1 var(--font-body); color: var(--text-2); white-space: nowrap; }
.filter b { font-weight: 600; color: var(--text-3); }
.filter input:checked + span { background: var(--text-1); border-color: var(--text-1); color: #0A0B0C; }
.filter input:checked + span b { color: #6A6E75; }
.filter--fill { flex: 1; }
.filter--fill span { width: 100%; justify-content: center; }

/* segmented control */
.seg { display: flex; gap: 6px; }
.seg__item { flex: 1; cursor: pointer; }
.seg__item input { position: absolute; opacity: 0; pointer-events: none; }
.seg__item span { display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font: 700 13px/1 var(--font-body); color: var(--text-2); }
.seg__item input:checked + span { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.seg--compact .seg__item { flex: none; }
.seg--compact { gap: 5px; }
.seg--compact .seg__item span { width: 42px; height: 34px; }
.open-form__row .label { white-space: nowrap; }
.seg--tabs { background: var(--surface-1); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg--tabs .seg__item span { height: 34px; border: 0; background: transparent; color: var(--text-3); border-radius: 10px; }
.seg--tabs .seg__item input:checked + span { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line-2); }

/* switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--surface-4); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 21px; background: var(--accent-ink); }
.switch--sm { transform: scale(.85); margin-left: auto; }

/* radio dot */
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--text-4); flex-shrink: 0; }

/* fields */
.field { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 6px 0 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.field input { flex: 1; width: 100%; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; font: 700 16px/1 var(--font-body); }
.field input::placeholder { color: var(--text-3); font-weight: 500; }
.field--search { height: 44px; margin-bottom: 10px; }
.field--search input { font-weight: 500; font-size: 15px; }
.field--focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(204, 255, 74, .08); }
.field--mono input { font: 600 13px/1 var(--font-mono); color: var(--text-2); }
.field__cur { color: var(--text-3); font-weight: 600; margin-right: auto; }
.field__mini { height: 38px; min-width: 44px; padding: 0 10px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font: 700 13px/1 var(--font-body); color: var(--text-2); }
.field__ok { display: flex; align-items: center; gap: 5px; margin-right: 8px; color: var(--accent); font: 700 12px/1 var(--font-body); }
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group .field { height: 48px; }

/* progress */
.progress { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.progress--thick { height: 8px; border-radius: 4px; }

/* media */
.avatar { border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.thumb { position: relative; width: var(--s, 44px); height: var(--s, 44px); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1px solid var(--line); background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r) 30%, transparent), transparent 72%), var(--surface-2); }
.thumb::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--r); }
.thumb[data-rarity="chroma"]::after { background: var(--chroma); }

/* lists */
.list { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.list__row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.list__row + .list__row { border-top: 1px solid var(--line); }
.list--dense .list__row { padding: 9px 14px; }
.list__body { flex: 1; min-width: 0; }
.list__title { font: 700 14px/1.2 var(--font-body); }
.list__text { margin-top: 3px; font: 500 12px/1.2 var(--font-body); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__value { font: 700 14px/1.2 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list__bet { min-width: 62px; text-align: right; font: 700 13px/1 var(--font-body); color: var(--text-2); }
.list__win { min-width: 76px; text-align: right; font: 700 13px/1.2 var(--font-body); color: var(--accent); }
.list__win small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.list__win.is-pending { color: var(--text-4); }
.list__rank { width: 22px; text-align: center; font: 700 13px/1 var(--font-body); color: var(--text-3); }
.list__end { text-align: right; font-size: 14px; }
.list__end b { display: block; }
.list--ranked { border-radius: 0 0 var(--radius-lg) var(--radius-lg); border-top: 0; }
.list__row--me { margin-top: 10px; border-radius: 16px; background: var(--accent-dim); border: 1px solid var(--accent-line); }
.list__row--me .list__rank { color: var(--accent); }
.list__row--me .list__text { color: #9FBF4A; }
.status { display: inline-block; margin-top: 4px; font: 600 11.5px/1 var(--font-body); }
.status--ok { color: var(--accent); }
.status--wait { color: var(--amber); }

/* menu */
.menu { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.menu__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font: 600 15px/1.2 var(--font-body); cursor: pointer; }
.menu__item + .menu__item { border-top: 1px solid var(--line); }
.menu__item > span:nth-child(2) { flex: 1; }
.menu__aside { display: flex; align-items: center; gap: 6px; color: var(--text-3); font: 500 13px/1 var(--font-body); }

/* 6. Cards --------------------------------------------------------------- */
.card { display: block; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; }

/* item card */
.item-card { position: relative; display: block; padding-bottom: 11px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.item-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--r); }
.item-card[data-rarity="chroma"]::after { background: var(--chroma); }
.item-card__media { height: 92px; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r) 30%, transparent), transparent 72%); }
.item-card__media img { width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .5)); }
.item-card__tag { position: absolute; top: 7px; left: 7px; padding: 4px 5px; border-radius: 5px; background: rgba(255, 255, 255, .07); font: 800 8.5px/1 var(--font-body); letter-spacing: .08em; color: var(--text-2); }
.item-card__tag--chroma { background: var(--chroma); color: #120C1F; }
.item-card__nostock { position: absolute; top: 7px; left: 7px; right: 7px; padding: 4px 6px; border-radius: 6px; background: rgba(255, 77, 79, .92); color: #fff; font: 800 9px/1.1 var(--font-body); letter-spacing: .04em; text-align: center; text-transform: uppercase; z-index: 3; }
.item-card__chance { position: absolute; top: 7px; right: 7px; padding: 4px 5px; border-radius: 5px; background: rgba(8, 9, 10, .7); font: 600 9.5px/1 var(--font-mono); color: var(--text-2); }
.item-card__check { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.item-card__check .icon { stroke-width: 3; }
.item-card__name { padding: 0 9px; font: 600 11.5px/1.2 var(--font-body); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card__price { padding: 5px 9px 0; font: 700 13px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.item-card.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* case card */
.case-card { position: relative; display: block; background: radial-gradient(120% 80% at 50% 0%, #1D1F23 0%, #131416 62%); border: 1px solid #202328; border-radius: var(--radius-xl); overflow: hidden; }
.case-card__cover { position: relative; height: 160px; display: flex; align-items: center; justify-content: center; padding-top: 4px; }
.case-card__cover img { width: 150px; height: 150px; }
.case-card__cover .badge { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); }
.case-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 15px; }
.case-card__name { min-width: 0; font: 700 16px/1.1 var(--font-body); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-card__price { font: 800 15.5px/1 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.case-card__price i { font-style: normal; color: var(--accent); margin-left: 3px; }

/* 7. Screens ------------------------------------------------------------- */
/* home: live feed */
.live__head { display: flex; align-items: center; gap: 8px; padding: 4px var(--gutter) 10px; font: 800 11px/1 var(--font-body); letter-spacing: .14em; }
.live__head .muted { letter-spacing: 0; font-size: 12px; font-weight: 500; }
.mini-tabs { margin-left: auto; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-1); border: 1px solid var(--line); }
.mini-tabs__item { padding: 5px 8px; border-radius: 6px; font: 700 11px/1 var(--font-body); letter-spacing: 0; color: var(--text-3); }
.mini-tabs__item.is-active { background: var(--surface-3); color: var(--text-1); }
.live__row { display: flex; gap: 6px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.live__row::-webkit-scrollbar { display: none; }
.live__tile { position: relative; flex: 0 0 58px; height: 66px; border-radius: 12px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r) 32%, transparent), transparent 72%), var(--surface-1); }
.live__tile::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--r); }
.live__tile[data-rarity="chroma"]::after { background: var(--chroma); }

/* home: hero */
.hero { position: relative; display: block; height: 204px; margin-top: 16px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid #2D1C40; background: radial-gradient(55% 75% at 80% 64%, rgba(255, 122, 26, .40), rgba(255, 122, 26, 0) 70%), linear-gradient(115deg, #1F102F 0%, #140A1F 50%, #0F0B12 100%); }
.hero__art { position: absolute; right: -24px; bottom: -14px; }
.hero__body { position: relative; height: 100%; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; }
.hero__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font: 600 12px/1 var(--font-body); color: #B9A9C9; }
.hero__title { font: 800 27px/1.02 var(--font-display); letter-spacing: -.02em; }
.hero__text { max-width: 170px; margin-top: 8px; font: 500 12.5px/1.35 var(--font-body); color: #B9A9C9; }
.hero .btn { margin-top: auto; }
.pager { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.pager i { width: 5px; height: 5px; border-radius: 3px; background: var(--text-4); }
.pager i.is-active { width: 16px; background: var(--accent); }

/* home: free cases */
.free-list { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.free-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 8px; }
.free-row + .free-row { border-top: 1px solid var(--line); }
.free-row__body { flex: 1; min-width: 0; }
.free-row__title { font: 700 15px/1.2 var(--font-body); }
.free-row__text { margin-top: 3px; font: 500 12px/1.3 var(--font-body); color: var(--text-2); }

/* home: modes */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mode-tile { display: flex; flex-direction: column; padding: 12px 10px 11px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 16px; }
.mode-tile .tile { margin-bottom: 12px; }
.mode-tile__name { font: 700 13px/1.1 var(--font-body); }
.mode-tile__meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; font: 600 11px/1 var(--font-body); color: var(--text-3); }

/* modes page */
.mode-card { display: block; padding-bottom: 12px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; }
.mode-card__art { height: 130px; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 60% at 50% 55%, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%); }
.mode-card--lime { --c: var(--lime); } .mode-card--red { --c: var(--red); } .mode-card--blue { --c: var(--blue); } .mode-card--violet { --c: var(--violet); }
.mode-card__body { display: flex; flex-direction: column; padding: 12px 12px 0; }
.mode-card__name { font: 700 16px/1.1 var(--font-body); }
.mode-card__text { min-height: 32px; margin: 5px 0 8px; font: 500 12px/1.35 var(--font-body); color: var(--text-2); }

/* case page */
.case-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 var(--gutter) 4px; background: radial-gradient(50% 45% at 50% 34%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.case-hero__cover { margin-top: -10px; }
.case-hero__name { margin-top: -6px; font: 800 30px/1 var(--font-display); letter-spacing: .03em; }
.case-hero__desc { margin-top: 9px; font-size: 13px; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; margin-top: 18px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 16px; }
.stats__cell { display: flex; flex-direction: column; gap: 6px; padding: 12px 13px; }
.stats__cell + .stats__cell { border-left: 1px solid var(--line); }
.stats__cell b { font: 800 16px/1 var(--font-body); white-space: nowrap; }
.stats__cell span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.open-form { margin-top: 12px; }
.open-form__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fair { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 16px; }
.fair__body { flex: 1; min-width: 0; }
.fair__title { margin-bottom: 4px; font: 700 14px/1.2 var(--font-body); }
/* Provably-fair ("Честная игра") UI removed from the app (owner's choice) — the server RNG/seeds are untouched, only the
   user-facing surface is hidden: the case-screen fair button + profile menu items (data-action=fair), the per-game
   "проверить" buttons (.mn-fair), the result-modal fair lines (.fair-line) and the fair modal/screen (#fairm/#tab-fair). */
.fair-line, .mn-fair, #fairm, #tab-fair, [data-action="fair"] { display: none !important; }

/* opening */
.open-title { margin-top: 18px; text-align: center; }
.open-title h2 { margin-top: 10px; font: 800 22px/1 var(--font-display); letter-spacing: -.01em; }
.roulette { position: relative; height: 156px; margin-top: 22px; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roulette__track { position: absolute; top: 13px; left: 50%; display: flex; gap: 8px; transform: translateX(calc(-50% + 0px)); }
.roulette__tile { position: relative; flex: 0 0 96px; height: 128px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r) 26%, transparent), transparent 72%), var(--surface-1); }
.roulette__tile::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--r); }
.roulette__tile[data-rarity="chroma"]::after { background: var(--chroma); }
.roulette__tile span { font: 600 10.5px/1 var(--font-body); color: var(--text-3); white-space: nowrap; }
.roulette__tile.is-win { border-color: color-mix(in srgb, var(--r) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--r) 35%, transparent); }
.roulette__tile.is-win span { color: var(--text-1); }
.roulette::before, .roulette::after { content: ''; position: absolute; top: 0; bottom: 0; width: 44px; z-index: 1; }
.roulette::before { left: 0; background: linear-gradient(90deg, var(--bg), rgba(8, 9, 10, 0)); }
.roulette::after { right: 0; background: linear-gradient(270deg, var(--bg), rgba(8, 9, 10, 0)); }
.roulette__marker { position: absolute; z-index: 2; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); }
.roulette__marker::before, .roulette__marker::after { content: ''; position: absolute; left: -7px; border-left: 8px solid transparent; border-right: 8px solid transparent; }
.roulette__marker::before { top: 0; border-top: 10px solid var(--accent); }
.roulette__marker::after { bottom: 0; border-bottom: 10px solid var(--accent); }
.progress-row { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; }

/* drop */
.app--fullscreen { padding-bottom: 0; }
.drop { min-height: 100vh; display: flex; flex-direction: column; padding: 0 var(--gutter) 26px; background: radial-gradient(48% 30% at 50% 36%, color-mix(in srgb, var(--r) 34%, transparent), transparent 70%), var(--bg); }
.drop__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.drop__body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 30px; }
.rarity-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 8px; font: 800 10px/1 var(--font-body); letter-spacing: .12em; color: var(--r); background: color-mix(in srgb, var(--r) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 45%, transparent); }
.drop__item { margin-top: 20px; width: 236px; height: 236px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); }
.drop__name { margin-top: 14px; font: 800 27px/1.05 var(--font-display); letter-spacing: -.02em; }
.drop__meta { margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.drop__value { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.drop__value b { font: 800 26px/1 var(--font-body); }
.drop__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.drop__actions .grid-2 .btn { height: 50px; }

/* upgrade */
.upgrade__top { display: flex; align-items: center; justify-content: space-between; }
.gauge { position: relative; width: 260px; height: 260px; margin: 6px auto 0; }
.gauge__svg { width: 100%; height: 100%; }
.gauge__ticks path { stroke: #2A2E34; stroke-width: 1.6; }
.gauge__ticks path.is-on { stroke: rgba(204, 255, 74, .75); }
.gauge__track { fill: none; stroke: #16181B; stroke-width: 20; }
.gauge__arc { fill: none; stroke: var(--accent); stroke-width: 20; stroke-linecap: round; }
.gauge__core { fill: #0B0C0D; stroke: #1B1E22; }
.gauge__pointer { fill: #fff; }
.gauge__value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge__value b { font: 800 44px/1 var(--font-display); letter-spacing: -.03em; }
.gauge__value small { font-size: 24px; color: var(--text-2); }
.gauge__value span { margin-top: 8px; font: 600 12px/1 var(--font-body); color: var(--text-3); }
.slots { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.slot { position: relative; display: flex; flex-direction: column; padding: 11px 12px 12px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--line); overflow: hidden; }
.slot::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--r); }
.slot[data-rarity="chroma"]::after { background: var(--chroma); }
.slot--target { border-color: var(--accent-line); }
.slot--target .overline { color: var(--accent); }
.slot__media { display: flex; justify-content: center; margin: 4px 0; background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r) 26%, transparent), transparent 72%); }
.slot__media img { width: 76px; height: 76px; }
.slot__name { font: 600 12.5px/1.2 var(--font-body); color: var(--text-2); }
.slot__price { margin-top: 5px; font: 800 15px/1 var(--font-body); }
.slots__arrow { position: absolute; left: 50%; top: 50%; z-index: 1; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.range { display: block; margin: 18px 0 16px; }
.range__head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.range__head b { font: 700 13px/1 var(--font-body); }
.range input { width: 100%; accent-color: var(--accent); }
.range__scale { display: flex; justify-content: space-between; margin-top: 6px; }
.upgrade .seg { margin: 8px 0 14px; }

/* mines */
.mines-head { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8px; }
.mines-head__chips { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.big-mult { margin-top: 10px; font: 800 46px/1 var(--font-display); letter-spacing: -.03em; color: var(--accent); }
.rail { display: flex; gap: 6px; margin: 16px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.rail__step { flex: 0 0 auto; height: 30px; padding: 0 10px; display: flex; align-items: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font: 700 12px/1 var(--font-body); color: var(--text-3); }
.rail__step.is-done { background: var(--surface-1); color: var(--text-2); }
.rail__step.is-current { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.mines-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 14px; padding: 10px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 20px; }
.mines-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 13px; color: #2E3238; background: linear-gradient(180deg, #1C1F23, #15171A); border: 1px solid #24282D; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 -3px 0 rgba(0, 0, 0, .4); }
.mines-cell.is-coin { background: radial-gradient(60% 60% at 50% 45%, rgba(255, 178, 36, .26), rgba(255, 178, 36, .05)); border-color: rgba(255, 178, 36, .45); box-shadow: none; }
.mines-cell.is-knife { background: radial-gradient(60% 60% at 50% 45%, rgba(255, 64, 83, .3), rgba(255, 64, 83, .06)); border-color: rgba(255, 64, 83, .55); box-shadow: none; color: var(--red); }
.bet { display: flex; flex-direction: column; gap: 9px; margin: 12px 0; }
.bet .seg { margin-top: 0; }
.bet__head { display: flex; justify-content: space-between; }

/* flip */
.coin-stage { height: 262px; display: flex; align-items: center; justify-content: center; margin-top: 4px; background: radial-gradient(45% 50% at 50% 50%, rgba(255, 64, 83, .22), transparent 70%); }
.flip-history-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.flip-history { display: flex; gap: 5px; }
.flip-history__dot { width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.flip-history__dot--murder { background: rgba(255, 64, 83, .16); color: var(--red); }
.flip-history__dot--sheriff { background: rgba(62, 139, 255, .16); color: var(--blue); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 12px; }
.side { cursor: pointer; }
.side input { position: absolute; opacity: 0; pointer-events: none; }
.side__body { position: relative; display: flex; flex-direction: column; padding: 14px; border-radius: 18px; background: var(--surface-1); border: 1px solid var(--line); }
.side__body .tile { margin-bottom: 14px; }
.side__body b { font: 800 17px/1 var(--font-display); }
.side__body small { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.side__check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); display: none; align-items: center; justify-content: center; }
.side input:checked + .side__body .side__check { display: flex; }
.side--murder input:checked + .side__body { border-color: rgba(255, 64, 83, .65); background: linear-gradient(180deg, rgba(255, 64, 83, .18), rgba(255, 64, 83, .02)); }
.side--sheriff input:checked + .side__body { border-color: rgba(62, 139, 255, .65); background: linear-gradient(180deg, rgba(62, 139, 255, .18), rgba(62, 139, 255, .02)); }

/* rocket */
.crash-history { display: flex; gap: 6px; margin: 4px calc(var(--gutter) * -1) 12px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.crash-chip { flex-shrink: 0; height: 26px; padding: 0 9px; display: flex; align-items: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font: 700 12px/1 var(--font-body); }
.crash { position: relative; height: 270px; margin-bottom: 12px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(70% 70% at 80% 20%, rgba(204, 255, 74, .10), rgba(204, 255, 74, 0) 70%), var(--surface-1); }
.crash__chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash__value { position: absolute; left: 18px; top: 18px; }
.crash__value b { display: block; font: 800 52px/1 var(--font-display); letter-spacing: -.04em; }
.crash__value > span { display: flex; align-items: center; gap: 7px; margin-top: 10px; font: 700 12.5px/1 var(--font-body); color: var(--accent); }
.grid-2 + .btn--tall { margin-top: 12px; }

/* inventory */
.inv-summary { position: relative; overflow: hidden; padding: 16px; border-radius: 20px; border: 1px solid #232A12; background: linear-gradient(140deg, #14170D 0%, #0F1012 60%); }
.inv-summary__art { position: absolute; right: -30px; top: -34px; opacity: .9; }
.inv-summary__value { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.inv-summary__value b { font: 800 32px/1 var(--font-body); letter-spacing: -.02em; }
.inv-summary__delta { display: block; margin: 8px 0 16px; font: 700 12.5px/1 var(--font-body); color: var(--accent); }
.selection-bar { position: fixed; z-index: 25; left: 50%; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); width: calc(100% - 24px); max-width: calc(var(--app-width) - 24px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 18px; background: #1A1D21; border: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.selection-bar > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.selection-bar > div b { font: 700 14px/1 var(--font-body); }
.selection-bar > div span { font: 600 12.5px/1 var(--font-body); color: var(--text-2); }
.selection-bar .btn { height: 40px; }

/* bottom sheets (deposit, withdraw) */
.app--sheet { padding-bottom: 0; background: #030304; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(3, 3, 4, .74); }
.sheet { position: fixed; z-index: 10; left: 50%; bottom: 0; width: 100%; max-width: var(--app-width); max-height: 92vh; overflow-y: auto; transform: translateX(-50%); padding: 10px var(--gutter) calc(30px + env(safe-area-inset-bottom)); background: #101113; border-top: 1px solid var(--line-2); border-radius: 26px 26px 0 0; scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
.sheet__grab { display: block; width: 40px; height: 4px; margin: 0 auto 16px; border-radius: 2px; background: var(--surface-4); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet__head h2 { font: 800 21px/1 var(--font-display); letter-spacing: -.02em; }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.withdraw-items { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.withdraw-items__body { flex: 1; display: flex; flex-direction: column; gap: 5px; margin-left: 4px; }
.withdraw-items__body span { font-size: 12px; color: var(--text-3); }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps li { position: relative; display: flex; flex-direction: column; gap: 3px; padding-left: 38px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-2); font: 800 12px/24px var(--font-display); text-align: center; color: var(--accent); }
.steps b { font: 700 14px/1.2 var(--font-body); }
.steps span { font-size: 12.5px; color: var(--text-3); }

/* deposit */
.bonus-strip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-dim); border: 1px dashed var(--accent-line); font: 700 13px/1 var(--font-body); color: var(--accent); }
.amount { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px 12px; padding: 16px 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--accent-line); }
.amount .overline { grid-column: 1 / -1; }
.amount__input { display: flex; align-items: baseline; gap: 6px; font: 800 38px/1 var(--font-body); }
.amount__input input { width: 100%; background: transparent; border: 0; outline: 0; font: inherit; letter-spacing: -.03em; }
.amount__input span { font-size: 26px; color: var(--text-3); }
.amount__bonus { text-align: right; font: 700 13px/1 var(--font-body); color: var(--accent); }
.amount__bonus small { display: block; margin-top: 4px; font-weight: 500; font-size: 12px; color: var(--text-3); }
.methods { display: flex; flex-direction: column; gap: 6px; }
.method { cursor: pointer; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method__body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.method__text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.method__text b { font: 700 14px/1.2 var(--font-body); }
.method__text span { font-size: 12px; color: var(--text-3); }
.method input:checked + .method__body { border-color: var(--accent-line); background: linear-gradient(90deg, rgba(204, 255, 74, .07), rgba(204, 255, 74, .02)); }
.method input:checked + .method__body .radio { border: 7px solid var(--accent); }

/* profile */
.profile { display: flex; align-items: center; gap: 14px; margin-top: 6px; padding: 16px; }
.profile__avatar { position: relative; }
.profile__level { position: absolute; right: -6px; bottom: -6px; height: 22px; padding: 0 6px; border-radius: 7px; border: 2px solid var(--surface-1); background: var(--accent); color: var(--accent-ink); font: 800 10px/18px var(--font-display); }
.profile__name { font: 800 20px/1 var(--font-display); letter-spacing: -.02em; }
.profile__id { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; color: var(--text-3); }
.xp__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.xp__head > span:first-child { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.xp .muted { margin-top: 9px; }
.stat { display: flex; flex-direction: column; padding: 12px 12px 13px; }
.stat .tile { margin-bottom: 12px; }
.stat b { font: 800 16px/1 var(--font-body); white-space: nowrap; }
.stat span { margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.best { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--r) 10%, transparent), transparent 60%), var(--surface-1); }
.best__body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.best__body b { font: 700 15px/1 var(--font-body); }
.best__body span:last-child { font-size: 12px; color: var(--text-3); }
.referral { padding: 16px; border-radius: 18px; border: 1px solid rgba(204, 255, 74, .22); background: linear-gradient(135deg, rgba(204, 255, 74, .14), rgba(204, 255, 74, .02) 60%), var(--surface-1); }
.referral__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.referral__head b { display: block; font: 800 16px/1.2 var(--font-body); }
.referral__head span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.referral .field { height: 46px; }
.referral__stats { display: flex; gap: 18px; margin-top: 12px; font: 600 12.5px/1 var(--font-body); color: var(--text-2); }
.referral__stats b { color: var(--text-1); }
.referral__stats b.c-lime { color: var(--accent); }
.footer-links { margin-top: 8px; text-align: center; font-size: 11.5px; color: var(--text-3); }

/* top */
.prize { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(255, 197, 61, .25); background: linear-gradient(100deg, rgba(255, 197, 61, .16), rgba(255, 197, 61, .02) 70%), var(--surface-1); }
.prize__body { flex: 1; }
.prize__body .overline { color: #C9A04A; }
.prize__body b { display: block; margin-top: 6px; font: 800 22px/1 var(--font-body); color: var(--gold); }
.prize__timer { text-align: right; font-size: 11px; color: var(--text-3); }
.prize__timer b { display: block; margin-top: 4px; font-size: 14px; color: var(--text-1); }
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; align-items: end; gap: 8px; margin-top: 22px; }
.podium__place { --m: #D9DDE4; display: flex; flex-direction: column; align-items: center; }
.podium__place--gold { --m: #FFC53D; } .podium__place--silver { --m: #D9DDE4; } .podium__place--bronze { --m: #D98A4A; }
.podium__crown { margin-bottom: 4px; }
.podium__avatar { position: relative; padding: 3px; border-radius: 50%; background: var(--m); box-shadow: 0 0 18px color-mix(in srgb, var(--m) 35%, transparent); margin-bottom: 8px; }
.podium__rank { position: absolute; left: 50%; bottom: -8px; width: 22px; height: 22px; margin-left: -11px; border-radius: 7px; border: 2px solid var(--bg); background: var(--m); color: #0A0B0C; font: 800 11px/18px var(--font-display); text-align: center; }
.podium__name { margin-top: 6px; font: 700 13.5px/1.2 var(--font-body); }
.podium__value { margin-top: 4px; font: 700 12.5px/1 var(--font-body); color: var(--text-2); }
.podium__block { width: 100%; margin-top: 12px; padding-top: 12px; display: flex; justify-content: center; border-radius: 14px 14px 0 0; border: 1px solid color-mix(in srgb, var(--m) 25%, transparent); border-bottom: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--m) 20%, transparent), color-mix(in srgb, var(--m) 2%, transparent)); color: var(--m); font: 800 12px/1 var(--font-body); }
.podium__place--gold .podium__block { height: 136px; }
.podium__place--silver .podium__block { height: 104px; }
.podium__place--bronze .podium__block { height: 84px; }
/* Weekly prize shown on a place: a small skin chip. Display only — nothing is credited automatically. */
.top-prize { display: inline-flex; align-items: center; gap: 5px; max-width: 150px; margin-top: 5px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--m, #FFC53D) 14%, transparent); border: 1px solid color-mix(in srgb, var(--m, #FFC53D) 28%, transparent); font: 800 10px/1.1 var(--font-body); letter-spacing: .02em; }
.top-prize img { width: 16px; height: 16px; object-fit: contain; flex: none; }
.top-prize span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__row .top-prize { margin-top: 4px; }

/* tasks */
.streak__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.streak__head b { display: block; font: 700 15px/1.2 var(--font-body); }
.streak__head span { display: block; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.streak__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 12px; }
.day { height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font: 700 11px/1 var(--font-body); }
.day small { font: 600 9.5px/1 var(--font-body); color: var(--text-3); }
.day--done { background: var(--surface-1); color: var(--text-3); }
.day--now { border-color: var(--accent); background: linear-gradient(180deg, rgba(204, 255, 74, .14), rgba(204, 255, 74, .03)); box-shadow: inset 0 0 0 1px var(--accent); }
.day--case { padding-top: 2px; border-color: rgba(155, 107, 255, .35); background: linear-gradient(180deg, rgba(155, 107, 255, .18), rgba(155, 107, 255, .03)); }
.day--case small { color: #B590FF; }
.task { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.task + .task { border-top: 1px solid var(--line); }
.task__body { flex: 1; min-width: 0; }
.task__body b { display: block; font: 700 14px/1.2 var(--font-body); }
.task.is-done .task__body b { color: var(--text-3); }
.task__body .muted { display: block; margin-top: 4px; }
.task__progress { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.task__done { display: flex; align-items: center; gap: 4px; font: 700 12.5px/1 var(--font-body); color: var(--accent); }
.reward { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); font: 800 12.5px/1 var(--font-body); white-space: nowrap; }
.promo { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px; }
.promo .field { flex: 1; height: 46px; border: 0; }



/* ==========================================================================
   BLOXHUNT app glue — the single-page shell, the old class names the client still renders, and token aliases for the
   retained blocks below (they were written against the previous theme's variables).
   ========================================================================== */
:root {
  --card: var(--surface-1); --card-2: var(--surface-2); --muted: var(--text-3); --text: var(--text-1); --danger: var(--red);
  --btn: var(--accent); --btn-text: var(--accent-ink); --accent-text: var(--accent-ink); --accent-soft: var(--accent-dim); --accent-glow: rgba(204, 255, 74, .35);
  --col: var(--app-width); --nav-h: var(--tabbar-h);
  --gem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h12l4 6-10 12L2 9z M2 9h20 M9 3L7 9l5 12 5-12-2-6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html, body { height: 100%; }
body { overflow-x: hidden; }
.hidden { display: none !important; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.app { min-height: 100vh; }
.main { padding-bottom: 8px; }
button { font-family: inherit; color: inherit; }

/* header: logo on the root tabs, back + title on every other screen */
.header__back { display: none; }
.header.is-sub .header__back { display: flex; }
.header.is-sub .logo { display: none; }
.header .icon-btn { cursor: pointer; }
.balance { cursor: pointer; }
.balance__value { white-space: nowrap; }

/* tab bar: buttons, not links */
.tabbar__item { background: none; border: 0; cursor: pointer; }
.tabbar__item.active { color: var(--text-1); }
.tabbar__item.active .glyph { color: var(--accent); }
.tabbar__item.active::before { content: ''; position: absolute; top: -1px; width: 20px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar__item.active .tabbar__avatar { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--accent); }
.tabbar__avatar { border-radius: 50%; object-fit: cover; }
.tabbar__ava { position: relative; width: 25px; height: 25px; border-radius: 50%; overflow: hidden; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font: 700 11px/1 var(--font-body); color: var(--text-2); opacity: .55; filter: grayscale(1); }
.tabbar__item.active .tabbar__ava { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--accent); }
.tabbar__ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* rarity → --r on any element the client tags with the old rarity-* classes */
.rarity-common { --r: #8C929B; } .rarity-uncommon { --r: #48D597; } .rarity-rare { --r: #3E8BFF; } .rarity-epic { --r: #9B6BFF; }
.rarity-legendary { --r: #FF4053; } .rarity-mythic { --r: #FFC53D; } .rarity-godly { --r: #FF52CF; } .rarity-ancient { --r: #FFB224; }
.rarity-chroma { --r: #C49BFF; } .rarity-unique { --r: #FFC53D; } .rarity-coin { --r: var(--accent); } .rarity-promo { --r: #FF5CD0; }
span[class*="rarity-"], .row-name[class*="rarity-"], .drop-name[class*="rarity-"], .up-item-name[class*="rarity-"], .confirm-name[class*="rarity-"] { color: var(--r); }
.rarity-chroma.text, span.rarity-chroma { background: var(--chroma); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cur { color: var(--accent); margin-left: 2px; font-weight: 700; }
.section-title { display: block; font: 700 10.5px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 18px 0 10px; }
.section-title.mn-lbl { margin: 0; }
.empty { padding: 30px 14px; text-align: center; color: var(--text-3); font-size: 13.5px; line-height: 1.4; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; text-align: center; }
.empty-ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-3); margin-bottom: 4px; }
.empty-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-ico.ok { color: var(--accent); background: var(--accent-dim); }
.empty-title { font: 700 16px/1.2 var(--font-body); }
.empty-sub { font-size: 13px; color: var(--text-3); line-height: 1.4; }
.empty-btn { margin-top: 8px; }

/* buttons the client still emits by the old names */
.btn-primary { height: 54px; width: 100%; padding: 0 18px; border-radius: 15px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 16px/1 var(--font-body); white-space: nowrap; background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .5); cursor: pointer; }
.btn-primary:disabled { background: var(--surface-3); color: var(--text-3); box-shadow: none; cursor: default; }
.btn-primary:active:not(:disabled) { filter: brightness(.94); }
.btn-primary.topup { background: var(--gold); }
.btn-primary.skip { background: var(--surface-3); color: var(--text-1); box-shadow: none; }
.btn-primary.dng { background: var(--red); color: #fff; }
.btn-secondary { height: 54px; width: 100%; padding: 0 18px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 15px/1 var(--font-body); white-space: nowrap; background: var(--surface-3); color: var(--text-1); border: 1px solid var(--line-2); cursor: pointer; }
.btn-secondary:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 8px; }

/* old list rows (fair rounds, referral friends, flip history) in the design's list look */
.list .row, .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.list .row + .row { border-top: 1px solid var(--line); }
.row-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.row-left > div { min-width: 0; }
.row-name { font: 700 14px/1.2 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { margin-top: 3px; font: 500 12px/1.2 var(--font-body); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-val { font: 700 14px/1.2 var(--font-body); white-space: nowrap; }
.row-price { font-weight: 700; color: var(--text-1); }
.hist-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.hist-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hist-ico.win { color: var(--accent); background: var(--accent-dim); }
.hist-ico.lose { color: #FF6B7A; background: rgba(255, 64, 83, .14); }
.hist-ico.img img { width: 30px; height: 30px; object-fit: contain; }
.hist-delta { font: 700 14px/1.2 var(--font-body); white-space: nowrap; }
.hist-delta.plus { color: var(--accent); }
.hist-delta.minus { color: var(--text-2); }
.fair-ok { font: 600 12.5px/1 var(--font-body); color: var(--accent); white-space: nowrap; }
.ref-row-sub.done { color: var(--accent); }
.ref-row-sub.pending { color: var(--amber); }

/* avatars: the letter is a FALLBACK behind the picture. The picture gets an opaque backing (same as the circle) so a
   transparent avatar — e.g. a headless Roblox head, whose thumbnail is empty where the head would be — shows the dark
   circle, never the letter bleeding through. The letter only appears when there is no image or it fails to load. */
.avatar { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-1); flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.avatar.xs { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--surface-3); }
.avatar .ava-letter { position: relative; }

/* item pictures the client renders in lists, slots and the drop screen */
.item-ico { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r, var(--text-3)) 30%, transparent), transparent 72%), var(--surface-2); border: 1px solid var(--line); }
.item-ico img { width: 30px; height: 30px; object-fit: contain; }
.item-ico:not(.img)::after { content: ''; width: 20px; height: 20px; background: var(--r, var(--text-3)); -webkit-mask: var(--gem) center/contain no-repeat; mask: var(--gem) center/contain no-repeat; }
.item-ico.lg { width: 96px; height: 96px; border-radius: 24px; }
.item-ico.lg img { width: 72px; height: 72px; }

/* case screen */
.case-hero__cover { width: 220px; height: 220px; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .5)); }
.case-hero.free { --accent: #CCFF4A; }
.case-hero.promo { --accent: #FF5CD0; }
.open-form .switch input:checked + span { background: var(--gold); }
.promo-entry { display: flex; gap: 8px; margin-top: 10px; }
.promo-entry .field { flex: 1; }
.promo-entry .btn { flex: none; }
.roulette__track { left: 0; transform: none; top: 13px; }
.roulette__tile img { width: 70px; height: 70px; object-fit: contain; }
.roulette__tile .ico { width: 56px; height: 56px; margin: 7px 0; border-radius: 16px; background: color-mix(in srgb, var(--r) 22%, transparent); display: flex; align-items: center; justify-content: center; }
.roulette__tile .ico::after { content: ''; width: 26px; height: 26px; background: var(--r); -webkit-mask: var(--gem) center/contain no-repeat; mask: var(--gem) center/contain no-repeat; }
.item-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.item-card__media img { object-fit: contain; }
.item-card__media .ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--r) 22%, transparent); }
.item-card__media .ico::after { content: ''; width: 26px; height: 26px; background: var(--r); -webkit-mask: var(--gem) center/contain no-repeat; mask: var(--gem) center/contain no-repeat; }
.item-card__price .cur { color: var(--accent); }
.item-card.is-selected .item-card__chance { display: none; }
.item-card[data-rarity="coin"] .item-card__media { background: radial-gradient(60% 52% at 50% 42%, rgba(204, 255, 74, .25), transparent 72%); }
.fair { cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; background: none; }
.case-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.case-card__cover img { object-fit: contain; }
.case-card__cover .case-ico { width: 110px; height: 110px; border-radius: 28px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.case-card__cover .case-ico svg { width: 44px; height: 44px; }
.free-row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
.free-row img { width: 64px; height: 64px; object-fit: contain; }
.free-row .btn { flex: none; }
.mode-tile, .mode-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.mode-tile.off, .mode-card.off { opacity: .5; }
.hero { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.hero__art { width: 196px; height: 196px; object-fit: contain; }

/* drop screen as an overlay */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(3, 3, 4, .74); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.modal-card { width: 100%; max-width: 340px; background: var(--surface-1); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; animation: pop .22s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font: 700 10.5px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.drop-name { font: 800 22px/1.1 var(--font-display); letter-spacing: -.02em; }
.drop-rarity { font: 800 10px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.drop-value { color: var(--text-2); font-size: 14px; display: flex; justify-content: center; align-items: center; gap: 4px; }
.modal-card .item-ico.lg { margin: 4px auto; }
.modal.drop-modal { padding: 0; align-items: stretch; background: var(--bg); }
.modal.drop-modal .drop { width: 100%; max-width: var(--app-width); margin: 0 auto; animation: pop .25s cubic-bezier(.2, .9, .3, 1.15); }
.drop__item { object-fit: contain; }
.drop__big { width: 236px; height: 236px; margin-top: 20px; border-radius: 48px; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 52% at 50% 42%, color-mix(in srgb, var(--r) 30%, transparent), transparent 72%); }
.drop__big img { width: 200px; height: 200px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); }
.drop__big.gem::after { content: ''; width: 110px; height: 110px; background: var(--r); -webkit-mask: var(--gem) center/contain no-repeat; mask: var(--gem) center/contain no-repeat; }
.drop__name.rarity-chroma { background: var(--chroma); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fair-line { margin-top: 10px; font: 600 12.5px/1 var(--font-body); color: var(--text-3); cursor: pointer; text-decoration: underline dotted; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: calc(var(--app-width) - 32px); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 50; background: #1A1D21; border: 1px solid var(--line-2); color: var(--text-1); padding: 12px 14px; border-radius: 13px; font: 600 14px/1.3 var(--font-body); text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }

/* bottom-sheet picker (the design's .sheet is a page; the picker is an overlay with head / body / foot) */
.sheet-wrap { position: fixed; inset: 0; z-index: 45; }
.sheet-wrap .sheet-backdrop { position: absolute; inset: 0; background: rgba(3, 3, 4, .74); backdrop-filter: blur(3px); }
.sheet-wrap .sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: var(--app-width); max-height: 80vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; background: #101113; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); animation: sheetUp .25s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheetUp { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-4); margin: 10px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 16px 10px; flex: none; }
.sheet-title { flex: 1; font: 800 19px/1 var(--font-display); letter-spacing: -.02em; }
.sheet-close { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #101113; flex: none; }
.sheet .empty { padding: 32px 0; }
.picker-search-row { padding: 0 16px 10px; flex: none; }
.picker-search { width: 100%; height: 40px; padding: 0 14px; border-radius: 12px; background: #16181b; border: 1px solid var(--line-2); color: var(--text-1); font: 500 14px/1 var(--font-body); }
.picker-search::placeholder { color: var(--text-3); }
.picker-search:focus { outline: none; border-color: var(--accent, #c6ff3d); }
.up-sort { height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--text-2); font: 600 13px/1 var(--font-body); white-space: nowrap; }
.up-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.up-grid .empty, .up-grid .empty-state { grid-column: 1 / -1; }
.cf-pick-title { margin: 6px 0 8px; }
.ask-card { text-align: center; }
.ask-text { white-space: pre-line; line-height: 1.45; color: var(--text-2); font-size: 14px; }
.ask-input { height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-1); font: 700 15px/1 var(--font-body); width: 100%; }

/* upgrade screen (the wheel is retained below; slots, range and segments come from the design) */
.upgrade { display: flex; flex-direction: column; gap: 10px; }
.up-fast { background: var(--surface-2); color: var(--text-3); }
.up-fast.on { color: var(--gold); border-color: rgba(255, 197, 61, .5); background: rgba(255, 197, 61, .12); }
.wheel { position: relative; width: 236px; aspect-ratio: 1 / 1; align-self: center; --arc: var(--accent); margin: 2px auto 0; }
.up-slot { cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; --rc: var(--text-3); }
.up-slot:disabled { opacity: .5; cursor: default; }
.up-slot .up-slot-ico { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; }
.up-slot .up-slot-ico svg { width: 26px; height: 26px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; }
.up-slot .up-slot-ico img { width: 72px; height: 72px; object-fit: contain; }
.up-slot.filled .up-slot-ico svg { display: none; }
.up-slot.filled .up-slot-ico:not(.img)::after { content: ''; width: 34px; height: 34px; background: var(--rc); -webkit-mask: var(--gem) center/contain no-repeat; mask: var(--gem) center/contain no-repeat; }
.up-slot.filled { border-color: color-mix(in srgb, var(--rc) 60%, transparent); }
.up-slot.filled::after { background: var(--rc); }
.up-slot.filled.chroma::after { background: var(--chroma); }
.up-slot-name:empty::before { content: '—'; color: var(--text-3); }
.up-slot-val:empty { display: none; }
.up-slider.off { opacity: .4; pointer-events: none; }
.up-hint.warn { color: var(--amber); }
.up-diff .pay { color: var(--accent); }
.up-extra:empty { display: none; }
.up-summary { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.up-summary:empty { display: none; }
.up-summary b { color: var(--text-1); }
.up-summary .pay { color: var(--accent); }
.seg__btn { flex: 1; display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font: 700 13px/1 var(--font-body); color: var(--text-2); cursor: pointer; }
.seg__btn.on { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.seg__btn:disabled { opacity: .45; cursor: default; }
.up-go.busy { opacity: .7; }

/* mines (design board; the old shake/bump animations) */
.mines-cell { cursor: pointer; }
.mines-cell:disabled { cursor: default; }
.mines-cell .icon { width: 20px; height: 20px; }
.mines-cell.is-coin img { width: 42px; height: 42px; }
.mines-cell.is-coin.dim, .mines-cell.is-knife.dim { opacity: .55; }
.mines-cell.is-knife.hit { animation: mn-bump .3s ease-out; box-shadow: 0 0 18px rgba(255, 64, 83, .55); }
.mines-board.shake { animation: mn-shake .4s; }
@keyframes mn-shake { 0%, 100% { transform: none; } 10%, 50%, 90% { transform: translateX(-6px); } 30%, 70% { transform: translateX(6px); } }
@keyframes mn-bump { 0% { transform: scale(1.2); } 100% { transform: scale(1); } }
.big-mult.bump { animation: mn-bump .3s ease-out; }
.big-mult.lost { color: var(--red); }
.big-mult.won { color: var(--accent); }
.mn-sub { display: block; margin-top: 8px; font: 600 13px/1.3 var(--font-body); color: var(--text-2); }
.mn-sub.lost { color: #FF6B7A; }
.mn-sub.won { color: var(--accent); }
.field--bet .bet-value { flex: 1; font: 700 16px/1 var(--font-body); }
.field--bet .bet-value.items { font-size: 13px; }
.field__mini:disabled { opacity: .45; }
.items-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--text-2); font: 600 13px/1 var(--font-body); }
.items-btn.has { border-style: solid; border-color: var(--accent-line); background: var(--accent-dim); color: var(--accent); }
.items-btn:disabled { opacity: .5; }
.items-btn .mn-items-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.items-btn .icon { flex: none; }
.range input[type=range] { height: 28px; margin: 0; }
.range.off { opacity: .4; pointer-events: none; }
.mn-fair { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 36px; margin-top: 4px; background: transparent; border: 0; color: var(--text-3); font: 600 12.5px/1 var(--font-body); }
.mn-fair .icon { width: 14px; height: 14px; }

/* crash (design card; the canvas scene is retained below) */
.crash { height: 270px; }
.crash__scene { position: absolute; inset: 0; }
.crash__scene canvas { width: 100%; height: 100%; display: block; }
.crash.burst { animation: mn-shake .4s; }
.crash__value { pointer-events: none; }
.crash__value b.lost { color: var(--red); }
.crash__value > span.won { color: var(--accent); }
.crash__value > span.lost { color: #FF6B7A; }
.crash__value > span.plain { color: var(--text-2); }
.crash__phase { position: absolute; right: 16px; top: 16px; }
.cr-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin: -4px 0 12px; }
.cr-bar-fill { height: 100%; width: 0; background: var(--accent); }
.crash-chip.c-red { color: #FF6B7A; }
.crash-chip.c-lime { color: var(--accent); }
.crash-chip.c-gold { color: var(--gold); }
.field .switch { margin-left: auto; }
.list__win.is-lost { color: #FF6B7A; }
.list__row.me { background: var(--accent-dim); }
.cr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(204, 255, 74, .6); animation: cr-pulse 1s ease-in-out infinite; display: inline-block; }
@keyframes cr-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.cr-players .section-head { margin-top: 20px; }
.cr-auto .switch { flex: none; }

/* inventory */
.inv-summary__art { width: 150px; height: 150px; object-fit: contain; }
.inv-grid .item-card .item-card__chance { display: none; }
.inv-sell { position: absolute; top: 7px; right: 7px; height: 24px; padding: 0 8px; border-radius: 7px; background: rgba(8, 9, 10, .75); color: var(--accent); font: 800 10.5px/1 var(--font-body); }
.inv-wd { position: absolute; top: 7px; left: 7px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--gold, #ffc53d); color: #241a00; font: 800 10.5px/1 var(--font-body); z-index: 2; }
.inv-wd svg { width: 12px; height: 12px; }
.wd-pick-head { display: flex; align-items: center; justify-content: space-between; }
.wd-pick-all { background: none; border: 0; padding: 2px 4px; cursor: pointer; color: var(--accent); font: 800 11px/1 var(--font-body); }
/* inventory cells: the skin, then its actions as real buttons underneath */
.inv-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inv-cell { display: flex; flex-direction: column; }
.inv-cell .item-card { cursor: default; }
.inv-cell__acts { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.inv-cell__acts .btn { width: 100%; height: 40px; padding: 0 8px; gap: 6px; }
.inv-cell__acts .btn svg { flex: none; }
.inv-head { display: flex; align-items: center; justify-content: space-between; }

/* profile & referral & settings */
.profile__id { background: none; border: 0; padding: 0; cursor: pointer; }
.stat b .cur { font-size: 14px; }
.menu__item { width: 100%; text-align: left; background: none; border: 0; color: inherit; }
.menu__item .menu__aside { margin-left: auto; }
.menu__item.hidden { display: none !important; }
.referral .field input { font: 600 12.5px/1 var(--font-mono); color: var(--text-2); }
.seg--lang .seg__btn { height: 34px; }
.version { margin-top: 8px; text-align: center; font-size: 11.5px; color: var(--text-3); }
.lang-row { justify-content: space-between; }
.lang-row .seg { width: 120px; }

/* fair screen */
.fair-card { display: flex; flex-direction: column; gap: 10px; }
.fair-head { font: 700 15px/1.2 var(--font-body); }
.fair-note { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.fair-row { display: flex; align-items: center; gap: 8px; }
.fair-k { flex: none; width: 118px; font: 600 11.5px/1.3 var(--font-body); color: var(--text-3); }
.fair-v { flex: 1; min-width: 0; font: 500 11.5px/1.3 var(--font-mono); color: var(--text-2); word-break: break-all; }
.fair-copy { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; }
.fair-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fair-btn { height: 44px; font-size: 14px; }
.fair-how { margin-top: 10px; }
.fair-how summary { cursor: pointer; font: 700 14px/1.2 var(--font-body); padding: 10px 0; }
.fair-how ol { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; list-style: decimal; }
.fairm-card { max-width: 360px; text-align: left; }
.fairm-sub { font-size: 13px; color: var(--text-2); }

/* roblox */
.rbx-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.rbx-card { display: flex; flex-direction: column; gap: 10px; }
.rbx-who { display: flex; align-items: center; gap: 12px; }
.rbx-code { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--accent-line); font: 600 13px/1.4 var(--font-mono); color: var(--accent); word-break: break-word; }
.rbx-note { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.p-name { font: 800 17px/1.2 var(--font-display); }
.p-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.p-sub.ok { color: var(--accent); }
.adm-input.nick { height: 48px; }

/* tasks */
.task .btn { flex: none; }
.task-btn { height: 36px; padding: 0 14px; border-radius: 11px; font: 700 13.5px/1 var(--font-body); background: var(--surface-3); color: var(--text-1); border: 1px solid var(--line-2); flex: none; }
.task-btn.ready { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.task-btn.done, .task-btn:disabled { background: transparent; color: var(--text-3); border: 1px dashed var(--line-2); }
.task .reward { flex: none; }

/* top-up screen */
.tp-view { display: flex; flex-direction: column; gap: 12px; }
.dep-bot { display: flex; align-items: center; gap: 14px; }
.dep-bot .avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.dep-bot-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.dep-bot-name { font: 800 17px/1.1 var(--font-body); color: var(--text-1); text-decoration: none; }
a.dep-bot-name { color: var(--accent); }
.dep-bot-go { align-self: stretch; }
.tp-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: var(--surface-3); flex: none; }
.tp-head { display: flex; align-items: center; gap: 12px; }
.tp-status { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--accent-line); text-align: center; }
.tp-wait { font: 700 14px/1.2 var(--font-body); color: var(--accent); }
.tp-status small { font-size: 12px; color: var(--text-3); }
.tp-actions { display: flex; gap: 8px; }
.tp-actions .btn { flex: 1; }
.tp-conv { font: 600 12.5px/1 var(--font-mono); color: var(--text-3); text-align: right; min-height: 14px; }

/* admin panel: keep its own look, align the surfaces */
.adm-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-tabs button { flex: 1 1 auto; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font: 700 12px/1 var(--font-body); }
.adm-tabs button.on { background: var(--surface-3); color: var(--text-1); border-color: var(--line-2); }
.adm-body { margin-top: 12px; }


/* ======================= retained from the previous stylesheet ======================= */

/* ----- ADMIN ----- */
/* ADMIN */
.menu-ico.adm { color: #FFC53D; border-color: rgba(255,197,61,.4); background: rgba(255,197,61,.1); }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; height: auto; margin-bottom: 12px; overflow: visible; }
.adm-tabs button { flex: 1 1 auto; padding: 8px 10px; font-size: 12px; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-body { display: flex; flex-direction: column; gap: 10px; }
.adm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adm-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.adm-stat b { display: block; font-size: 20px; font-weight: 800; }
.adm-stat span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.adm-stat.good b { color: var(--accent); } .adm-stat.bad b { color: var(--danger); }
.adm-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.adm-input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; background: #0E1116; border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: 14px; box-sizing: border-box; }
textarea.adm-input { height: 90px; padding: 10px 12px; resize: vertical; }
.adm-row { display: flex; gap: 8px; align-items: center; }
.adm-row .adm-input { flex: 1; }
.adm-btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; }
.adm-btn.pri { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.adm-btn.dng { background: rgba(255,77,79,.12); color: #FF8A8C; border-color: rgba(255,77,79,.4); }
.adm-btn:disabled { opacity: .5; }
.adm-user { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.adm-user.banned { border-color: rgba(255,77,79,.4); }
.adm-user .n { font-weight: 700; font-size: 14px; } .adm-user .s { color: var(--muted); font-size: 12px; }
.adm-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.adm-kv:last-child { border-bottom: 0; }
.adm-kv .k { color: var(--muted); }
.adm-log { font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.adm-log b { color: var(--text); }
.adm-toggle { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-toggle:last-child { border-bottom: 0; }
.adm-inv { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.adm-inv:last-child { border-bottom: 0; }
.adm-inv .x { color: #FF8A8C; background: transparent; border: 0; font: inherit; font-weight: 700; }

.menu-ico.rbx, .ref-ico.rbx { color: #F2F4F7; background: #1B1F26; border: 1px solid var(--line-2); box-shadow: none; }
.menu-ico.rbx svg, .ref-ico.rbx svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.rbx-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rbx-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.rbx-who { display: flex; align-items: center; gap: 12px; }
.rbx-who .avatar { width: 52px; height: 52px; font-size: 20px; }
.p-sub.ok { color: var(--accent); }
.rbx-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; font-weight: 700; line-height: 1.5; letter-spacing: .02em;
  background: #0E1116; border: 1px dashed rgba(34,229,132,.5); border-radius: 12px; padding: 12px 14px; text-align: center; user-select: all; -webkit-user-select: all;
}
.rbx-note { color: var(--muted); font-size: 12px; text-align: center; }


/* ----- ADMIN: RTP ----- */
/* admin: RTP */
.rtp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rtp-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; text-align: right; padding: 6px 4px; }
.rtp-table td { text-align: right; padding: 7px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rtp-table td.k, .rtp-table th:first-child { text-align: left; color: var(--muted); }
.rtp-table td small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.rtp-table td.ok { color: var(--accent); } .rtp-table td.hot { color: var(--danger); } .rtp-table td.cold { color: #5AA9FF; } .rtp-table td.mute { color: var(--muted); }
.rtp-note { font-size: 12px; color: var(--muted); line-height: 1.4; padding: 4px 0 8px; }
.rtp-note.bad { color: var(--danger); }
.rtp-case { border-top: 1px solid var(--line); padding: 6px 0; }
.rtp-case summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 13px; list-style: none; }
.rtp-case summary::-webkit-details-marker { display: none; }
.rtp-case summary b.bad { color: var(--danger); }
.rtp-item { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0 0 8px; color: var(--muted); }
.rtp-item b { color: var(--text); }

.fair-line { font-size: 11px; color: var(--muted); margin: 6px 0 2px; cursor: pointer; font-variant-numeric: tabular-nums; }


/* ----- ADMIN: tasks ----- */
.adm-task .adm-row > span { color: var(--muted); }


/* ----- ADMIN: MM2 prices ----- */
/* admin: MM2 prices */
.price-table td.k { color: var(--text); text-align: left; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-table tr[data-adm] { cursor: pointer; }
.price-table td small { color: var(--accent); }
.pdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3A404B; margin-right: 7px; vertical-align: middle; }
.pdot.on { background: var(--accent); }
.price-run { flex: 1; font-size: 12px; color: var(--muted); line-height: 1.35; }
.price-run.bad { color: #FF8A8C; }
.price-edit td { text-align: left; }
.price-edit .adm-row { margin: 4px 0; }


/* ----- PROVABLY FAIR (modal + checks) ----- */
/* provably fair */
.menu-ico.fair { color: var(--accent); }
.fair-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fair-head { font-weight: 800; font-size: 14px; }
.fair-note { font-size: 13px; color: #C7CDD6; line-height: 1.5; }
.fair-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k copy" "v copy"; column-gap: 8px; align-items: center; padding: 8px 10px; background: #0E1116; border: 1px solid var(--line-2); border-radius: 10px; }
.fair-k { grid-area: k; font-size: 11px; color: #9AA3B2; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.fair-v { grid-area: v; font-size: 13px; color: #F2F4F7; word-break: break-all; line-height: 1.4; }
.fair-copy { grid-area: copy; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card-2); color: #C7CDD6; display: inline-flex; align-items: center; justify-content: center; }
.fair-copy:active { color: var(--accent); }
.fair-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fair-btn { margin-top: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.fair-how { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.fair-how summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
.fair-how summary::-webkit-details-marker { display: none; }
.fair-how summary::after { content: '+'; color: var(--muted); }
.fair-how[open] summary::after { content: '−'; }
.fair-how ol { margin: 10px 0 2px; padding-left: 18px; color: #C7CDD6; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.fair-how li { padding-left: 2px; }
.fair-rnd { cursor: pointer; }
.fair-rnd .row-name { font-size: 13px; }
.fair-ok { color: var(--accent); font-weight: 700; font-size: 12px; white-space: nowrap; }
#fairm { z-index: 15; } /* opens on top of the result/lose modals (z 10), under the toast (z 20) */
.fairm-card { text-align: left; max-height: 86vh; overflow: auto; }
.fairm-card .drop-name { text-align: center; }
.fairm-sub { text-align: center; color: #C7CDD6; font-size: 13px; margin: -4px 0 10px; }
#fairm-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.fair-checks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.fair-check { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.fair-check .m { width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.fair-check.ok .m { background: var(--accent-soft); color: var(--accent); }
.fair-check.bad .m { background: rgba(255,77,79,.15); color: var(--danger); }
.fair-check.info .m { background: var(--card-2); color: var(--muted); }
.fair-verdict { text-align: center; font-weight: 800; padding: 8px; border-radius: 10px; }
.fair-verdict.ok { background: var(--accent-soft); color: var(--accent); }
.fair-verdict.bad { background: rgba(255,77,79,.15); color: var(--danger); }


/* ----- UPGRADE WHEEL ----- */
/* Wheel */
.wheel { position: relative; width: min(236px, 60vw); aspect-ratio: 1 / 1; align-self: center; --arc: var(--accent); }
.wheel-glow {
  position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--arc) 24%, transparent) 0%, color-mix(in srgb, var(--arc) 6%, transparent) 45%, transparent 68%);
  transition: background .3s;
}
.wheel-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(180deg); } /* the arc starts at the bottom (6 o'clock) and grows clockwise */
.wheel-ticks { fill: none; stroke: #3A414D; stroke-width: 6; stroke-dasharray: 1.5 13.37; }
.wheel-track { fill: none; stroke: var(--card-2); stroke-width: 18; }
.wheel-arc { fill: none; stroke: var(--arc); stroke-width: 18; transition: stroke-dasharray .25s, stroke .25s; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--arc) 65%, transparent)); }
.wheel-arc-hi { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 2; transition: stroke-dasharray .25s; }
.wheel-inner { fill: none; stroke: var(--line); stroke-width: 1; }
.wheel-dots { fill: none; stroke: #39404C; stroke-width: 2; stroke-dasharray: 1 7; }
.wheel-spin { position: absolute; inset: 0; transform: rotate(calc(var(--a, 0deg) + 180deg)); } /* +180: the needle rests at the bottom, where the arc starts */
.wheel-spin.spin { /* rotation is driven by the Web Animations API in app.js; this class only shows the trail */ }
.wheel-trail {
  position: absolute; inset: 7%; border-radius: 50%; opacity: 0; transition: opacity .4s;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 250deg, rgba(255,255,255,.55) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 18px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 18px));
}
.wheel-spin.spin .wheel-trail { opacity: 1; }
/* idle: nothing selected yet -> no needle, no arc, no glow; calm hint in the centre */
.wheel.idle .wheel-spin, .wheel.idle .wheel-arc, .wheel.idle .wheel-arc-hi, .wheel.idle .wheel-glow,
.wheel.idle .wheel-ico, .wheel.idle .wheel-pct, .wheel.idle .wheel-badge { display: none; }
.wheel-hint { display: none; color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; max-width: 60%; line-height: 1.3; }
.wheel.idle .wheel-hint { display: block; }
.wheel.idle .wheel-ticks { stroke: #2A3038; }
.wheel-needle {
  position: absolute; top: 4%; left: 50%; width: 6px; height: 12%; margin-left: -3px; border-radius: 3px;
  background: #fff; box-shadow: 0 0 14px 3px rgba(255,255,255,.75);
}
.wheel-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; pointer-events: none; }
.wheel-ico {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--arc) 14%, transparent); box-shadow: 0 0 28px color-mix(in srgb, var(--arc) 35%, transparent);
}
.wheel-ico::after { content: ""; width: 28px; height: 28px; background: var(--arc); -webkit-mask: var(--gem) center/contain no-repeat; mask: var(--gem) center/contain no-repeat; }
.wheel-pct { font-size: 42px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.wheel-badge {
  height: 22px; padding: 0 8px; display: flex; align-items: center; gap: 6px; border-radius: 8px;
  background: color-mix(in srgb, var(--arc) 12%, transparent); color: var(--arc); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
}
.wheel-badge:empty { display: none; }
.wheel.win .wheel-arc { filter: drop-shadow(0 0 16px var(--arc)); }
.wheel.lose .wheel-arc { opacity: .3; }


/* ----- COINFLIP ----- */
/* COINFLIP */
@keyframes cf-me { 0% { transform: rotateY(0); } 100% { transform: rotateY(2160deg); } }
@keyframes cf-op { 0% { transform: rotateY(0); } 100% { transform: rotateY(2340deg); } }
@keyframes cf-float { 0%,100% { transform: translateY(0) rotateY(-18deg); } 50% { transform: translateY(-6px) rotateY(18deg); } }
@keyframes cf-toss { 0%,100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-34px) scale(1.18); } }
@keyframes cf-in { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }
@keyframes cf-win { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.cf-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cf-h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.cf-create { height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 800; font-family: inherit; }
.cf-create:disabled { background: var(--card-2); color: var(--muted); }
.cf-info { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.4; color: #C8CED6; margin-bottom: 12px; }
.cf-info svg { flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cf-info b { color: var(--text); }
.cf-rooms { display: flex; flex-direction: column; gap: 10px; }
.room { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; animation: cf-in .35s ease-out backwards; }
.room.mine { border-color: rgba(34,229,132,.4); }
.room-top { display: flex; align-items: center; gap: 12px; }
.room-ava { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.room-ava svg, .cf-ava svg { fill: none; stroke: #8FB6FF; stroke-width: 1.8; stroke-linejoin: round; width: 20px; height: 20px; }
.room.mine .room-ava { border-color: var(--accent); background: var(--accent-soft); }
.room.mine .room-ava svg { stroke: var(--accent); }
.room-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.room-name { font-size: 14px; font-weight: 700; }
.room-range { font-size: 12px; color: var(--muted); font-weight: 500; }
.room-sum { font-size: 19px; font-weight: 800; }
.room-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-items { display: flex; align-items: center; gap: 6px; }
.room-it { width: 36px; height: 36px; border-radius: 10px; background: #191D24; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.room-it .item-ico { width: 24px; height: 24px; background: transparent; border: 0; }
.room-it .item-ico::after { width: 18px; height: 18px; }
.room-more { font-size: 12px; color: var(--muted); font-weight: 600; }
.join { height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--accent); background: rgba(34,229,132,.1); color: var(--accent); font-size: 14px; font-weight: 700; font-family: inherit; }
.join:disabled { border-color: var(--line); background: #191D24; color: var(--muted); }
.join.cancel { border-color: rgba(255,77,79,.5); background: rgba(255,77,79,.1); color: #FF8A8C; }
.cf-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 14px; }
.cf-sides { display: flex; align-items: center; justify-content: space-between; }
.cf-side { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: opacity .3s, transform .3s; }
.cf-side.win { animation: cf-win .5s ease-out; }
.cf-side.lose { opacity: .35; }
.cf-ava { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cf-ava svg { width: 26px; height: 26px; }
.cf-ava.cube, .room-ava.cube { border: 2px solid #4B8BFF; background: rgba(75,139,255,.12); }
.cf-ava.cube svg, .room-ava.cube svg { stroke: #8FB6FF; }
.cf-ava.gem, .room-ava.gem { border: 2px solid var(--accent); background: rgba(34,229,132,.12); }
.cf-ava.gem svg, .room-ava.gem svg { stroke: var(--accent); }
.cf-side-pct.gem { color: var(--accent); }
.cf-side-pct.cube { color: #8FB6FF; }
.cf-bar.gem-left { background: #4B8BFF; }
.cf-bar.gem-left .cf-bar-op { background: var(--accent); }
/* side picker in the create sheet */
.cf-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 12px; }
.cf-pick button {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; border-radius: 14px; font-family: inherit;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 700; text-align: left;
}
.cf-pick button.on.gem { border-color: var(--accent); background: rgba(34,229,132,.08); }
.cf-pick button.on.cube { border-color: #4B8BFF; background: rgba(75,139,255,.1); }
.cf-pick .mini { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; }
.cf-pick .mini svg { width: 18px; height: 18px; fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.cf-pick .mini.gem { background: radial-gradient(circle at 35% 30%, #5BF2A8, #12B866); border: 3px solid #0E8F4F; }
.cf-pick .mini.gem svg { stroke: #06130C; }
.cf-pick .mini.cube { background: radial-gradient(circle at 35% 30%, #8FB6FF, #3A73E8); border: 3px solid #2A56B5; }
.cf-pick .mini.cube svg { stroke: #061022; }
.cf-pick-title { margin: 0 0 8px 2px; }
#picker-extra:empty { display: none; }

/* Reference-matched Mini App navigation, mode tiles and item picker. */
.tabbar {
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 0 5px env(safe-area-inset-bottom);
  background: rgba(9, 10, 11, .96);
  border-top-color: #24272b;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.tabbar__item {
  gap: 5px;
  padding-top: 10px;
  font-size: 10px;
  transition: color .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.tabbar__item::before {
  width: 21px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(204,255,74,.62);
  transform: scaleX(.4);
  opacity: 0;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
}
.tabbar__item.active::before { transform: scaleX(1); opacity: 1; }
.tabbar__item .glyph, .tabbar__ava {
  transition: color .22s ease, opacity .22s ease, filter .22s ease, box-shadow .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.tabbar__item.active .glyph, .tabbar__item.active .tabbar__ava { transform: translateY(-1px) scale(1.08); }
.tabbar__item:active { transform: scale(.93); }
.tabbar__item { isolation: isolate; }
.tabbar__item::after { content: ''; position: absolute; z-index: -1; top: 5px; width: 54px; height: 36px; border-radius: 13px; background: transparent; transform: scale(.72); opacity: 0; transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .2s ease, background .2s ease; }
.tabbar__item.active::after { background: linear-gradient(145deg, rgba(204,255,74,.16), rgba(204,255,74,.035)); box-shadow: inset 0 0 0 1px rgba(204,255,74,.2), 0 4px 18px rgba(204,255,74,.08); transform: scale(1); opacity: 1; }
.tabbar__item.active .glyph { filter: drop-shadow(0 0 7px rgba(204,255,74,.55)); }

.mode-tile {
  --mode-tone: var(--lime);
  position: relative;
  min-height: 112px;
  padding: 11px 9px 10px;
  overflow: hidden;
  border-radius: 19px;
  border-color: color-mix(in srgb, var(--mode-tone) 16%, #23262a);
  background: linear-gradient(155deg, color-mix(in srgb, var(--mode-tone) 5%, #141517), #0e0f11 72%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 5px 16px rgba(0,0,0,.18);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.mode-tile[data-mode="crash"] { --mode-tone: var(--violet); }
.mode-tile[data-mode="flip"] { --mode-tone: var(--blue); }
.mode-tile[data-mode="mines"] { --mode-tone: var(--red); }
.mode-tile .tile {
  width: 48px;
  height: 48px;
  margin-bottom: 11px;
  border-radius: 15px;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--mode-tone) 27%, #202124), color-mix(in srgb, var(--mode-tone) 9%, #111214) 72%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mode-tone) 56%, transparent), inset 0 1px 0 rgba(255,255,255,.13), 0 5px 18px color-mix(in srgb, var(--mode-tone) 15%, transparent);
  animation: modeIconFloat 3.2s ease-in-out infinite;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
}
.mode-tile:nth-child(2) .tile { animation-delay: .25s; }
.mode-tile:nth-child(3) .tile { animation-delay: .5s; }
.mode-tile:nth-child(4) .tile { animation-delay: .75s; }
.mode-tile .tile .glyph { width: 23px; height: 23px; }
.mode-tile__name { font-size: 12.5px; white-space: nowrap; text-shadow: 0 1px 8px rgba(255,255,255,.08); }
.mode-tile .dot { background: #caff49; box-shadow: 0 0 9px rgba(204,255,74,.42); }
.mode-tile__meta { color: #858a91; font-size: 10.5px; }
.mode-tile:active { transform: translateY(-3px) scale(.95); border-color: color-mix(in srgb, var(--mode-tone) 68%, transparent); box-shadow: 0 8px 26px color-mix(in srgb, var(--mode-tone) 22%, transparent); }

.mode-tile.off { --mode-tone: var(--text-3); }
@keyframes modeIconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes modeSweep { from { transform: translateX(-55%); opacity: 0; } 35% { opacity: 1; } to { transform: translateX(55%); opacity: 0; } }

.sheet-wrap .sheet-backdrop { animation: pickerFade .2s ease-out both; }
.sheet-wrap .sheet {
  max-height: calc(var(--tg-viewport-stable-height, 100vh) * .84);
  border: 1px solid #303338;
  border-bottom: 0;
  background: linear-gradient(155deg, rgba(21,22,24,.99), rgba(13,14,16,.99));
  box-shadow: 0 -24px 80px rgba(0,0,0,.76), 0 -1px 0 rgba(255,255,255,.07) inset;
  animation: sheetUp .34s cubic-bezier(.18,.82,.22,1) both;
}
.sheet-grip { width: 40px; height: 4px; margin-bottom: 14px; background: #373a40; }
.sheet-head { gap: 9px; padding: 4px 16px 14px; }
.sheet-title { font: 800 17px/1.15 var(--font-body); letter-spacing: 0; }
.up-sort { height: 40px; border-radius: 12px; background: #17191c; border-color: #2b2e33; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.up-sort:active { transform: scale(.96); border-color: var(--accent-line); background: var(--accent-dim); }
.sheet-close { width: 40px; height: 40px; border-radius: 12px; background: #17191c; transition: background .18s ease, color .18s ease, transform .18s ease; }
.sheet-close:active { transform: scale(.92); background: var(--surface-4); color: var(--text-1); }
.sheet-body { overscroll-behavior: contain; padding-top: 0; }
.sheet-foot { background: rgba(15,16,18,.98); border-top-color: #292c30; }
.up-grid { gap: 9px; }
.up-grid .item-card {
  border-radius: 15px;
  background: linear-gradient(160deg, #17191c, #111214 76%);
  transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
  animation: pickerItemIn .3s cubic-bezier(.2,.8,.2,1) both;
}
.up-grid .item-card:nth-child(3n + 2) { animation-delay: 35ms; }
.up-grid .item-card:nth-child(3n) { animation-delay: 70ms; }
.up-grid .item-card:active { transform: scale(.96); }
.up-grid .item-card.is-selected { border-color: var(--accent); background: linear-gradient(155deg, rgba(204,255,74,.12), rgba(17,18,20,.98) 74%); box-shadow: inset 0 0 0 1px rgba(204,255,74,.3), 0 0 20px rgba(204,255,74,.08); }
.up-grid .item-card.is-selected .item-card__name { color: var(--text-1); }
.cf-pick-title { margin: 0 0 9px 2px; color: #858a91; }
.cf-pick { gap: 9px; margin: 0 0 15px; }
.cf-pick button {
  position: relative;
  min-width: 0;
  height: 58px;
  padding: 0 11px;
  border-radius: 15px;
  background: #17191c;
  border-color: #272a2f;
  font-size: 13px;
  transition: transform .18s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.cf-pick button:active { transform: scale(.97); }
.cf-pick button.on { box-shadow: 0 0 22px rgba(204,255,74,.08), inset 0 0 0 1px rgba(255,255,255,.025); }
.cf-pick button.on.gem { border-color: var(--accent); background: linear-gradient(100deg, rgba(204,255,74,.14), rgba(204,255,74,.035)); }
.cf-pick button.on.cube { border-color: #4b8bff; background: linear-gradient(100deg, rgba(75,139,255,.16), rgba(75,139,255,.035)); box-shadow: 0 0 22px rgba(75,139,255,.09); }
.cf-pick .mini { width: 38px; height: 38px; box-shadow: 0 4px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.cf-pick button.on .mini { transform: scale(1.06) rotate(-4deg); }
@keyframes pickerFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pickerItemIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pickerSelect { 45% { transform: scale(1.035); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .tabbar__item, .tabbar__item::before, .tabbar__item .glyph, .tabbar__ava,
  .mode-tile, .mode-tile .tile, .sheet-wrap .sheet, .sheet-wrap .sheet-backdrop,
  .up-grid .item-card, .cf-pick button { animation: none !important; transition: none !important; }
  .mode-tile .tile { animation: none !important; }
}
.cf-side-name { font-size: 12px; font-weight: 600; color: #C8CED6; margin-top: 4px; max-width: 104px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-side-sum { font-size: 15px; font-weight: 700; }
.cf-side-pct { font-size: 28px; line-height: 1; font-weight: 800; }
.cf-side-pct.op { color: #8FB6FF; }
.cf-side-pct.me { color: var(--accent); }
.coinbox { width: 120px; height: 120px; perspective: 600px; flex: none; }
.coinbox.toss { animation: cf-toss 3.2s cubic-bezier(.3,.1,.3,1); }
.cf-coin { position: relative; width: 120px; height: 120px; transform-style: preserve-3d; animation: cf-float 3s ease-in-out infinite; }
.cf-coin.spin-me { animation: cf-me 3.2s cubic-bezier(.15,.6,.15,1) forwards; }
.cf-coin.spin-op { animation: cf-op 3.2s cubic-bezier(.15,.6,.15,1) forwards; }
.face { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face svg { width: 52px; height: 52px; fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.face-me { background: radial-gradient(circle at 35% 30%, #5BF2A8, #12B866); border: 6px solid #0E8F4F; box-shadow: 0 0 32px rgba(34,229,132,.45), inset 0 0 0 3px rgba(255,255,255,.25); }
.face-me svg { stroke: #06130C; }
.face-op { background: radial-gradient(circle at 35% 30%, #8FB6FF, #3A73E8); border: 6px solid #2A56B5; box-shadow: 0 0 32px rgba(75,139,255,.45), inset 0 0 0 3px rgba(255,255,255,.25); transform: rotateY(180deg); }
.face-op svg { stroke: #061022; }
.cf-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--accent); }
.cf-bar-op { background: #4B8BFF; border-right: 2px solid var(--card); transition: width .25s ease-out; }
.cf-head { font-size: 17px; font-weight: 800; text-align: center; min-height: 22px; }
.cf-head.win { color: var(--accent); animation: cf-win .5s ease-out; }
.cf-head.lose { color: #FF8A8C; }
.cf-range { display: flex; flex-direction: column; gap: 8px; background: #0E1116; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cf-range-head { display: flex; justify-content: space-between; align-items: baseline; }
.cf-stat { font-size: 13px; font-weight: 700; color: var(--muted); }
.cf-stat.ok { color: var(--accent); }
.cf-stat.bad { color: #FF8A8C; }
.cf-track { position: relative; height: 14px; margin-top: 6px; border-radius: 7px; background: #1B1F26; }
.cf-track-ok { position: absolute; top: 0; bottom: 0; left: 25%; width: 50%; background: rgba(34,229,132,.22); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); box-sizing: border-box; }
.cf-mark { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.7); transition: left .25s ease-out; }
.cf-track-labels { display: flex; justify-content: space-between; padding: 0 calc(25% - 36px); font-size: 12px; font-weight: 600; color: #C8CED6; }
.cf-track-labels span { width: 72px; text-align: center; }
#cf-inv { margin: 8px 0 14px; }
.cf-wait-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cf-wait-actions.hidden { display: none; }
.mn-cta.bot { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--card-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.mn-cta.bot:disabled { opacity: .5; }
.cf-ava.wait { border: 2px dashed var(--line-2); background: var(--card-2); color: var(--muted); font-weight: 800; font-size: 20px; }
.cf-head.wait { color: var(--muted); }
.cf-head.wait::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; animation: cf-blink 1s infinite; }
@keyframes cf-blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.cf-range.hidden { display: none; }
.room-actions { display: flex; gap: 6px; }
.join.watch { padding: 0 12px; display: flex; align-items: center; gap: 6px; }
.join.watch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#cf-cta { width: 100%; }
#cf-fair { width: 100%; justify-content: center; margin-top: 8px; }
.cf-recent-title { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .cf-coin, .coinbox.toss, .room, .cf-side.win, .cf-head.win { animation: none; } }


/* ----- CRASH SCENE ----- */
/* ---------- crash ("Ракетка") ---------- */
.cr-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.cr-bar.hidden { display: none; }
.cr-bar-fill { height: 100%; width: 0; background: var(--accent); }
.cr-sky { position: relative; height: 210px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0B0E13; }
.cr-sky canvas { width: 100%; height: 100%; display: block; }
.cr-sky.burst { animation: mn-shake .4s; }
.cr-last { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-height: 26px; }
.cr-last::-webkit-scrollbar { display: none; }
.cr-chip { flex: none; height: 26px; padding: 0 9px; border-radius: 8px; display: flex; align-items: center; font-size: 12px; font-weight: 700; background: rgba(255,77,79,.12); color: #FF8A8C; }
.cr-chip.mid { background: rgba(34,229,132,.12); color: var(--accent); }
.cr-chip.big { background: rgba(255,197,61,.14); color: #FFC53D; }
.cr-players { display: flex; flex-direction: column; gap: 6px; }
.cr-board-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 2px 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cr-board-head b { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); }
.cr-board-list { display: flex; flex-direction: column; gap: 6px; }
.cr-board-empty { font-size: 12px; color: var(--muted); padding: 4px 2px 2px; }
.cr-p { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.04); }
.cr-p.won { background: rgba(34,229,132,.10); border-color: rgba(34,229,132,.28); }
.cr-p.lost { background: rgba(255,77,79,.09); border-color: rgba(255,77,79,.22); }
.cr-p.lost .avatar, .cr-p.lost .cr-p-text { opacity: .7; }
.cr-p.me { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(34,229,132,.35); }
.avatar.xs { width: 30px; height: 30px; font-size: 13px; flex: 0 0 auto; }
.cr-p-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.cr-p-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-p-stake { font-size: 11px; color: var(--muted); }
.cr-p-res { flex: none; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.cr-p.won .cr-p-res { color: var(--accent); }
.cr-p.lost .cr-p-res { color: #FF8A8C; }
.cr-p.live .cr-p-res { color: var(--muted); }
.cr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(34,229,132,.6); animation: cr-pulse 1s ease-in-out infinite; }
@keyframes cr-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.cr-p-more { font-size: 12px; color: var(--muted); text-align: center; padding: 2px; }
@media (prefers-reduced-motion: reduce) { .cr-dot { animation: none; } }
.cr-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.cr-opt-text { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.cr-opt-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.cr-auto-box { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 4px; transition: opacity .15s; }
.cr-auto-box.off { opacity: .35; pointer-events: none; }
.cr-auto-input { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; background: #0E1116; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; }
.cr-auto-input:focus { outline: none; border-color: var(--accent); }
.mn-pm.cr-on { background: rgba(34,229,132,.12); border-color: var(--accent); color: var(--accent); }
.mn-cta.take { background: #FFC53D; color: #141414; box-shadow: 0 8px 28px rgba(255,197,61,.28); }
@media (prefers-reduced-motion: reduce) { .cr-sky.burst { animation: none; } }


/* ---- pass 2 glue ---- */
.section-head__link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.filter.on > span { background: var(--text-1); border-color: var(--text-1); color: #0A0B0C; }
.filter.on > span b { color: #6A6E75; }
.tp-balance { align-items: flex-start; }
.referral__stats { align-items: center; }
.drop__actions .grid-2.solo { grid-template-columns: 1fr; }
.referral__head .tile { display: flex; margin-top: 0; }

/* ---- restored from the previous stylesheet: the upgrade LOSE dialog, the admin promo tab, the admin price table ---- */
.lose-ico { width: 56px; height: 56px; border-radius: 16px; margin: 4px auto 2px; background: rgba(255, 64, 83, .12); border: 1px solid rgba(255, 64, 83, .35); color: var(--red); display: flex; align-items: center; justify-content: center; }
.lose-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.lose-amount { color: var(--red); font: 800 20px/1.2 var(--font-body); display: flex; justify-content: center; align-items: center; margin-bottom: 4px; }
.lose-card .btn { margin-top: 4px; }
.promo-code { font-family: var(--font-mono); font-weight: 800; letter-spacing: .08em; font-size: 15px; }
.promo-sum { display: flex; flex-direction: column; gap: 4px; cursor: pointer; list-style: none; }
.promo-sum::-webkit-details-marker { display: none; }
.promo-sum > span:first-child { display: flex; align-items: center; gap: 8px; }
.promo-meta { font-size: 12px; color: var(--muted); line-height: 1.4; }
.promo-hint { display: block; font-size: 11px; color: var(--muted); }
.promo-form { margin-top: 8px; }
.promo-actions { flex-wrap: wrap; gap: 6px; }
.promo-uses:not(:empty) { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.price-ico { display: inline-block; width: 26px; height: 26px; border-radius: 6px; vertical-align: middle; margin-right: 6px; background: var(--surface-3); object-fit: contain; }
.price-table { table-layout: fixed; }
.price-table td.k, .price-table th:first-child { width: 44%; max-width: none; }
.adm-card { overflow-x: auto; min-width: 0; }
.adm-body { min-width: 0; }
/* ---- admin panel on the new design: toggles as kit switches, buttons that wrap, rows that wrap when cramped ---- */
input.switch { appearance: none; -webkit-appearance: none; position: relative; width: 44px; height: 26px; flex-shrink: 0; border-radius: 13px; background: var(--surface-4); cursor: pointer; margin: 0; border: 0; outline: 0; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { left: 21px; background: var(--accent-ink); }
input.switch:disabled { opacity: .4; }
.adm-btn { height: auto; min-height: 40px; padding: 8px 14px; line-height: 1.2; white-space: normal; }
.adm-row { flex-wrap: wrap; }
.adm-row > select.adm-input { min-width: 150px; }
.adm-row > .adm-input { min-width: 0; }
#tab-case .roulette { margin-top: 6px; }
#tab-case .open-form { margin-top: 16px; }

/* ---- phones: the primary action of a game screen floats above the tab bar while the rest scrolls ---- */
.btn--float { position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); z-index: 6; box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
#tab-case .open-form { position: sticky; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); z-index: 6; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
#wheel, #tab-mines .mines-head { scroll-margin-top: calc(var(--header-h) + 10px); }
.range input[type=range] { touch-action: none; }
@media (max-width: 400px) {
  .case-hero__cover { width: 200px; height: 200px; }
  .wheel { width: min(236px, 54vw); }
}
#mn-steps, #tab-case .roulette { scroll-margin-top: calc(var(--header-h) + 10px); }
/* ---- the drop screen on a short window (Telegram Desktop at its default size, small phones): compact, and it scrolls if it still does not fit ---- */
.modal.drop-modal { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal.drop-modal .drop { min-height: 100%; }
@media (max-height: 720px) {
  .drop__body { padding-top: 10px; }
  .drop__big { width: 180px; height: 180px; margin-top: 8px; border-radius: 36px; }
  .drop__big img { width: 150px; height: 150px; }
  .drop__big.gem::after { width: 84px; height: 84px; }
  .drop__name { margin-top: 10px; font-size: 23px; }
  .drop__meta { margin-top: 6px; }
  .drop__value { margin-top: 12px; }
  .drop__actions { margin-top: 14px; }
}
/* ---- restored: the target's picture in the centre of the upgrade wheel keeps its size ---- */
.wheel-ico.img { background: transparent; box-shadow: none; width: 58px; height: 58px; }
.wheel-ico.img::after { display: none; }
.wheel-ico.img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--arc) 45%, transparent)); }

/* ---- Telegram Desktop and small viewports: nothing may shift the layout while the player watches ----
   Classic (non-overlay) scrollbars appear and vanish as content heights change and push everything 17px sideways;
   the page and the drop screen scroll without a visible scrollbar instead. The drop screen is opaque, so it does not
   need a full-screen blur under it (heavy on Windows GPUs), and its entrance no longer overshoots. Heights follow
   the viewport Telegram actually shows, not the browser's idea of 100vh. */
html, body { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
.modal.drop-modal { overflow-x: hidden; scrollbar-width: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal.drop-modal::-webkit-scrollbar { display: none; }
.modal.drop-modal .drop { animation: drop-in .22s ease-out; }
@keyframes drop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body, .app { min-height: var(--tg-viewport-stable-height, 100vh); }
.sheet-wrap .sheet { max-height: calc(var(--tg-viewport-stable-height, 100vh) * 0.8); }
.room { animation: none; }
.room.fresh { animation: cf-in .35s ease-out backwards; }
/* ---- visual pass: small misfits found on 375px screens ---- */
.field--bet .bet-value { white-space: nowrap; }
#tab-crash .field--bet { padding: 0 6px 0 10px; gap: 4px; }
#tab-crash .field__mini { min-width: 32px; padding: 0 6px; }
#tab-crash .field--bet .bet-value { font-size: 15px; }
.mines-head__chips .chip { gap: 4px; }
.case-hero__desc { text-align: center; max-width: 320px; }
.item-card[data-rarity="coin"] .item-card__price { display: none; }
#tab-flip .page-title h1 { display: none; }
#tab-flip .page-title { justify-content: flex-end; margin-top: 0; }
[hidden] { display: none !important; } /* the kit makes every img a block, which beat the hidden attribute: an empty <img> drew as a broken-picture frame */
body.modal-open { overflow: hidden; touch-action: none; }
.modal-card, .sheet-wrap .sheet, .modal.drop-modal, .fairm-card { overscroll-behavior: contain; touch-action: pan-y; }
/* ---- FREE / PROMO as cards: the designer's chest art fills the cover; the price slot carries a status ---- */
/* the designer's chest art: transparent PNG, 10.2 px below the card top, centred, the card's own dark gradient behind it */
.case-card--art .case-card__cover { height: 136px; padding: 10.2px 0 0; align-items: flex-start; }
.case-card--art .case-card__cover img { width: 92%; height: auto; max-height: 112px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); }
.case-card__status { font: 700 13px/1.1 var(--font-body); color: var(--accent); white-space: nowrap; text-align: right; }

/* Top: names must never widen the podium columns or the list rows (long nicks, dots, no spaces) */
.podium__place { min-width: 0; }
.podium__name, .podium__value { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.list__body { min-width: 0; flex: 1; }
.list__title, .list__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Top: the kit's pedestals carry a weekly prize; ours only carry the rank, so they are short steps with the label centred instead of tall empty boxes */
.podium__block { align-items: center; padding-top: 0; }
.podium__place--gold .podium__block { height: 72px; }
.podium__place--silver .podium__block { height: 56px; }
.podium__place--bronze .podium__block { height: 42px; }

/* ==========================================================================
   MOTION SKIN — final layer. Bottom nav, mode tiles, item picker, toggles.
   Kept last so every rule wins over the legacy theme without touching logic.
   ========================================================================== */

/* ---- 1. BOTTOM NAV: glass rail, sliding neon indicator, springy icons ---- */
.tabbar {
  height: calc(74px + env(safe-area-inset-bottom)) !important;
  padding: 0 6px env(safe-area-inset-bottom) !important;
  background: linear-gradient(180deg, rgba(15, 16, 18, .97), rgba(7, 8, 9, .99)) !important;
  border-top: 1px solid rgba(255, 255, 255, .07) !important;
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .04) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.tabbar__item {
  gap: 6px !important;
  padding-top: 10px !important;
  border-radius: 16px !important;
  isolation: isolate;
  transition: transform .26s cubic-bezier(.2, 1.3, .4, 1), color .24s ease !important;
}
.tabbar__item .glyph {
  width: 25px; height: 25px;
  color: #666b73;
  transition: color .24s ease, filter .24s ease, transform .42s cubic-bezier(.2, 1.5, .4, 1);
}
.tabbar__ava {
  transition: opacity .24s ease, filter .24s ease, box-shadow .24s ease, transform .42s cubic-bezier(.2, 1.5, .4, 1);
}
.tabbar__item.active { color: #fff !important; }
.tabbar__item.active .glyph {
  color: var(--accent) !important;
  filter: drop-shadow(0 0 8px rgba(204, 255, 74, .7));
  animation: navPop .5s cubic-bezier(.2, 1.5, .4, 1), navBreathe 2.8s ease-in-out .5s infinite;
}
.tabbar__item.active .tabbar__ava {
  opacity: 1; filter: none;
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(204, 255, 74, .4);
  animation: navPop .5s cubic-bezier(.2, 1.5, .4, 1);
}
.tabbar__item::before {
  top: -1px; height: 3px; width: 22px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(204, 255, 74, .65);
  transform: scaleX(.25); opacity: 0;
  transition: transform .34s cubic-bezier(.2, 1.2, .4, 1), opacity .2s ease;
}
.tabbar__item.active::before { transform: scaleX(1); opacity: 1; }
.tabbar__item::after {
  content: ''; position: absolute; z-index: -1; top: 4px;
  width: 50px; height: 40px; border-radius: 13px;
  background: radial-gradient(70% 100% at 50% 100%, rgba(204, 255, 74, .2), rgba(204, 255, 74, .035) 70%, transparent);
  box-shadow: inset 0 0 0 1px rgba(204, 255, 74, .2);
  transform: scale(.6); opacity: 0;
  transition: transform .34s cubic-bezier(.2, 1.3, .4, 1), opacity .24s ease;
}
.tabbar__item.active::after {
  transform: scale(1); opacity: 1;
  background-size: 220% 100%;
  animation: navShimmer 2.6s ease-in-out infinite;
}
@keyframes navShimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.tabbar__item:active { transform: scale(.9) !important; }
.tabbar__item:active .glyph { transform: scale(1.3) rotate(-10deg); }
.tabbar__badge {
  box-shadow: 0 0 0 2px #0a0b0c, 0 0 12px rgba(255, 64, 83, .7);
  animation: badgePulse 1.8s ease-in-out infinite;
}
@keyframes navPop { 0% { transform: scale(.6) translateY(5px); } 70% { transform: scale(1.2) translateY(-3px); } 100% { transform: scale(1) translateY(0); } }
@keyframes navBreathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.05); } }
@keyframes badgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* ---- 2. MODE TILES: coloured glass, animated aura, living icons ---- */
.mode-tile {
  min-height: 118px !important;
  padding: 12px 9px 11px !important;
  border-radius: 20px !important;
  border: 1px solid color-mix(in srgb, var(--mode-tone) 30%, #25282c) !important;
  background:
    radial-gradient(95% 70% at 50% 0%, color-mix(in srgb, var(--mode-tone) 16%, transparent), transparent 72%),
    linear-gradient(160deg, #16181b, #0e0f11 78%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 20px rgba(0, 0, 0, .28) !important;
  animation: tileEnter .5s cubic-bezier(.2, 1.1, .35, 1) both;
  transition: transform .28s cubic-bezier(.2, 1.35, .4, 1), border-color .24s ease, box-shadow .24s ease !important;
}
.mode-tile:nth-child(1) { animation-delay: .04s; }
.mode-tile:nth-child(2) { animation-delay: .1s; }
.mode-tile:nth-child(3) { animation-delay: .16s; }
.mode-tile:nth-child(4) { animation-delay: .22s; }
.mode-tile::before {
  content: ''; position: absolute; z-index: 0;
  width: 84px; height: 84px; border-radius: 50%;
  top: -30px; left: 50%; margin-left: -42px;
  background: radial-gradient(circle, color-mix(in srgb, var(--mode-tone) 38%, transparent), transparent 66%);
  filter: blur(6px); opacity: .55;
  animation: auraDrift 4s ease-in-out infinite;
  pointer-events: none;
}
.mode-tile > * { position: relative; z-index: 1; }
.mode-tile .tile {
  width: 50px !important; height: 50px !important;
  margin-bottom: 11px !important;
  border-radius: 16px !important;
  color: var(--mode-tone) !important;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--mode-tone) 30%, #1d1f22), color-mix(in srgb, var(--mode-tone) 10%, #101113) 72%) !important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mode-tone) 60%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 6px 18px color-mix(in srgb, var(--mode-tone) 20%, transparent) !important;
}
.mode-tile .tile .glyph { width: 25px; height: 25px; }
.mode-tile__name { font-weight: 800 !important; letter-spacing: -.01em; }
.mode-tile .dot {
  background: var(--mode-tone) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode-tone) 20%, transparent), 0 0 10px color-mix(in srgb, var(--mode-tone) 75%, transparent) !important;
  animation: livePulse 1.6s ease-in-out infinite;
}
.mode-tile__meta { color: #90959d !important; }
.mode-tile:active {
  transform: translateY(-4px) scale(.95) !important;
  border-color: var(--mode-tone) !important;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--mode-tone) 28%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--mode-tone) 30%, transparent) !important;
}

/* per-mode icon life */
.mode-tile[data-mode="upgrade"] .tile .glyph { animation: iconSpin 5s linear infinite; }
.mode-tile[data-mode="crash"] .tile .glyph { animation: iconRocket 2.2s ease-in-out infinite; }
.mode-tile[data-mode="flip"] .tile .glyph { animation: iconFlip 2.6s ease-in-out infinite; }
.mode-tile[data-mode="mines"] .tile .glyph { animation: iconBomb 2s ease-in-out infinite; }
@keyframes tileEnter { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes auraDrift { 0%, 100% { transform: translate(-6px, 0) scale(.9); opacity: .4; } 50% { transform: translate(6px, -6px) scale(1.2); opacity: .8; } }
@keyframes livePulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .65; } }
@keyframes tileShine { from { transform: translateX(-60%); opacity: 0; } 40% { opacity: 1; } to { transform: translateX(60%); opacity: 0; } }
@keyframes iconSpin { to { transform: rotate(360deg); } }
@keyframes iconRocket { 0%, 100% { transform: translateY(2px) rotate(-8deg); } 50% { transform: translateY(-3px) rotate(6deg); } }
@keyframes iconFlip { 0%, 100% { transform: rotateY(-22deg) rotate(-4deg); } 50% { transform: rotateY(22deg) rotate(4deg); } }
@keyframes iconBomb { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.12) rotate(4deg); } }

/* ---- 3. ITEM PICKER: glossy sheet, coin-side cards with check pop ---- */
.sheet-wrap .sheet {
  background: linear-gradient(155deg, #1a1c1f 0%, #111214 55%, #0d0e10 100%) !important;
  border: 1px solid #34383e !important;
  box-shadow: 0 -26px 80px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  animation: sheetUp .38s cubic-bezier(.18, 1.1, .3, 1) both;
}
.sheet-grip { width: 44px; height: 5px; background: #484c53; }
.sheet-head { padding: 2px 16px 14px !important; }
.sheet-title {
  font: 800 18px/1.15 var(--font-body) !important;
  letter-spacing: -.01em !important;
  padding-left: 12px; position: relative;
}
.sheet-title::before {
  content: ''; position: absolute; left: 0; top: 1px; bottom: 1px;
  width: 4px; border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(204, 255, 74, .6);
}
.sheet-close, .up-sort {
  transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), background .2s ease, border-color .2s ease !important;
}
.sheet-close:active { transform: rotate(90deg) scale(.9) !important; background: #2a2d32 !important; }
.up-sort:active { transform: scale(.94) !important; border-color: var(--accent-line) !important; }
.cf-pick-title {
  color: #8b9098 !important;
  font-size: 10.5px !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}
.cf-pick { gap: 10px !important; margin-bottom: 16px !important; }
.cf-pick button {
  height: 70px !important;
  padding: 0 12px !important;
  border-radius: 18px !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  background: linear-gradient(155deg, #1b1e22, #121316) !important;
  border: 1px solid #2c3036 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 16px rgba(0, 0, 0, .3) !important;
  animation: tileEnter .4s cubic-bezier(.2, 1.1, .35, 1) both;
  transition: transform .26s cubic-bezier(.2, 1.4, .4, 1), border-color .24s ease, box-shadow .24s ease, background .24s ease !important;
}
.cf-pick button:nth-child(2) { animation-delay: .07s; }
.cf-pick button:active { transform: scale(.94) !important; }
.cf-pick .mini {
  width: 44px !important; height: 44px !important;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, .45), inset 0 -3px 6px rgba(0, 0, 0, .3), 0 5px 14px rgba(0, 0, 0, .35);
  transition: transform .36s cubic-bezier(.2, 1.5, .4, 1) !important;
}
.cf-pick .mini svg { width: 22px !important; height: 22px !important; }
.cf-pick button.on .mini { transform: rotate(-12deg) scale(1.14); }
.cf-pick button.on::after {
  content: '✓'; position: absolute; top: 7px; right: 9px;
  width: 19px; height: 19px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 900 12px/1 var(--font-body);
  animation: checkPop .38s cubic-bezier(.2, 1.6, .4, 1) both;
}
.cf-pick button.on.gem {
  border-color: var(--accent) !important;
  background: radial-gradient(80% 120% at 12% 20%, rgba(204, 255, 74, .22), transparent 70%), linear-gradient(155deg, #1c2115, #11130e) !important;
  box-shadow: 0 0 0 1px rgba(204, 255, 74, .55), 0 0 28px rgba(204, 255, 74, .2), inset 0 1px 0 rgba(255, 255, 255, .12) !important;
}
.cf-pick button.on.gem::after { background: var(--accent); color: #101402; }
.cf-pick button.on.cube {
  border-color: #5b98ff !important;
  background: radial-gradient(80% 120% at 12% 20%, rgba(91, 152, 255, .24), transparent 70%), linear-gradient(155deg, #151c29, #0e1118) !important;
  box-shadow: 0 0 0 1px rgba(91, 152, 255, .55), 0 0 28px rgba(62, 139, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .12) !important;
}
.cf-pick button.on.cube::after { background: #5b98ff; color: #061022; }
@keyframes checkPop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

.up-grid .item-card {
  animation: tileEnter .38s cubic-bezier(.2, 1.1, .35, 1) both;
  transition: transform .24s cubic-bezier(.2, 1.35, .4, 1), border-color .22s ease, box-shadow .24s ease !important;
}
.up-grid .item-card:nth-child(3n + 2) { animation-delay: .05s; }
.up-grid .item-card:nth-child(3n) { animation-delay: .1s; }
.up-grid .item-card:active { transform: scale(.93) translateY(-3px) !important; }
.up-grid .item-card.is-selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px rgba(204, 255, 74, .6), 0 0 26px rgba(204, 255, 74, .18) !important;
  animation: checkPop .32s cubic-bezier(.2, 1.5, .4, 1) both;
}
.sheet-foot .btn--primary {
  background: linear-gradient(100deg, #b7ef39, #dcff7a) !important;
  box-shadow: 0 6px 22px rgba(204, 255, 74, .24), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .18) !important;
  transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), box-shadow .2s ease !important;
}
.sheet-foot .btn--primary:active:not(:disabled) {
  transform: scale(.97) translateY(2px) !important;
  box-shadow: 0 2px 10px rgba(204, 255, 74, .2) !important;
}

/* ---- 4. TOGGLES & SEGMENTS: springy, glowing, tactile ---- */
.switch span, .switch span::after { transition: background .3s cubic-bezier(.2, .9, .3, 1), left .32s cubic-bezier(.2, 1.5, .4, 1), transform .32s cubic-bezier(.2, 1.5, .4, 1), box-shadow .3s ease !important; }
.switch span::after {
  box-shadow: 0 2px 7px rgba(0, 0, 0, .5), inset 0 -2px 0 rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.switch input:checked + span {
  background: linear-gradient(90deg, #a9e632, #dcff78) !important;
  box-shadow: 0 0 16px rgba(204, 255, 74, .38), inset 0 0 0 1px rgba(255, 255, 255, .25) !important;
}
.switch input:checked + span::after {
  left: 21px; background: #101502 !important;
  transform: rotate(360deg) scale(.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.switch input:not(:checked) + span::after { background: #f2f4f7; transform: rotate(0); }
.switch:active span::after { transform: scaleX(1.25) !important; }
.seg__btn, .chip-btn, .filter span {
  transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), background .22s ease, border-color .22s ease, color .22s ease, box-shadow .22s ease !important;
}
.seg__btn:active, .chip-btn:active, .filter span:active { transform: scale(.93) !important; }
.seg__btn.on, .filter input:checked + span {
  box-shadow: 0 0 16px rgba(204, 255, 74, .16), inset 0 1px 0 rgba(255, 255, 255, .12) !important;
}
.btn:not(:disabled) {
  transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), filter .2s ease, box-shadow .2s ease !important;
}
.btn:active:not(:disabled) { transform: scale(.96) translateY(2px) !important; }
.btn--primary {
  background: linear-gradient(100deg, #b7ef39, #dcff7a) !important;
  box-shadow: 0 6px 22px rgba(204, 255, 74, .2), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .18) !important;
}

/* tap ripple on pressable surfaces */
.mode-tile .tile { position: relative; }
.tabbar__item, .mode-tile, .cf-pick button, .seg__btn, .btn { overflow: hidden; }
.tap-ripple {
  position: absolute; z-index: 4; pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .3), rgba(204, 255, 74, .12) 45%, transparent 68%);
  animation: tapRipple .58s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes tapRipple { from { transform: scale(.15); opacity: .95; } to { transform: scale(1); opacity: 0; } }

/* ==========================================================================
   LUXURY LAYER — champagne gold on near-black. Applied to the same three
   components; the confirm button becomes icon-only so its label can't spill.
   ========================================================================== */
:root { --lux: #E8D19A; --lux-2: #C39B3F; --lux-soft: rgba(232, 209, 154, .13); }

.tabbar {
  background: linear-gradient(180deg, rgba(19, 19, 20, .97), rgba(6, 6, 7, .995)) !important;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(232, 209, 154, .16) !important;
  border-top-color: rgba(232, 209, 154, .16) !important;
}
.tabbar::before {
  content: ''; position: absolute; top: -1px; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px rgba(204, 255, 74, .5);
  pointer-events: none;
  animation: luxLine 4s ease-in-out infinite;
}
@keyframes luxLine { 0%, 100% { opacity: .35; transform: scaleX(.7); } 50% { opacity: 1; transform: scaleX(1); } }
.tabbar__item::before {
  background: var(--accent) !important;
  box-shadow: 0 0 14px 2px rgba(204, 255, 74, .6) !important;
}
.tabbar__item::after {
  background: radial-gradient(75% 110% at 50% 100%, rgba(232, 209, 154, .22), rgba(232, 209, 154, .04) 68%, transparent) !important;
  box-shadow: inset 0 0 0 1px rgba(232, 209, 154, .26), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}
.tabbar__item.active { color: #FFF7E4 !important; }
.tabbar__item.active .glyph { color: var(--accent) !important; filter: drop-shadow(0 0 9px rgba(204, 255, 74, .6)) !important; }
.tabbar__item.active .tabbar__ava { box-shadow: 0 0 0 2px var(--lux), 0 0 20px rgba(232, 209, 154, .38) !important; }
.tabbar__item span { font-weight: 700; letter-spacing: .01em; }

.mode-tile {
  border-color: color-mix(in srgb, var(--mode-tone) 26%, rgba(232, 209, 154, .2)) !important;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .045), transparent 34%),
    radial-gradient(95% 70% at 50% 0%, color-mix(in srgb, var(--mode-tone) 14%, transparent), transparent 72%),
    linear-gradient(165deg, #17171a, #0b0b0d 78%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(232, 209, 154, .07), 0 8px 24px rgba(0, 0, 0, .4) !important;
}
.mode-tile .tile {
  background: radial-gradient(circle at 28% 16%, rgba(255, 255, 255, .18), transparent 42%), radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--mode-tone) 30%, #1d1f22), color-mix(in srgb, var(--mode-tone) 9%, #0e0f11) 72%) !important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mode-tone) 52%, transparent),
    inset 0 0 0 2.5px rgba(255, 255, 255, .05),
    inset 0 2px 0 rgba(255, 255, 255, .16),
    0 7px 20px color-mix(in srgb, var(--mode-tone) 20%, transparent) !important;
}
.mode-tile__meta { color: #a8a49a !important; }

.sheet-wrap .sheet {
  border-color: rgba(232, 209, 154, .28) !important;
  background: linear-gradient(160deg, #1c1b1a 0%, #121212 52%, #0c0c0c 100%) !important;
  box-shadow: 0 -28px 90px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(232, 209, 154, .14) !important;
}
.sheet-grip { background: linear-gradient(90deg, transparent, rgba(232, 209, 154, .55), transparent) !important; }
.sheet-title::before { background: linear-gradient(180deg, #F6E5B8, #B98F33) !important; box-shadow: 0 0 14px rgba(232, 209, 154, .5) !important; }
.cf-pick button {
  background: linear-gradient(150deg, #1e1e20, #131313) !important;
  border-color: rgba(255, 255, 255, .09) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 7px 18px rgba(0, 0, 0, .4) !important;
}
.cf-pick button.on::after { background: linear-gradient(135deg, #F6E5B8, #C39B3F) !important; color: #1a1506 !important; }

.sheet-foot { display: flex; align-items: center; gap: 12px; }
.picker-summary { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.picker-summary b {
  font: 800 16px/1.1 var(--font-body); color: #FFF7E4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-summary span {
  font: 600 12.5px/1.1 var(--font-body); color: #9e9a91;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-summary span:empty { display: none; }
.sheet-foot .btn--primary.btn--done {
  width: 68px; min-width: 68px; height: 58px; padding: 0;
  border-radius: 18px; flex: none; overflow: hidden;
  color: #1b1607 !important;
  background: linear-gradient(135deg, #F6E5B8 0%, #DDBB6C 45%, #B98F33 100%) !important;
  box-shadow: 0 8px 26px rgba(195, 155, 63, .3), inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -3px 0 rgba(80, 55, 10, .28) !important;
}
.sheet-foot .btn--primary.btn--done svg { stroke-width: 3; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .35)); }
.sheet-foot .btn--primary.btn--done:disabled {
  background: #242424 !important; color: #6c6c6c !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06) !important;
}

@media (prefers-reduced-motion: reduce) {
  .tabbar::before { animation: none !important; opacity: 1; transform: none; }
  .mode-tile, .mode-tile .tile, .mode-tile .tile::before, .mode-tile .glyph, .mode-tile .dot, .tabbar__item.active::after,
  .cf-pick button, .cf-pick .mini, .up-grid .item-card, .sheet-wrap .sheet,
  .btn, .switch span, .switch span::after, .seg__btn, .filter span, .tap-ripple {
    animation: none !important; transition: none !important;
  }
  .tabbar__item::before, .tabbar__item::after, .mode-tile::before { opacity: 1; transform: none; }
}

/* Refined labels: kept, but smaller, tracked out and colour-graded so the rail reads premium. */
.tabbar__item .nav-label {
  display: block;
  max-width: 100%;
  font: 700 8.5px/1.1 var(--font-body) !important;
  letter-spacing: -.01em !important;
  color: #9a968e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .26s ease, text-shadow .26s ease;
}
.tabbar__item.active .nav-label {
  color: var(--accent) !important;
  text-shadow: 0 0 10px rgba(204, 255, 74, .28);
}
.tabbar__item.is-passing .nav-label {
  color: #E5FF9C !important;
  text-shadow: 0 0 12px rgba(204, 255, 74, .7);
}

/* Keep the home mode strip at a fixed compact height in every viewport. */
#modes-home { grid-auto-rows: 118px; align-items: stretch; }
#modes-home .mode-tile { height: 118px; min-height: 118px; max-height: 118px; }

/* One sliding lime cursor + a different idle motion for every tab. */
.tabbar__item::before { display: none !important; }
.nav-cursor {
  position: absolute; z-index: 3; top: -1px; left: 0; height: 3px; width: 40px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(204, 255, 74, .65);
  opacity: 0; pointer-events: none;
  transition: transform .54s cubic-bezier(.32, .72, .24, 1), width .54s cubic-bezier(.32, .72, .24, 1), opacity .2s ease;
}
.tabbar__item.is-passing:not(.active)::after {
  background: linear-gradient(150deg, rgba(204, 255, 74, .24), rgba(204, 255, 74, .06)) !important;
  box-shadow: inset 0 0 0 1.5px rgba(204, 255, 74, .75), 0 0 26px rgba(204, 255, 74, .26) !important;
  transform: scale(1) !important;
  opacity: 1 !important;
}
.tabbar__item.is-passing .glyph {
  color: var(--accent) !important;
  filter: brightness(1.5) drop-shadow(0 0 12px rgba(204, 255, 74, .95)) drop-shadow(0 0 4px rgba(204, 255, 74, .7)) !important;
  animation: navPass .22s cubic-bezier(.2, 1.4, .4, 1);
}
.tabbar__item.is-passing .tabbar__ava {
  box-shadow: 0 0 0 3px var(--accent), 0 0 22px rgba(204, 255, 74, .6) !important;
  filter: brightness(1.25);
  animation: navPass .22s cubic-bezier(.2, 1.4, .4, 1);
}
.tabbar__item.is-passing .nav-label {
  color: #E5FF9C !important;
  text-shadow: 0 0 12px rgba(204, 255, 74, .7);
}
@keyframes navPass { 0% { transform: scale(1); } 50% { transform: scale(1.24) rotate(-8deg); } 100% { transform: scale(1); } }
.tabbar__item:not(.active)[data-tab="inventory"] .glyph { animation: navChest 3.2s ease-in-out infinite; }
.tabbar__item:not(.active)[data-tab="profile"] .tabbar__ava { animation: navAvatar 4.2s ease-in-out infinite; }
.tabbar__item:not(.active)[data-tab="tasks"] .glyph { animation: navCalendar 3.6s ease-in-out infinite; }
.tabbar__item:not(.active)[data-tab="top"] .glyph { animation: navTrophy 4.6s ease-in-out infinite; }
.tabbar__item.active .nav-label { animation: navLabelIn .42s cubic-bezier(.2, 1.3, .4, 1) both; }
.nav-burst {
  position: absolute; z-index: 2; left: 50%; top: 16px; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle, var(--accent) 1.4px, transparent 2px) 0 0 / 6px 6px no-repeat,
    radial-gradient(circle, var(--accent) 1.2px, transparent 1.8px) 100% 20% / 6px 6px no-repeat,
    radial-gradient(circle, var(--accent) 1.6px, transparent 2.2px) 30% 100% / 6px 6px no-repeat,
    radial-gradient(circle, var(--accent) 1px, transparent 1.6px) 90% 90% / 6px 6px no-repeat;
  animation: navSpark .62s ease-out both;
}
@keyframes navChest { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2px) rotate(3deg); } }
@keyframes navAvatar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes navCalendar { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes navTrophy { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.06); } }
@keyframes navLabelIn { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: translateY(-1px) scale(1); } }
@keyframes navSpark { 0% { transform: scale(.2) rotate(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.9) rotate(45deg); opacity: 0; } }

/* The selection flight is the app's main feedback, so it stays even when the OS asks for less motion.
   Only the decorative scale/spark animations are dropped; the travel and the highlight remain. */
@media (prefers-reduced-motion: reduce) {
  .nav-cursor { transition: transform .42s cubic-bezier(.32, .72, .24, 1), width .42s ease, opacity .2s ease !important; }
  .tabbar__item:not(.active)[data-tab] .glyph,
  .tabbar__item:not(.active)[data-tab] .tabbar__ava,
  .tabbar__item.active .nav-label, .nav-burst,
  .tabbar__item.is-passing .glyph, .tabbar__item.is-passing .tabbar__ava { animation: none !important; }
  .tabbar__item.is-passing .glyph { filter: brightness(1.5) drop-shadow(0 0 12px rgba(204, 255, 74, .95)) !important; }
}

/* Four different ambient effects — one per category. */
.mode-card[data-mode="upgrade"] { --mode-tone: #CCFF4A; }
.mode-card[data-mode="crash"] { --mode-tone: #9B6BFF; }
.mode-card[data-mode="flip"] { --mode-tone: #3E8BFF; }
.mode-card[data-mode="mines"] { --mode-tone: #FF4053; }
.mode-card { position: relative; }
.mode-card__art { position: relative; }
.card-lava { position: absolute; z-index: 0; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.card-lava i { position: absolute; display: block; pointer-events: none; will-change: transform, opacity; }
.mode-card > :not(.card-lava), .mode-tile > :not(.card-lava) { position: relative; z-index: 2; }

/* Апгрейд — lava lamp: slow rising liquid blobs. */
[data-mode="upgrade"] .card-lava i {
  left: calc(50% - min(38%, 55px)); top: calc(50% - min(38%, 55px));
  width: min(76%, 110px); height: min(76%, 110px); border-radius: 50%;
  background: radial-gradient(circle at 40% 34%, rgba(204,255,74,.55), rgba(204,255,74,.22) 55%, transparent 72%);
  filter: blur(18px); opacity: .2;
}
[data-mode="upgrade"] .card-lava i:nth-child(1) { animation: lavaRise1 6.4s ease-in-out infinite; }
[data-mode="upgrade"] .card-lava i:nth-child(2) { animation: lavaRise2 8.2s ease-in-out infinite; opacity: .14; }
[data-mode="upgrade"] .card-lava i:nth-child(3) { animation: lavaRise3 7.3s ease-in-out infinite; opacity: .11; }
[data-mode="upgrade"] .card-lava i:nth-child(n+4) { display: none; }

/* Ракетка — warp speed streaks. */
[data-mode="crash"] .card-lava i {
  width: 2px; height: 34px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, #CDB8FF, transparent);
  box-shadow: 0 0 9px rgba(205,184,255,.9); opacity: 0;
  animation: warpStreak 3s linear infinite;
}
[data-mode="crash"] .card-lava i:nth-child(1) { left: 18%; top: 68%; animation-delay: 0s; }
[data-mode="crash"] .card-lava i:nth-child(2) { left: 42%; top: 84%; animation-delay: -.8s; }
[data-mode="crash"] .card-lava i:nth-child(3) { left: 66%; top: 62%; animation-delay: -1.6s; }
[data-mode="crash"] .card-lava i:nth-child(4) { left: 30%; top: 92%; animation-delay: -2.2s; }
[data-mode="crash"] .card-lava i:nth-child(5) { left: 78%; top: 88%; animation-delay: -2.7s; }

/* Flip — the same lava-lamp liquid as Upgrade, but blue. */
[data-mode="flip"] .card-lava i {
  left: calc(50% - min(38%, 55px)); top: calc(50% - min(38%, 55px));
  width: min(76%, 110px); height: min(76%, 110px); border-radius: 50%;
  background: radial-gradient(circle at 40% 34%, rgba(62,139,255,.55), rgba(62,139,255,.22) 55%, transparent 72%);
  filter: blur(18px); opacity: .2;
}
[data-mode="flip"] .card-lava i:nth-child(1) { animation: lavaRise1 6.4s ease-in-out infinite; }
[data-mode="flip"] .card-lava i:nth-child(2) { animation: lavaRise2 8.2s ease-in-out infinite; opacity: .14; }
[data-mode="flip"] .card-lava i:nth-child(3) { animation: lavaRise3 7.3s ease-in-out infinite; opacity: .11; }
[data-mode="flip"] .card-lava i:nth-child(n+4) { display: none; }

/* Мины — rising embers. */
[data-mode="mines"] .card-lava i {
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #FFB3BC, #FF4053 52%, transparent 72%);
  box-shadow: 0 0 13px rgba(255,64,83,.85); opacity: 0;
  animation: emberRise 3.6s ease-out infinite;
}
[data-mode="mines"] .card-lava i:nth-child(1) { left: 24%; top: 78%; animation-delay: 0s; }
[data-mode="mines"] .card-lava i:nth-child(2) { left: 48%; top: 88%; animation-delay: -.9s; }
[data-mode="mines"] .card-lava i:nth-child(3) { left: 72%; top: 74%; animation-delay: -1.8s; }
[data-mode="mines"] .card-lava i:nth-child(4) { left: 36%; top: 94%; animation-delay: -2.6s; }
[data-mode="mines"] .card-lava i:nth-child(5) { left: 84%; top: 90%; animation-delay: -3.1s; }

@keyframes lavaRise1 {
  0%   { transform: translate(-14%, 108%) scale(.72, .9); border-radius: 50% 45% 55% 45%; }
  35%  { transform: translate(18%, 22%) scale(1.12, .86); border-radius: 42% 58% 46% 54%; }
  70%  { transform: translate(-10%, -20%) scale(.94, 1.16); border-radius: 56% 44% 60% 40%; }
  100% { transform: translate(-14%, 108%) scale(.72, .9); border-radius: 50% 45% 55% 45%; }
}
@keyframes lavaRise2 {
  0%   { transform: translate(28%, 110%) scale(.9, .7); border-radius: 45% 55% 40% 60%; }
  40%  { transform: translate(-22%, 8%) scale(.85, 1.18); border-radius: 58% 42% 55% 45%; }
  75%  { transform: translate(16%, -24%) scale(1.1, .9); border-radius: 40% 60% 48% 52%; }
  100% { transform: translate(28%, 110%) scale(.9, .7); border-radius: 45% 55% 40% 60%; }
}
@keyframes lavaRise3 {
  0%   { transform: translate(-30%, 104%) scale(.8, .95); border-radius: 52% 48% 60% 40%; }
  45%  { transform: translate(24%, 30%) scale(1.18, .82); border-radius: 44% 56% 42% 58%; }
  80%  { transform: translate(-18%, -16%) scale(.9, 1.1); border-radius: 60% 40% 52% 48%; }
  100% { transform: translate(-30%, 104%) scale(.8, .95); border-radius: 52% 48% 60% 40%; }
}
@keyframes warpStreak {
  0%   { transform: translate(0, 0) rotate(35deg) scaleY(.3); opacity: 0; }
  18%  { opacity: .85; }
  100% { transform: translate(130px, -175px) rotate(35deg) scaleY(2.2); opacity: 0; }
}
@keyframes rippleRing {
  0%   { transform: translate(-50%, -50%) scale(.22); opacity: .7; }
  100% { transform: translate(-50%, -50%) scale(1.18); opacity: 0; }
}
@keyframes emberRise {
  0%   { transform: translateY(34px) scale(.5); opacity: 0; }
  25%  { opacity: .95; }
  70%  { opacity: .6; }
  100% { transform: translateY(-125px) scale(1.1); opacity: 0; }
}
/* Hover/tap feedback for the mode cards and the home tiles. */
.mode-card:hover, .mode-tile:hover {
  border-color: var(--mode-tone) !important;
  box-shadow: 0 16px 42px color-mix(in srgb, var(--mode-tone) 28%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--mode-tone) 22%, transparent) !important;
}
.mode-card:hover .tile, .mode-tile:hover .tile {
  filter: brightness(1.22);
  box-shadow: 0 0 32px color-mix(in srgb, var(--mode-tone) 45%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--mode-tone) 65%, transparent) !important;
}
.mode-card:hover .card-lava i, .mode-tile:hover .card-lava i { animation-duration: 2.6s; opacity: .44; }
.mode-card:hover .mode-card__name, .mode-tile:hover .mode-tile__name {
  color: #fff; text-shadow: 0 0 10px color-mix(in srgb, var(--mode-tone) 60%, transparent);
}

/* macOS-style screen transition: the old view drifts away, the new one eases in. */
.main { position: relative; }
.tab-panel.active { animation: panelIn .42s cubic-bezier(.22, .8, .24, 1) both; }
.tab-panel.is-leaving {
  display: block !important;
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  pointer-events: none;
  animation: panelOut .24s ease-out both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(2px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes panelOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-10px) scale(.99); }
}

/* React Bits-inspired: spotlight follows the pointer, icons lean toward it, clicks throw sparks. */
.card-lava::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .13), transparent 66%);
  opacity: 0; transition: opacity .3s ease;
}
.mode-card:hover .card-lava::after, .mode-tile:hover .card-lava::after { opacity: 1; }
.tabbar__item:hover::after {
  background-image: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .2), transparent 62%) !important;
}
/* Coin-side cards in the item picker: glassy, with a spotlight and a springy selection. */
.cf-pick button { overflow: hidden; }
.cf-pick button::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(140px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .14), transparent 62%);
  opacity: 0; transition: opacity .28s ease;
}
.cf-pick button:hover::before { opacity: 1; }
.cf-pick button > span:last-child { position: relative; z-index: 1; }
/* Slim custom scrollbar for the item picker instead of the default white bar. */
.sheet-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(204, 255, 74, .55) transparent;
}
.sheet-body::-webkit-scrollbar { width: 5px; }
.sheet-body::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.sheet-body::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(230, 255, 150, .9), rgba(140, 191, 28, .6));
  box-shadow: 0 0 10px rgba(204, 255, 74, .4);
}
.sheet-body::-webkit-scrollbar-thumb:hover { background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
}


/* One tinted material for the floating navigation rail. */
.glass-nav .tabbar {
  bottom: calc(6px + env(safe-area-inset-bottom));
  width: calc(100% - 16px); max-width: calc(var(--app-width) - 16px);
  height: 66px !important; padding: 4px !important;
  border: 1px solid rgba(218,250,174,.32) !important;
  border-radius: 34px; isolation: isolate;
  background: radial-gradient(ellipse at 18% -50%, #dfff984d, transparent 64%), linear-gradient(158deg,#435037aa,#171e18d9 48%,#25311fbd) !important;
  -webkit-backdrop-filter: blur(20px) saturate(145%); backdrop-filter: blur(20px) saturate(145%);
  box-shadow: inset 0 1px 1px #f2ffcf66,inset 0 -1px 2px #adc99638,0 5px 18px #0008 !important;
}
.glass-nav .tabbar::before, .glass-nav .nav-cursor, .glass-nav .tabbar__item::after { display: none !important; }
.glass-nav .tabbar__item {
  min-width: 0; justify-content: center; gap: 3px !important; padding: 0 !important; border-radius: 30px !important;
}
.glass-nav .tabbar__item.active {
  background: radial-gradient(ellipse at 30% 0%,#d8ff844d,transparent 68%),linear-gradient(155deg,#9cae6340,#73894930);
  box-shadow: inset 0 1px 1px #edffb785,inset 0 0 0 1px #d8ff9a38,inset 0 -2px 4px #b2d46a28;
}
.glass-nav .tabbar__item .nav-label { color: #c3cdbd; font-size: 10px !important; }
.glass-nav .tabbar__item:not(.active) .glyph { color: #c1cfbc; }
.lite-motion .tabbar, .lite-motion.glass-nav .tabbar {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.lite-motion.glass-nav .tabbar { background: linear-gradient(155deg,#35402d,#1b211b 58%,#293322) !important; }
.lite-motion .tabbar *, .lite-motion .tabbar::before, .lite-motion .tabbar__item::after,
.lite-motion .mode-tile, .lite-motion .mode-tile *, .lite-motion .mode-tile::before,
.lite-motion .mode-tile .tile::before { animation: none !important; transition: none !important; }

.glass-lens { display: none; }
.glass-nav .glass-lens {
  display: block; position: absolute; pointer-events: none; left: 0; top: 4px; bottom: 4px;
  border-radius: 32px; will-change: transform;
  background: radial-gradient(ellipse at 28% -12%,#d9ffa63b,transparent 68%), linear-gradient(155deg,#59644090,#151d13ba 72%);
  box-shadow: inset 0 1px 1px #eaffbf80,inset 0 0 0 1px #d8ff9a33,inset 0 -1px 2px #bdd5842b;
}
.glass-nav .tabbar { touch-action: pan-y; user-select: none; }
.glass-nav .tabbar__item.active { background: transparent; box-shadow: none; }
.glass-nav .tabbar__item .glyph, .glass-nav .tabbar__item .tabbar__ava {
  animation: none !important; scale: var(--lens-zoom,1);
}

/* Give the traveling lens a readable contour against the dark rail. */
.glass-nav .glass-lens {
  background: radial-gradient(ellipse at 26% -20%,#efffcf85,transparent 65%),linear-gradient(160deg,#8bb04b88,#354b29c9 64%,#52743c99);
  box-shadow: inset 0 1.5px 1px #f1ffd5c7,inset 0 0 0 1px #d9ff995e,inset 0 -1px 2px #c5f97b66,0 2px 5px #0004;
}

/* A low-profile selection plate keeps the icon and label together. */
.glass-nav .tabbar {
  height: 59px !important; border-radius: 20px;
  background: linear-gradient(160deg,#384037ba,#151918d6 65%) !important;
  box-shadow: inset 0 1px #e7f3dc40,0 4px 16px #0004 !important;
}
.glass-nav .glass-lens {
  border-radius: 15px;
  background: linear-gradient(155deg,#85946b41,#11160fd9 68%);
  box-shadow: inset 0 1px #e7f6d35c,inset 0 -1px #b8d99433;
}
.glass-nav .tabbar__item { border-radius: 15px !important; }
.glass-nav .tabbar__item .nav-label { text-shadow: none; }
.glass-nav:not(.lite-motion) .tabbar {
  backdrop-filter: var(--rail-optics,blur(8px) saturate(125%));
  -webkit-backdrop-filter: var(--rail-optics,blur(8px) saturate(125%));
}
@media (hover: none) {
  .card-lava::after { display: none; }
}

.tabbar__item:not(.active)[data-tab] .glyph,
.tabbar__item:not(.active)[data-tab] .tabbar__ava { animation: none; will-change: auto; }
.lite-motion .card-lava { display: none; }
.mode-tile, .mode-card { -webkit-tap-highlight-color: transparent; }

body { -webkit-user-select: none; user-select: none; }
img, svg { -webkit-user-drag: none; -webkit-touch-callout: none; }
.money-value, .bet-value, .balance__value, .case-card__price, .slot__price, .lose-amount,
input:not([type=checkbox]):not([type=range]), textarea { -webkit-user-select: text; user-select: text; }

.glass-nav .tabbar {
  background: radial-gradient(ellipse at var(--reflection-x,50%) 0%,#d4ff7540,transparent 60%),linear-gradient(154deg,#525e444d,#141b18ab) !important;
  border-color: #c7f88f6b !important;
  box-shadow: inset 0 1px #f1ffdda3,inset 0 -1px #adf55c3b,0 3px 15px #050a045c,0 0 15px #b6ff3d18 !important;
}
.glass-nav .glass-lens { background: linear-gradient(150deg,#e2ff9b48,#6f8c492e 38%,#141e17a1 68%,#aacb593d); box-shadow: inset 0 1px #edffc7aa,inset 0 -1px #ccff7973,0 0 10px #baff482b; }
.fair-card, .fairm-card {
  position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid #a9ce654f !important;
  background: radial-gradient(ellipse at 15% 0%,#374a22,transparent 65%),linear-gradient(137deg,#171c15,#090c0a 72%,#263020) !important;
  box-shadow: inset 0 1px #e2ffb648,0 6px 24px #0004 !important;
}
.fair-surface { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:-1; opacity:.74; }
.lite-motion .fair-surface { display:none; }
.fair-card .fair-head,.fairm-card .drop-name {color:#d9ff88;}
.fair-card .fair-row,.fairm-card .fair-row {background:#080d08aa;}

.fairm-card { overflow: auto; }

/* Test-instance ribbon (STAGING=1): a fixed, non-interactive badge so the test bot is never mistaken for prod. */
#staging-ribbon{position:fixed;top:0;left:50%;transform:translateX(-50%);z-index:99999;pointer-events:none;
  font:700 10px/1 ui-monospace,monospace;letter-spacing:2px;color:#0a0a0a;background:#ffd166;
  padding:3px 10px;border-radius:0 0 7px 7px;box-shadow:0 1px 6px #0007;opacity:.92;}
body.staging{outline:2px solid #ffd16688;outline-offset:-2px;}
