/* ==========================================================
   ЗОЛОТОЙ СЕПТИМ — дизайн-система
   Визуал: меню Skyrim (тонкие линии, чёрные панели, золото, пергамент).
   UX: оболочка казино-приложения (меню, кошель, ряды игр, лента ставок, чат).
   Текстуры — из файлов игры (assets/img/game).
   ========================================================== */

:root {
  /* Поверхности */
  --bg:        #070707;
  --surface-1: #0c0c0b;
  --surface-2: #131210;
  --surface-3: #1b1916;
  --surface-4: #24211d;
  --hair:      rgba(255, 255, 255, 0.08);
  --line:      rgba(255, 255, 255, 0.38);
  --line-soft: rgba(255, 255, 255, 0.14);
  --panel:     rgba(0, 0, 0, 0.72);

  /* Текст */
  --ink:   #ece8de;
  --dim:   #aaa497;
  --faint: #857f74;

  /* Золото */
  --gold:    #d6b56a;
  --gold-hi: #f2e0a6;
  --gold-lo: #8f7232;

  /* Пергамент */
  --ink-paper:   #2c2117;
  --ink-paper-2: #5a4632;
  --paper-red:   #7b1d14;

  /* Акценты */
  --win:   #f2e0a6;
  --wound: #e0796b;
  --frost: #9cc6db;
  --live:  #7fd18b;

  --radius: 6px;
  --side-w: 248px;
  --side-w-mini: 72px;
  --chat-w: 340px;
  --top-h: 64px;

  --font-ui:   "Jost", "Futura", "Century Gothic", sans-serif;
  --font-book: "Cormorant Garamond", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% 0%, transparent 0%, rgba(0,0,0,.6) 60%, #000 100%),
    linear-gradient(rgba(5,5,5,.86), rgba(5,5,5,.92)),
    url("../img/game/stone-carved.jpg");
  background-size: auto, auto, 640px;
  background-attachment: fixed;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--gold-hi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--gold-hi); outline-offset: 3px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================
   Типографика и орнамент (Skyrim)
   ========================================================== */

.gilded {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.05;
  color: var(--gold);
  background: url("../img/game/gold.jpg") center / 420px;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.9));
}
.menu-title {
  margin: 0;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink);
  text-shadow: 0 2px 6px #000;
}
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.3em; color: var(--gold); font-weight: 400; }
.lore { margin: 0; font-family: var(--font-book); font-style: italic; font-weight: 500; font-size: 20px; color: var(--dim); }
.septims { font-weight: 500; color: var(--gold-hi); font-variant-numeric: tabular-nums; }

.rule { position: relative; height: 14px; margin: 28px auto; }
.rule::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}
.rule::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px;
  border: 1px solid rgba(255,255,255,.7); background: var(--bg);
  transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 0 3px var(--bg);
}
.rule.plain::after { display: none; }

.header-rule { display: flex; align-items: center; gap: 20px; margin: 0 0 28px; }
.header-rule::before, .header-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.header-rule::after { background: linear-gradient(270deg, transparent, var(--line)); }
.header-rule > * { flex: none; }
.header-rule h2 { font-size: clamp(20px, 2.4vw, 28px); }

.trim { height: 20px; background: url("../img/game/trim-chain.jpg") left center / auto 100% repeat-x; box-shadow: 0 0 0 1px #000, 0 2px 8px #000; }
.trim.beasts { height: 28px; background-image: url("../img/game/trim-beasts.jpg"); }
.trim.waves  { background-image: url("../img/game/trim-waves.jpg"); }

.menu-panel { position: relative; padding: 28px 32px; background: linear-gradient(90deg, rgba(0,0,0,.25), var(--panel) 12%, var(--panel) 88%, rgba(0,0,0,.25)); }
.menu-panel::before, .menu-panel::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
}
.menu-panel::before { top: 0; }
.menu-panel::after { bottom: 0; }

.parchment {
  position: relative; padding: 44px 48px; color: var(--ink-paper);
  background: url("../img/game/parchment.jpg") center / cover;
  font-family: var(--font-book); font-weight: 500; font-size: 19px; line-height: 1.5;
  box-shadow: 0 18px 40px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.6);
}
.parchment h2, .parchment h3 { margin: 0 0 6px; font-family: var(--font-book); font-weight: 700; font-size: 30px; color: var(--ink-paper); }
.parchment .sub { font-style: italic; color: var(--ink-paper-2); }
.parchment.torn {
  background: url("../img/game/parchment-torn.webp") center / 100% 100% no-repeat;
  box-shadow: none; filter: drop-shadow(0 18px 30px rgba(0,0,0,.7));
  padding: 64px 64px 72px 72px;
}

.gilt-frame {
  position: relative; padding: 14px;
  background:
    url("../img/game/trim-chain.jpg") top left / auto 14px repeat-x,
    url("../img/game/trim-chain.jpg") bottom left / auto 14px repeat-x,
    linear-gradient(#0b0b0a, #0b0b0a);
  box-shadow: 0 0 0 1px #000, 0 20px 50px rgba(0,0,0,.8);
}
.gilt-frame::before { content: ""; position: absolute; inset: 14px 0; border-left: 3px solid var(--gold-lo); border-right: 3px solid var(--gold-lo); pointer-events: none; }
.gilt-inner { padding: 28px; background: radial-gradient(circle at 50% 30%, #1d1912, #090908 75%); box-shadow: inset 0 0 0 1px rgba(214,181,106,.25); }

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

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 26px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 2px;
  background: rgba(0,0,0,.55); color: var(--ink);
  font-family: var(--font-ui); font-weight: 400; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .2s var(--ease), color .2s, border-color .2s, box-shadow .2s, filter .2s;
}
.btn::before, .btn::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px;
  border: 1px solid currentColor; background: var(--bg); transform: translateY(-50%) rotate(45deg);
}
.btn::before { left: -4px; }
.btn::after { right: -4px; }
.btn:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.08); box-shadow: 0 0 22px rgba(255,255,255,.1); }
.btn-gold {
  border-color: #000; color: #20170a; font-weight: 500;
  background: url("../img/game/gold.jpg") center / 300px;
  box-shadow: inset 0 0 0 1px rgba(255,240,200,.45), inset 0 -10px 18px rgba(60,40,10,.35), 0 0 0 1px var(--gold-lo);
  text-shadow: 0 1px 0 rgba(255,240,200,.45);
}
.btn-gold::before, .btn-gold::after { border-color: var(--gold); background: #000; }
.btn-gold:hover { color: #000; border-color: #000; background: url("../img/game/gold.jpg") center / 300px; filter: brightness(1.12); box-shadow: inset 0 0 0 1px rgba(255,240,200,.6), 0 0 0 1px var(--gold), 0 0 24px rgba(214,181,106,.35); }
.btn-blood { border-color: rgba(224,121,107,.6); color: #f3c6bd; }
.btn-blood:hover { border-color: var(--wound); color: #fff; background: rgba(163,40,31,.25); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; filter: none; }
.btn-lg { min-height: 52px; padding: 0 36px; font-size: 14px; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 12px; }
.btn-plain::before, .btn-plain::after { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--dim); cursor: pointer;
  transition: background .2s, color .2s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"], .icon-btn[aria-pressed="true"] { background: var(--surface-3); color: #fff; }
.icon-btn .dot { position: absolute; }

/* ---------- Монета ---------- */

.coin { width: var(--size, 32px); height: var(--size, 32px); flex: none; border-radius: 50%; background: url("../img/game/coin-icon.png") center / cover; box-shadow: 0 1px 3px #000; }
.coin-3d { --size: 220px; width: var(--size); height: var(--size); perspective: 900px; position: relative; }
.coin-3d .spin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: coin-spin 9s cubic-bezier(.45,.05,.55,.95) infinite; }
.coin-3d .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; background-size: cover; filter: drop-shadow(0 14px 20px rgba(0,0,0,.75)); }
.coin-3d .front { background-image: url("../img/game/coin-front.webp"); }
.coin-3d .back  { background-image: url("../img/game/coin-back.webp"); transform: rotateY(180deg); }
@keyframes coin-spin { 0%, 30% { transform: rotateY(0); } 50%, 80% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
.coin-glow { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(242,224,166,.3), transparent 70%); filter: blur(28px); }

.purse { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.purse .septims { font-size: 18px; }
.purse .unit { color: var(--dim); text-transform: uppercase; font-size: 11px; letter-spacing: 0.22em; }

.notices { display: flex; flex-direction: column; gap: 6px; }
.notice { font-size: 16px; color: var(--ink); text-shadow: 0 1px 2px #000, 0 0 10px #000; }
.notice b { font-weight: 500; color: var(--gold-hi); }
.notice.loss b { color: var(--wound); }
.notice.info b { color: var(--frost); }

.risk { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--dim); }
.risk .pips { display: inline-flex; gap: 5px; }
.risk .pips i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid rgba(255,255,255,.5); }
.risk .pips i.on { background: var(--gold); border-color: var(--gold); }
.risk.master .pips i.on { background: var(--wound); border-color: var(--wound); }

.ledger { width: 100%; border-collapse: collapse; font-size: 19px; }
.ledger th { padding: 6px 8px; text-align: left; font-weight: 700; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-paper-2); border-bottom: 1px solid rgba(44,33,23,.45); }
.ledger td { padding: 10px 8px; border-bottom: 1px dotted rgba(44,33,23,.35); }
.ledger .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ledger .rank { width: 44px; font-weight: 700; font-style: italic; color: var(--paper-red); }
.ledger small { display: block; font-style: italic; color: var(--ink-paper-2); font-size: 16px; line-height: 1.2; }

.house-rules { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.house-rules li { position: relative; padding-left: 26px; }
.house-rules li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 7px; height: 7px; background: var(--paper-red); transform: rotate(45deg); }

/* ==========================================================
   Оболочка приложения
   ========================================================== */

.app {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 100vh;
}

/* ---------- Левое меню ---------- */

.side {
  position: sticky; top: 0; z-index: 40;
  width: var(--side-w); height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(12,12,11,.96), rgba(7,7,7,.96));
  border-right: 1px solid var(--hair);
  transition: width .25s var(--ease), transform .25s var(--ease);
}
.side-top { display: flex; align-items: center; gap: 8px; height: var(--top-h); padding: 0 14px; border-bottom: 1px solid var(--hair); flex: none; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; }
.mode {
  position: relative; display: grid; place-items: center; height: 40px; overflow: hidden;
  border-radius: 4px; color: var(--ink); text-decoration: none;
  font-size: 12px; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase;
  background: var(--art) center / cover; box-shadow: inset 0 0 0 1px var(--hair);
}
.mode::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.62); transition: background .2s; }
.mode span { position: relative; text-shadow: 0 1px 3px #000; }
.mode:hover { color: #fff; }
.mode:hover::before { background: rgba(0,0,0,.45); }
.mode[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--gold), 0 0 14px rgba(214,181,106,.2); }
.mode[aria-current="page"]::before { background: rgba(0,0,0,.35); }
.mode.m-hall { --art: url("../img/game/gold.jpg"); }
.mode.m-fights { --art: url("../img/game/stone-door.jpg"); }

.side-scroll { flex: 1; overflow-y: auto; padding: 14px 12px 24px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.side-group { padding: 6px; background: rgba(255,255,255,.025); border: 1px solid var(--hair); border-radius: var(--radius); }
.side-label { padding: 8px 10px 4px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); }
.side-link {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px;
  border-radius: 4px; color: var(--dim); text-decoration: none; font-size: 15px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--surface-3); color: #fff; }
.side-link[aria-current="page"] { background: linear-gradient(90deg, rgba(214,181,106,.16), transparent); color: var(--gold-hi); box-shadow: inset 2px 0 0 var(--gold); }
.side-link .tag { margin-left: auto; padding: 1px 7px; border-radius: 3px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #1a1408; background: var(--gold); }

/* Свёрнутое меню — только значки */
.app[data-side="mini"] .side { width: var(--side-w-mini); }
.app[data-side="mini"] .side .label,
.app[data-side="mini"] .side .side-label,
.app[data-side="mini"] .side .tag,
.app[data-side="mini"] .side .modes { display: none; }
.app[data-side="mini"] .side-top { justify-content: center; padding: 0; }
.app[data-side="mini"] .side-link { justify-content: center; padding: 0; }
.app[data-side="mini"] .side-scroll { padding: 14px 8px; }

/* ---------- Центр ---------- */

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(0,0,0,.94), rgba(0,0,0,.8));
  backdrop-filter: blur(8px);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); }
