@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Outfit;
  src: url("/fonts/outfit-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Outfit;
  src: url("/fonts/outfit-560.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Outfit;
  src: url("/fonts/outfit-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0b0a;
  --bg-2: #141210;
  --panel: #161311;
  --panel-2: #1e1a17;
  --line: rgba(243, 239, 230, 0.12);
  --text: #f3efe6;
  --muted: #9a9388;
  --heat: #ff4d2e;
  --ivory: #f3efe6;
  --ink: #14110e;
  --good: #d6f25c;
  --bad: #ff6b6b;
  --felt: #14352c;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --sans: Outfit, "Segoe UI", sans-serif;
  --serif: Fraunces, "Iowan Old Style", Palatino, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(255, 77, 46, 0.09), transparent 55%),
    var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--heat); color: var(--ivory); }
:focus-visible { outline: 2px solid var(--heat); outline-offset: 3px; }
h1, h2, .brand span { font-family: var(--serif); font-weight: 600; letter-spacing: -0.035em; }

.grain {
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; opacity: 0.045;
}
.grain rect { width: 100%; height: 100%; }

.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; overflow-x: clip; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 18px 18px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(12, 11, 10, 0.92);
}
.brand {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 12px;
  text-decoration: none; font-size: 28px; font-style: italic;
}
.brand span { font-style: italic; font-weight: 400; }
.mark {
  width: 14px; height: 14px; border-radius: 1px; background: var(--heat);
  box-shadow: 6px 6px 0 rgba(255, 77, 46, 0.25);
}
.nav-link {
  display: flex; align-items: center; min-height: 40px; padding: 0 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
  border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] { color: var(--text); border-left-color: var(--heat); }
.nav-link[hidden], [hidden] { display: none !important; }
.side-foot { margin-top: auto; padding: 14px 8px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.side-foot a { color: var(--ivory); }
.age-pill {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--heat); color: var(--heat); font-size: 11px; font-weight: 700; margin-bottom: 8px;
}

