/* «Студия Свояка» — токены и общий словарь классов сайта.
   Выросло из игровой комнаты: зелёное сукно табло, оранжевые цены, красная кнопка.
   Страницы пользуются только этими классами и токенами, свои цвета — лишь как акценты страницы. */

:root {
  --bg: #04190A; --bg-2: #072410;
  --card: #0A3A12; --card-2: #0D4617; --card-3: #12561E;
  --cell: #0D6A1D; --cell-hi: #13862A; --cell-used: #0A4613;
  --line: rgba(190, 255, 170, .10); --line-2: rgba(190, 255, 170, .20);
  --text: #F4FFF1; --muted: #A9CFA4; --dim: #5E8A5A;
  --orange: #FF9D1C; --orange-2: #FFC46B; --orange-ink: #2A1600; --orange-edge: #B9650A;
  --red: #E0301E; --red-deep: #B5170E; --red-edge: #7D0D05;
  --good: #3DDC6A; --bad: #FF5D4D; --gold: #FFD23F; --cyan: #5EE0FF; --purple: #B57BFF;
  --r-xl: 26px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .35);
  --font-logo: 'Rubik Mono One', 'Rubik', system-ui, sans-serif;
  --font-ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* производные: грани клеток, лампочки, фокус */
  --cell-edge: #05300C;
  --cell-face: linear-gradient(180deg, #128027 0%, var(--cell) 52%, #0B5E19 100%);
  --cell-bevel: inset 0 1px 0 rgba(255, 255, 255, .13), inset 0 -2px 0 rgba(0, 0, 0, .16);
  --lit-face: linear-gradient(180deg, #FFBE5C 0%, var(--orange) 50%, #F38A0D 100%);
  --red-face: radial-gradient(130% 120% at 50% 0%, #F2503A 0%, var(--red) 45%, var(--red-deep) 100%);
  --felt: repeating-linear-gradient(135deg, rgba(255, 255, 255, .013) 0 2px, transparent 2px 7px);
  --bulb-core: #FFF7DC; --bulb: #FFC86A; --bulb-rim: #FF9D1C;
  --focus: #FFE1A8;
  --tg: #2AABEE; --tg-edge: #157DB4;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.2, .9, .3, 1);
  --head-h: 84px; --tabbar-h: 66px;
  color-scheme: dark;
}

/* ---------- основа ---------- */

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: #1B6B28 var(--bg);
}
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 500 16px/1.45 var(--font-ui);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-x: clip;
}

/* свет студии: сверху прожектор, по бокам тёплая дымка, внизу темнее — как пол съёмочного павильона */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(56% 520px at 50% -160px, rgba(150, 240, 110, .26), transparent 78%),
    radial-gradient(36% 420px at 4% -90px, rgba(255, 196, 107, .16), transparent 74%),
    radial-gradient(36% 420px at 96% -90px, rgba(255, 157, 28, .15), transparent 74%),
    conic-gradient(from 160deg at 16% -8%, transparent 0deg, rgba(255, 236, 190, .045) 7deg, transparent 15deg),
    conic-gradient(from 184deg at 84% -8%, transparent 0deg, rgba(255, 236, 190, .045) 8deg, transparent 16deg),
    radial-gradient(130% 60% at 50% 115%, rgba(0, 0, 0, .55), transparent 62%),
    linear-gradient(180deg, #0A3613 0%, #062711 360px, var(--bg) 760px);
}
/* сукно: еле заметный шум, чтобы зелёный не был «пластиковым» */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 1 0 0 0 0 .75 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.15; letter-spacing: -.005em; }
h1 { font-size: clamp(26px, 3vw, 36px); }
h2 { font-size: clamp(21px, 2.2vw, 26px); }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--orange-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange); }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
::selection { background: rgba(255, 157, 28, .38); color: #fff; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
svg.i { flex: none; }

/* ---------- утилиты (раньше компонентов — модификаторы компонентов их перебивают) ---------- */

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.orange { color: var(--orange); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- раскладка ---------- */

.page {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 6px 24px 56px;
}
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.sm { gap: 8px; }
.stack.lg { gap: 28px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.row.sm { gap: 8px; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; white-space: normal; }
.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 4px 2px 6px;
  margin: -4px -2px -6px;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; scroll-snap-align: start; }
/* мягкий край справа: видно, что лента листается */
.hscroll.fade { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }

/* ---------- типографика ---------- */

.display {
  font-family: var(--font-logo);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
  word-spacing: -.32em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
/* text-wrap выше сбрасывает nowrap от .ellipsis — возвращаем, иначе длинное имя вылезает на соседей */
.display.ellipsis { white-space: nowrap; max-width: 100%; }
.display.xl { font-size: clamp(34px, 5vw, 60px); line-height: 1; }
.display.l { font-size: clamp(25px, 3vw, 36px); }
.display.m { font-size: clamp(18px, 1.9vw, 23px); }
.display.s { font-size: 14px; letter-spacing: .02em; }
.display.glow { text-shadow: 0 0 22px rgba(255, 157, 28, .45), 0 3px 0 rgba(0, 0, 0, .35); }
.eyebrow {
  display: inline-block;
  font: 700 11px/1.3 var(--font-ui);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: 17px; color: var(--muted); max-width: 60ch; }
.small { font-size: 13px; }

/* цена на табло: оранжевое число на зелёной клетке */
.price {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: .18em;
  min-width: 2.4em;
  padding: .42em .62em .36em;
  border-radius: var(--r-sm);
  background: var(--cell-face);
  color: var(--orange);
  font: 400 16px/1 var(--font-logo);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  word-spacing: -.35em;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(255, 157, 28, .55), 0 2px 0 rgba(0, 0, 0, .35);
  box-shadow: var(--cell-bevel), 0 3px 0 var(--cell-edge);
}
.price small { font-size: .55em; color: var(--muted); text-shadow: none; letter-spacing: 0; }
.price.sm { font-size: 12px; border-radius: 8px; box-shadow: var(--cell-bevel), 0 2px 0 var(--cell-edge); }
.price.lg { font-size: 26px; border-radius: 14px; }
.price.xl { font-size: clamp(36px, 5vw, 52px); border-radius: 18px; box-shadow: var(--cell-bevel), 0 5px 0 var(--cell-edge); }
.price.on { background: var(--lit-face); color: var(--orange-ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 0 var(--orange-edge), 0 0 22px rgba(255, 157, 28, .45); }
.price.on small { color: rgba(42, 22, 0, .7); }
.price.red { background: var(--red-face); color: #FFE2B0; text-shadow: 0 0 12px rgba(255, 190, 120, .5), 0 2px 0 rgba(0, 0, 0, .3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 3px 0 var(--red-edge); }
.price.used { background: var(--cell-used); color: rgba(255, 157, 28, .28); text-shadow: none; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .35); }

/* ---------- карточки ---------- */

.card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 110px at 50% 0, rgba(190, 255, 170, .055), transparent),
    var(--felt),
    var(--card);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    inset 0 -30px 50px rgba(0, 0, 0, .14),
    0 12px 30px rgba(0, 0, 0, .22);
  color: inherit;
}
a.card { display: block; text-decoration: none; }
/* ссылки-карточки не красим целиком в оранжевый при наведении */
a.card:hover, a.li:hover, a.feed-ava:hover { color: inherit; }
.card.pad-l { padding: 28px; }
.card.flat { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.card.inset { background: rgba(0, 0, 0, .2); box-shadow: inset 0 2px 10px rgba(0, 0, 0, .25); border-color: var(--line); }
.card.hover { transition: transform .18s var(--ease-out), border-color .18s, box-shadow .18s, background-color .18s; cursor: pointer; }
.card.hover:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  background-color: var(--card-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -30px 50px rgba(0, 0, 0, .12), 0 20px 40px rgba(0, 0, 0, .32);
}
.card.hover:active { transform: translateY(-1px); }
.card.accent {
  border-color: rgba(255, 157, 28, .55);
  background:
    radial-gradient(120% 140px at 50% 0, rgba(255, 157, 28, .12), transparent),
    var(--felt),
    var(--card);
  box-shadow:
    inset 0 1px 0 rgba(255, 210, 150, .18),
    inset 0 0 0 1px rgba(255, 157, 28, .12),
    0 0 0 1px rgba(255, 157, 28, .10),
    0 14px 40px rgba(255, 120, 0, .14);
}
.card.red {
  border-color: rgba(255, 120, 100, .35);
  background: radial-gradient(120% 140px at 50% 0, rgba(255, 140, 110, .22), transparent), var(--felt), var(--red-deep);
}

/* обложка карточки: картинка под контентом + зелёная вуаль, чтобы текст читался */
.card-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  overflow: hidden;
  background: var(--card-2);
  pointer-events: none;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease-out); }
.card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 25, 10, 0) 25%, rgba(4, 25, 10, .55) 62%, rgba(4, 25, 10, .92) 100%),
    linear-gradient(0deg, rgba(10, 58, 18, .22), rgba(10, 58, 18, .22));
}
.card.hover:hover .card-media img { transform: scale(1.04); }
/* без картинки: градиент из цвета рубрики (--tint) и большой эмодзи */
.card-media.fallback {
  background:
    radial-gradient(90% 80% at 85% 20%, color-mix(in srgb, var(--tint, var(--orange)) 70%, transparent), transparent 70%),
    linear-gradient(150deg, color-mix(in srgb, var(--tint, var(--orange)) 45%, var(--card)) 0%, var(--card) 85%);
}
.card-media .emo {
  position: absolute;
  right: 6%;
  top: 8%;
  font-size: var(--emo, 72px);
  line-height: 1;
  transform: rotate(-8deg);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35));
}