.top-left, .top-right { display: flex; align-items: center; gap: 6px; }
.top-right { justify-content: flex-end; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .gilded { font-size: 17px; letter-spacing: 0.2em; }
.only-mobile { display: none !important; }

/* Кошель в центре */
.wallet { display: flex; align-items: stretch; height: 44px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--hair); }
.wallet-balance {
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border: 0; background: var(--surface-2); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.wallet-balance:hover { background: var(--surface-3); }
.wallet-balance .septims { font-size: 16px; }
.wallet-balance .ico { width: 14px; height: 14px; color: var(--faint); }
.wallet .btn { min-height: 0; border-radius: 0; padding: 0 20px; }
.wallet .btn::before, .wallet .btn::after { display: none; }

.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 13px; font-weight: 500; color: #1a1408; background: var(--av, var(--gold)); flex: none; }

.content { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 40px; }

/* ---------- Промо-баннеры ---------- */

.promos {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr);
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.promos::-webkit-scrollbar { display: none; }
.promo {
  position: relative; overflow: hidden; scroll-snap-align: start;
  min-height: 210px; padding: 24px 26px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  border-radius: var(--radius);
  background: var(--art) center / cover;
  box-shadow: 0 0 0 1px var(--hair), 0 18px 40px rgba(0,0,0,.6);
}
.promo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.65) 55%, rgba(0,0,0,.2) 100%); }
.promo > * { position: relative; }
.promo .tag { padding: 2px 8px; border-radius: 3px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #1a1408; background: var(--gold); }
.promo h3 { font-size: 22px; max-width: 70%; }
.promo p { margin: 0; max-width: 62%; color: var(--dim); font-size: 15px; }
.promo .btn { margin-top: auto; }
.promo .art { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
.promo.p-jackpot { --art: url("../img/game/nebula.webp"); background-color: #05070c; background-size: 220% auto; }
.promo.p-jackpot h3, .promo.p-jackpot p { max-width: 60%; position: relative; z-index: 1; }
.promo.p-tourney { --art: url("../img/game/stone-door.jpg"); }
.promo.p-club { --art: url("../img/game/dwemer.jpg"); }

/* ---------- Поиск и категории ---------- */

.search {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px;
  border-radius: var(--radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--faint);
}
.search:focus-within { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--faint); }

.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; flex: none;
  border: 0; border-radius: 999px; background: var(--surface-2); color: var(--dim); cursor: pointer;
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase; box-shadow: inset 0 0 0 1px var(--hair);
  transition: background .15s, color .15s, box-shadow .15s;
}
.pill .ico { width: 16px; height: 16px; }
.pill:hover { color: #fff; background: var(--surface-3); }
.pill[aria-selected="true"] { color: #1a1408; background: url("../img/game/gold.jpg") center / 200px; box-shadow: none; font-weight: 500; }

.lobby-tools { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Ряды игр ---------- */

.shelf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shelf-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.shelf-head h2 .ico { color: var(--gold); }
.shelf-head .spacer { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-soft), transparent); }
.shelf-head .all { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); text-decoration: none; padding: 10px 6px; }
.shelf-head .all:hover { color: #fff; }
.shelf-nav { display: flex; gap: 4px; }
.shelf-nav .icon-btn { width: 36px; height: 36px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }

.tiles {
  --cols: 7;
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--cols) - 1) * 14px) / var(--cols));
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 2px 4px; scrollbar-width: none;
}
.tiles::-webkit-scrollbar { display: none; }
.tile-wrap { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: #111 center / cover no-repeat; /* картинку ставит app.js */
  box-shadow: 0 0 0 1px var(--hair), 0 10px 22px rgba(0,0,0,.55);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tile::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, var(--tint, rgba(214,181,106,.18)), transparent 65%),
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.2) 45%, rgba(0,0,0,.92) 100%);
}
.tile::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(255,255,255,.14); border-radius: 3px; pointer-events: none; transition: border-color .2s; }
.tile:hover { transform: translateY(-5px); box-shadow: 0 0 0 1px rgba(214,181,106,.6), 0 16px 30px rgba(0,0,0,.7), 0 0 26px rgba(214,181,106,.18); }
.tile:hover::after { border-color: rgba(214,181,106,.55); }
.tile .emblem { position: absolute; left: 50%; top: 38%; width: 58%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; color: var(--gold-hi); filter: drop-shadow(0 8px 14px #000); }
.tile .emblem img { width: 100%; height: 100%; object-fit: contain; }
.tile .emblem .ico { width: 70%; height: 70%; stroke-width: .9; }
.tile .name { position: absolute; left: 12px; right: 12px; bottom: 16px; text-align: center; font-size: 14px; line-height: 1.2; letter-spacing: .12em; }
.tile .badge { position: absolute; top: 12px; left: 12px; padding: 2px 7px; border-radius: 3px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #1a1408; background: var(--gold); z-index: 1; }
.tile .badge.hot { background: var(--wound); color: #1f0805; }
.tile .badge.house { background: rgba(0,0,0,.6); color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold-lo); }
.tile .play {
  position: absolute; left: 50%; top: 38%; z-index: 2;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.65); box-shadow: 0 0 0 1px var(--gold); color: var(--gold-hi);
  transform: translate(-50%, -50%) scale(.8); opacity: 0; transition: opacity .2s, transform .2s var(--ease);
}
.tile:hover .play, .tile:focus-visible .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.tile > * { z-index: 1; }
.players { display: flex; align-items: center; gap: 7px; padding-left: 2px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.players::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 6px var(--live); }
.players b { font-weight: 500; color: var(--dim); }

.empty { padding: 40px 20px; text-align: center; color: var(--faint); }

/* ---------- Лента ставок ---------- */

.bets { border-radius: var(--radius); background: rgba(12,12,11,.85); box-shadow: 0 0 0 1px var(--hair); overflow: hidden; }
.bets-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hair); }
.seg button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--dim); cursor: pointer; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.seg button:hover { color: #fff; }
.seg button[aria-selected="true"] { background: var(--surface-4); color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold-lo); }
.live-dot { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.bets-scroll { overflow-x: auto; }
.bets table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.bets th { padding: 12px 16px; text-align: left; font-weight: 400; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.bets td { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
.bets tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.bets .r { text-align: right; }
.bets .game { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.bets .game .ico { width: 18px; height: 18px; color: var(--gold); }
.bets .who { color: var(--dim); }
.bets .who.hidden { font-style: italic; color: var(--faint); }
.bets .amt { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.bets .amt .coin { --size: 16px; }
.bets .mult { color: var(--dim); }
.bets .win { color: var(--win); font-weight: 500; }
.bets .loss { color: var(--wound); }
.bets tr.new td { animation: row-in .6s var(--ease); }
@keyframes row-in { from { background: rgba(214,181,106,.12); opacity: 0; transform: translateY(-6px); } }

/* ---------- Чат-таверна ---------- */

.chat {
  position: sticky; top: 0; z-index: 35;
  width: 0; height: 100vh; overflow: hidden;
  background: linear-gradient(180deg, rgba(12,12,11,.98), rgba(7,7,7,.98));
  border-left: 1px solid var(--hair);
  transition: width .25s var(--ease);
}
.app[data-chat="open"] .chat { width: var(--chat-w); }
.chat-inner { width: var(--chat-w); height: 100%; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 10px 0 18px; border-bottom: 1px solid var(--hair); flex: none; }
.chat-head h2 { margin: 0; font-size: 13px; font-weight: 400; letter-spacing: .24em; text-transform: uppercase; }
.chat-head .online { font-size: 12px; color: var(--faint); }
.chat-head .icon-btn { margin-left: auto; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.msg { display: flex; gap: 10px; font-size: 14px; line-height: 1.45; }
.msg .avatar { width: 30px; height: 30px; font-size: 12px; }
.msg .who { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }
.msg .rank { padding: 0 5px; border-radius: 2px; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #1a1408; background: var(--gold); }
.msg .rank.guard { background: var(--frost); color: #08161d; }
.msg p { margin: 2px 0 0; color: var(--dim); }
.msg.system { justify-content: center; text-align: center; font-size: 13px; color: var(--faint); font-style: italic; font-family: var(--font-book); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--hair); flex: none; }
.chat-form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius); outline: 0; background: var(--surface-2); color: var(--ink); font: inherit; box-shadow: inset 0 0 0 1px var(--hair); }
.chat-form input:focus { box-shadow: inset 0 0 0 1px var(--gold); }
.chat-form .icon-btn { background: var(--surface-3); color: var(--gold-hi); }

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

.site-footer { padding: 32px 28px 40px; color: var(--faint); font-size: 14px; }
.site-footer .inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 40px; }
.site-footer .gilded { font-size: 14px; letter-spacing: .26em; }

/* ---------- Нижнее меню (телефон) ---------- */

.bottom-nav { display: none; }
.scrim { display: none; }

/* ---------- Простая шапка для страниц-документов (UI-кит) ---------- */

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.doc-top { position: sticky; top: 0; z-index: 30; background: linear-gradient(180deg, rgba(0,0,0,.94), rgba(0,0,0,.8)); }
.doc-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); }
.doc-top .wrap { display: flex; align-items: center; gap: 24px; min-height: var(--top-h); flex-wrap: wrap; }
.doc-top nav { display: flex; gap: 6px; margin-left: auto; }
.doc-top nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; color: var(--dim); text-decoration: none; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.doc-top nav a:hover, .doc-top nav a[aria-current="page"] { color: #fff; }

/* ==========================================================
   Адаптив
   ========================================================== */

@media (max-width: 1500px) { .tiles { --cols: 6; } }
@media (max-width: 1280px) {
  .tiles { --cols: 5; }
  /* чат накрывает контент, а не сжимает его */
  .chat { position: fixed; right: 0; top: 0; box-shadow: -20px 0 40px rgba(0,0,0,.6); }
}
@media (max-width: 1100px) { .tiles { --cols: 4; } }
/* Открытый чат сбоку (шире 1280) забирает 340px — карточек в ряду меньше, чтобы не мельчали */
@media (min-width: 1281px) { .app[data-chat="open"] .tiles { --cols: 5; } }
@media (min-width: 1281px) and (max-width: 1500px) { .app[data-chat="open"] .tiles { --cols: 4; } }

@media (max-width: 900px) {
  :root { --top-h: 58px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto;
    width: min(86vw, 300px) !important;
    transform: translateX(-102%);
    box-shadow: 20px 0 40px rgba(0,0,0,.6);
  }
  .app[data-drawer="open"] .side { transform: none; }
  .app[data-side="mini"] .side .label, .app[data-side="mini"] .side .side-label, .app[data-side="mini"] .side .tag { display: initial; }
  .app[data-side="mini"] .side .modes { display: grid; }
  .app[data-side="mini"] .side-link { justify-content: flex-start; padding: 0 10px; }
  .only-desktop { display: none !important; }
  .only-mobile { display: inline-grid !important; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 12px; gap: 8px; }
  .brand .gilded { display: none; }
  .wallet { justify-self: center; }
  .wallet .btn { padding: 0 14px; font-size: 11px; letter-spacing: .14em; }
  .content { padding: 16px 14px 96px; gap: 32px; }
  .tiles { --cols: 3.3; gap: 10px; grid-auto-columns: calc((100% - 3 * 10px) / var(--cols)); }
  .promos { grid-auto-columns: 88%; }
  .promo h3 { max-width: 100%; }
  .promo p { max-width: 100%; }
  .promo .art { display: none; }
  .chat { position: fixed; inset: 0 0 64px 0; height: auto; }
  .app[data-chat="open"] .chat { width: 100%; }
  .chat-inner { width: 100%; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app[data-drawer="open"] .scrim { opacity: 1; pointer-events: auto; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: 64px; padding-bottom: env(safe-area-inset-bottom);
    background: rgba(7,7,7,.97); border-top: 1px solid var(--hair);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--faint); text-decoration: none; cursor: pointer;
    font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  }
  .bottom-nav [aria-current="page"], .bottom-nav [aria-expanded="true"] { color: var(--gold-hi); }
  .parchment { padding: 32px 22px; }
  .parchment.torn { padding: 48px 32px 52px 40px; }
  .site-footer { padding-bottom: 96px; }
}
@media (max-width: 520px) {
  .tiles { --cols: 2.4; }
  .wallet-balance .unit { display: none; }
}

/* ==========================================================
   Уведомления в углу (общие для всех страниц)
   ========================================================== */

.toasts { position: fixed; left: 20px; top: calc(var(--top-h) + 16px); z-index: 60; max-width: min(420px, calc(100vw - 40px)); pointer-events: none; }
.toasts .notice { animation: toast-in .35s var(--ease); transition: opacity .5s, transform .5s; }
.toasts .notice.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-10px); } }

