:root {
  --bg: #0e1014;
  --surface: #161a20;
  --surface-2: #1d222a;
  --line: #2a313b;
  --text: #ecebe8;
  --muted: #9aa3ad;
  --accent: #f4b740;
  --accent-ink: #1b1405;
  --win: #39c98a;
  --loss: #ee6461;
  --pending: #8ab4f8;
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(244,183,64,.10), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(57,201,138,.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.win { color: var(--win); }
.loss { color: var(--loss); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Шапка */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(14,16,20,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 1.25rem; letter-spacing: .3px; }
.brand:hover { text-decoration: none; }
.brand-die { width: 28px; height: 28px; }
.brand-die rect { fill: var(--accent); }
.brand-die circle { fill: var(--accent-ink); }
.net-pill { font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.wallet { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.wallet-info { font-family: var(--mono); font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Кнопки */
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .05s, opacity .2s, background .2s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #ffc85c; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 4px 9px; font: inherit; font-size: .8rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

/* Герой */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.5px; }
.lead { color: var(--muted); max-width: 640px; margin: 0 0 20px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 150px; }
.facts b { color: var(--accent); }
.facts span { color: var(--muted); font-size: .85rem; }

/* Статистика */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stat-label { display: block; color: var(--muted); font-size: .8rem; }
.stat-value { display: block; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.game-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 16px; }

/* Шансы */
.chances { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.chance { text-align: left; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.chance:hover { border-color: #4a5462; }
.chance[aria-checked="true"] { border-color: var(--accent); background: rgba(244,183,64,.08); }
.chance:disabled { opacity: .45; cursor: not-allowed; }
.chance-pct { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.chance-mult { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.chance-cond, .chance-max { display: block; color: var(--muted); font-size: .78rem; }

/* Ставка */
.bet-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: .85rem; color: var(--muted); }
.amount { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; }
.amount:focus-within { border-color: var(--accent); }
.amount input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 600 1.2rem var(--mono); }
.amount-btns { display: flex; gap: 4px; flex-shrink: 0; }
.field-hint { font-size: .8rem; color: var(--muted); }
.field-hint.bad { color: var(--loss); }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; align-content: center; }
.summary div { display: flex; flex-direction: column; min-width: 0; }
.summary span { font-size: .78rem; }
.summary b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.btn-play { width: 100%; padding: 14px; font-size: 1.1rem; }

/* Результат */
.result { display: flex; align-items: center; gap: 18px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.roll { width: 84px; height: 84px; flex-shrink: 0; display: grid; place-items: center; border-radius: 18px; background: var(--surface-2); border: 2px solid var(--line); font: 800 2rem var(--mono); }
.roll.spin { color: var(--pending); border-color: var(--pending); }
.roll.won { color: var(--win); border-color: var(--win); box-shadow: 0 0 24px rgba(57,201,138,.25); }
.roll.lost { color: var(--loss); border-color: var(--loss); }
.result-title { font-weight: 700; font-size: 1.1rem; }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: rgba(244,183,64,.08); }

/* История */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tab { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 9px; padding: 7px 12px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: .78rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.addr { font-family: var(--mono); font-size: .82rem; }
.me { color: var(--accent); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.tag.won { background: rgba(57,201,138,.14); color: var(--win); }
.tag.lost { background: rgba(238,100,97,.12); color: var(--loss); }
.tag.pending { background: rgba(138,180,248,.12); color: var(--pending); }
.tag.refunded { background: var(--surface-2); color: var(--muted); }
.links a { margin-left: 8px; font-size: .8rem; }
.btn-sm { padding: 4px 10px; font-size: .8rem; border-radius: 8px; }

.how ol { padding-left: 20px; margin: 10px 0; }
.how li { margin-bottom: 6px; color: #d4d2ce; }
.footer { padding: 10px 16px 40px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.4); z-index: 20; }
.toast.bad { border-color: var(--loss); }

/* Плашка «тестнет» на странице игры */
.testnet-note { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 12px 16px; border-color: rgba(244,183,64,.4); }

/* ---------------------------------------------------------------- Лендинг */
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.nav { display: flex; gap: 18px; margin-left: 12px; }
.nav a { color: var(--muted); font-size: .92rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.eyebrow { display: inline-block; color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 12px; }
.accent { color: var(--accent); }
.center { text-align: center; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }

.l-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; padding-top: 56px; padding-bottom: 32px; }
.l-hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.05; letter-spacing: -1px; margin: 0 0 16px; }
.l-hero .lead { font-size: 1.08rem; }
.l-hero-art { display: grid; place-items: center; }
.l-hero-art img { width: min(320px, 70vw); height: auto; border-radius: 48px; box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px var(--line); transform: rotate(3deg); }

.live { margin-top: 8px; }
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin-bottom: 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--win); box-shadow: 0 0 0 0 rgba(57,201,138,.6); animation: pulse 2s infinite; align-self: center; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(57,201,138,.6); } 70% { box-shadow: 0 0 0 9px rgba(57,201,138,0); } 100% { box-shadow: 0 0 0 0 rgba(57,201,138,0); } }
.live-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.live-grid .stat { background: var(--surface-2); }
.rolls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; min-height: 34px; }
.mini-roll { display: grid; place-items: center; width: 40px; height: 34px; border-radius: 9px; font: 700 .9rem var(--mono); border: 1px solid var(--line); }
.mini-roll:hover { text-decoration: none; filter: brightness(1.2); }
.mini-roll.won { color: var(--win); background: rgba(57,201,138,.1); border-color: rgba(57,201,138,.35); }
.mini-roll.lost { color: var(--loss); background: rgba(238,100,97,.08); border-color: rgba(238,100,97,.3); }

.l-section { padding-top: 40px; }
.l-section > h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 16px; letter-spacing: -.3px; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: #d4d2ce; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step { margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 10px; }
.odds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.odd { margin: 0; text-align: center; }
.odd .chance-mult { font-size: 1.25rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-col .card { margin: 0; }

.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: r; }
.roadmap li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 12px 46px; position: relative; }
.roadmap li::before { content: ""; position: absolute; left: 16px; top: 15px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.roadmap li.done::before { background: var(--win); border-color: var(--win); }
.roadmap li span { color: var(--muted); font-size: .9rem; }

.faq { display: grid; gap: 8px; }
.faq details { margin: 0; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 10px; }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px; background: linear-gradient(120deg, rgba(244,183,64,.12), rgba(57,201,138,.06)), var(--surface); border-color: rgba(244,183,64,.35); }
.cta-band h2 { margin: 0 0 4px; }
.landing .footer { padding-top: 32px; }
.landing .footer p { margin: 4px 0; }

/* Условия использования */
.legal { max-width: 760px; padding-top: 32px; }
.legal h1 { margin: 0 0 6px; }
.legal h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.legal p, .legal li { color: #d4d2ce; }

@media (max-width: 860px) {
  .nav { display: none; }
  .l-hero { grid-template-columns: 1fr; padding-top: 32px; }
  .l-hero-art { order: -1; }
  .l-hero-art img { width: 150px; border-radius: 28px; }
  .steps, .two-col { grid-template-columns: 1fr; }
  .odds, .live-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chances { grid-template-columns: repeat(2, 1fr); }
  .bet-row { grid-template-columns: 1fr; }
  .net-pill { display: none; }
  .hero { padding-top: 24px; }
}
@media (max-width: 420px) {
  .amount-btns .chip[data-act="half"], .amount-btns .chip[data-act="double"] { display: none; }
  .wallet-info { display: none !important; }
}