/* ---------- лампочки шапито ---------- */
/* Две «фазы» лампочек в шахматном порядке: ::before и ::after. Вокруг рамки соседние
   лампы всегда из разных фаз, поэтому попеременное мигание выглядит как бегущий огонь.
   Сетка с background-repeat: round подгоняется под любой размер карточки, маска оставляет только кольцо. */
.card.marquee {
  padding: 32px;
  border-color: rgba(255, 196, 107, .30);
  background:
    radial-gradient(110% 90% at 50% -10%, rgba(255, 157, 28, .13), transparent 60%),
    var(--felt),
    var(--card);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, .14),
    inset 0 0 0 8px rgba(0, 0, 0, .10),
    inset 0 0 0 9px rgba(255, 196, 107, .07),
    0 16px 40px rgba(0, 0, 0, .3),
    0 0 50px rgba(255, 157, 28, .07);
}
.card.marquee::before,
.card.marquee::after,
.bulbs::before,
.bulbs::after {
  content: '';
  position: absolute;
  inset: 5px;
  z-index: 3;
  pointer-events: none;
  border-radius: calc(var(--r-xl) - 9px);
  padding: 16px;
  background-size: 30px 30px;
  background-repeat: round;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 0 2px rgba(255, 214, 140, .95)) drop-shadow(0 0 6px rgba(255, 150, 40, .55));
  transition: opacity .25s;
}
.card.marquee::before,
.bulbs::before {
  background-image:
    radial-gradient(circle 3.2px at 25% 25%, var(--bulb-core) 0 35%, var(--bulb) 65%, var(--bulb-rim) 92%, transparent 100%),
    radial-gradient(circle 3.2px at 75% 75%, var(--bulb-core) 0 35%, var(--bulb) 65%, var(--bulb-rim) 92%, transparent 100%);
}
.card.marquee::after,
.bulbs::after {
  background-image:
    radial-gradient(circle 3.2px at 75% 25%, var(--bulb-core) 0 35%, var(--bulb) 65%, var(--bulb-rim) 92%, transparent 100%),
    radial-gradient(circle 3.2px at 25% 75%, var(--bulb-core) 0 35%, var(--bulb) 65%, var(--bulb-rim) 92%, transparent 100%);
}
/* вторая фаза чуть тусклее в покое — рамка «дышит», а не горит ровной полосой */
.card.marquee::after, .bulbs::after { opacity: .72; }
.card.marquee.off::before, .card.marquee.off::after { opacity: .22; filter: none; }

/* полоска лампочек сама по себе: <div class="bulbs-row"></div> (подвал, призовые строки) */
.bulbs { position: relative; isolation: isolate; }
.bulbs-row {
  height: 14px;
  background:
    radial-gradient(circle 2.6px at 50% 50%, var(--bulb-core) 0 30%, var(--bulb) 60%, var(--bulb-rim) 90%, transparent 100%) 0 0 / 22px 14px round no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 160, 50, .55));
  opacity: .8;
}
.bulbs-row.dim { opacity: .35; filter: none; }

/* ---------- кнопки ---------- */

.btn {
  --b-face: var(--lit-face);
  --b-ink: var(--orange-ink);
  --b-edge: var(--orange-edge);
  --b-depth: 4px;
  --b-glow: rgba(255, 157, 28, .0);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--b-face);
  color: var(--b-ink);
  font: 800 15px/1.1 var(--font-ui);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -2px 0 rgba(0, 0, 0, .10),
    0 var(--b-depth) 0 var(--b-edge),
    0 calc(var(--b-depth) + 8px) 18px rgba(0, 0, 0, .28),
    0 0 26px var(--b-glow);
  transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.07) saturate(1.05); color: var(--b-ink); }