/* ==========================================================
   Экран игры: панель заклада слева, стол справа
   ========================================================== */

.game-shell { display: flex; flex-direction: column; min-height: 100vh; }
.game-shell .content { max-width: 1240px; gap: 28px; }

.game-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.game-title h1 { font-size: clamp(22px, 3vw, 32px); }
.game-title .crumbs { width: 100%; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
.game-title .crumbs a { color: var(--dim); text-decoration: none; }
.game-title .crumbs a:hover { color: #fff; }

.game {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-1);
  box-shadow: 0 0 0 1px var(--hair), 0 24px 60px rgba(0,0,0,.7);
}

/* Панель заклада */
.game-controls {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
  background: var(--surface-2);
  border-right: 1px solid var(--hair);
}
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.ctl-label output, .ctl-label .val { letter-spacing: .04em; text-transform: none; color: var(--dim); font-variant-numeric: tabular-nums; }

.field-box {
  display: flex; align-items: stretch; height: 46px;
  border-radius: var(--radius); background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--hair);
  transition: box-shadow .15s;
}
.field-box:focus-within { box-shadow: inset 0 0 0 1px var(--gold); }
.field-box input, .field-box select {
  flex: 1; min-width: 0; height: 100%; padding: 0 12px;
  border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums;
}
.field-box select { appearance: none; cursor: pointer; }
.field-box select option { background: #111; }
.field-box .suffix { display: flex; align-items: center; padding-right: 12px; color: var(--faint); pointer-events: none; }
.field-box .coin { align-self: center; margin-left: 12px; --size: 20px; }
.field-box .mini {
  min-width: 48px; border: 0; border-left: 1px solid var(--hair);
  background: transparent; color: var(--dim); cursor: pointer; font-size: 14px; font-weight: 400;
}
.field-box .mini:hover { background: var(--surface-3); color: #fff; }
.field-box .mini:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.field-box input:disabled, .field-box select:disabled, .field-box .mini:disabled { opacity: .5; cursor: not-allowed; }

.bet-btn, .cashout-btn { width: 100%; min-height: 56px; font-size: 15px; }
.bet-btn::before, .bet-btn::after, .cashout-btn::before, .cashout-btn::after { display: none; }

.ctl-note { font-size: 13px; color: var(--faint); line-height: 1.45; }
.borrow { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--gold-hi); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* Стол */
.game-stage {
  position: relative;
  min-height: 560px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 24px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(214,181,106,.07), transparent 60%),
    linear-gradient(rgba(6,6,6,.82), rgba(6,6,6,.9)),
    url("../img/game/stone-carved.jpg") center / 520px;
}
.game-stage .stage-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; }

.game-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding: 12px 18px;
  border-top: 1px solid var(--hair);
  background: var(--surface-2);
  grid-column: 1 / -1;
  font-size: 13px; color: var(--faint);
}
.game-bar .fair { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); }
.game-bar .fair .ico { width: 18px; height: 18px; color: var(--live); }
.game-bar .spacer { flex: 1; }