.maincol { min-width: 0; max-width: 100%; }
.top {
  position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; gap: 10px;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  background: rgba(12, 11, 10, 0.84); backdrop-filter: blur(18px);
}
.icon-btn, .search, .balance, .btn { border: 1px solid var(--line); background: transparent; }
.icon-btn {
  display: none; width: 40px; height: 40px; place-items: center; color: var(--text); border-radius: 2px;
}
.search { flex: 1; max-width: 420px; position: relative; border-radius: 2px; }
.search input, .field input, .field select, .amt input {
  width: 100%; background: transparent; border: 0; outline: 0; padding: 11px 12px;
}
.search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--panel-2);
  border: 1px solid var(--line); padding: 6px; display: none; box-shadow: var(--shadow);
}
.search-pop.open { display: block; }
.search-pop a { display: block; padding: 10px 12px; text-decoration: none; }
.search-pop a:hover { background: rgba(255, 255, 255, 0.04); }
.search-pop small { color: var(--muted); margin-left: 8px; }
.spacer { flex: 1; }
.balance {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-height: 42px; border-radius: 2px;
}
.balance b { font-weight: 500; }
.balance span { color: var(--muted); font-size: 10px; letter-spacing: 0.16em; }
.btn {
  min-height: 42px; padding: 0 16px; font-weight: 500; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 2px;
}
.btn.gold { background: var(--ivory); color: var(--ink); border-color: transparent; }
.btn.gold:hover { background: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(255, 107, 107, 0.4); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.view { padding: 28px 28px 80px; max-width: 1240px; min-width: 0; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.85fr); gap: 28px;
  padding: 8px 0 28px; margin-bottom: 8px; align-items: end;
}
.kicker { margin: 0 0 12px; color: var(--heat); letter-spacing: 0.18em; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(48px, 6vw, 84px); line-height: 0.88; }
.hero p { color: var(--muted); max-width: 460px; line-height: 1.55; font-size: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.instrument { margin: 0; border: 1px solid var(--line); background: #100e0c; position: relative; overflow: hidden; }
.instrument canvas, .plinko-board canvas { width: 100%; height: auto; display: block; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; gap: 12px; }
.row-head h2 { margin: 0; font-size: 28px; }
.row-head a, .row-head span { color: var(--muted); text-decoration: none; font-size: 13px; }
.row-head a:hover { color: var(--heat); }
.hscroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; min-width: 0; max-width: 100%; }
.tile {
  flex: 0 0 196px; height: 248px; position: relative; overflow: hidden;
  text-decoration: none; scroll-snap-align: start; border: 1px solid var(--line); background: #100e0c;
}
.tile:hover { border-color: rgba(255, 77, 46, 0.7); transform: translateY(-3px); }
.tile { transition: border-color .2s ease, transform .2s ease; }
.art { position: absolute; inset: 0 0 64px 0; }
.tile-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 2px; background: #100e0c;
}
.tile-meta strong { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.tile-meta em { font-style: normal; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.grid .tile { flex: none; width: auto; }

.art-dice { background: #1a1410; }
.art-dice::before, .art-dice::after {
  content: ""; position: absolute; width: 58px; height: 58px; border-radius: 6px;
  background:
    radial-gradient(circle at 22% 22%, #14110e 3px, transparent 4px),
    radial-gradient(circle at 78% 22%, #14110e 3px, transparent 4px),
    radial-gradient(circle at 50% 50%, #14110e 3px, transparent 4px),
    radial-gradient(circle at 22% 78%, #14110e 3px, transparent 4px),
    radial-gradient(circle at 78% 78%, #14110e 3px, transparent 4px),
    var(--ivory);
}
.art-dice::before { left: 28px; top: 34px; transform: rotate(-14deg); }
.art-dice::after { right: 26px; bottom: 22px; transform: rotate(12deg); background: var(--heat); }
.art-crash { background: #14110e; }
.art-crash::before {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 18px; height: 100px;
  background: linear-gradient(var(--heat), transparent); clip-path: polygon(0 100%, 18% 78%, 40% 80%, 68% 28%, 100% 4%, 100% 100%);
}
.art-mines { background: #101614; }
.art-mines::before {
  content: ""; position: absolute; inset: 28px 36px 18px;
  background: linear-gradient(#1d3a32, #1d3a32) 0 0 / 28px 28px;
  mask: radial-gradient(circle, #000 3px, transparent 4px);
}
.art-plinko { background: #14110e; }
.art-plinko::before {
  content: ""; position: absolute; inset: 22px 28px 16px;
  background: radial-gradient(circle, var(--ivory) 2.5px, transparent 3px) 0 0 / 22px 20px;
}
.art-limbo { background: #14110e; }
.art-limbo::after {
  content: "∞"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 92px; color: var(--heat); line-height: 1;
}
.art-reels { background: linear-gradient(180deg, #241816, #120e0c); }
.art-blackjack { background: radial-gradient(circle at 50% 30%, #1d4a3e, #0e1c18 70%); }
.art-blackjack::before, .art-blackjack::after {
  content: "A"; position: absolute; width: 46px; height: 66px; background: var(--ivory); color: var(--heat);
  display: grid; place-items: center; font-family: var(--serif); font-size: 28px;
}
.art-blackjack::before { left: 42px; top: 36px; transform: rotate(-8deg); }
.art-blackjack::after { content: "K"; right: 42px; top: 46px; transform: rotate(10deg); color: var(--ink); }
.art-roulette { background: #14110e; }
.art-roulette::before {
  content: ""; position: absolute; width: 108px; height: 108px; border-radius: 50%; left: 50%; top: 28px; transform: translateX(-50%);
  background: conic-gradient(#9d2c3a 0 18deg, #161311 0 36deg, #1d4a3e 0 48deg, #9d2c3a 0 72deg, #161311 0 108deg, #9d2c3a 0 144deg, #161311 0 180deg, #9d2c3a 0 216deg, #161311 0 252deg, #9d2c3a 0 288deg, #161311 0 360deg);
  box-shadow: inset 0 0 0 18px #1a140f, 0 0 0 1px var(--ivory);
}

.feed, .panel, .slip, .stage-wrap, .card-block { background: transparent; border: 1px solid var(--line); }
.feed { margin-top: 28px; max-width: 100%; overflow-x: auto; }
.feed h2 { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 16px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.win { color: var(--good); }
.loss { color: var(--bad); }
.tag { color: var(--muted); font-size: 11px; border: 1px solid var(--line); padding: 1px 6px; }

.game-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.slip { padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 90px; background: #120f0d; }
.stage-wrap { overflow: hidden; background: #100e0c; }
.stage-bar { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.stage-bar h1 { margin: 0; font-size: 36px; }
.stage-bar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.stage { min-height: 460px; padding: 18px; position: relative; display: grid; align-items: center; justify-items: center; }
.stage.plinko-stage { display: block; min-height: 0; padding: 0; }
.stage.plinko-stage canvas, .plinko-board canvas { width: 100%; height: auto; display: block; }
.plinko-board { width: 100%; background: #100e0c; }
.bin-row {
  display: grid; grid-template-columns: repeat(var(--bins, 9), minmax(0, 1fr));
  gap: 4px; padding: 2px 16px 16px; container-type: inline-size;
}
.bin {
  min-height: 36px; display: grid; place-items: center; border-radius: 4px;
  font-weight: 600; font-size: clamp(7px, calc(32cqi / var(--bins, 9)), 12px);
  letter-spacing: -0.04em; overflow: hidden; white-space: nowrap;
}
.bin.hit { outline: 2px solid #f6f1e8; transform: translateY(-2px); }

.ava {
  width: 22px; height: 22px; display: inline-grid; place-items: center; margin-right: 8px;
  background: hsl(calc(12 + var(--hue, 0)), 42%, 28%); color: #f6f1e8; font-style: normal;
  font-size: 11px; font-weight: 700;
}
td .ava { vertical-align: middle; }
.now { margin: 8px 0 4px; }
.now-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.live-card {
  border: 1px solid var(--line); background:
    radial-gradient(420px 120px at 0% 0%, rgba(255, 77, 46, 0.08), transparent 60%),
    #120f0d;
  padding: 16px 16px 14px; min-height: 128px; display: flex; flex-direction: column; gap: 6px;
}
.live-card span { color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; }
.live-mult { font-family: var(--serif); font-size: 48px; line-height: 0.9; letter-spacing: -0.04em; font-weight: 600; }
.live-mult.loss { color: var(--bad); }
.live-mult.red { color: #e15b74; }
.live-mult.green { color: #7dcea0; }
.live-mult.black { color: var(--ivory); }
.live-card em { color: var(--muted); font-style: normal; font-size: 13px; }
tr.fresh { animation: row-in .35s ease; }
@keyframes row-in { from { opacity: 0; } }
.stage.flash-win { box-shadow: inset 0 0 0 1px var(--good); }
.stage.flash-loss { box-shadow: inset 0 0 0 1px var(--bad); }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.field input, .field select, .amt {
  border: 1px solid var(--line); background: #0c0b0a; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; border-radius: 2px;
}
.amt { display: flex; align-items: center; }
.amt input { flex: 1; min-width: 0; }
.amt button, .seg button, .wallet-toggle button {
  background: transparent; border: 0; border-left: 1px solid var(--line); min-width: 42px; height: 42px; color: var(--muted); font-weight: 500;
}
.wallet-toggle, .seg { display: flex; border: 1px solid var(--line); overflow: hidden; background: #0c0b0a; }
.wallet-toggle button, .seg button { flex: 1; border-left: 1px solid var(--line); }
.wallet-toggle button:first-child, .seg button:first-child { border-left: 0; }
.wallet-toggle button.on, .seg button.on { background: var(--ivory); color: var(--ink); }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat { background: #0c0b0a; border: 1px solid var(--line); padding: 10px; }
.stat span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.stat b { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.big { font-family: var(--serif); font-size: clamp(72px, 9vw, 120px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.86; }
.slider { width: min(560px, 100%); }
.slider input { width: 100%; accent-color: var(--heat); }
.history { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.pill { padding: 6px 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; }

.mines { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: min(460px, 100%); }
.mine-tile {
  aspect-ratio: 1; border: 1px solid var(--line); background: #1c1814; color: var(--text); font-size: 22px; font-weight: 700;
}
.mine-tile.gem { background: #1a3328; color: var(--good); }
.mine-tile.bomb { background: #3a1816; color: var(--bad); }
.mine-tile:disabled { cursor: default; }

.felt {
  width: min(760px, 100%); min-height: 420px; padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 239, 230, 0.08), transparent 42%),
    radial-gradient(circle at 50% 45%, #1d5a4b, var(--felt) 72%);
  border: 1px solid rgba(243, 239, 230, 0.2);
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.hand { display: flex; gap: 8px; min-height: 104px; align-items: center; flex-wrap: wrap; }
.pcard {
  width: 72px; height: 100px; background: var(--ivory); color: var(--ink);
  padding: 8px; display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--serif); font-weight: 600; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}
.pcard.red { color: #9d2c3a; }
.pcard.back { background: repeating-linear-gradient(135deg, #1a120c, #1a120c 8px, var(--heat) 8px, var(--heat) 9px); }
.pcard i { font-style: normal; font-size: 22px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wheel-wrap { width: 280px; height: 280px; position: relative; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%; transition: transform 4.2s cubic-bezier(.15, .8, .1, 1);
  box-shadow: inset 0 0 0 22px #1a140f, 0 0 0 1px var(--ivory);
}
.pointer {
  position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 16px solid var(--heat);
}
.rtable { width: min(820px, 100%); display: grid; gap: 4px; margin-top: 18px; }
.rgrid { display: grid; grid-template-columns: 46px repeat(12, 1fr); gap: 4px; }
.rcell, .zero { min-height: 38px; border: 0; font-weight: 500; font-size: 13px; position: relative; }
.rcell.red { background: #8d2433; }
.rcell.black { background: #1a1714; }
.zero { background: #1d4a3e; grid-row: span 3; }
.rcell em, .obet em { position: absolute; right: 3px; bottom: 2px; font-style: normal; font-size: 10px; color: var(--ivory); }
.outside { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 4px; }
.obet { min-height: 38px; border: 1px solid var(--line); background: #14110e; position: relative; font-weight: 500; }

.reels { display: flex; gap: 12px; }
.reel {
  width: 120px; height: 160px; border: 1px solid var(--line); background: #0c0b0a; display: grid; place-items: center;
}
.sym { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 34px; color: var(--ink); }
.paytable { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.paytable span { border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; }

.page { max-width: 760px; }
.page h1 { font-size: clamp(40px, 6vw, 68px); line-height: 0.92; margin: 0 0 12px; }
.prose { color: var(--muted); line-height: 1.65; }
.prose h2 { color: var(--text); font-size: 28px; margin-top: 32px; }
.prose code, #revealed { word-break: break-all; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.tier { padding: 16px; border: 1px solid var(--line); background: #120f0d; }
.tier.on { border-color: var(--heat); }
.tier strong { font-family: var(--serif); font-size: 22px; }
.bar { height: 2px; background: #2a2420; overflow: hidden; margin: 14px 0; }
.bar i { display: block; height: 100%; background: var(--heat); }

.modal-back {
  position: fixed; inset: 0; background: rgba(8, 7, 6, 0.72); display: grid; place-items: center; z-index: 40; padding: 18px;
}
.modal {
  width: min(420px, 100%); background: #161311; border: 1px solid var(--line); padding: 22px; box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 12px; font-size: 36px; }
.modal .btn { width: 100%; margin-top: 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: #1c1814; border: 1px solid var(--line); padding: 12px 14px; box-shadow: var(--shadow); max-width: 320px; }
.age {
  position: fixed; inset: 0; z-index: 200; background: #090807; display: grid; place-items: center; padding: 20px;
}
html.age-ok .age { display: none; }
.age-card { width: min(460px, 100%); background: #161311; border: 1px solid var(--line); padding: 28px; }
.age-card h2 { font-size: 40px; line-height: 0.95; margin: 0 0 8px; }
.menu-open .side { transform: translateX(0); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 30; width: min(280px, 86vw); transform: translateX(-105%);
    transition: transform .2s ease; background: #0c0b0a;
  }
  .icon-btn { display: inline-grid; }
  .hero, .game-layout { grid-template-columns: 1fr; }
  .now-grid { grid-template-columns: repeat(3, minmax(148px, 1fr)); overflow-x: auto; }
  .live-card { min-height: 96px; padding: 12px; }
  .live-mult { font-size: 32px; }
  .stage-wrap { order: -1; }
  .slip { position: static; }
  .spacer { display: none; }
  .search { display: none; }
  .stage { min-height: 280px; }
  .top { padding: 0 12px; gap: 8px; }
  .balance span { display: none; }
  .top .btn { min-height: 36px; padding: 0 10px; }
  .view { padding: 18px 14px 64px; }
  .hero h1 { font-size: 44px; }
  .top { min-width: 0; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel { transition: none; }
  .side { transition: none; }
  tr.fresh, .tile { animation: none; transition: none; }
}