.btn:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(calc(var(--b-depth) - 1px));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    inset 0 -1px 0 rgba(0, 0, 0, .1),
    0 1px 0 var(--b-edge),
    0 3px 8px rgba(0, 0, 0, .3);
}
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--r-md); }
.btn:disabled, .btn[aria-disabled="true"] { filter: grayscale(.55) brightness(.75); opacity: .7; cursor: not-allowed; }
.btn > svg { margin: 0 -2px; }
.btn.lit { --b-glow: rgba(255, 157, 28, .45); }
.btn.ghost {
  --b-face: var(--cell-face);
  --b-ink: var(--text);
  --b-edge: var(--cell-edge);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -2px 0 rgba(0, 0, 0, .14),
    0 var(--b-depth) 0 var(--b-edge),
    0 calc(var(--b-depth) + 8px) 18px rgba(0, 0, 0, .22);
}
.btn.ghost:hover { filter: none; background: linear-gradient(180deg, #179A31 0%, var(--cell-hi) 55%, #0F7022 100%); }
.btn.danger { --b-face: var(--red-face); --b-ink: #fff; --b-edge: var(--red-edge); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn.good { --b-face: linear-gradient(180deg, #6BF08F 0%, var(--good) 55%, #2CC257 100%); --b-ink: #04250E; --b-edge: #17803A; color: #04250E; }
.btn.tg { --b-face: linear-gradient(180deg, #4CC0F7 0%, var(--tg) 55%, #1E9AD9 100%); --b-ink: #fff; --b-edge: var(--tg-edge); color: #fff; text-shadow: 0 1px 0 rgba(0, 60, 100, .35); }
.btn.sm { --b-depth: 3px; min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn.lg { --b-depth: 5px; min-height: 58px; padding: 0 30px; font-size: 17px; border-radius: 18px; }
.btn.block { display: flex; width: 100%; }
.btn.icon { padding: 0; width: 46px; }
.btn.sm.icon { width: 36px; }
/* текстовая кнопка без плашки */
.btn.link {
  --b-depth: 0px;
  min-height: 0;
  padding: 6px 4px;
  background: none;
  box-shadow: none;
  color: var(--orange-2);
  letter-spacing: .08em;
  font-size: 12px;
}
.btn.link:hover { color: var(--orange); filter: none; text-decoration: underline; text-underline-offset: 4px; }
.btn.link:active { transform: none; box-shadow: none; }

/* красная студийная кнопка: глянцевый купол в чёрном корпусе с латунным ободком */
.btn.buzzer {
  --bz: 116px;
  flex: none;
  flex-direction: column;
  gap: 4px;
  width: var(--bz);
  height: var(--bz);
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #FF7158 0%, var(--red) 40%, var(--red-deep) 72%, #860E06 100%);
  color: #fff;
  font: 400 calc(var(--bz) * .115)/1 var(--font-logo);
  letter-spacing: .03em;
  text-shadow: 0 2px 0 rgba(90, 0, 0, .5);
  box-shadow:
    inset 0 -8px 14px rgba(70, 0, 0, .5),
    inset 0 3px 2px rgba(255, 210, 190, .35),
    0 0 0 5px #170A06,
    0 0 0 7px rgba(255, 196, 107, .34),
    0 8px 0 5px #0B0503,
    0 18px 34px 4px rgba(0, 0, 0, .5),
    0 0 50px 8px rgba(224, 48, 30, .32);
}
.btn.buzzer::before {
  content: '';
  position: absolute;
  left: 24%;
  right: 24%;
  top: 6%;
  height: 32%;
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 70%, rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn.buzzer::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 110, 85, .55);
  opacity: 0;
  pointer-events: none;
}
.btn.buzzer > * { position: relative; z-index: 1; }
.btn.buzzer > svg { width: 30%; height: 30%; margin: 0; filter: drop-shadow(0 2px 0 rgba(90, 0, 0, .45)); }
.btn.buzzer:hover { filter: brightness(1.08); }
.btn.buzzer:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow:
    inset 0 -4px 10px rgba(70, 0, 0, .55),
    inset 0 3px 2px rgba(255, 210, 190, .3),
    0 0 0 5px #170A06,
    0 0 0 7px rgba(255, 196, 107, .34),
    0 3px 0 5px #0B0503,
    0 8px 18px 2px rgba(0, 0, 0, .5),
    0 0 70px 14px rgba(224, 48, 30, .45);
}
.btn.buzzer:focus-visible { outline-offset: 12px; border-radius: 50%; }
.btn.buzzer.sm { --bz: 76px; }
.btn.buzzer.lg { --bz: 156px; }
.btn.buzzer:disabled { filter: grayscale(.8) brightness(.6); opacity: 1; }

/* круглая зелёная кнопка-иконка (шапка, панели) */
.icon-btn {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cell-face);
  color: var(--text);
  box-shadow: var(--cell-bevel), 0 3px 0 var(--cell-edge), 0 8px 16px rgba(0, 0, 0, .22);
  transition: transform .08s, box-shadow .08s, background .15s, color .15s;
  text-decoration: none;
}
.icon-btn:hover { background: linear-gradient(180deg, #179A31 0%, var(--cell-hi) 55%, #0F7022 100%); color: #fff; }
.icon-btn:active { transform: translateY(2px); box-shadow: var(--cell-bevel), 0 1px 0 var(--cell-edge); }
.icon-btn:focus-visible { border-radius: 50%; }
.icon-btn.on, .icon-btn[aria-current="page"] {
  background: var(--lit-face);
  color: var(--orange-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 0 var(--orange-edge), 0 0 20px rgba(255, 157, 28, .4);
}
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.ghost { background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.badge-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--bg), 0 0 10px rgba(255, 157, 28, .8);
}
.badge-dot.red { background: var(--bad); box-shadow: 0 0 0 3px var(--bg), 0 0 10px rgba(255, 93, 77, .8); }
.badge-dot.good { background: var(--good); box-shadow: 0 0 0 3px var(--bg), 0 0 10px rgba(61, 220, 106, .8); }

/* ---------- формы ---------- */

.field {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 2px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font: 600 16px/1.3 var(--font-ui);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .28);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field::placeholder { color: var(--dim); font-weight: 500; }
.field:hover { border-color: rgba(190, 255, 170, .3); }
.field:focus, .field:focus-visible {
  outline: none;
  border-color: var(--orange);
  background-color: rgba(0, 0, 0, .36);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .28), 0 0 0 4px rgba(255, 157, 28, .2);
}
.field.lg { min-height: 60px; padding: 15px 18px; font-size: 20px; border-radius: 16px; }
.field.mono { font-family: var(--font-logo); font-weight: 400; letter-spacing: .22em; text-transform: uppercase; text-align: center; }
.field.mono::placeholder { letter-spacing: .22em; }
.field.err, .field[aria-invalid="true"] { border-color: var(--bad); }
textarea.field { min-height: 96px; resize: vertical; }
.label { display: block; margin: 0 0 7px; font: 700 12px/1.2 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.form-err { min-height: 1.3em; font-size: 14px; font-weight: 600; color: #FFB0A6; }
.form-err:empty { min-height: 0; }

/* сегменты: <div class="seg"><button class="on">…</button><button>…</button></div> */
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(0, 0, 0, .28);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25);
  max-width: 100%;
}
.seg.block { display: flex; width: 100%; }
.seg > button, .seg > a {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  color: var(--muted);
  font: 800 13px/1.1 var(--font-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg > button:hover, .seg > a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.seg > .on, .seg > [aria-pressed="true"], .seg > [aria-selected="true"] {
  background: var(--lit-face);
  color: var(--orange-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 0 var(--orange-edge);
}
.seg > .on:hover { color: var(--orange-ink); }

/* переключатель: <label class="switch"><input type="checkbox"><i></i><span>Текст</span></label> */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch > i {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .38);
  box-shadow: inset 0 0 0 2px var(--line-2), inset 0 2px 6px rgba(0, 0, 0, .3);
  transition: background .2s, box-shadow .2s;
}
.switch > i::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #D9F2D4, var(--muted));
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  transition: transform .22s var(--ease-pop), background .2s;
}
.switch input:checked + i { background: var(--lit-face); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 16px rgba(255, 157, 28, .35); }
.switch input:checked + i::after { transform: translateX(20px); background: linear-gradient(180deg, #fff, #FFF1D6); }
.switch input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 3px; }
.switch input:disabled + i { opacity: .45; }

/* ---------- вкладки-клетки табло ---------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, .26);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .28);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--cell-face);
  color: #D7F0D2;
  font: 400 12.5px/1 var(--font-logo);
  letter-spacing: .03em;
  word-spacing: -.3em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--cell-bevel), 0 2px 0 var(--cell-edge);
  transition: background .15s, color .15s, box-shadow .2s, transform .08s;
}
.tab:hover { color: #fff; background: linear-gradient(180deg, #179A31 0%, var(--cell-hi) 55%, #0F7022 100%); }
.tab:active { transform: translateY(1px); }
.tab svg { color: var(--orange-2); }
.tab.on, .tab[aria-current="page"], .tab[aria-selected="true"] {
  background: var(--lit-face);
  color: var(--orange-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 var(--orange-edge), 0 0 24px rgba(255, 157, 28, .45);
}
.tab.on svg, .tab[aria-current="page"] svg, .tab[aria-selected="true"] svg { color: var(--orange-ink); }
.tab:focus-visible { outline-offset: 2px; border-radius: 12px; }

/* ---------- чипы и лиги ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(13, 106, 29, .55);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: #D7F0D2;
  font: 700 12px/1.1 var(--font-ui);
  letter-spacing: .04em;
  white-space: nowrap;
  text-decoration: none;
}
.chip svg { width: 14px; height: 14px; }
a.chip:hover { color: #fff; background: rgba(19, 134, 42, .7); }
.chip.orange { color: var(--orange-2); background: rgba(255, 157, 28, .14); box-shadow: inset 0 0 0 1px rgba(255, 157, 28, .38); }
.chip.good { color: #8FF2AA; background: rgba(61, 220, 106, .13); box-shadow: inset 0 0 0 1px rgba(61, 220, 106, .35); }
.chip.purple { color: #D7B8FF; background: rgba(181, 123, 255, .14); box-shadow: inset 0 0 0 1px rgba(181, 123, 255, .38); }
.chip.red { color: #fff; background: var(--red-face); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 2px 0 var(--red-edge); }
.chip.solid { color: var(--orange-ink); background: var(--lit-face); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }

.tier {
  --c: #B8C2D1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 3px 10px 3px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 15%, rgba(0, 0, 0, .3));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent);
  color: var(--c);
  font: 800 11.5px/1.1 var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* камешек лиги */
.tier::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff 0%, var(--c) 45%, color-mix(in srgb, var(--c) 60%, #000) 100%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent);
}
.tier-bronze { --c: #C98A5B; }
.tier-silver { --c: #B8C2D1; }
.tier-gold { --c: #F2C14E; }
.tier-platinum { --c: #4FD1C5; }
.tier-diamond { --c: #9D7BFF; }

/* ---------- списки (топы, ленты) ---------- */

.list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 16px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent), var(--card-2);
  color: inherit;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .12s;
}
a.li:hover, .li.hover:hover { background-color: var(--card-3); border-color: var(--line-2); }
.li .rank {
  text-align: center;
  font: 400 15px/1 var(--font-logo);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.li .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.li .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.li .who .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.li .who a { color: inherit; text-decoration: none; }
.li .who a:hover { color: var(--orange-2); }
.li .val { text-align: right; font: 400 18px/1 var(--font-logo); color: var(--orange); font-variant-numeric: tabular-nums; letter-spacing: -.02em; word-spacing: -.35em; white-space: nowrap; }
.li .val small { display: block; margin-top: 5px; font: 700 10px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.li.r1 .rank { color: var(--gold); text-shadow: 0 0 12px rgba(255, 210, 63, .55); }
.li.r2 .rank { color: #CFD8E6; }
.li.r3 .rank { color: #D99A6A; }
.li.me { border-color: rgba(255, 157, 28, .6); box-shadow: inset 0 0 0 1px rgba(255, 157, 28, .25), 0 0 20px rgba(255, 157, 28, .12); }

/* ---------- аватарки и рамки ---------- */

.ava {
  --s: 40px;
  --bg: #12561E;
  --ring: max(2px, calc(var(--s) * .065));
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  vertical-align: middle;
}
.ava-in {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 58%), var(--bg);
  box-shadow: inset 0 calc(var(--s) * -.06) calc(var(--s) * .12) rgba(0, 0, 0, .28), 0 0 0 2px rgba(0, 0, 0, .28);
}
.ava-in img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava .emo { font-size: calc(var(--s) * .56); line-height: 1; filter: drop-shadow(0 calc(var(--s) * .03) calc(var(--s) * .03) rgba(0, 0, 0, .3)); user-select: none; }
.ava .emo.q { font: 400 calc(var(--s) * .38)/1 var(--font-logo); color: rgba(255, 255, 255, .7); filter: none; }

/* рамки — кольцо снаружи аватарки, раскладку не двигают */
.ava[class*="frame-"]::before {
  content: '';
  position: absolute;
  inset: calc(var(--ring) * -1.5);
  border-radius: 50%;
  padding: var(--ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.frame-fire::before {
  background: conic-gradient(from 0deg, #FFE066, #FF9D1C, #E0301E, #FF7A1C, #FFD23F, #FF5A1C, #E0301E, #FFB03A, #FFE066);
  animation: spin 2.6s linear infinite;
}
.frame-fire::after {
  content: '';
  position: absolute;
  inset: calc(var(--ring) * -1.5);
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--s) * .18) rgba(255, 110, 20, .65), 0 0 calc(var(--s) * .06) rgba(255, 200, 80, .8);
  animation: flicker 1.6s ease-in-out infinite;
  pointer-events: none;
}
.frame-gold::before,
.frame-crown::before {
  background: conic-gradient(from 210deg, #FFF3B8, #FFD23F 18%, #B8820F 34%, #FFE57F 52%, #C9961C 70%, #FFF3B8 86%, #FFD23F);
  filter: drop-shadow(0 0 calc(var(--s) * .05) rgba(255, 210, 63, .55));
}
.frame-crown::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(var(--s) * -.36);
  width: calc(var(--s) * .52);
  height: calc(var(--s) * .38);
  transform: translateX(-50%) rotate(-6deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FFF3B8'/%3E%3Cstop offset='.5' stop-color='%23FFD23F'/%3E%3Cstop offset='1' stop-color='%23C08A12'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M3 20 1.5 6.5l7.5 6L16 2l7 10.5 7.5-6L29 20z' fill='url(%23g)' stroke='%237A5208' stroke-width='1.4' stroke-linejoin='round'/%3E%3Crect x='3' y='19' width='26' height='4' rx='1.5' fill='%23E0A92A' stroke='%237A5208' stroke-width='1.2'/%3E%3Ccircle cx='16' cy='13' r='2' fill='%23E0301E'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4));
  pointer-events: none;
}
.frame-neon::before {
  background: conic-gradient(from 90deg, var(--orange), #FFD08A, var(--cyan), #A8F0FF, var(--orange), #FFD08A, var(--cyan), #A8F0FF, var(--orange));
  filter: drop-shadow(0 0 3px rgba(255, 157, 28, .9)) drop-shadow(0 0 calc(var(--s) * .12) rgba(94, 224, 255, .6));
  animation: neon 3.2s steps(1) infinite;
}
/* Чемпион недели — золото с красными лентами пьедестала, медленно едет; кубок в углу */
.frame-champion::before {
  background: conic-gradient(from 0deg, #FFF3B8, #FFD23F 9%, #E0301E 13% 21%, #FFD23F 25%, #B8820F 37%, #FFE57F 49%, #E0301E 53% 61%, #FFE57F 65%, #C9961C 78%, #FFF3B8 90%, #FFD23F);
  filter: drop-shadow(0 0 calc(var(--s) * .07) rgba(255, 190, 60, .7));
  animation: spin 9s linear infinite;
}
.frame-champion::after {
  content: '';
  position: absolute;
  right: calc(var(--s) * -.17);
  top: calc(var(--s) * -.17);
  width: max(12px, calc(var(--s) * .46));
  height: max(12px, calc(var(--s) * .46));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23FFF3B8'/%3E%3Cstop offset='.45' stop-color='%23FFD23F'/%3E%3Cstop offset='1' stop-color='%23B8820F'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M9.2 7.5H5.6c-.7 0-1.2.6-1.1 1.3.5 3.6 2.6 5.6 5.6 5.9M22.8 7.5h3.6c.7 0 1.2.6 1.1 1.3-.5 3.6-2.6 5.6-5.6 5.9' fill='none' stroke='%236B4708' stroke-width='3.4' stroke-linecap='round'/%3E%3Cpath d='M9.2 7.5H5.6c-.7 0-1.2.6-1.1 1.3.5 3.6 2.6 5.6 5.6 5.9M22.8 7.5h3.6c.7 0 1.2.6 1.1 1.3-.5 3.6-2.6 5.6-5.6 5.9' fill='none' stroke='url(%23g)' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M8.6 4.5h14.8v6a7.4 7.4 0 0 1-14.8 0z' fill='url(%23g)' stroke='%236B4708' stroke-width='1.3' stroke-linejoin='round'/%3E%3Cpath d='M16 6.6l1.1 2.3 2.5.3-1.9 1.7.5 2.5-2.2-1.3-2.2 1.3.5-2.5-1.9-1.7 2.5-.3z' fill='%23E0301E'/%3E%3Cpath d='M14.3 17.6h3.4v3.6h-3.4z' fill='url(%23g)' stroke='%236B4708' stroke-width='1.1'/%3E%3Cpath d='M10.8 21.2h10.4l.9 3.3H9.9z' fill='url(%23g)' stroke='%236B4708' stroke-width='1.1' stroke-linejoin='round'/%3E%3Crect x='8' y='24.4' width='16' height='3.6' rx='1.2' fill='%23C8302A' stroke='%236B0F08' stroke-width='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)) drop-shadow(0 0 4px rgba(255, 210, 63, .5));
  transform: rotate(14deg);
  pointer-events: none;
}
.ava[style*="--s:2"].frame-champion::after { display: none; } /* в крошечных аватарках кубок — только шум */
@media (prefers-reduced-motion: reduce) {
  .frame-champion::before { animation: none !important; }
}

/* ---------- прогресс, точки, плашки ---------- */

.bar {
  position: relative;
  display: block;
  height: 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .36);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .16) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #FFC66E, var(--orange) 60%, #E8830A);
  box-shadow: 0 0 12px rgba(255, 157, 28, .55);
  transition: width .5s var(--ease-out);
}
.bar.sm { height: 6px; }
.bar.lg { height: 14px; }
.bar.good > i { background: linear-gradient(180deg, #7DF29C, var(--good)); box-shadow: 0 0 12px rgba(61, 220, 106, .5); }
.bar.red > i { background: linear-gradient(180deg, #FF7B66, var(--red)); box-shadow: 0 0 12px rgba(224, 48, 30, .5); }

.dots { display: inline-flex; align-items: center; gap: 4px; }
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .3);
}
.dots i.on { background: radial-gradient(circle at 40% 35%, #FFE0A8, var(--orange) 70%); box-shadow: 0 0 6px rgba(255, 157, 28, .75); }
.dots.lg i { width: 11px; height: 11px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .4);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: 700 13px/1.1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.pill svg { width: 15px; height: 15px; color: var(--orange); }
.pill.lit { background: rgba(255, 157, 28, .16); box-shadow: inset 0 0 0 1px rgba(255, 157, 28, .45); color: var(--orange-2); }

/* ---------- плитка режима ---------- */

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 16px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent), var(--felt), var(--card);
  color: inherit;
  text-decoration: none;
  text-align: left;
  width: 100%;
  transition: background-color .15s, border-color .15s, transform .15s var(--ease-out);
}
.tile > .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: var(--cell-face);
  color: var(--orange);
  font-size: 24px;
  box-shadow: var(--cell-bevel), 0 3px 0 var(--cell-edge);
  transition: background .15s, color .15s, box-shadow .2s;
}
.tile > .ico svg { width: 24px; height: 24px; }
.tile .txt { flex: 1 1 auto; min-width: 0; display: block; }
.tile .t { display: block; font: 400 15px/1.15 var(--font-logo); text-transform: uppercase; letter-spacing: .01em; word-spacing: -.32em; color: var(--text); }
.tile .d { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.tile > svg:last-child { flex: none; margin-left: auto; color: var(--dim); transition: transform .15s, color .15s; }
.tile:hover { background-color: var(--card-2); border-color: var(--line-2); color: inherit; }
.tile:hover > .ico { background: var(--lit-face); color: var(--orange-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 0 var(--orange-edge), 0 0 18px rgba(255, 157, 28, .35); }
.tile:hover > svg:last-child { color: var(--orange); transform: translateX(3px); }
.tile:active { transform: scale(.99); }
.tile.off, .tile[aria-disabled="true"] { opacity: .5; pointer-events: none; filter: saturate(.6); }
.tile.off > .ico { color: var(--muted); }

/* ---------- заголовок секции, заглушки, пустые места ---------- */

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
  margin: 0 0 14px;
}
.sec-head > a, .sec-head .more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 11px/1.2 var(--font-ui);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.sec-head > a:hover, .sec-head .more:hover { color: var(--orange); }

.skel {
  display: block;
  min-height: 1em;
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(190, 255, 170, .05) 30%, rgba(190, 255, 170, .11) 50%, rgba(190, 255, 170, .05) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skel.text { height: 14px; border-radius: 6px; }
.skel.circle { border-radius: 50%; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 18px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}
.empty svg { color: var(--dim); }

.spin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 157, 28, .25);
  border-top-color: var(--orange);
  animation: spin .8s linear infinite;
  flex: none;
}

/* ---------- лента дейлика: аватарка со счётом в уголке ---------- */
/* <a class="feed-ava" href="/u/..."><span class="fa-pic">{avatar 64}<b class="fa-sc">18</b></span><span class="fa-nm">имя</span></a> */
.feed-ava {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 82px;
  flex: none;
  color: inherit;
  text-decoration: none;
  text-align: center;
}
.feed-ava .fa-pic { position: relative; display: inline-block; transition: transform .18s var(--ease-pop); }
.feed-ava:hover .fa-pic { transform: translateY(-3px) rotate(-3deg); }
.feed-ava .fa-sc {
  position: absolute;
  right: -7px;
  bottom: -5px;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cell-face);
  color: var(--orange);
  font: 400 11px/1 var(--font-logo);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 157, 28, .6);
  box-shadow: 0 0 0 3px var(--card), var(--cell-bevel);
}
.feed-ava .fa-sc.max { background: var(--lit-face); color: var(--orange-ink); text-shadow: none; }
.feed-ava .fa-sc.wait { color: var(--muted); text-shadow: none; }
.feed-ava .fa-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.feed-ava:hover .fa-nm { color: var(--text); }

/* ---------- тосты ---------- */

#toast-root {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100% - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 100%;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 78, 30, .97), rgba(8, 44, 16, .97));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in .34s var(--ease-pop) both;
}
.toast-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--cell-face);
  color: var(--orange);
  box-shadow: var(--cell-bevel);
}
.toast.good { border-color: rgba(61, 220, 106, .45); }
.toast.good .toast-ico { background: linear-gradient(180deg, #6BF08F, var(--good)); color: #04250E; }
.toast.bad { border-color: rgba(255, 93, 77, .55); background: linear-gradient(180deg, rgba(92, 22, 14, .97), rgba(52, 12, 8, .97)); }
.toast.bad .toast-ico { background: var(--red-face); color: #fff; }
.toast.out { animation: toast-out .26s ease forwards; }

/* ---------- модалки (на телефоне — шторка снизу) ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-back {
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 50% 30%, rgba(4, 30, 10, .6), rgba(0, 6, 2, .86));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade-in .2s ease both;
}
.modal-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 28px 26px 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background:
    radial-gradient(90% 200px at 50% -40px, rgba(255, 196, 107, .14), transparent 75%),
    var(--felt),
    linear-gradient(180deg, #0D4617, var(--card) 220px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .07);
  animation: sheet-in .34s var(--ease-pop) both;
  scrollbar-width: thin;
}
.modal-sheet:focus { outline: none; }
.modal.wide .modal-sheet { width: min(720px, 100%); }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.modal-title { margin: 0 44px 16px 0; }
.modal-body > p + p { margin-top: 10px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal.closing { pointer-events: none; }
.modal.closing .modal-back { animation: fade-out .2s ease forwards; }
.modal.closing .modal-sheet { animation: sheet-out .2s ease forwards; }

/* ---------- шапка сайта ---------- */

.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--orange);
  color: var(--orange-ink);
  font-weight: 800;
  text-decoration: none;
}
.skip:focus { top: 12px; color: var(--orange-ink); }

.site-head { position: relative; z-index: 20; }
.sh-in {
  display: grid;
  /* края по содержимому, меню — по центру оставшегося места: широкая правая часть (гость, монеты, звук) не наезжает на меню */
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  max-width: 1360px;
  min-height: var(--head-h);
  margin: 0 auto;
  padding: 14px 24px;
}
.logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
}
.logo:hover { color: #fff; }
.logo-mark { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 0 14px rgba(255, 157, 28, .35)); transition: transform .25s var(--ease-pop); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-word {
  font: 400 27px/1 var(--font-logo);
  letter-spacing: .02em;
  color: #FFF8EC;
  text-shadow: 0 0 18px rgba(255, 157, 28, .55), 0 0 2px rgba(255, 200, 120, .5), 0 3px 0 rgba(0, 0, 0, .35);
}
.logo.sm .logo-mark { width: 30px; height: 30px; }
.logo.sm .logo-word { font-size: 18px; }
.site-nav { justify-self: center; }
.site-nav .tab { min-height: 46px; padding: 0 22px; font-size: 14px; }
.sh-act { justify-self: end; display: flex; align-items: center; gap: 10px; }

/* плашка профиля в шапке */
.me-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  max-width: 240px;
  padding: 0 16px 0 6px;
  border-radius: 99px;
  background: var(--cell-face);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--cell-bevel), 0 3px 0 var(--cell-edge), 0 8px 16px rgba(0, 0, 0, .22);
  transition: background .15s, box-shadow .2s;
}
.me-pill:hover { color: #fff; background: linear-gradient(180deg, #179A31 0%, var(--cell-hi) 55%, #0F7022 100%); }
.me-pill.on, .me-pill[aria-current="page"] { box-shadow: var(--cell-bevel), 0 3px 0 var(--cell-edge), 0 0 0 2px var(--orange), 0 0 22px rgba(255, 157, 28, .35); }
.me-pill .mp-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.me-pill .mp-nm { font-weight: 800; font-size: 14.5px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-pill .mp-lv { display: flex; align-items: center; gap: 7px; font: 400 10px/1 var(--font-logo); color: var(--orange); letter-spacing: .04em; }
.me-pill .mp-lv .bar { width: 46px; height: 4px; }
.me-pill .mp-lv .bar > i { min-width: 3px; box-shadow: none; }
.me-pill.skel { width: 150px; box-shadow: none; }

/* ---------- подвал ---------- */

/* короткая страница (404, чужой профиль) — подвал всё равно прижат к низу экрана */
#root { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
#view { flex: 1 0 auto; }
.site-foot { width: 100%; max-width: 1360px; margin: 24px auto 0; padding: 0 24px 34px; }
.sf-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
  padding-top: 22px;
}
.sf-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.sf-links a { color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.sf-links a:hover { color: var(--orange); }
.sf-note { color: var(--dim); font-size: 13px; font-weight: 600; }

/* ---------- нижняя панель на телефоне ---------- */

.tabbar { display: none; }

/* игровые экраны (квиз, комната) рисуют свою верхнюю панель — сайтовую рамку прячем */
body.chrome-game .site-head,
body.chrome-game .site-foot,
body.chrome-game .tabbar { display: none !important; }

/* ---------- 404 и ошибки ---------- */

.nf { max-width: 760px; margin: 32px auto 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 48px 32px 44px; }
.nf-board { display: flex; gap: 10px; margin-bottom: 6px; }
.nf-board .price { width: 1.9em; padding-left: 0; padding-right: 0; }
.nf .lead { margin: 0 auto; }
.nf .row { justify-content: center; margin-top: 6px; }

/* ---------- онбординг и выбор аватарки ---------- */

.ob { display: flex; flex-direction: column; gap: 16px; }
.ob-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 4px 34px 0; }
.ob > .seg:first-child { width: calc(100% - 46px); }
.ob-hero .logo-mark { width: 64px; height: 64px; }
.ob-hero .lead { font-size: 15px; }
.ob-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ob-or { display: flex; align-items: center; gap: 12px; color: var(--dim); font: 700 11px/1 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; }
.ob-or::before, .ob-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.ob-note { font-size: 13px; color: var(--muted); text-align: center; }
.ob-note b { color: var(--text); }
.ob-reason { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: rgba(255, 157, 28, .12); box-shadow: inset 0 0 0 1px rgba(255, 157, 28, .35); color: var(--orange-2); font-weight: 600; font-size: 14px; }
.ob-reason svg { color: var(--orange); flex: none; }
.ob-steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ob-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.ob-steps .price { min-width: 36px; font-size: 14px; }
.ob-status { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 28px; color: var(--muted); font-weight: 600; font-size: 14px; }
.ob-status.bad { color: #FFB0A6; }
.ob-link { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.ob-link a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-who { display: flex; align-items: center; gap: 14px; }
.ob-who .field { flex: 1; }
.ob-back { align-self: center; }
.ob-code { display: flex; justify-content: center; gap: 5px; }
.ob-code .price { width: 1.7em; min-width: 0; padding-left: 0; padding-right: 0; font-size: min(26px, 5.4vw); }
.ob-tg-photo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(42, 171, 238, .1); box-shadow: inset 0 0 0 1px rgba(42, 171, 238, .35); font-weight: 600; font-size: 14px; }

.ap { display: flex; flex-direction: column; gap: 12px; }
.ap-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.ap-colors { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; justify-items: center; }
.ap-opt {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, .24);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 22px;
  line-height: 1;
  transition: transform .12s var(--ease-pop), background .15s, box-shadow .15s;
}
.ap-opt:hover { background: rgba(255, 255, 255, .07); transform: scale(1.08); }
.ap-opt.on, .ap-opt[aria-checked="true"] { background: rgba(255, 157, 28, .18); box-shadow: inset 0 0 0 2px var(--orange), 0 0 14px rgba(255, 157, 28, .35); }
.ap-opt img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.ap-img { width: 56px; padding: 3px; }
.ap-color {
  width: 100%;
  max-width: 32px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .25), 0 0 0 2px rgba(0, 0, 0, .3);
  transition: transform .12s var(--ease-pop), box-shadow .15s;
}
.ap-color:hover { transform: scale(1.12); }
.ap-color.on, .ap-color[aria-checked="true"] { box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .25), 0 0 0 3px var(--bg), 0 0 0 5px var(--orange); }
.ap-colors.dim { opacity: .4; }

/* ---------- анимации ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes flicker { 0%, 100% { opacity: .85; } 40% { opacity: 1; } 55% { opacity: .65; } 70% { opacity: .95; } }
@keyframes neon { 0%, 100% { opacity: 1; } 91% { opacity: 1; } 92% { opacity: .45; } 93% { opacity: 1; } 95% { opacity: .6; } 96% { opacity: 1; } }
@keyframes bulbs { 0%, 34% { opacity: 1; } 50%, 84% { opacity: .25; } 100% { opacity: 1; } }
@keyframes buzz-ring { 0% { opacity: .75; transform: scale(.86); } 100% { opacity: 0; transform: scale(1.22); } }

#view:focus { outline: none; }
#view.enter { animation: page-in .28s var(--ease-out) both; }
#view.game-view { display: block; width: 100%; min-height: 100vh; min-height: 100dvh; }

@media (prefers-reduced-motion: no-preference) {
  /* бегущие огни — только когда наводят: в покое рамка горит ровно */
  .card.marquee:hover::before, .bulbs.run::before { animation: bulbs 1.1s ease-in-out infinite; }
  .card.marquee:hover::after, .bulbs.run::after { animation: bulbs 1.1s ease-in-out infinite -.55s; opacity: 1; }
  .btn.buzzer::after { animation: buzz-ring 2.4s ease-out infinite; }
  .btn.buzzer:hover::after, .btn.buzzer:disabled::after { animation: none; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .frame-fire::before, .frame-neon::before, .skel, .spin { animation: none !important; }
  .spin { border-color: var(--orange); border-right-color: transparent; }
}

/* ---------- адаптив ---------- */

@media (max-width: 1040px) and (min-width: 900px) {
  /* узкий десктоп: меню и кнопки не помещаются — от логотипа остаётся значок */
  .site-head .logo-word { display: none; }
  .site-head .site-nav .tab { padding: 0 12px; }
  .sh-act { gap: 8px; }
}
@media (max-width: 1100px) {
  .site-nav .tab { padding: 0 16px; font-size: 13px; }
  .me-pill .mp-txt { display: none; }
  .me-pill { padding: 0 4px; }
}

@media (min-width: 900px) {
  #toast-root { top: calc(var(--head-h) + 8px); left: auto; right: max(24px, calc((100vw - 1360px) / 2 + 24px)); align-items: flex-end; transform: none; }
}

@media (max-width: 899px) {
  :root { --head-h: 64px; }
  .page { padding: 4px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); }
  .bento { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bento > [class*="span-"] { grid-column: 1 / -1; }
  .card { padding: 18px; border-radius: 22px; }
  .card.pad-l { padding: 22px 20px; }
  .card.marquee { padding: 28px 24px; }

  .sh-in { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px; gap: 12px; }
  .site-nav, .sh-act .hide-m { display: none; }
  .logo-mark { width: 38px; height: 38px; }
  .logo-word { font-size: 22px; }
  .sh-act { gap: 8px; }
  .sh-act .icon-btn { width: 42px; height: 42px; }
  /* профиль на телефоне — в нижней панели; в шапке остаётся только «Войти» для гостя */
  .sh-act .me-pill { display: none; }
  .sh-login { --b-depth: 3px; min-height: 40px; padding: 0 14px; font-size: 13px; border-radius: 12px; gap: 6px; }
  .sh-login svg { width: 16px; height: 16px; }

  .site-foot { display: none; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + var(--safe-b));
    background: linear-gradient(180deg, rgba(8, 40, 15, .94), rgba(4, 25, 10, .98));
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .tabbar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 54px;
    border-radius: 14px;
    color: var(--muted);
    font: 700 10.5px/1 var(--font-ui);
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .15s;
  }
  .tabbar .tb-ico {
    display: grid;
    place-items: center;
    width: 46px;
    height: 30px;
    border-radius: 10px;
    transition: background .15s, box-shadow .2s, color .15s;
  }
  .tabbar .tb-ico .ava { --s: 26px; }
  .tabbar a:active .tb-ico { transform: scale(.94); }
  .tabbar a[aria-current="page"] { color: var(--orange); }
  .tabbar a[aria-current="page"] .tb-ico {
    background: var(--lit-face);
    color: var(--orange-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 0 var(--orange-edge), 0 0 16px rgba(255, 157, 28, .45);
  }
  .tabbar a:focus-visible { outline-offset: -2px; }

  #toast-root { top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .nf { margin-top: 12px; padding: 36px 20px 32px; }
}

@media (max-width: 640px) {
  .modal { place-items: end stretch; padding: 0; }
  .modal-sheet {
    width: 100%;
    max-height: 92dvh;
    padding: 30px 20px calc(22px + var(--safe-b));
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
    animation: sheet-up .32s var(--ease-out) both;
  }
  /* язычок шторки */
  .modal-sheet::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    width: 42px;
    height: 5px;
    margin-left: -21px;
    border-radius: 99px;
    background: var(--line-2);
  }
  .modal.closing .modal-sheet { animation: sheet-down .22s ease forwards; }
  .modal.wide .modal-sheet { width: 100%; }
  .modal-actions .btn { flex: 1 1 0; }
  .modal-x { top: 12px; right: 12px; }
  .ap-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .ap-opt { font-size: 24px; }
  .btn.lg { min-height: 54px; font-size: 16px; padding: 0 22px; }
}

@media (max-width: 380px) {
  .logo-word { font-size: 19px; }
  .tabbar a { font-size: 9.5px; letter-spacing: .03em; }
}

/* ---------- гость: пометка в шапке и «что переедет» в окне входа ---------- */

.sh-user { display: flex; align-items: center; gap: 10px; }
.sh-guest {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px 0 6px;
  border-radius: 99px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .15s, color .15s;
}
.sh-guest:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 157, 28, .55); }
.sh-guest[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--orange); }
.sh-guest .ava { filter: saturate(.75); }
.sh-guest .sg-txt { display: flex; flex-direction: column; gap: 3px; }
.sh-guest b { font: 400 11px/1 var(--font-logo); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.sh-guest small { font-size: 11px; font-weight: 600; line-height: 1; color: var(--dim); }
.tabbar .ava.is-guest { filter: saturate(.7); box-shadow: 0 0 0 1.5px var(--line-2); }

.ob-guest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ob-guest .og-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ob-guest .og-txt b { font-weight: 800; font-size: 15px; line-height: 1.1; }
.ob-guest .og-txt small { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.25; }
.ob-guest .og-arrow { color: var(--orange); display: grid; flex: none; }
.ob-guest .og-to {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--orange-ink);
  background: var(--lit-face);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 0 var(--orange-edge), 0 0 16px rgba(255, 157, 28, .35);
}