/* Последние результаты */
.dice-top { display: flex; align-items: center; gap: 12px; }
.dice-top .recent { flex: 1; min-width: 0; }
.recent { display: flex; justify-content: flex-end; gap: 6px; min-height: 30px; overflow: hidden; }
.recent span {
  flex: none; min-width: 58px; padding: 4px 10px; border-radius: 999px; text-align: center;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: var(--surface-3); color: var(--dim);
  animation: chip-in .3s var(--ease);
}
.recent span.win { background: url("../img/game/gold.jpg") center / 160px; color: #1a1408; }
@keyframes chip-in { from { opacity: 0; transform: translateX(10px) scale(.9); } }

.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- Кости великанов ---------- */

.dice-result {
  align-self: center;
  display: grid; place-items: center;
  width: 140px; height: 140px;
  font-size: 44px; font-weight: 400; font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: radial-gradient(circle at 50% 35%, #2a251c, #0d0c0a 70%);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(214,181,106,.35), inset 0 -10px 24px rgba(0,0,0,.6), 0 18px 40px rgba(0,0,0,.7);
  transform: rotate(45deg);
  transition: box-shadow .25s, color .25s;
}
.dice-result > span { transform: rotate(-45deg); }
.dice-result.win { color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold), 0 0 40px rgba(214,181,106,.35), 0 18px 40px rgba(0,0,0,.7); }
.dice-result.loss { color: var(--wound); box-shadow: inset 0 0 0 1px rgba(224,121,107,.6), 0 18px 40px rgba(0,0,0,.7); }
.dice-result.rolling > span { animation: flicker .12s linear infinite; }
@keyframes flicker { 50% { opacity: .55; } }

.track-wrap { position: relative; padding: 50px 6px 0; }
.track {
  position: relative; height: 14px; border-radius: 999px;
  box-shadow: 0 0 0 6px #0b0b0a, 0 0 0 7px var(--hair), inset 0 2px 4px rgba(0,0,0,.6);
  background: linear-gradient(90deg, var(--left-c) 0%, var(--left-c) var(--t), var(--right-c) var(--t), var(--right-c) 100%);
}
.track.over  { --left-c: #6e1f18; --right-c: var(--gold); }
.track.under { --left-c: var(--gold); --right-c: #6e1f18; }
.track input[type=range] {
  position: absolute; left: 0; right: 0; top: -14px; width: 100%; height: 42px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: grab;
}
.track input[type=range]:disabled { cursor: not-allowed; }
.track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; transform: rotate(45deg);
  background: url("../img/game/gold.jpg") center / 120px; border: 1px solid #000;
  box-shadow: 0 0 0 1px var(--gold-lo), 0 4px 10px rgba(0,0,0,.7);
}
.track input[type=range]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 0; transform: rotate(45deg);
  background: url("../img/game/gold.jpg") center / 120px; border: 1px solid #000;
  box-shadow: 0 0 0 1px var(--gold-lo), 0 4px 10px rgba(0,0,0,.7);
}
.track input[type=range]::-moz-range-track { background: transparent; }
.track input[type=range]:focus-visible { outline: none; }
.track input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--gold-hi); }

.marker {
  position: absolute; top: 0; left: var(--r, 50%);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  opacity: 0; transition: left .45s var(--ease), opacity .2s;
  pointer-events: none;
}
.marker.show { opacity: 1; }
.marker b { padding: 3px 10px; border-radius: 4px; font-size: 14px; font-weight: 500; background: #fff; color: #111; }
.marker.win b { background: url("../img/game/gold.jpg") center / 140px; color: #1a1408; }
.marker.loss b { background: var(--wound); color: #1f0805; }
.marker i { width: 2px; height: 18px; background: currentColor; color: #fff; }
.marker.win i { color: var(--gold); }
.marker.loss i { color: var(--wound); }

.scale { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }

.toggle-dir { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 46px; padding: 0 12px; border: 0; border-radius: var(--radius); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink); cursor: pointer; font-size: 16px; font-variant-numeric: tabular-nums; }
.toggle-dir:hover { box-shadow: inset 0 0 0 1px var(--gold-lo); }
.toggle-dir .ico { color: var(--gold); }
.toggle-dir:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Драугр или пусто ---------- */

.crypt {
  align-self: center;
  width: min(100%, 540px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
.slab {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  background: #1a1916 url("../img/game/stone-statue.jpg") center / 260px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), inset 0 -6px 12px rgba(0,0,0,.6), 0 6px 0 #050505, 0 10px 18px rgba(0,0,0,.6);
  transition: transform .15s var(--ease), box-shadow .15s, filter .15s;
  overflow: hidden;
}
.slab::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45); transition: background .15s; }
.slab::after { content: ""; position: absolute; inset: 22%; border: 1px solid rgba(255,255,255,.14); transform: rotate(45deg); transition: border-color .15s; }
.slab:not(:disabled):hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(214,181,106,.5), 0 9px 0 #050505, 0 14px 22px rgba(0,0,0,.6); }
.slab:not(:disabled):hover::before { background: rgba(0,0,0,.25); }
.slab:not(:disabled):hover::after { border-color: rgba(214,181,106,.5); }
.slab:disabled { cursor: default; }
.slab.idle { filter: saturate(.7) brightness(.75); }

.slab .face { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .3s var(--ease); }
.slab.open { transform: translateY(4px); background: #0b0a09; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 0 #050505, inset 0 8px 18px rgba(0,0,0,.8); }
.slab.open::before, .slab.open::after { opacity: 0; }
.slab.open .face { opacity: 1; transform: none; }
.slab.gold .face img { width: 68%; filter: drop-shadow(0 4px 10px rgba(0,0,0,.8)) drop-shadow(0 0 14px rgba(242,224,166,.35)); }
.slab.draugr { background: radial-gradient(circle at 50% 45%, rgba(156,198,219,.22), #0b0a09 70%); }
.slab.draugr .face .ico { width: 60%; height: 60%; stroke-width: 1; color: var(--frost); filter: drop-shadow(0 0 10px rgba(156,198,219,.8)); }
.slab.draugr.hit { box-shadow: inset 0 0 0 2px var(--wound), 0 0 30px rgba(224,121,107,.45); animation: hit .4s; }
.slab.ghost .face { opacity: .35; }
@keyframes hit { 25% { transform: translate(-4px, 4px); } 50% { transform: translate(4px, 4px); } 75% { transform: translate(-2px, 4px); } }

.crypt-hud { padding: 0 44px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 32px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.crypt-hud b { margin-left: 8px; font-size: 18px; font-weight: 400; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.crypt-hud b.gold { color: var(--gold-hi); }

.result-banner {
  position: absolute; left: 50%; top: 50%; z-index: 5;
  transform: translate(-50%, -50%) scale(.9);
  min-width: 220px; padding: 20px 28px; text-align: center;
  background: rgba(5,5,5,.92); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--gold), 0 0 60px rgba(214,181,106,.25), 0 20px 50px #000;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease);
}
.result-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.result-banner .gilded { font-size: 34px; }
.result-banner small { display: block; margin-top: 6px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }

@media (max-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr); }
  .game-controls { order: 2; border-right: 0; border-top: 1px solid var(--hair); }
  .game-stage { order: 1; min-height: 0; padding: 18px 14px; }
  .game-bar { order: 3; }
  .stats-row { grid-template-columns: minmax(0, 1fr); }
  .crypt { gap: 7px; }
  .dice-result { width: 104px; height: 104px; font-size: 32px; }
  .toasts { top: calc(var(--top-h) + 8px); left: 12px; }
}

/* ---------- Двемерский автомат ---------- */

.machine {
  --cell: clamp(76px, 10.5vw, 118px);
  position: relative;
  align-self: center;
  width: min(100%, 620px);
  padding: 16px 18px 20px;
  border-radius: 12px;
  background: url("../img/game/dwemer.jpg") center / 320px;
  box-shadow: inset 0 0 0 2px var(--gold-lo), inset 0 0 0 7px #1a140b, inset 0 0 0 8px rgba(214,181,106,.3), 0 24px 60px #000;
}
.machine::before { content: ""; position: absolute; inset: 8px; border-radius: 8px; background: linear-gradient(180deg, rgba(25,17,7,.55), rgba(10,7,3,.8)); pointer-events: none; }
.machine > * { position: relative; }
.machine-plate {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 0 auto 14px; padding: 8px 18px; width: fit-content;
  border-radius: 4px; background: rgba(0,0,0,.6); box-shadow: inset 0 0 0 1px rgba(214,181,106,.4);
}
.machine-plate .gilded { font-size: 15px; letter-spacing: .3em; }
.machine-plate .ico { color: var(--gold); width: 18px; height: 18px; animation: turn 8s linear infinite; }
.machine-plate .ico:last-child { animation-direction: reverse; }
@keyframes turn { to { transform: rotate(360deg); } }

.reels-row { display: flex; align-items: stretch; gap: 10px; }
.line-marks { display: flex; flex-direction: column; justify-content: space-around; gap: 4px; }
.line-marks span {
  display: grid; place-items: center; width: 24px; height: 24px; transform: rotate(45deg);
  font-size: 11px; color: var(--faint); background: #0b0a08; box-shadow: inset 0 0 0 1px rgba(214,181,106,.3);
  transition: background .2s, color .2s, box-shadow .2s;
}
.line-marks span > i { font-style: normal; transform: rotate(-45deg); }
.line-marks span.lit { background: url("../img/game/gold.jpg") center / 80px; color: #1a1408; box-shadow: 0 0 14px rgba(214,181,106,.7); }

.reels { position: relative; flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reel {
  height: calc(var(--cell) * 3); overflow: hidden; border-radius: 6px;
  background: linear-gradient(180deg, #050403, #16120c 50%, #050403);
  box-shadow: inset 0 0 0 1px rgba(214,181,106,.35), inset 0 14px 18px -6px #000, inset 0 -14px 18px -6px #000;
}
.strip { will-change: transform; }
.sym { height: var(--cell); display: grid; place-items: center; transition: filter .2s, transform .2s; }
.sym img { width: 66%; height: 66%; object-fit: contain; filter: drop-shadow(0 4px 8px #000); }
.sym .ico { width: 52%; height: 52%; stroke-width: 1.1; filter: drop-shadow(0 3px 6px #000); }
.sym.s-cog .ico { color: #c08d52; }
.sym.s-mug .ico { color: #e2a94e; }
.sym.s-scroll .ico { color: #e8d6ad; }
.sym.s-crown .ico { color: var(--gold-hi); }
.reels.dim .sym { filter: brightness(.45) saturate(.6); }
.reels.dim .sym.win { filter: none; transform: scale(1.08); animation: sym-glow 1s ease-in-out infinite alternate; }
@keyframes sym-glow { to { filter: drop-shadow(0 0 16px rgba(242,224,166,.85)); } }

.paylines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.paylines polyline { fill: none; stroke: var(--gold-hi); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(242,224,166,.9)); stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw .5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.win-plate { min-height: 34px; margin-top: 14px; text-align: center; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.win-plate b { display: block; font-size: 24px; font-weight: 400; letter-spacing: .06em; color: var(--gold-hi); text-transform: none; }

.paytable { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pay { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px var(--hair); font-size: 14px; line-height: 1.25; color: var(--dim); }
.pay b { flex: none; padding-left: 8px; }
.pay .sym { height: 36px; width: 36px; flex: none; }
.pay .sym img, .pay .sym .ico { width: 100%; height: 100%; }
.pay b { margin-left: auto; font-weight: 500; color: var(--gold-hi); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .machine { --cell: clamp(64px, 22vw, 96px); padding: 12px 10px 14px; }
  .catch-audio + .stage-main .machine { margin-top: 36px; }   /* кнопка звука не наезжает на рамку автомата */
  .line-marks span { width: 18px; height: 18px; font-size: 9px; }
  .reels-row { gap: 6px; }
}

/* ---------- Удар великана ---------- */

.game-stage:has(.troll-scene) { padding: 0; }
.troll-scene { position: relative; flex: 1; min-height: 560px; overflow: hidden; isolation: isolate; background: #070b18; }
.troll-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.troll-top { position: absolute; inset: 14px 14px auto 14px; z-index: 2; display: flex; align-items: center; gap: 10px; }
.troll-sound {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: rgba(5,7,14,.62); box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--dim); cursor: pointer;
}
.troll-audio { position: relative; flex: none; }
.troll-audio-panel {
  position: absolute; left: 0; top: 44px; z-index: 3; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px 10px 10px; border-radius: var(--radius); background: rgba(5,7,14,.92);
  box-shadow: 0 0 0 1px var(--line-soft), 0 14px 30px rgba(0,0,0,.6);
}
.troll-audio-panel .row { display: flex; align-items: center; gap: 10px; }
.troll-audio-panel input[type="range"] { width: 130px; accent-color: var(--gold); cursor: pointer; }
.troll-audio-panel span { width: 26px; text-align: right; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.troll-sound.off { color: var(--faint); opacity: .55; }
.troll-sound:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--gold-lo); }
.troll-history {
  flex: 1; min-width: 0; display: flex; justify-content: flex-end; gap: 6px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px); mask-image: linear-gradient(90deg, transparent, #000 56px);
}
.troll-history a {
  flex: none; padding: 4px 10px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: rgba(5,7,14,.66); color: var(--dim); box-shadow: inset 0 0 0 1px var(--hair);
  animation: chip-in .3s var(--ease);
}
.troll-history a:hover { color: #fff; }
.troll-history a.mid { color: var(--frost); box-shadow: inset 0 0 0 1px rgba(156,198,219,.35); }
.troll-history a.high { background: url("../img/game/gold.jpg") center / 160px; color: #1a1408; box-shadow: none; }

.troll-center {
  position: absolute; left: 0; right: 0; top: 12%; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,.95);
}
.troll-eyebrow { min-height: 18px; font-size: 12px; font-weight: 400; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }
.troll-big { font-size: clamp(48px, 7.5vw, 88px); font-weight: 400; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.is-flying .troll-big { color: var(--gold-hi); text-shadow: 0 0 34px rgba(242,224,166,.45), 0 3px 0 rgba(0,0,0,.85); }
.is-crashed .troll-big { color: var(--wound); text-shadow: 0 0 34px rgba(224,121,107,.5), 0 3px 0 rgba(0,0,0,.85); animation: troll-pop .45s var(--ease); }
.is-crashed .troll-eyebrow { color: var(--wound); }
@keyframes troll-pop { from { transform: scale(1.3); } }
.troll-bar { width: min(240px, 56%); height: 4px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.troll-bar.off { visibility: hidden; }
.troll-bar i { display: block; height: 100%; transform-origin: left; background: var(--gold); }
.troll-sub { min-height: 22px; padding: 0 12px; font-size: 13px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.troll-foot { position: absolute; left: 14px; bottom: 10px; z-index: 1; font-size: 11px; letter-spacing: .06em; color: rgba(236,232,222,.5); font-variant-numeric: tabular-nums; }
.troll-scene .result-banner { top: 70%; }

.troll-btn { padding: 0 10px; letter-spacing: .14em; }
.troll-btn.is-cashout { animation: troll-cash 1s ease-in-out infinite alternate; }
.troll-btn .troll-cash { font-variant-numeric: tabular-nums; }
@keyframes troll-cash { to { box-shadow: inset 0 0 0 1px rgba(255,240,200,.6), 0 0 0 1px var(--gold), 0 0 30px rgba(214,181,106,.55); } }

.troll-players { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--hair); }
.troll-players ul { display: flex; flex-direction: column; gap: 4px; max-height: 232px; margin: 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.troll-players li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius); background: var(--surface-1);
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.troll-players li.me { box-shadow: inset 0 0 0 1px var(--gold-lo); }
.troll-players li.won { background: rgba(214,181,106,.1); }
.troll-players li.lost { opacity: .5; }
.troll-players .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.troll-players .who.hidden { color: var(--faint); font-style: italic; }
.troll-players .amt { color: var(--dim); }
.troll-players .res { min-width: 44px; text-align: right; font-size: 13px; color: var(--faint); }
.troll-players li.won .res { color: var(--gold-hi); }

@media (max-width: 900px) {
  .troll-scene { flex: none; min-height: 0; height: min(118vw, 540px); }
  .troll-center { top: 13%; }
  .troll-players ul { max-height: 190px; }
}

/* ---------- Северный улов ---------- */

.game-stage:has(.catch-scene) { padding: 0; gap: 0; }
.game-stage:has(.catch-scene) > :not(.catch-scene) { padding: 22px 28px 26px; }
.catch-scene {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 18px 16px; overflow: hidden; isolation: isolate;
  background: linear-gradient(rgba(4,8,12,.25), rgba(4,8,12,.6)), url("../img/catch/bg.webp") center / cover;
}
.catch-scene.bonus { box-shadow: inset 0 0 120px rgba(214,181,106,.28); }
/* Звук и музыка: кнопка в углу сцены, панель раскрывается влево */
.catch-audio { position: absolute; right: 12px; top: 12px; z-index: 6; }
.catch-audio .troll-audio-panel { left: auto; right: 0; }

.catch-hud {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 22px; min-height: 40px; padding: 4px 16px;
  border-radius: 999px; background: rgba(5,7,10,.72); box-shadow: inset 0 0 0 1px var(--gold-lo);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  visibility: hidden; opacity: 0; transition: opacity .3s;
}
.catch-hud.on { visibility: visible; opacity: 1; }
.catch-hud b { margin-left: 8px; font-size: 18px; font-weight: 400; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.catch-hud b.gold { color: var(--gold-hi); }
.catch-meter { display: inline-flex; gap: 4px; }
.catch-meter i { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--hair); opacity: .35; filter: grayscale(1); transition: opacity .25s, filter .25s, box-shadow .25s; }
.catch-meter i.on { opacity: 1; filter: none; box-shadow: inset 0 0 0 1px var(--gold), 0 0 12px rgba(214,181,106,.5); }
.catch-meter img { width: 100%; height: 100%; object-fit: contain; }

/* Рамка — картинка с прозрачным проёмом; барабаны лежат под ней ровно в проёме */
.catch-machine { position: relative; width: min(100%, 720px); aspect-ratio: 1298 / 1046; filter: drop-shadow(0 18px 30px rgba(0,0,0,.7)); }
.catch-frame { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.catch-reels {
  position: absolute; left: 10.1%; top: 15.6%; width: 79.8%; height: 74.9%; z-index: 1;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
  padding: 1.1% .6%;   /* символы не заходят под резьбу рамки */
  background: #06141b url("../img/catch/backdrop.webp") center / cover;
}
.catch-reel { position: relative; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); overflow: hidden; }
.catch-divider { position: absolute; top: 0; z-index: 1; width: auto; height: 100%; max-width: none; transform: translateX(-50%); pointer-events: none; }
.catch-cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0 9%; transition: filter .2s, opacity .2s, transform .2s; }
.catch-cell img { width: 100%; height: 78%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.7)); }
.catch-cell.land { animation: catch-land .28s var(--ease) backwards; }
.catch-cell.fisher { z-index: 2; }      /* счётчик и множитель рыбака — поверх разделителя барабанов */
.catch-cell.land:nth-child(2) { animation-delay: .03s; }
.catch-cell.land:nth-child(3) { animation-delay: .06s; }
@keyframes catch-land { from { transform: translateY(-30%); opacity: .2; } 70% { transform: translateY(3%); } }
.catch-cell.dim { filter: brightness(.38) saturate(.5); }
.catch-cell.win { animation: catch-win .9s ease-in-out infinite alternate; z-index: 1; }
@keyframes catch-win { to { transform: scale(1.05); filter: drop-shadow(0 0 14px rgba(242,224,166,.9)); } }
.catch-cell.rod img, .catch-cell.wild img, .catch-cell.fisher img { height: 88%; }
.catch-value {
  position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); padding: 0 7px; max-width: 82%; overflow: hidden; border-radius: 999px; white-space: nowrap;
  background: rgba(5,7,10,.82); box-shadow: inset 0 0 0 1px var(--gold-lo); color: var(--gold-hi);
  font-size: clamp(10px, 1.25vw, 15px); font-weight: 500; line-height: 1.5; font-variant-numeric: tabular-nums;
}
.catch-value.big { background: url("../img/game/gold.jpg") center / 120px; color: #1a1408; box-shadow: 0 0 12px rgba(214,181,106,.7); }
.catch-strip { position: absolute; left: 0; right: 0; top: 0; height: 300%; display: grid; grid-template-rows: repeat(9, minmax(0, 1fr)); animation: catch-roll .34s linear infinite; filter: blur(1.5px); }
.catch-strip .catch-cell img { opacity: .8; }
@keyframes catch-roll { from { transform: translateY(-66.66%); } to { transform: translateY(0); } }
.catch-reels .paylines { z-index: 2; }
.catch-pop {
  position: absolute; left: 50%; top: 42%; z-index: 3; transform: translate(-50%, -50%); pointer-events: none;
  font-size: clamp(26px, 4.4vw, 50px); font-weight: 500; color: var(--gold-hi); text-shadow: 0 0 22px rgba(242,224,166,.7), 0 3px 0 #000;
  animation: catch-pop .75s var(--ease) both;
}
@keyframes catch-pop { from { transform: translate(-50%, 0) scale(.6); opacity: 0; } 30% { opacity: 1; } to { transform: translate(-50%, -110%) scale(1.05); opacity: 0; } }

/* Кнопка стоит строго по центру, подпись — слева от неё: длина текста кнопку не двигает */
.catch-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; width: 100%; min-height: 84px; }
.catch-spin {
  flex: none; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: url("../img/catch/spin.webp") center / contain no-repeat; filter: drop-shadow(0 6px 10px rgba(0,0,0,.7));
  transition: transform .15s var(--ease), filter .15s;
}
.catch-spin:hover { transform: scale(1.06); filter: drop-shadow(0 6px 10px rgba(0,0,0,.7)) brightness(1.15); }
.catch-spin:active { transform: scale(.94); }
.catch-spin.turning { animation: turn 1.1s linear infinite; }
.catch-spin:disabled { opacity: .6; cursor: default; }
.catch-info > summary { cursor: pointer; margin-bottom: 14px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.catch-info > summary:hover { color: #fff; }
.catch-ante {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius); cursor: pointer; text-align: left;
  background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink); font-size: 14px; transition: box-shadow .15s;
}
.catch-ante small { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); line-height: 1.3; }
.catch-ante .knob { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--hair); transition: background .2s; }
.catch-ante .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dim); transition: transform .2s var(--ease), background .2s; }
.catch-ante.on { box-shadow: inset 0 0 0 1px var(--gold); }
.catch-ante.on .knob { background: url("../img/game/gold.jpg") center / 120px; }
.catch-ante.on .knob::after { transform: translateX(18px); background: #1a1408; }
.catch-ante:disabled { opacity: .5; cursor: not-allowed; }
/* Автоспины: сколько вращений подряд */
.catch-auto { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.catch-auto button {
  height: 40px; padding: 0; border: 0; border-radius: var(--radius); cursor: pointer; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; transition: box-shadow .15s, color .15s;
}
.catch-auto button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--gold-lo); color: #fff; }
.catch-auto button.on { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold-hi); }
.catch-auto button:disabled { opacity: .5; cursor: not-allowed; }
.catch-auto button.on:disabled { opacity: 1; }
.catch-buy { min-height: 46px; font-size: 13px; letter-spacing: .14em; }

/* Сбор улова: рыба летит к рыбаку, у рыбака счётчик и множитель уровня */
.catch-fly {
  position: absolute; left: var(--x0); top: var(--y0); z-index: 3; width: 13%; aspect-ratio: 1; object-fit: contain; pointer-events: none;
  transform: translate(-50%, -50%); filter: drop-shadow(0 0 10px rgba(242,224,166,.8));
  animation: catch-fly .52s cubic-bezier(.45, 0, .7, 1) forwards;
}
@keyframes catch-fly {
  35% { transform: translate(-50%, -95%) scale(1.2) rotate(-14deg); }
  100% { left: var(--x1); top: var(--y1); transform: translate(-50%, -50%) scale(.35) rotate(24deg); opacity: .3; }
}
.catch-count {
  position: absolute; left: 50%; top: 2%; z-index: 2; transform: translateX(-50%); padding: 0 9px; border-radius: 999px; white-space: nowrap;
  background: url("../img/game/gold.jpg") center / 140px; color: #1a1408; box-shadow: 0 0 14px rgba(214,181,106,.8), 0 2px 6px #000;
  font-size: clamp(11px, 1.5vw, 18px); font-weight: 500; line-height: 1.55; font-variant-numeric: tabular-nums;
  animation: catch-bump .3s var(--ease);
}
@keyframes catch-bump { from { transform: translateX(-50%) scale(1.45); } }
.catch-xmult {
  position: absolute; right: 3%; top: 18%; z-index: 3; padding: 0 8px; border-radius: 8px; transform: rotate(8deg);
  background: var(--paper-red); color: #fff; box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(224,121,107,.8);
  font-size: clamp(13px, 1.9vw, 24px); font-weight: 500; line-height: 1.45;
  animation: catch-xmult .7s var(--ease);
}
@keyframes catch-xmult { from { transform: scale(3.2) rotate(-18deg); opacity: 0; } 60% { transform: scale(.9) rotate(12deg); opacity: 1; } }

/* Сундук для одинокого рыбака */
.catch-burst {
  position: absolute; left: 50%; top: 50%; z-index: 4; width: 30%; aspect-ratio: 1; object-fit: contain; pointer-events: none;
  transform: translate(-50%, -50%); filter: drop-shadow(0 0 26px rgba(242,224,166,.9));
}
.catch-burst.in { animation: catch-burst-in .6s var(--ease), catch-burst-shake .11s linear .6s infinite alternate; }
.catch-burst.boom { animation: catch-burst-boom .55s ease-out forwards; }
@keyframes catch-burst-in { from { transform: translate(-50%, 60%) scale(.3); opacity: 0; } }
@keyframes catch-burst-shake { from { transform: translate(-51.5%, -50%) rotate(-3deg); } to { transform: translate(-48.5%, -50%) rotate(3deg); } }
@keyframes catch-burst-boom { 30% { transform: translate(-50%, -50%) scale(1.35); filter: brightness(2.6) drop-shadow(0 0 50px #fff3c8); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(2.1); filter: brightness(3); opacity: 0; } }
.catch-fly.spark { width: 6%; filter: drop-shadow(0 0 12px rgba(255,220,130,1)); animation-duration: .5s; }
.catch-cell.morph img { animation: catch-morph .55s var(--ease); }
@keyframes catch-morph { from { transform: scale(.1) rotate(-30deg); filter: brightness(3); } 60% { transform: scale(1.25); filter: brightness(1.6) drop-shadow(0 0 16px rgba(242,224,166,.9)); } }
.catch-cell.miss { animation: catch-miss .4s; }
@keyframes catch-miss { 25% { transform: translateX(-4%) rotate(-3deg); filter: brightness(1.5); } 60% { transform: translateX(4%) rotate(3deg); } }

/* Праздник суммы вращения */
.catch-win {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  overflow: hidden; pointer-events: none; text-align: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(3,6,9,.78), rgba(3,6,9,.25) 70%); animation: catch-fade .25s;
}
.catch-win small { position: relative; font-size: clamp(12px, 1.8vw, 18px); letter-spacing: .3em; text-transform: uppercase; color: var(--ink); text-shadow: 0 2px 8px #000; animation: catch-panel .45s var(--ease); }
.catch-win b {
  position: relative; font-size: clamp(40px, 7.5vw, 86px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--gold-hi); text-shadow: 0 0 30px rgba(242,224,166,.65), 0 4px 0 rgba(0,0,0,.9); animation: catch-panel .45s var(--ease);
}
.catch-win.t0 b { font-size: clamp(32px, 5.5vw, 60px); }
.catch-win.t2 b, .catch-win.t3 b { animation: catch-panel .45s var(--ease), catch-throb .7s ease-in-out .45s infinite alternate; }
.catch-win.t3 { background: radial-gradient(ellipse at 50% 50%, rgba(60,40,5,.82), rgba(3,6,9,.35) 72%); }
.catch-win.t3 b { color: #fff3c8; text-shadow: 0 0 46px rgba(255,220,130,.95), 0 4px 0 rgba(0,0,0,.9); }
@keyframes catch-throb { to { transform: scale(1.08); } }
.catch-win-item {
  position: absolute; left: var(--x); bottom: -14%; width: var(--s); height: var(--s); object-fit: contain; opacity: 0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.7)); animation: catch-fountain var(--t) var(--d) cubic-bezier(.2, .7, .4, 1) both;
}
/* Сцена не выше ~800 px, поэтому высоту взлёта считаем от неё: --l — доля высоты сцены */
@keyframes catch-fountain {
  0% { transform: translate(-50%, 0) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: translate(-50%, calc(var(--l) * -8)) rotate(var(--r)); opacity: 1; }
  100% { transform: translate(-50%, calc(var(--l) * -5.5)) rotate(calc(var(--r) * 1.5)); opacity: 0; }
}

/* Рыбалка перед бонусом: canvas ложится на сцену так же, как фон (cover), поэтому удочка попадает в свою воду */
.catch-cast { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; object-fit: cover; pointer-events: none; opacity: 0; transition: opacity .5s; }
.catch-machine, .catch-hud { transition: opacity .5s, transform .5s var(--ease), visibility .5s; }
.catch-scene.fishing .catch-cast { opacity: 1; }
.catch-scene.fishing .catch-machine { opacity: 0; transform: scale(.94); visibility: hidden; }
.catch-scene.fishing .catch-hud.on { opacity: 0; visibility: hidden; }
.catch-scene.fishing .catch-bar { position: relative; z-index: 4; }
.catch-tray { position: absolute; left: 0; right: 0; top: 14px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; animation: catch-fade .4s; }
.catch-tray-title { padding: 6px 18px; border-radius: 999px; background: rgba(5,7,10,.72); box-shadow: inset 0 0 0 1px var(--gold-lo); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.catch-tray-title b { margin-left: 10px; font-size: 18px; font-weight: 400; letter-spacing: .02em; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
/* Садок — панель с тремя ячейками: проёмы ячеек заданы в долях картинки upgrade_panel */
.catch-creel { position: relative; width: min(80%, 440px); aspect-ratio: 1100 / 530; background: url("../img/catch/upgrade_panel.webp") center / 100% 100%; filter: drop-shadow(0 12px 22px rgba(0,0,0,.7)); }
.catch-creel-slot { position: absolute; top: 29%; bottom: 22%; width: 26.3%; padding: 1.5% 0 1%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.catch-creel-slot:nth-child(1) { left: 10%; }
.catch-creel-slot:nth-child(2) { left: 37.4%; }
.catch-creel-slot:nth-child(3) { left: 64.7%; }
.catch-creel-slot img { flex: 1; min-height: 0; max-width: 74%; object-fit: contain; filter: drop-shadow(0 0 10px rgba(242,224,166,.6)); animation: catch-xmult .55s var(--ease); }
.catch-creel-slot img.boot { filter: drop-shadow(0 0 10px rgba(224,121,107,.7)); }
.catch-creel-slot small { font-size: clamp(7px, 1.05vw, 10px); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.catch-plate { text-align: right; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); text-shadow: 0 2px 8px #000; }
.catch-plate b { margin-left: 12px; font-size: 22px; font-weight: 400; letter-spacing: .04em; color: var(--gold-hi); text-transform: none; }

.catch-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(3,6,9,.62); cursor: pointer; animation: catch-fade .25s; }
@keyframes catch-fade { from { opacity: 0; } }
.catch-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: catch-panel .4s var(--ease); }
@keyframes catch-panel { from { transform: scale(.86); opacity: 0; } }
/* Табличка держит пропорции картинки: поля только по бокам (проценты считаются от ширины сцены и по вертикали растягивали её), текст по центру */
.catch-panel.banner { box-sizing: border-box; width: min(100%, 640px); aspect-ratio: 1100 / 576; padding: 0 clamp(40px, 12%, 110px); gap: 6px; overflow: hidden; background: url("../img/catch/bonus_panel.webp") center / contain no-repeat; }
.catch-panel.banner .gilded { font-size: clamp(22px, 4vw, 40px); }
.catch-panel.banner small { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }

.catch-pays .pay small { color: var(--faint); font-size: 12px; }
.catch-pays .pay .sym img { width: 100%; height: 100%; object-fit: contain; }
.catch-fishes { display: flex; flex-wrap: wrap; gap: 8px; }
.catch-fishes span { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: var(--radius); background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px var(--hair); }
.catch-fishes img { width: 40px; height: 40px; object-fit: contain; }
.catch-fishes b { font-weight: 500; color: var(--gold-hi); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .game-stage:has(.catch-scene) > :not(.catch-scene) { padding: 16px 14px 18px; }
  .catch-scene { padding: 10px 6px 12px; }
  .catch-machine { width: 100%; }
  .catch-creel { width: 76%; }
  .catch-hud { gap: 4px 12px; font-size: 10px; border-radius: 14px; }
  .catch-hud b { font-size: 15px; }
  .catch-meter i { width: 24px; height: 24px; }
}

/* ==========================================================
   Шапка: гость / игрок, меню профиля
   ========================================================== */

.top-center { display: flex; justify-content: center; }
.guest-actions { display: flex; gap: 14px; align-items: center; }
.guest-actions .btn { min-height: 40px; }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70;
  width: 260px; padding: 8px;
  border-radius: var(--radius); background: rgba(12,12,11,.98);
  box-shadow: 0 0 0 1px var(--hair), 0 20px 50px rgba(0,0,0,.8);
}
.user-menu .um-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--hair); }
.user-menu .um-head b { display: block; font-weight: 500; }
.user-menu .um-head small { color: var(--faint); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 10px;
  border: 0; border-radius: 4px; background: none; color: var(--dim); text-decoration: none; cursor: pointer; font-size: 15px; text-align: left;
}
.user-menu a:hover, .user-menu button:hover { background: var(--surface-3); color: #fff; }
.user-menu .ico { width: 18px; height: 18px; }

/* ==========================================================
   Формы и простые страницы (вход, касса, честность)
   ========================================================== */

.page { max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px 24px 72px; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 40px); }
.page-head p { margin: 6px 0 0; color: var(--dim); max-width: 640px; }

.card { padding: 24px; border-radius: var(--radius); background: rgba(12,12,11,.88); box-shadow: 0 0 0 1px var(--hair), 0 18px 40px rgba(0,0,0,.5); }
.card h2 { margin: 0 0 16px; font-size: 14px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }

.form { display: flex; flex-direction: column; gap: 16px; }
.form .field-box input { font-size: 16px; }
.form-error { min-height: 20px; margin: 0; font-size: 14px; color: var(--wound); }
.form-hint { margin: 0; font-size: 13px; color: var(--faint); }
.form textarea { width: 100%; min-height: 72px; padding: 12px; resize: vertical; border: 0; border-radius: var(--radius); outline: 0; background: var(--surface-1); color: var(--ink); font: inherit; box-shadow: inset 0 0 0 1px var(--hair); }
.form textarea:focus { box-shadow: inset 0 0 0 1px var(--gold); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--dim); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* Вход */
.auth-wrap { min-height: calc(100vh - var(--top-h)); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(100%, 440px); padding: 32px 30px; border-radius: 8px; background: rgba(10,10,9,.94); box-shadow: 0 0 0 1px var(--hair), 0 30px 70px rgba(0,0,0,.8); }
.auth-card .crest { display: grid; place-items: center; margin: -76px auto 14px; }
.auth-card h1 { text-align: center; font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--faint); margin: 0 0 22px; font-size: 15px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 999px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hair); }
.tabs button { min-height: 40px; border: 0; border-radius: 999px; background: none; color: var(--dim); cursor: pointer; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.tabs button[aria-selected="true"] { background: var(--surface-4); color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold-lo); }

/* Таблицы данных */
.data-scroll { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.data th { padding: 10px 12px; text-align: left; font-weight: 400; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--hair); white-space: nowrap; }
.data td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
.data tr:hover td { background: rgba(255,255,255,.02); }
.data .r { text-align: right; }
.data .muted { color: var(--faint); }
.data .plus { color: var(--gold-hi); }
.data .minus { color: var(--wound); }
.data .empty { padding: 28px; text-align: center; color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; word-break: break-all; }

.status { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; background: var(--surface-3); color: var(--dim); }
.status.pending { background: rgba(214,181,106,.15); color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold-lo); }
.status.approved, .status.active { background: rgba(127,209,139,.12); color: var(--live); }
.status.rejected, .status.blocked { background: rgba(224,121,107,.12); color: var(--wound); }
.status.admin { background: rgba(214,181,106,.18); color: var(--gold-hi); }
.status.cashier { background: rgba(156,198,219,.15); color: var(--frost); }

.big-balance { display: flex; align-items: center; gap: 16px; }
.big-balance .gilded { font-size: clamp(36px, 5vw, 54px); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 15px; }
.kv dt { color: var(--faint); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; padding-top: 3px; }
.kv dd { margin: 0; min-width: 0; }

/* ==========================================================
   Админка
   ========================================================== */

.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--top-h) + 20px); display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--radius); background: rgba(12,12,11,.9); box-shadow: 0 0 0 1px var(--hair); }
.admin-nav button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 4px; background: none; color: var(--dim); cursor: pointer; font-size: 15px; text-align: left; }
.admin-nav button:hover { background: var(--surface-3); color: #fff; }
.admin-nav button[aria-selected="true"] { background: linear-gradient(90deg, rgba(214,181,106,.16), transparent); color: var(--gold-hi); box-shadow: inset 2px 0 0 var(--gold); }
.admin-nav .count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #1a1408; font-size: 12px; text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; border-radius: var(--radius); background: rgba(12,12,11,.88); box-shadow: 0 0 0 1px var(--hair); }
.kpi .label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.kpi .value { margin-top: 6px; font-size: 26px; font-weight: 400; font-variant-numeric: tabular-nums; }
.kpi .value.gold { color: var(--gold-hi); }
.kpi .value.red { color: var(--wound); }
.kpi .sub { margin-top: 2px; font-size: 13px; color: var(--faint); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; height: 44px; }
.toolbar select { height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font: inherit; box-shadow: inset 0 0 0 1px var(--hair); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.row-actions .btn { min-height: 36px; padding: 0 14px; font-size: 11px; }
.row-actions .btn::before, .row-actions .btn::after { display: none; }
.linkish { padding: 0; border: 0; background: none; color: var(--gold-hi); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Боковая карточка игрока */
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 80; width: min(640px, 100vw); overflow-y: auto; padding: 24px; background: #0b0b0a; box-shadow: -30px 0 60px rgba(0,0,0,.8); transform: translateX(102%); transition: transform .25s var(--ease); }
.drawer.open { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.drawer-head h2 { margin: 0; font-size: 22px; }
.drawer-head .icon-btn { margin-left: auto; }
.drawer section { margin-top: 24px; }
.drawer h3 { margin: 0 0 10px; font-size: 12px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }

.muted { color: var(--faint); }
.plus { color: var(--gold-hi); }
.minus { color: var(--wound); }

dialog.modal {
  width: min(460px, calc(100vw - 32px)); padding: 26px; border: 0; border-radius: 8px;
  background: #0d0d0c; color: var(--ink);
  box-shadow: 0 0 0 1px var(--gold-lo), 0 30px 80px #000;
}
dialog.modal::backdrop { background: rgba(0,0,0,.7); }
dialog.modal h2 { font-size: 16px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Подтверждение ID ---------- */

.verify-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px 20px; text-align: center;
  background: linear-gradient(90deg, transparent, rgba(214,181,106,.16) 20%, rgba(214,181,106,.16) 80%, transparent);
  border-bottom: 1px solid rgba(214,181,106,.3);
  color: var(--gold-hi); text-decoration: none; font-size: 15px;
}
.verify-banner:hover { color: #fff; background: linear-gradient(90deg, transparent, rgba(214,181,106,.26) 20%, rgba(214,181,106,.26) 80%, transparent); }
.verify-banner .ico { color: var(--gold); flex: none; }
.verify-banner b { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

.verify-section { display: flex; flex-direction: column; gap: 24px; }
.verify-section .grid-2 { gap: 24px; }
.verify-card { display: flex; flex-direction: column; gap: 14px; }
.verify-card .form-hint { margin: 0; }
.verify-section .form-error:empty { display: none; }
.verify-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; }
@media (max-width: 520px) {
  .verify-amount { flex-wrap: nowrap; gap: 8px; }
  .verify-amount .coin { width: 38px !important; height: 38px !important; }
  .verify-amount .unit { font-size: 11px; letter-spacing: .14em; }
  .verify-amount .icon-btn { width: 40px; height: 40px; }
}
.verify-actions .btn { flex: 1 1 auto; min-height: 44px; padding: 0 18px; font-size: 12px; }
.verify-actions .btn::before, .verify-actions .btn::after { display: none; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--dim); font-size: 17px; }
.steps b { color: var(--ink); font-weight: 500; }
.verify-amount { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0 6px; flex-wrap: wrap; }
.verify-amount .gilded { font-size: clamp(48px, 9vw, 84px); letter-spacing: .04em; }
.verify-amount .unit { color: var(--dim); text-transform: uppercase; letter-spacing: .22em; font-size: 13px; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: rgba(0,0,0,.4); color: var(--dim); font-size: 15px; text-align: center; }
.pulse { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(214,181,106,.6); animation: ring 1.8s infinite; }
@keyframes ring { 70% { box-shadow: 0 0 0 12px rgba(214,181,106,0); } 100% { box-shadow: 0 0 0 0 rgba(214,181,106,0); } }
.verify-done { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 44px 24px; text-align: center; }
.verify-done h1 { font-size: clamp(30px, 5vw, 46px); }
.verify-done p { margin: 0; color: var(--dim); font-size: 18px; }

.bonus-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bonus-bar i { display: block; height: 100%; background: url("../img/game/gold.jpg") center / 200px; }

.temp-pass { display: inline-block; padding: 6px 10px; border-radius: 4px; background: var(--surface-3); color: var(--gold-hi); user-select: all; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; }
  .admin-nav button { flex: none; }
  .page { padding: 20px 14px 96px; }
  .guest-actions { gap: 10px; }
  .guest-actions .btn { padding: 0 12px; font-size: 11px; letter-spacing: .12em; }
  .guest-actions .btn::before, .guest-actions .btn::after { display: none; }
}

/* ---------- Сахарный пир ---------- */

.game-stage:has(.feast-scene) { padding: 0; gap: 0; }
.game-stage:has(.feast-scene) > :not(.feast-scene) { padding: 22px 28px 26px; }
.feast-scene {
  --k: 1;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 18px 14px; overflow: hidden; isolation: isolate;
  background: linear-gradient(rgba(20,6,22,.35), rgba(12,4,14,.7)), url("../img/feast/bg.webp") center / cover;
  transition: box-shadow .6s;
}
.feast-scene.bonus { box-shadow: inset 0 0 140px rgba(230,80,200,.32); }

/* Табло бонуса: две плашки счётчика вращений */
.feast-hud { display: flex; justify-content: center; gap: 10px; width: 100%; visibility: hidden; opacity: 0; transition: opacity .4s, visibility .4s; }
.feast-hud.on { visibility: visible; opacity: 1; }
.feast-badge {
  display: flex; align-items: baseline; justify-content: center; gap: 8px; width: min(48%, 250px); aspect-ratio: 2.036; padding: 0 14%; padding-top: calc(min(48%, 250px) / 2.036 * .4);
  background: url("../img/feast/badge.webp") center / contain no-repeat; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6));
}
.feast-badge small { white-space: nowrap; font-size: clamp(8px, 1.1vw, 11px); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 4px #000; }
.feast-badge b { font-size: clamp(16px, 2.4vw, 24px); font-weight: 500; line-height: 1.1; color: var(--gold-hi); text-shadow: 0 0 14px rgba(242,224,166,.6), 0 2px 0 #000; font-variant-numeric: tabular-nums; animation: catch-bump .3s var(--ease); }

/* Рамка поля: проём измерен скриптом make_feast_assets.py, в долях картинки */
.feast-machine { position: relative; width: min(100%, 600px); aspect-ratio: 1137 / 1208; filter: drop-shadow(0 18px 30px rgba(0,0,0,.7)); }
.feast-frame { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }
.feast-board { position: absolute; left: 9.7%; right: 9.7%; top: 14.7%; bottom: 9.6%; overflow: hidden; border-radius: 2%; background: rgba(28,6,30,.55); }
.feast-spot, .feast-item, .feast-x {
  position: absolute; width: calc(100% / 7); height: calc(100% / 7);
  left: calc(var(--c) * 100% / 7); top: calc(var(--r) * 100% / 7);
}
.feast-spot { display: grid; place-items: center; }
.feast-spot img { width: 98%; height: 98%; object-fit: contain; opacity: .5; transition: opacity .3s, filter .3s; }
.feast-spot.marked img { opacity: .95; filter: drop-shadow(0 0 6px rgba(240,110,220,.8)); }
.feast-spot.hot img { opacity: 1; filter: drop-shadow(0 0 8px rgba(255,150,230,.9)); }
.feast-spot img.up { animation: feast-spot-up .45s var(--ease); }
@keyframes feast-spot-up { from { transform: scale(1.35); filter: brightness(2.2) drop-shadow(0 0 14px #fff); } }

/* Блюдо падает: ряд меняется — top плавно доезжает; задержка своя у каждого столбца */
.feast-item {
  z-index: 2; display: grid; place-items: center;
  transition: top calc(.36s * var(--k)) cubic-bezier(.45, 0, .6, 1.15) var(--d), filter .2s, opacity .2s;
}
.feast-item img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.75)); }
.feast-item.jarl img, .feast-item.wild img { width: 96%; height: 96%; filter: drop-shadow(0 0 8px rgba(255,220,130,.8)) drop-shadow(0 3px 4px rgba(0,0,0,.7)); }
.feast-item.dim { filter: brightness(.4) saturate(.5); }
.feast-item.win { z-index: 3; animation: feast-win .5s ease-in-out infinite alternate; }
@keyframes feast-win { to { transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(255,220,250,.95)); } }
.feast-item.pop { animation: feast-pop calc(.24s * var(--k)) ease-in forwards; }
@keyframes feast-pop { 40% { transform: scale(1.3); filter: brightness(2.4); opacity: 1; } to { transform: scale(.1); opacity: 0; } }

.feast-x { z-index: 3; display: flex; align-items: flex-end; justify-content: flex-end; padding: 3%; pointer-events: none; }
.feast-x i {
  padding: 0 4px; border-radius: 999px; font-style: normal; font-weight: 600; line-height: 1.35; white-space: nowrap;
  font-size: clamp(8px, 1.25vw, 13px); color: #fff; background: rgba(120,20,110,.88); box-shadow: inset 0 0 0 1px rgba(255,190,240,.7), 0 0 8px rgba(240,110,220,.6);
  animation: catch-xmult .5s var(--ease);
}

/* Выигрыш кластера всплывает над его серединой */
.feast-label {
  position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  transform: translate(-50%, -50%); animation: feast-label .45s var(--ease) both; white-space: nowrap;
}
.feast-label b { font-size: clamp(16px, 2.8vw, 30px); font-weight: 600; line-height: 1; color: var(--gold-hi); text-shadow: 0 0 14px rgba(242,224,166,.7), 0 2px 0 #000, 0 0 4px #000; font-variant-numeric: tabular-nums; }
.feast-label small { margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: clamp(9px, 1.15vw, 12px); font-weight: 500; color: #fff; background: rgba(20,6,22,.85); box-shadow: inset 0 0 0 1px var(--gold-lo); }
.feast-label.mult small { font-size: clamp(10px, 1.35vw, 14px); font-weight: 600; background: rgba(150,25,135,.92); box-shadow: 0 0 12px rgba(255,120,230,.8); }
.feast-label.mult b { font-size: clamp(20px, 3.4vw, 38px); }
@keyframes feast-label { from { transform: translate(-50%, -20%) scale(.5); opacity: 0; } 70% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } }
.feast-x.boost { z-index: 6; }
.feast-x.boost i { animation: feast-boost .5s ease-in-out infinite alternate; }
@keyframes feast-boost { to { transform: scale(1.6); background: #e040c0; box-shadow: 0 0 16px #ff9ff0; } }

.feast-bar { min-height: 76px; }
.feast-spin { width: 76px; height: 76px; background-image: url("../img/feast/spin.webp"); }
.feast-buys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.feast-buys .catch-buy { padding: 0 8px; font-size: 12px; letter-spacing: .08em; }

/* Окна: начало бонуса, ещё вращения, итог, крупный выигрыш — текст по центру картинки */
.feast-panel {
  box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: min(100%, 560px); padding: 0 12%; text-align: center; background: center / contain no-repeat; animation: catch-panel .4s var(--ease);
}
.feast-panel.intro { aspect-ratio: 1.4995; background-image: url("../img/feast/intro.webp"); padding: 2% 18% 6%; }
.feast-panel.result, .feast-panel.more { aspect-ratio: 1.7008; background-image: url("../img/feast/result.webp"); }
.feast-panel.big { aspect-ratio: 1.7958; background-image: url("../img/feast/bigwin.webp"); }
.feast-panel .gilded { font-size: clamp(22px, 4.2vw, 42px); line-height: 1.1; }
.feast-panel small { font-size: clamp(10px, 1.4vw, 13px); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 6px #000; }
.feast-panel.big .gilded { animation: catch-throb .7s ease-in-out infinite alternate; }

.feast-pays { overflow-x: auto; }
.feast-pays table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.feast-pays th, .feast-pays td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.feast-pays thead th { font-weight: 400; font-size: 11px; color: var(--faint); }
.feast-pays tbody th { width: 44px; padding: 2px 6px 2px 0; }
.feast-pays tbody th img { display: block; width: 38px; height: 38px; object-fit: contain; }
.feast-pays td { color: var(--ink); }

@media (max-width: 900px) {
  .game-stage:has(.feast-scene) > :not(.feast-scene) { padding: 16px 14px 18px; }
  .feast-scene { padding: 8px 4px 10px; }
  .feast-machine { width: 100%; }
  .feast-bar .catch-plate { font-size: 10px; letter-spacing: .12em; }
  .feast-bar .catch-plate b { display: block; margin: 2px 0 0; font-size: 17px; }
  .feast-badge { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