@media (max-width: 1100px) {
  .sh-guest .sg-txt { display: none; }
  .sh-guest { padding: 0 6px; }
}
@media (max-width: 899px) {
  /* на телефоне гость виден в нижней панели — в шапке только «Войти» */
  .sh-act .sh-guest { display: none; }
}


/* ======================================================================
   МОНЕТЫ И МАГАЗИН (агент E): плашка монет в шапке, кружок на вкладке «Профиль»
   и рамки из магазина (.frame-<id> из site/shop.js). Кольцо рисует общее правило
   .ava[class*="frame-"]::before — здесь только его заливка и украшения в ::after.
   ====================================================================== */

.sh-coins {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px 0 9px;
  border-radius: 99px;
  color: var(--orange-2);
  text-decoration: none;
  background: rgba(0, 0, 0, .26);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .28);
  transition: box-shadow .15s, background .15s, transform .15s var(--ease-pop);
}
.sh-coins:hover { color: var(--gold); background: rgba(255, 210, 63, .1); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .6), 0 0 18px rgba(255, 210, 63, .18); }
.sh-coins:active { transform: scale(.96); }
.sh-coins .sc-coin { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.sh-coins b { font: 400 13px/1 var(--font-logo); letter-spacing: -.02em; word-spacing: -.3em; }

.tabbar .tb-ico { position: relative; }
.tb-coins {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 20px;
  padding: 3px 5px 2px;
  border-radius: 99px;
  font: 800 9.5px/1 var(--font-ui);
  letter-spacing: 0;
  text-transform: none;
  color: var(--orange-ink);
  background: linear-gradient(180deg, #FFE27A, var(--gold) 55%, #E0A92A);
  box-shadow: 0 0 0 2px #06260D, 0 2px 6px rgba(0, 0, 0, .4);
  pointer-events: none;
}

@media (max-width: 1100px) {
  .sh-coins { padding: 0 11px 0 8px; }
}
@media (max-width: 899px) {
  /* на телефоне монеты — кружком на вкладке «Профиль» */
  .sh-act .sh-coins { display: none; }
}

@keyframes frame-glint { 0%, 55% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
@keyframes frame-hue { to { filter: hue-rotate(360deg) saturate(1.3) drop-shadow(0 0 3px rgba(255, 255, 255, .5)); } }
@keyframes frame-twinkle { 0%, 100% { opacity: .35; transform: scale(.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes frame-bulbs { 0%, 45% { opacity: 1; } 55%, 95% { opacity: .18; } }
@keyframes frame-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Неон-розовая — трубка вывески, изредка помаргивает */
.frame-neon-pink::before {
  background: linear-gradient(135deg, #FFD6EF, #FF4FB3 35%, #FF7AC6 65%, #FFD6EF);
  filter: drop-shadow(0 0 2px rgba(255, 79, 179, 1)) drop-shadow(0 0 calc(var(--s) * .1) rgba(255, 122, 198, .75));
  animation: neon 4.3s steps(1) infinite;
}

/* Микрофон — золотое кольцо и микрофон ведущего в красном кружке */
.frame-mic::before {
  background: conic-gradient(from 200deg, #FFF3B8, #FFD23F 20%, #B8820F 40%, #FFE57F 60%, #C9961C 80%, #FFF3B8);
}
.frame-mic::after {
  content: '';
  position: absolute;
  right: calc(var(--s) * -.12);
  bottom: calc(var(--s) * -.08);
  width: calc(var(--s) * .44);
  height: calc(var(--s) * .44);
  min-width: 12px;
  min-height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3CradialGradient id='r' cx='.5' cy='.2' r='.9'%3E%3Cstop offset='0' stop-color='%23F2503A'/%3E%3Cstop offset='.5' stop-color='%23E0301E'/%3E%3Cstop offset='1' stop-color='%23B5170E'/%3E%3C/radialGradient%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23C9961C'/%3E%3Cstop offset='.45' stop-color='%23FFF3B8'/%3E%3Cstop offset='1' stop-color='%23B8820F'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='16' cy='16' r='14.5' fill='url(%23r)' stroke='%237D0D05' stroke-width='1.5'/%3E%3Crect x='12' y='5.5' width='8' height='13' rx='4' fill='url(%23g)' stroke='%236B4708' stroke-width='1'/%3E%3Cpath d='M12.6 9.5h6.8M12.6 12h6.8M12.6 14.5h6.8' stroke='%236B4708' stroke-width='.8' opacity='.7'/%3E%3Cpath d='M9.2 14.5a6.8 6.8 0 0 0 13.6 0' fill='none' stroke='%23FFE07A' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M16 21.4v3.6M12.2 25.6h7.6' stroke='%23FFE07A' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45));
  transform: rotate(12deg);
  pointer-events: none;
}

/* Табло — клетки по кругу: оранжевые цены через зелёные, медленно едут */
.ava.frame-board { --ring: max(3px, calc(var(--s) * .09)); }
.frame-board::before {
  background: repeating-conic-gradient(from 4deg, #FFB648 0 20deg, #2A1600 20deg 24deg, #13862A 24deg 44deg, #2A1600 44deg 48deg);
  filter: drop-shadow(0 0 calc(var(--s) * .05) rgba(255, 157, 28, .5));
  animation: spin 14s linear infinite;
}

/* Лампочки — огни сцены вокруг аватарки, две половины мигают по очереди */
/* .ava. — чтобы перебить общее правило кольца (маску и отступы) */
.ava.frame-bulbs::before,
.ava.frame-bulbs::after {
  content: '';
  position: absolute;
  inset: calc(var(--s) * -.17);
  padding: 0;
  border-radius: 50%;
  -webkit-mask: none;
  mask: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='b' cx='.4' cy='.35' r='.7'%3E%3Cstop offset='0' stop-color='%23FFFDF0'/%3E%3Cstop offset='.45' stop-color='%23FFD27A'/%3E%3Cstop offset='1' stop-color='%23FF8A00'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='50' cy='50' r='44' fill='none' stroke='%233A2205' stroke-width='9'/%3E%3Ccircle cx='50' cy='50' r='44' fill='none' stroke='%23B9650A' stroke-width='1.2' stroke-dasharray='1 0'/%3E%3Ccircle cx='50.0' cy='6.0' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='81.1' cy='18.9' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='94.0' cy='50.0' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='81.1' cy='81.1' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='50.0' cy='94.0' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='18.9' cy='81.1' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='6.0' cy='50.0' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='18.9' cy='18.9' r='3.3' fill='url(%23b)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 calc(var(--s) * .04) rgba(255, 190, 80, .9));
  pointer-events: none;
}
.frame-bulbs::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='b' cx='.4' cy='.35' r='.7'%3E%3Cstop offset='0' stop-color='%23FFFDF0'/%3E%3Cstop offset='.45' stop-color='%23FFD27A'/%3E%3Cstop offset='1' stop-color='%23FF8A00'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='66.8' cy='9.3' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='90.7' cy='33.2' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='90.7' cy='66.8' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='66.8' cy='90.7' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='33.2' cy='90.7' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='9.3' cy='66.8' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='9.3' cy='33.2' r='3.3' fill='url(%23b)'/%3E%3Ccircle cx='33.2' cy='9.3' r='3.3' fill='url(%23b)'/%3E%3C/svg%3E"); }
.frame-bulbs::before { animation: frame-bulbs 1.2s ease-in-out infinite; }
.frame-bulbs::after { animation: frame-bulbs 1.2s ease-in-out infinite -.6s; }

/* Кислота — все цвета сразу и по кругу */
.frame-acid::before {
  background: conic-gradient(#FF3CAC, #FFB13C, #FFE53B, #2EE59D, #3DD6F5, #9D7BFF, #FF3CAC);
  filter: saturate(1.3) drop-shadow(0 0 3px rgba(255, 255, 255, .5));
  animation: spin 2.4s linear infinite, frame-hue 5s linear infinite;
}
.frame-acid::after {
  content: '';
  position: absolute;
  inset: calc(var(--ring) * -1.5);
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--s) * .14) rgba(255, 60, 172, .45), 0 0 calc(var(--s) * .2) rgba(61, 214, 245, .3);
  animation: frame-glow 1.8s ease-in-out infinite;
  pointer-events: none;
}

/* Лёд — холодное кольцо с искоркой */
.frame-ice::before {
  background: conic-gradient(from 30deg, #F4FDFF, #9EEBFF 18%, #3DB8E0 34%, #E8FCFF 50%, #7FD8F0 68%, #FFFFFF 84%, #F4FDFF);
  filter: drop-shadow(0 0 calc(var(--s) * .07) rgba(158, 235, 255, .8));
}
.frame-ice::after {
  content: '';
  position: absolute;
  top: calc(var(--s) * -.1);
  right: calc(var(--s) * -.02);
  width: calc(var(--s) * .3);
  height: calc(var(--s) * .3);
  min-width: 8px;
  min-height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.9 6.4 2.6 8.6 12 12-9.4 3.4-11.1 5.6-12 12-.9-6.4-2.6-8.6-12-12 9.4-3.4 11.1-5.6 12-12z' fill='%23F4FDFF'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(158, 235, 255, 1));
  animation: frame-twinkle 2.6s ease-in-out infinite;
  pointer-events: none;
}

/* Тёмная материя — фиолетовая воронка с искрами, крутится навстречу себе */
.frame-dark-matter::before {
  background: conic-gradient(from 0deg, #0B0614, #3B1C6E 18%, #B57BFF 30%, #120A24 44%, #5B2BB5 62%, #E0C8FF 70%, #0B0614 86%);
  filter: drop-shadow(0 0 calc(var(--s) * .1) rgba(157, 123, 255, .7));
  animation: spin 5s linear infinite reverse;
}
.frame-dark-matter::after {
  content: '';
  position: absolute;
  inset: calc(var(--s) * -.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 18% 22%, #fff 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 84% 30%, #E0C8FF 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 88%, #fff 0 1.3px, transparent 1.9px),
    radial-gradient(circle at 10% 70%, #B57BFF 0 1px, transparent 1.6px),
    radial-gradient(circle at 50% 4%, #fff 0 .9px, transparent 1.4px);
  animation: spin 9s linear infinite;
  pointer-events: none;
}

/* Джекпот — густое золото, по кольцу пробегает блик, сбоку монетка */
.frame-jackpot::before {
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%) 160% 0 / 250% 100% no-repeat,
    conic-gradient(from 210deg, #FFF6C8, #FFD23F 16%, #A8780E 32%, #FFE57F 48%, #C08A12 66%, #FFF6C8 84%, #FFD23F);
  filter: drop-shadow(0 0 calc(var(--s) * .08) rgba(255, 210, 63, .75));
  animation: frame-glint 3.2s ease-in-out infinite;
}
.frame-jackpot::after {
  content: '';
  position: absolute;
  left: calc(var(--s) * -.1);
  bottom: calc(var(--s) * -.06);
  width: calc(var(--s) * .36);
  height: calc(var(--s) * .36);
  min-width: 10px;
  min-height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3CradialGradient id='c' cx='.38' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='%23FFF6C8'/%3E%3Cstop offset='.5' stop-color='%23FFD23F'/%3E%3Cstop offset='1' stop-color='%23C08A12'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='16' cy='16' r='14.5' fill='url(%23c)' stroke='%237A5208' stroke-width='1.5'/%3E%3Ccircle cx='16' cy='16' r='10.5' fill='none' stroke='%23A8780E' stroke-width='1.2'/%3E%3Cpath d='M16 9.5v13M19.4 12.2c-.6-1.1-1.9-1.7-3.4-1.7-2 0-3.4 1-3.4 2.5 0 3.4 7 1.8 7 5.3 0 1.5-1.5 2.6-3.6 2.6-1.6 0-3-.7-3.6-1.9' fill='none' stroke='%237A5208' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45));
  transform: rotate(-14deg);
  pointer-events: none;
}

/* у маленьких аватарок (списки, табло) украшения не лезут на соседей */
.ava[style*="--s:2"]:is(.frame-mic, .frame-jackpot, .frame-ice)::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  .frame-neon-pink::before, .frame-board::before, .frame-bulbs::before, .frame-bulbs::after,
  .frame-acid::before, .frame-acid::after, .frame-ice::after, .frame-dark-matter::before,
  .frame-dark-matter::after, .frame-jackpot::before { animation: none !important; }
}
