:root {
  --bg: #0b0a10;
  --panel: #14121c;
  --panel-2: #1c1927;
  --line: #2a2638;
  --text: #ece9f5;
  --muted: #8a84a3;
  --accent: #b14dff;
  --gold: #ffc94d;
  --up: #3dffa2;
  --down: #ff4d6d;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Space Grotesk', system-ui, sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(177,77,255,.18), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(61,255,162,.08), transparent 50%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 40px;
  opacity: .55;
  mask-image: linear-gradient(#000, transparent 90%);
}
.mono, .stat b, .price, .change, input, .quote, #feed, #board { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
h2 { margin: 0 0 12px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.logo { font-size: 40px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.logo span { color: var(--accent); text-shadow: 0 0 24px rgba(177,77,255,.7); }
.logo.small { font-size: 22px; margin: 0; }

.card { background: linear-gradient(180deg, var(--panel), var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* Header */
.top { display: flex; align-items: center; gap: 24px; padding: 14px 24px; border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; background: rgba(11,10,16,.75); flex-wrap: wrap; }
.stats { display: flex; gap: 28px; flex: 1; justify-content: center; flex-wrap: wrap; }
.stat label { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 20px; transition: color .3s; }
.stat b.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12); color: var(--gold); } }
.who { color: var(--muted); font-size: 14px; }

/* Layout */
.view.hidden { display: none !important; }
.work-layout { display: grid; gap: 16px; padding: 24px 24px 40px; max-width: 1200px; margin: 0 auto; grid-template-columns: 1fr 300px; align-items: start; }
.casino-layout { padding: 24px 24px 40px; max-width: 1200px; margin: 0 auto; }
.market-layout { display: grid; gap: 16px; padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto;
  grid-template-columns: 260px 1fr 300px;
  grid-template-areas: "coins chart trade" "coins chart orders" "coins chart feed"; grid-template-rows: auto auto 1fr; }
.coins { grid-area: coins; } .chart-card { grid-area: chart; } .trade { grid-area: trade; } .feed { grid-area: feed; } .orders { grid-area: orders; }
@media (max-width: 1100px) {
  .market-layout { grid-template-columns: 1fr 1fr; grid-template-areas: "chart chart" "coins trade" "coins orders" "coins feed"; grid-template-rows: auto; }
}
@media (max-width: 680px) {
  .market-layout, .work-layout { grid-template-columns: 1fr; grid-template-areas: "chart" "trade" "orders" "coins" "feed"; padding: 16px; }
  .top { padding: 12px 16px; gap: 12px; }
  .stats { gap: 16px; justify-content: flex-start; }
}

/* Nav */
.nav { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 12px; }
.nav-btn { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; padding: 8px 18px; border-radius: 9px; cursor: pointer; transition: .2s; }
.nav-btn:hover { color: var(--text); }
.nav-btn.active { background: rgba(177,77,255,.18); color: var(--text); box-shadow: inset 0 0 0 1px rgba(177,77,255,.4); }

/* Work */
.clicker { display: flex; flex-direction: column; align-items: center; }
.clicker h2 { align-self: flex-start; }
.work-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 14px 0; }
.work-stats div { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.work-stats label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.work-stats b { font-family: 'JetBrains Mono', monospace; font-size: 18px; }
.go-market { width: 100%; }

/* Coin list */
.coins { display: flex; flex-direction: column; min-height: 0; }
.coins-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.coins-head h2 { margin: 0; }
.btn.small { flex: 0; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
#coinList { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 640px; }
#coinList li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px; border-radius: 10px; cursor: pointer; transition: background .15s; border: 1px solid transparent; }
#coinList li:hover { background: var(--panel-2); }
#coinList li.sel { background: rgba(177,77,255,.12); border-color: rgba(177,77,255,.35); }
#coinList .tk { font-weight: 700; }
#coinList .pr { font-family: 'JetBrains Mono', monospace; font-size: 13px; text-align: right; }
#coinList .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#coinList .ch { font-family: 'JetBrains Mono', monospace; font-size: 12px; text-align: right; }
#coinList .mine { color: var(--gold); }
.pos { color: var(--up); } .neg { color: var(--down); }

/* Company info */
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.info-grid div { background: var(--panel-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.info-grid label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.info-grid b { font-family: 'JetBrains Mono', monospace; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.info-grid .hint { grid-column: 1 / -1; color: var(--muted); font-size: 12px; background: none; padding: 2px 2px 0; }
.info-grid .hint b { display: inline; color: var(--gold); }
@media (max-width: 680px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.modal-title { font-size: 22px; color: var(--text); letter-spacing: 0; text-transform: none; margin: 0; }

/* Banner for takeovers and launches */
.banner { position: fixed; top: 80px; left: 50%; transform: translate(-50%, -30px) scale(.95); opacity: 0; pointer-events: none; z-index: 25;
  background: linear-gradient(135deg, #2a1340, #14121c); border: 1px solid var(--accent); color: var(--text); font-weight: 700; font-size: 18px;
  padding: 14px 24px; border-radius: 14px; box-shadow: 0 0 60px rgba(177,77,255,.45); transition: .35s cubic-bezier(.2,.9,.3,1.3); max-width: calc(100% - 32px); text-align: center; }
.banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.banner.takeover { border-color: var(--gold); box-shadow: 0 0 60px rgba(255,201,77,.45); }

/* Clicker */
.click-wrap { position: relative; width: 190px; height: 190px; margin: 6px auto 14px; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgba(255,201,77,.7)); }
.click-btn {
  position: absolute; inset: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--gold) 40%, #b8811c 100%);
  box-shadow: 0 0 40px rgba(255,201,77,.35), inset 0 -8px 20px rgba(0,0,0,.35), inset 0 6px 14px rgba(255,255,255,.4);
  transition: transform .08s, opacity .25s, box-shadow .3s;
}
.click-btn:hover { box-shadow: 0 0 60px rgba(255,201,77,.55), inset 0 -8px 20px rgba(0,0,0,.35), inset 0 6px 14px rgba(255,255,255,.4); }
.click-btn:active { transform: scale(.93); }
.click-btn.cooling { opacity: .5; cursor: wait; }
.click-btn.hit { animation: hit .3s ease; }
@keyframes hit { 30% { transform: scale(.9) rotate(-6deg); } 70% { transform: scale(1.05) rotate(3deg); } }
.coin { font-size: 64px; font-weight: 700; color: #6b4708; text-shadow: 0 2px 0 rgba(255,255,255,.4); pointer-events: none; }
#floaters { position: absolute; inset: 0; pointer-events: none; }
.floater { position: absolute; font-weight: 700; color: var(--gold); font-size: 20px; text-shadow: 0 0 10px rgba(255,201,77,.8); animation: float 1s ease-out forwards; }
@keyframes float { to { transform: translateY(-80px) scale(1.3); opacity: 0; } }
.spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* Chart */
.chart-card { display: flex; flex-direction: column; min-height: 520px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.ticker { font-size: 30px; font-weight: 700; }
.price-box { text-align: right; }
.price { font-size: 30px; font-weight: 700; transition: color .4s; }
.price.up { color: var(--up); text-shadow: 0 0 20px rgba(61,255,162,.5); }
.price.down { color: var(--down); text-shadow: 0 0 20px rgba(255,77,109,.5); }
.change { font-size: 14px; }
.change.pos { color: var(--up); } .change.neg { color: var(--down); }
.chart-wrap { flex: 1; position: relative; min-height: 320px; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-card.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }

/* Trade */
.trade { display: flex; flex-direction: column; gap: 10px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); border-radius: 12px; padding: 4px; }
.tab { background: none; border: 0; color: var(--muted); padding: 10px; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; transition: .2s; }
.tab.active[data-side=buy] { background: rgba(61,255,162,.15); color: var(--up); }
.tab.active[data-side=sell] { background: rgba(255,77,109,.15); color: var(--down); }
input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: 10px; font-size: 16px; outline: none; transition: border .2s; }
input:focus { border-color: var(--accent); }
.pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pcts button { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 7px 0; cursor: pointer; font: inherit; font-size: 12px; transition: .15s; }
.pcts button:hover { color: var(--text); border-color: var(--accent); }
.quote { font-size: 13px; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 10px 12px; line-height: 1.6; min-height: 64px; }
.quote b { color: var(--text); }
.quote .warn { color: var(--down); }
.btn { background: var(--accent); color: white; border: 0; padding: 12px 18px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .1s, filter .2s; flex: 1; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.big { padding: 14px; font-size: 16px; }
.btn.buy { background: linear-gradient(135deg, #1fd685, #3dffa2); color: #04210f; }
.btn.sell { background: linear-gradient(135deg, #e0284a, #ff4d6d); }

/* Leaderboard and feed */
#board { margin: 0; padding: 0; list-style: none; counter-reset: r; }
#board li { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: 13px; counter-increment: r; }
#board li::before { content: counter(r); color: var(--muted); width: 22px; }
#board li span:first-of-type { flex: 1; }
#board li.me { background: rgba(177,77,255,.12); }
#board li:nth-child(1) span:first-of-type { color: var(--gold); }
#feed { margin: 0; padding: 0; list-style: none; max-height: 320px; overflow: auto; }
#feed li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; animation: slidein .4s ease; }
#feed li .t { color: var(--muted); }
#feed li.buy .s { color: var(--up); } #feed li.sell .s { color: var(--down); }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); background: rgba(177,77,255,.2); } }

/* Login */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(5,4,8,.85); backdrop-filter: blur(8px); padding: 16px; }
.overlay.hidden { display: none; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: 0 0 80px rgba(177,77,255,.2); }
.row { display: flex; gap: 8px; }
.err { color: var(--down); min-height: 1.2em; margin: 0; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); opacity: 0; visibility: hidden; background: var(--panel-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; transition: transform .3s, opacity .2s, visibility .3s; z-index: 30; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.bad { border-color: var(--down); }

/* Sub-tabs and panes */
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; flex-wrap: wrap; }
.subtab { background: none; border: 1px solid transparent; color: var(--muted); font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: .2s; }
.subtab:hover { color: var(--text); background: var(--panel-2); }
.subtab.active { color: var(--text); border-color: var(--accent); background: rgba(177,77,255,.12); }
.pane.hidden, .hidden { display: none !important; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pane-head b { font-size: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.shake { animation: shake .4s; }

/* Wordle */
.wordle { display: flex; flex-direction: column; align-items: center; }
.wordle .pane-head { width: 100%; }
.reward-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.reward-row span { background: var(--panel-2); padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.reward-row span.cur { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.wd-grid { display: grid; gap: 6px; margin-bottom: 18px; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-tile { width: 58px; height: 58px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: 28px; font-weight: 700; text-transform: uppercase; background: var(--bg); }
.wd-tile.filled { border-color: #5a5470; animation: pop .1s; }
.wd-tile.hit { background: #1fae63; border-color: #1fae63; }
.wd-tile.near { background: #c99a1c; border-color: #c99a1c; }
.wd-tile.miss { background: #2b2838; border-color: #2b2838; color: #9a95ad; }
.wd-tile.flip { animation: flip .5s ease both; }
.wd-row.win .wd-tile { animation: bounce .5s ease both; }
.wd-row.win .wd-tile:nth-child(2) { animation-delay: .08s } .wd-row.win .wd-tile:nth-child(3) { animation-delay: .16s }
.wd-row.win .wd-tile:nth-child(4) { animation-delay: .24s } .wd-row.win .wd-tile:nth-child(5) { animation-delay: .32s }
@keyframes flip { 0% { transform: rotateX(0); filter: brightness(1); } 45% { transform: rotateX(90deg); background: var(--bg); border-color: var(--line); color: var(--text); } 100% { transform: rotateX(0); } }
@keyframes pop { 50% { transform: scale(1.1); } }
@keyframes bounce { 40% { transform: translateY(-14px); } }
.wd-keys { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 500px; }
.wd-krow { display: flex; gap: 5px; justify-content: center; }
.wd-key { flex: 1; max-width: 44px; height: 52px; border: 0; border-radius: 6px; background: #3a3550; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; transition: .15s; }
.wd-key.wide { max-width: 70px; flex: 1.5; font-size: 12px; }
.wd-key:active { transform: scale(.94); }
.wd-key.hit { background: #1fae63; } .wd-key.near { background: #c99a1c; } .wd-key.miss { background: #1c1a26; color: #5f5a72; }
@media (max-width: 680px) { .wd-tile { width: 52px; height: 52px; font-size: 24px; } }

/* Circles */
.ci-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.ci-hud div { background: var(--panel-2); border-radius: 10px; padding: 8px 12px; }
.ci-hud label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.ci-hud b { font-family: 'JetBrains Mono', monospace; font-size: 18px; }
#ciLives { color: var(--down); letter-spacing: 2px; }
#ciCombo.hot { color: var(--gold); text-shadow: 0 0 12px rgba(255,201,77,.7); }
.ci-area { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; touch-action: manipulation; user-select: none;
  background: radial-gradient(circle at 50% 50%, #1a1626, #0b0a10); border: 1px solid var(--line); cursor: crosshair; }
.ci-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 18px; pointer-events: none; }
.ci-msg .count { font-size: 80px; font-weight: 700; color: var(--accent); text-shadow: 0 0 30px rgba(177,77,255,.7); animation: pop .6s; }
.ci-final { font-size: 20px; color: var(--text); } .ci-final .pos { font-size: 34px; font-weight: 700; }
.ci-circle { position: absolute; border-radius: 50%; cursor: pointer; animation: ciIn .15s ease-out;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--gold) 45%, #b8811c); box-shadow: 0 0 20px rgba(255,201,77,.5); }
.ci-ring { position: absolute; inset: -14px; border-radius: 50%; border: 3px solid rgba(255,201,77,.9); animation: ciShrink var(--life) linear forwards; pointer-events: none; }
@keyframes ciIn { from { transform: scale(0); } }
@keyframes ciShrink { from { transform: scale(1.6); opacity: .3; } to { transform: scale(.72); opacity: 1; border-color: #ff4d6d; } }
.ci-circle.pop { animation: ciPop .25s forwards; pointer-events: none; }
.ci-circle.fade { animation: ciFade .35s forwards; pointer-events: none; background: #ff4d6d; }
@keyframes ciPop { to { transform: scale(1.6); opacity: 0; } }
@keyframes ciFade { to { transform: scale(.3); opacity: 0; } }
.ci-float { position: absolute; font-weight: 700; font-family: 'JetBrains Mono', monospace; pointer-events: none; animation: float .7s ease-out forwards; }
.ci-float.hit { color: var(--gold); } .ci-float.miss { color: var(--down); }

/* Casino: roulette */
.roulette { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.rl-left { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#rlWheel { border-radius: 50%; box-shadow: 0 0 0 6px #5a3a1e, 0 0 50px rgba(255,201,77,.15); }
.rl-result { font-size: 18px; min-height: 32px; display: flex; align-items: center; gap: 10px; }
.rl-history { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.rl-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; }
.rl-num.red { background: #d42a46; } .rl-num.black { background: #16141d; border: 1px solid var(--line); } .rl-num.green { background: #0f9d58; }
.rl-result .rl-num { min-width: 40px; height: 40px; font-size: 20px; }
.chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { width: 54px; height: 54px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.55); font: inherit; font-weight: 700; font-size: 12px; color: #fff; cursor: pointer; transition: .15s;
  background: radial-gradient(circle, #7d2fd0 55%, #4a1a80 56%); }
.chip:nth-child(2) { background: radial-gradient(circle, #1fae63 55%, #116b3b 56%); }
.chip:nth-child(3) { background: radial-gradient(circle, #d42a46 55%, #7d1528 56%); }
.chip:nth-child(4) { background: radial-gradient(circle, #222 55%, #000 56%); }
.chip:nth-child(5) { background: radial-gradient(circle, #e0a81c 55%, #8a5a12 56%); color: #1a1000; }
.chip.sel { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 0 3px var(--text), 0 6px 20px rgba(0,0,0,.5); }
.rl-table { display: grid; grid-template-columns: 44px repeat(12, 1fr) 48px; grid-template-rows: repeat(3, 44px) 38px 38px; gap: 3px;
  background: #0d4d2c; padding: 10px; border-radius: 12px; border: 2px solid #5a3a1e; }
.rl-zero { grid-row: 1 / 4; grid-column: 1; }
.rl-nums { grid-row: 1 / 4; grid-column: 2 / 14; display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.rl-cols { grid-row: 1 / 4; grid-column: 14; display: grid; gap: 3px; }
.rl-dozens { grid-row: 4; grid-column: 2 / 14; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.rl-even { grid-row: 5; grid-column: 2 / 14; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.cell { position: relative; display: grid; place-items: center; border-radius: 4px; font-weight: 700; font-size: 14px; cursor: pointer; user-select: none;
  border: 1px solid rgba(255,255,255,.18); transition: filter .15s, transform .1s; }
.cell:hover { filter: brightness(1.35); }
.cell:active { transform: scale(.96); }
.cell.red { background: #b81f3a; } .cell.black { background: #15131b; } .cell.green { background: #0f9d58; }
.cell.out { background: rgba(255,255,255,.04); font-size: 12px; }
.cell.out.red { background: #b81f3a; } .cell.out.black { background: #15131b; }
.stack { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 30px; height: 30px; padding: 0 4px; border-radius: 999px;
  background: radial-gradient(circle, #ffc94d 55%, #b8811c 56%); color: #1a1000; font-size: 10px; display: grid; place-items: center;
  border: 2px dashed rgba(0,0,0,.35); box-shadow: 0 3px 8px rgba(0,0,0,.6); animation: pop .2s; pointer-events: none; }
.rl-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }
.rl-actions .muted { margin-right: auto; font-size: 15px; }
#rlSpin { flex: 0 0 140px; }
@media (max-width: 900px) {
  .roulette { grid-template-columns: 1fr; }
  .rl-table { grid-template-columns: 34px repeat(12, 1fr) 36px; font-size: 11px; padding: 6px; }
  .cell { font-size: 11px; }
}

/* Casino: blackjack */
.felt { background: radial-gradient(ellipse at 50% 0%, #17784a, #0b3d24 70%); border: 8px solid #5a3a1e; border-radius: 160px 160px 24px 24px;
  padding: 28px 24px; min-height: 380px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; box-shadow: inset 0 0 60px rgba(0,0,0,.5); }
.bj-row { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bj-label { color: rgba(255,255,255,.75); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.bj-label span { display: inline-block; margin-left: 6px; background: rgba(0,0,0,.4); padding: 2px 8px; border-radius: 999px; color: #fff; font-family: 'JetBrains Mono', monospace; }
.cards { display: flex; min-height: 120px; }
.pcard { width: 82px; height: 118px; border-radius: 9px; background: #fbfaf7; color: #15131b; position: relative; margin-left: -22px;
  box-shadow: 0 4px 14px rgba(0,0,0,.45); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.pcard:first-child { margin-left: 0; }
.pcard.red { color: #c81d3a; }
.pcard .tl { position: absolute; top: 6px; left: 7px; font-size: 14px; line-height: 1; text-align: center; }
.pcard .br { position: absolute; bottom: 6px; right: 7px; font-size: 14px; line-height: 1; text-align: center; transform: rotate(180deg); }
.pcard .mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; }
.pcard.back { background: repeating-linear-gradient(45deg, #6c2bb0 0 8px, #4a1a80 8px 16px); border: 4px solid #fbfaf7; }
.pcard.deal { animation: deal .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes deal { from { transform: translate(140px, -160px) rotate(25deg); opacity: 0; } }
.bj-outcome { font-size: 24px; font-weight: 700; opacity: 0; transform: scale(.8); transition: .3s; background: rgba(0,0,0,.45); padding: 8px 20px; border-radius: 999px; min-height: 1em; }
.bj-outcome.show { opacity: 1; transform: scale(1); }
.bj-outcome.good { box-shadow: 0 0 30px rgba(61,255,162,.4); } .bj-outcome.bad { box-shadow: 0 0 30px rgba(255,77,109,.3); }
.bj-controls { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; flex-wrap: wrap; }
.bj-controls .btn { flex: 1; min-width: 90px; }
.bet-box { display: flex; flex-direction: column; gap: 4px; width: 140px; }

/* Casino: mines */
.mines { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.mn-side { display: flex; flex-direction: column; gap: 8px; }
select { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: 10px; font: inherit; font-size: 16px; }
.mn-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.mn-stats div { background: var(--panel-2); border-radius: 10px; padding: 8px 12px; }
.mn-stats label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.mn-stats b { font-family: 'JetBrains Mono', monospace; font-size: 18px; color: var(--gold); }
#mnCash { background: linear-gradient(135deg, #e0a81c, #ffc94d); color: #1a1000; }
.mn-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 480px; width: 100%; margin: 0 auto; }
.mn-tile { aspect-ratio: 1; border: 0; border-radius: 12px; background: linear-gradient(180deg, #2c2840, #221f31); box-shadow: inset 0 -4px 0 rgba(0,0,0,.35);
  font-size: 30px; cursor: pointer; transition: transform .12s, background .2s; }
.mn-tile:not(:disabled):hover { transform: translateY(-3px); background: linear-gradient(180deg, #3a3554, #2c2840); }
.mn-tile:disabled { cursor: default; }
.mn-tile.pending { animation: pulse .5s infinite alternate; }
.mn-tile.safe { background: linear-gradient(180deg, #1c5a3c, #12402a); box-shadow: 0 0 18px rgba(61,255,162,.35); animation: reveal .3s; }
.mn-tile.mine { background: #2a1520; opacity: .8; animation: reveal .3s; }
.mn-tile.boom { background: #ff4d6d; box-shadow: 0 0 30px rgba(255,77,109,.8); animation: boom .5s; }
.mn-tile.dim { opacity: .35; }
@keyframes reveal { from { transform: rotateY(90deg); } }
@keyframes boom { 30% { transform: scale(1.3); } }
@keyframes pulse { to { opacity: .5; } }
@media (max-width: 760px) { .mines { grid-template-columns: 1fr; } .work-layout { grid-template-columns: 1fr; } }
.banner.win { border-color: var(--up); box-shadow: 0 0 60px rgba(61,255,162,.4); }

/* Live roulette */
.rl-phase { margin-bottom: 16px; }
.rl-phase-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.rl-phase-top b { font-size: 20px; }
.rl-timer { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; color: var(--up); }
.rl-phase[data-phase="spinning"] .rl-phase-top b { color: var(--gold); }
.rl-phase[data-phase="result"] .rl-phase-top b { color: var(--accent); }
.rl-bar { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.rl-bar div { height: 100%; border-radius: 999px; background: var(--up); box-shadow: 0 0 12px var(--up); }
.rl-bar div.hurry { background: var(--down); box-shadow: 0 0 12px var(--down); }
.rl-bar div.spinning { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.rl-bar div.result { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.rl-note { margin: 8px 0 0; font-size: 12px; text-align: right; }
.rl-table.closed .cell { cursor: not-allowed; }
.rl-table.closed .cell:hover { filter: none; }
.cell.placed { animation: pop .25s; }
.cell.won { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255,201,77,.7); z-index: 1; }
.stack.ghost { background: radial-gradient(circle, #8a84a3 55%, #4d4860 56%); color: #fff; opacity: .85; }
.rl-players { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.rl-players-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.rl-players-head h2 { margin: 0; }
.rl-player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rl-player { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; animation: slidein .35s ease; position: relative; transition: .3s; }
.rl-player.me { border-color: rgba(177,77,255,.5); }
.rl-player.winner { border-color: var(--up); box-shadow: 0 0 22px rgba(61,255,162,.25); }
.rl-player.loser { opacity: .55; }
.rl-p-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rl-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), #5a1fa0); }
.rl-p-total { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--gold); }
.rl-p-bets { display: flex; flex-wrap: wrap; gap: 4px; }
.rl-tag { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 3px 7px; border-radius: 6px; background: #2b2838; }
.rl-tag.red { background: #7d1528; } .rl-tag.black { background: #0b0a10; border: 1px solid var(--line); } .rl-tag.green { background: #0b6b3c; }
.rl-tag.hit { box-shadow: 0 0 0 1px var(--gold); color: var(--gold); }
.rl-net { position: absolute; top: -10px; right: 10px; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
  background: var(--bg); border: 1px solid currentColor; border-radius: 999px; padding: 2px 8px; animation: pop .4s; }

/* Ladders */
.ladder { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; width: 100%; }
.ladder-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.ladder-head h2 { margin: 0; }
.ladder-tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 3px; border-radius: 999px; }
.ladder-tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.ladder-tabs button.active { background: rgba(177,77,255,.2); color: var(--text); }
.ladder-list { list-style: none; margin: 0; padding: 0; }
.ladder-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-size: 14px; animation: slidein .3s ease; }
.ladder-list li:nth-child(odd):not(.gap):not(.empty) { background: rgba(255,255,255,.02); }
.ladder-list li.podium .nm { font-weight: 700; }
.ladder-list li:first-child.podium { background: linear-gradient(90deg, rgba(255,201,77,.14), transparent); }
.ladder-list li.me { background: rgba(177,77,255,.14) !important; box-shadow: inset 0 0 0 1px rgba(177,77,255,.4); }
.ladder-list .rk { font-family: 'JetBrains Mono', monospace; color: var(--muted); text-align: center; font-size: 15px; }
.ladder-list .sc { font-family: 'JetBrains Mono', monospace; font-size: 13px; text-align: right; }
.ladder-list li.gap { display: block; text-align: center; color: var(--muted); padding: 0; }
.ladder-list li.empty { display: block; text-align: center; padding: 14px; }
#ciCombo.fire { color: #ff7b2e; text-shadow: 0 0 16px rgba(255,123,46,.9); animation: pop .3s; }
.ci-streak { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-size: 30px; font-weight: 700; color: #ff9d4d;
  text-shadow: 0 0 24px rgba(255,123,46,.8); pointer-events: none; animation: streak 1.2s ease-out forwards; }
@keyframes streak { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -30px) scale(1); } }

/* Roulette: unplaced chips and confirm bar */
.stack.pend { top: 6px; left: auto; right: -6px; transform: none; min-width: 26px; height: 22px; font-size: 9px;
  background: rgba(11,10,16,.85); color: var(--gold); border: 2px dashed var(--gold); box-shadow: 0 0 10px rgba(255,201,77,.5); z-index: 2; }
.rl-confirm { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px;
  padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); transition: .2s; }
.rl-confirm .muted { margin-right: auto; font-size: 15px; }
.rl-confirm.has { border-color: var(--gold); background: rgba(255,201,77,.06); }
.rl-confirm.has #rlPending { color: var(--gold); }
#rlPlace { flex: 0 0 auto; min-width: 170px; background: linear-gradient(135deg, #1fd685, #3dffa2); color: #04210f; }

/* Dividends */
.div-panel { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; align-items: center; margin-top: 10px; padding: 12px; border-radius: 12px;
  border: 1px solid rgba(255,201,77,.35); background: rgba(255,201,77,.05); }
.div-panel .div-text b { color: var(--gold); }
.div-panel .muted { font-size: 12px; margin-top: 2px; }
.div-panel .muted b { color: var(--text); }
.div-panel input { padding: 10px 12px; }
#divPay { flex: 0; white-space: nowrap; background: linear-gradient(135deg, #e0a81c, #ffc94d); color: #1a1000; }
.btn.armed { background: linear-gradient(135deg, #e0284a, #ff4d6d) !important; color: #fff !important; animation: pop .2s; }
#divCountdown { color: var(--gold); }
@media (max-width: 680px) { .div-panel { grid-template-columns: 1fr; } }

/* Auto orders */
.orders { display: flex; flex-direction: column; gap: 8px; }
.orders h2 { margin-bottom: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; padding: 8px; border-radius: 8px; cursor: pointer; }
.seg button.active { background: rgba(177,77,255,.18); color: var(--text); }
#ordSide button.active[data-v=buy] { background: rgba(61,255,162,.15); color: var(--up); }
#ordSide button.active[data-v=sell] { background: rgba(255,77,109,.15); color: var(--down); }
.ord-price { display: flex; flex-direction: column; gap: 6px; }
.ord-all { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.ord-all input { width: auto; }
#ordSummary { min-height: 0; }
#ordPlace { background: linear-gradient(135deg, #7d2fd0, #b14dff); }
.my-orders { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.my-orders li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; border-radius: 9px; background: var(--panel-2); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.my-orders li .what b.buy { color: var(--up); } .my-orders li .what b.sell { color: var(--down); }
.my-orders li .st { color: var(--muted); grid-column: 1 / -1; font-size: 11px; }
.my-orders li.filled { box-shadow: inset 3px 0 0 var(--up); } .my-orders li.failed { box-shadow: inset 3px 0 0 var(--down); }
.my-orders li.cancelled, .my-orders li.failed, .my-orders li.filled { opacity: .65; }
.my-orders .x { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; cursor: pointer; padding: 0 8px; font: inherit; }
.my-orders .x:hover { color: var(--down); border-color: var(--down); }
#feed li .bot { font-size: 11px; }
.reload-note { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5,4,8,.8); backdrop-filter: blur(6px); font-size: 20px; font-weight: 700; }

/* Flappy */
.fl-stats { display: flex; gap: 14px; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--muted); white-space: nowrap; }
.fl-stats b { color: var(--gold); }
.fl-wrap { position: relative; display: flex; justify-content: center; }
#flCanvas { border-radius: 14px; border: 1px solid var(--line); cursor: pointer; touch-action: manipulation; box-shadow: 0 0 40px rgba(177,77,255,.15); }
.fl-msg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 20px; line-height: 1.5;
  background: rgba(11,10,16,.75); padding: 16px 26px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; backdrop-filter: blur(4px); }
.fl-msg b { font-size: 26px; }

/* Chicken */
.ck-top { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.ck-top .btn { flex: 0 0 auto; min-width: 150px; }
.ck-mult { display: flex; flex-direction: column; gap: 4px; min-width: 110px; }
.ck-mult b { font-family: 'JetBrains Mono', monospace; font-size: 26px; color: var(--gold); }
#ckCash { background: linear-gradient(135deg, #e0a81c, #ffc94d); color: #1a1000; }
#ckGo { background: linear-gradient(135deg, #1fd685, #3dffa2); color: #04210f; }
.ck-road-wrap::-webkit-scrollbar { height: 10px; }
.ck-road-wrap::-webkit-scrollbar-track { background: #14121c; }
.ck-road-wrap::-webkit-scrollbar-thumb { background: #4a4566; border-radius: 5px; border: 2px solid #14121c; }
.ck-road-wrap::-webkit-scrollbar-thumb:hover { background: var(--gold); }
@supports not selector(::-webkit-scrollbar) { .ck-road-wrap { scrollbar-width: thin; scrollbar-color: #4a4566 #14121c; } }
.ck-pets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ck-pet { width: 44px; height: 44px; font-size: 24px; line-height: 1; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; transition: .15s; }
.ck-pet:hover { transform: translateY(-2px); border-color: var(--muted); }
.ck-pet.on { border-color: var(--gold); background: rgba(255,201,77,.12); box-shadow: 0 0 14px rgba(255,201,77,.25); }
.ck-road-wrap { overflow-x: auto; border-radius: 16px; border: 2px solid #2a2638; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.ck-road { position: relative; display: flex; height: 260px; min-width: max-content;
  background: linear-gradient(180deg, #2b2a36 0, #22212b 50%, #2b2a36 100%); }
.ck-road::before, .ck-road::after { content: ''; position: absolute; left: 0; right: 0; height: 6px; background: repeating-linear-gradient(90deg, #f5f1e4 0 22px, transparent 22px 40px); opacity: .5; z-index: 1; pointer-events: none; }
.ck-road::before { top: 0; } .ck-road::after { bottom: 0; }
.ck-lane { position: relative; width: 92px; flex: 0 0 92px; border-right: 2px dashed rgba(255,214,102,.28); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: background .3s; }
.ck-start, .ck-end { border-right: 0; width: 84px; flex-basis: 84px; background:
  radial-gradient(circle at 20% 25%, rgba(255,255,255,.12) 0 3px, transparent 4px), radial-gradient(circle at 70% 70%, rgba(255,214,102,.18) 0 3px, transparent 4px),
  linear-gradient(180deg, #2f6b3f, #245733); }
.ck-end { background:
  conic-gradient(#f3f3f3 25%, #1a1a1a 0 50%, #f3f3f3 0 75%, #1a1a1a 0) 0 0 / 28px 28px; }
.ck-label { font-weight: 800; color: #fff; font-size: 12px; letter-spacing: .14em; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.ck-start .ck-label, .ck-end .ck-label { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 2; }
.ck-end .ck-label { background: rgba(0,0,0,.7); padding: 6px 8px; border-radius: 8px; }
.ck-lane .ck-coin { display: grid; place-items: center; min-width: 58px; height: 34px; padding: 0 10px; border-radius: 17px; background: rgba(20,18,30,.82); border: 2px solid #4a4566;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; color: #b9b4d0; z-index: 2; transition: .25s; backdrop-filter: blur(2px); }
.ck-lane.next .ck-coin { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 18px rgba(255,201,77,.45); transform: scale(1.08); }
.ck-lane.passed .ck-coin { background: #12402a; border-color: var(--up); color: var(--up); }
.ck-lane.passed { background: rgba(61,255,162,.07); }
.ck-lane.crash { background: rgba(255,77,109,.2); }
.ck-lane.crash .ck-coin { background: #5a1525; border-color: var(--down); color: #fff; }
/* Cars seen from above: body, windscreen and rear window, headlights */
.ck-car { --h: 0; position: absolute; left: 50%; top: -70px; width: 36px; height: 60px; margin-left: -18px; border-radius: 11px 11px 9px 9px;
  background: linear-gradient(90deg, hsl(var(--h) 75% 42%), hsl(var(--h) 80% 55%) 50%, hsl(var(--h) 75% 42%));
  box-shadow: 0 6px 10px rgba(0,0,0,.45), inset 0 0 0 2px rgba(0,0,0,.25); animation: drive 2s linear infinite; opacity: .9; }
.ck-car::before { content: ''; position: absolute; left: 5px; right: 5px; top: 22px; height: 18px; border-radius: 5px; background: linear-gradient(180deg, #10131c 0 45%, hsl(var(--h) 70% 30%) 45% 55%, #10131c 55%); }
.ck-car::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 5px; border-radius: 3px; background: radial-gradient(circle at 20% 50%, #ffe9a6 0 3px, transparent 4px), radial-gradient(circle at 80% 50%, #ffe9a6 0 3px, transparent 4px); }
.ck-lane.passed .ck-car, .ck-start .ck-car { display: none; }
.ck-lane.crash .ck-car { animation: none; top: 100px; opacity: 1; transform: rotate(-8deg); }
@keyframes drive { to { top: 290px; } }
.ck-chicken { position: absolute; top: 50%; left: 40px; transform: translate(-50%, -50%); width: 52px; height: 52px; display: grid; place-items: center; z-index: 3; transition: left .35s cubic-bezier(.3,1.4,.5,1); }
.ck-pet-face { font-size: 40px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); position: relative; z-index: 1; }
.ck-shadow { position: absolute; left: 50%; bottom: 2px; width: 34px; height: 10px; margin-left: -17px; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(2px); }
.ck-pet-face.wiggle { animation: ckWig .4s ease; }
@keyframes ckWig { 25% { transform: rotate(-14deg) scale(1.15); } 60% { transform: rotate(10deg) scale(1.1); } }
.ck-chicken.hop { animation: hopUp .35s ease; }
@keyframes hopUp { 50% { transform: translate(-50%, -85%) scale(1.1); } }
.ck-chicken.dead { animation: ckBoom .5s; }
@keyframes ckBoom { 30% { transform: translate(-50%, -50%) scale(1.4); } }
@media (max-width: 520px) { .ck-pets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .ck-pet { flex: 0 0 auto; width: 40px; height: 40px; font-size: 22px; } .ck-road { height: 230px; } }

/* Dial */
.dl-stage { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: stretch; }
.dl-swatch { position: relative; min-height: 340px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; transition: background .15s;
  background: repeating-linear-gradient(45deg, #14121c 0 14px, #18161f 14px 28px); }
.dl-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.dl-center b { font-size: 30px; }
.dl-center .pos { font-size: 22px; font-weight: 700; }
.dl-center .btn { flex: 0; min-width: 160px; }
.dl-timer { position: absolute; left: 0; bottom: 0; height: 6px; width: 0; background: rgba(255,255,255,.85); box-shadow: 0 0 12px rgba(255,255,255,.6); }
.dl-controls { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.dl-controls label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.dl-controls input[type=range] { -webkit-appearance: none; appearance: none; height: 26px; border-radius: 999px; border: 1px solid var(--line); padding: 0; cursor: pointer; }
.dl-controls input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid #0b0a10; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.dl-controls input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #0b0a10; }
.dl-controls .btn { margin-top: 8px; flex: 0 0 auto; }
.dl-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.dl-res { display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); border-radius: 14px; padding: 10px; font-family: 'JetBrains Mono', monospace; }
.dl-res-foot { display: flex; align-items: baseline; justify-content: space-between; } .dl-res-foot b { font-size: 20px; }
.dl-res.new { animation: pop .4s; box-shadow: 0 0 0 1px var(--gold); }
.dl-pair { display: flex; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.dl-pair span { flex: 1; position: relative; }
.dl-pair i { position: absolute; left: 6px; bottom: 5px; font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
@media (max-width: 760px) { .dl-stage { grid-template-columns: 1fr; } .dl-swatch { min-height: 240px; } }

/* Coinflip */
.cf-top { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; }
.cf-top .btn { flex: 0 0 auto; min-width: 150px; height: 46px; padding: 0 18px; }
.cf-top input { height: 46px; box-sizing: border-box; }
.cf-hint { flex: 1 1 220px; font-size: 12px; line-height: 1.4; align-self: center; }
.cf-main { max-width: 640px; margin-bottom: 12px; }
.cf-modal { width: min(380px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 20px 22px; text-align: center;
  background: radial-gradient(ellipse at 50% 35%, rgba(255,201,77,.08), transparent 65%), rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07); border-radius: 12px; min-height: 320px; }
.cf-coin-wrap { position: relative; perspective: 800px; width: 140px; height: 140px; margin-top: 0; }
.cf-coin-wrap::after { content: ''; position: absolute; left: 50%; bottom: -26px; width: 110px; height: 16px; margin-left: -55px;
  border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(7px); transition: transform .3s, opacity .3s; }
.cf-coin-wrap.flipping { animation: cf-hop 2.6s cubic-bezier(.3,.1,.4,1); }
.cf-coin-wrap.flipping::after { animation: cf-shadow 2.6s cubic-bezier(.3,.1,.4,1); }
@keyframes cf-hop { 0% { transform: translateY(0); } 45% { transform: translateY(-58px); } 100% { transform: translateY(0); } }
@keyframes cf-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 45% { transform: scale(.55); opacity: .4; } }
.cf-coin { position: relative; width: 140px; height: 140px; transform-style: preserve-3d; transform: rotateY(0deg); }
.cf-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-size: 58px; font-weight: 800; color: #7a5200; text-shadow: 0 1px 0 rgba(255,255,255,.45); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 35% 28%, #fff0b8, #ffc94d 52%, #c88f12); border: 5px solid #e8b43a;
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.12), inset 0 0 0 9px rgba(160,105,0,.35), inset 0 -10px 18px rgba(0,0,0,.22), 0 6px 18px rgba(0,0,0,.4); }
.cf-tails { transform: rotateY(180deg); background: radial-gradient(circle at 35% 28%, #f2f4f8, #c9cfdb 52%, #8a93a6); border-color: #aab2c2; color: #4a5266; }
.cf-outcome { min-height: 56px; text-align: center; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cf-outcome.show { font-size: 17px; }
.cf-outcome.show.good { color: var(--up); } .cf-outcome.show.bad { color: var(--down); }
.cf-outcome.show .pos, .cf-outcome.show .neg { font-size: 22px; }
.cf-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-side h3 { margin: 6px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted, #8b8ba7); font-weight: 600; }
.cf-list, .cf-recent { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cf-list { max-height: 300px; overflow-y: auto; }
.cf-list li, .cf-recent li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.cf-list li b { font-variant-numeric: tabular-nums; }
.cf-list li.me { border-color: rgba(255,201,77,.4); background: rgba(255,201,77,.06); }
.cf-list .nm, .cf-recent .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-list .btn.small { flex: 0 0 auto; width: 104px; padding: 7px 0; text-align: center; }
.cf-list .empty, .cf-recent .empty { justify-content: center; background: none; border-style: dashed; padding: 14px; }

.cf-title { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.cf-vs { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.cf-vs em { font-style: normal; font-weight: 700; font-size: 15px; color: var(--text, #fff); }
.cf-p { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.cf-p i { font-style: normal; font-weight: 800; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-size: 13px; color: #6b4a00; background: #ffc94d; }
.cf-p.tails i { background: #c9cfdb; color: #4a5266; }
.cf-p b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cf-modal .cf-coin-wrap { margin-top: 56px; }
.cf-modal .cf-outcome { min-height: 70px; margin-top: 14px; }
.cf-modal .btn { min-width: 140px; }

/* Crash */
.cx { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .cx { grid-template-columns: 1fr; } }
.cx-screen { position: relative; height: 340px; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 30% 100%, rgba(61,255,162,.06), transparent 60%), rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.cx-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cx-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; pointer-events: none; }
.cx-read b { font-family: 'JetBrains Mono', monospace; font-size: 64px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.cx-read.crashed b { color: var(--down); }
.cx-read.waiting b { font-size: 40px; color: var(--muted); }
.cx-read span { font-size: 15px; }
.cx-history { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; min-height: 28px; }
.cx-chip { padding: 3px 9px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.06); }
.cx-chip.low { color: var(--down); } .cx-chip.mid { color: var(--up); } .cx-chip.high { color: var(--gold, #ffc94d); background: rgba(255,201,77,.12); }
.cx-right { display: flex; flex-direction: column; gap: 12px; }
.cx-right .bet-box { width: 100%; }
.cx-right .btn.big { flex: 0 0 auto; min-height: 52px; padding: 0 16px; font-size: 17px; }
.cx-right .btn.cash { background: linear-gradient(135deg, #ffc94d, #ffae1f); color: #3a2500; }
.cx-msg { min-height: 20px; font-size: 14px; }
.cx-note, .cx-proof { font-size: 12px; margin: 0; line-height: 1.45; }
.cx-proof { word-break: break-all; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.cx-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cx-pl { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.cx-pl.me { border-color: rgba(255,201,77,.4); }
.cx-pl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-pl .st { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.cx-pl.won { background: rgba(61,255,162,.07); } .cx-pl.lost { opacity: .6; }

/* Dial comparison after each guess */
.dl-cmp { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
.dl-cmp.hidden { display: none; }
.dl-half { position: relative; }
.dl-half span { position: absolute; left: 14px; top: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.75); }
.dl-cmp-bar { grid-column: 1 / 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; background: rgba(11,10,16,.92); border-top: 1px solid var(--line); flex-wrap: wrap; }
.dl-cmp-score { display: flex; flex-direction: column; } .dl-cmp-score b { font-size: 30px; line-height: 1.1; } .dl-cmp-score small { font-size: 15px; color: var(--muted); font-weight: 500; }
.dl-final { display: flex; flex-direction: column; align-items: flex-end; } .dl-final b { font-size: 22px; } .dl-final .pos { font-size: 20px; font-weight: 700; }
.dl-cmp-bar .btn { flex: 0 0 auto; min-width: 170px; }
.dl-stage:has(.dl-controls.hidden) { grid-template-columns: 1fr; }

/* ---------- Phones ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { touch-action: manipulation; }           /* no double-tap zoom while tapping fast */
button, .cell, .chip, .click-btn { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.rl-table-wrap { margin: 0 -2px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.rl-table-wrap::-webkit-scrollbar { height: 6px; } .rl-table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
@media (max-width: 900px) {
  .rl-table { min-width: 600px; grid-template-columns: 40px repeat(12, 1fr) 44px; grid-template-rows: repeat(3, 48px) 44px 44px; }
  .cell { font-size: 13px; }
}
@media (max-width: 680px) {
  select, input { font-size: 16px; }              /* below 16px iOS zooms the page when a field is focused */
  .top { position: static; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo who" "nav nav" "stats stats"; gap: 10px 12px; padding: 12px 16px; align-items: center; }
  .top .logo { grid-area: logo; } .top .who-wrap { grid-area: who; } .top .nav { grid-area: nav; } .top .stats { grid-area: stats; }
  .nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; } .nav-btn { padding: 10px 0; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat label { font-size: 10px; } .stat b { font-size: 15px; white-space: nowrap; }
  main.view { padding: 12px; }
  .card { padding: 14px; }
  .subtab { padding: 9px 12px; }
  .btn.small { padding: 9px 14px; }
  .ladder-tabs button { padding: 7px 14px; }
  /* Crash: bet panel right under the graph so Cash out is always in thumb reach */
  .cx { display: flex; flex-direction: column; gap: 12px; }
  .cx-left { display: contents; }
  .cx-screen { order: 0; height: 240px; } .cx-history { order: 1; margin-top: 0; } .cx-right { order: 2; }
  .cx-read b { font-size: 52px; }
  .cx-right { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cx-right .btn.big, .cx-right .cx-msg, .cx-right .cx-note, .cx-right .cx-proof { grid-column: 1 / 3; }
  .cx-right .btn.big { min-height: 58px; font-size: 18px; }
  .cx-note { order: 5; } .cx-proof { order: 6; }
  /* Coinflip / dial */
  .cf-top .btn { flex: 1 1 100%; } .cf-top .bet-box { flex: 1 1 100%; width: 100%; }
  .cf-list .btn.small { width: 88px; }
  .dl-swatch { min-height: 170px; }
  .dl-stage { gap: 10px; } .dl-controls { gap: 6px; }
  .dl-controls input[type=range] { height: 34px; }
  .dl-controls input[type=range]::-webkit-slider-thumb { width: 34px; height: 34px; }
  .dl-cmp-bar { padding: 12px; } .dl-cmp-bar .btn { min-width: 0; flex: 1 1 100%; }
  .dl-cmp-score b { font-size: 26px; }
  .dl-results { grid-template-columns: repeat(2, 1fr); }
  .rl-note { text-align: left; }
}
/* Grid and flex children may shrink below their content, so wide inner pieces scroll or scale instead of stretching the page */
.work-layout > *, .market-layout > *, .casino-layout > *, .roulette > *, .cx > *, .cf-main > *, .dl-stage > * { min-width: 0; }
.fl-wrap { max-width: 100%; }
#flCanvas { max-width: 100%; }
@media (max-width: 680px) { .cx { align-items: stretch; } }

.rl-swipe { display: none; font-size: 12px; margin-bottom: 4px; }
@media (max-width: 900px) { .rl-swipe { display: block; } }

/* Store */
.coins-btns { display: flex; gap: 6px; }
.store-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.store-head { display: flex; align-items: center; justify-content: space-between; } .store-head h2 { margin: 0; }
.store-card > .muted { margin: 0; }
.store-items { display: flex; flex-direction: column; gap: 10px; }
.st-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.st-icon { font-size: 34px; line-height: 1; text-align: center; padding-top: 2px; }
.st-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .st-body p { margin: 0; line-height: 1.4; }
.st-body select { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-family: 'JetBrains Mono', monospace; }
.st-result { min-height: 22px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.st-result .muted { font-weight: 400; font-family: 'JetBrains Mono', monospace; }
.st-spin { display: inline-block; animation: st-spin .45s linear infinite; font-size: 20px; }
@keyframes st-spin { to { transform: rotate(360deg); } }
.st-buy { flex: 0 0 auto; align-self: center; white-space: nowrap; }
@media (max-width: 520px) { .st-item { grid-template-columns: 40px 1fr; } .st-buy { grid-column: 1 / 3; width: 100%; padding: 12px; } }
.coins-head { gap: 8px; } .coins-btns .btn { padding: 7px 10px; }

/* Rewards */
.rw-layout { padding: 24px 24px 40px; max-width: 1200px; margin: 0 auto; display: grid; gap: 18px; }
.rw-layout > * { min-width: 0; }
.rw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.rw-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.rw-card .rw-emoji { font-size: 38px; line-height: 1; }
.rw-card p { margin: 0; line-height: 1.4; flex: 1; }
.rw-price { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--gold); font-size: 20px; }
.rw-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rw-bar i { display: block; height: 100%; background: var(--gold); }
.rw-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.rw-card .btn { width: 100%; }
.rw-mine { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.rw-mine li { padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.rw-mine code { font-family: 'JetBrains Mono', monospace; background: var(--bg); padding: 6px 10px; border-radius: 8px; user-select: all; word-break: break-all; }
.rw-st { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.rw-st.paid { color: var(--gold); } .rw-st.delivered { color: var(--green, #3ddc84); } .rw-st.refunded { color: var(--muted); }
@media (max-width: 520px) { .rw-layout { padding: 14px 12px 30px; } .nav-btn { font-size: 14px; } }

/* R.I.P. board */
.who-wrap { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.rip-btn { background: rgba(255,77,109,.1); color: var(--down); border: 1px solid rgba(255,77,109,.35); border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; transition: .15s; }
.rip-btn:hover { background: rgba(255,77,109,.2); }
.rip-total { font-size: 18px; margin: 4px 0 10px; } .rip-total b { color: var(--down); font-family: 'JetBrains Mono', monospace; }
.rip-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.rip-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.rip-list li:first-child { border-color: rgba(255,77,109,.5); }
.rip-n { color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.rip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rip-list b { font-family: 'JetBrains Mono', monospace; }
@media (max-width: 520px) { .top .who-wrap { grid-area: who; } .top .who { text-align: right; } .rip-btn { padding: 5px 8px; font-size: 12px; } }

/* Horse racing */
.hr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hr-status { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 20px; }
.hr-track { display: grid; gap: 6px; padding: 12px; border-radius: 16px; border: 2px solid #2a2638; background: linear-gradient(180deg, #2f6b3f, #245733); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.hr-lane { position: relative; display: grid; grid-template-columns: 110px 1fr 28px; align-items: center; gap: 8px; height: 46px; padding: 0 8px; border-radius: 10px; background: rgba(20,14,10,.38); border-left: 4px solid var(--c); }
.hr-lane.win { background: rgba(255,201,77,.22); box-shadow: 0 0 0 2px var(--gold); }
.hr-name { font-weight: 700; font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-run { position: relative; height: 100%; margin-right: 26px; background: repeating-linear-gradient(90deg, transparent 0 38px, rgba(255,255,255,.07) 38px 40px); }
.hr-horse { position: absolute; top: 50%; left: 0; font-size: 28px; line-height: 1; transform: translate(0, -50%) scaleX(-1); filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); will-change: left; }
.hr-track.racing .hr-horse { animation: hrGallop .28s ease-in-out infinite; }
@keyframes hrGallop { 50% { margin-top: -5px; } }
.hr-flag { font-size: 20px; text-align: center; }
.hr-bet { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 14px 0 10px; }
.hr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hr-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hr-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); border-top: 4px solid var(--c); }
.hr-card.won { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255,201,77,.3); }
.hr-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hr-x { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 20px; color: var(--gold); }
.hr-chance { font-size: 13px; } .hr-mine { min-height: 18px; font-size: 13px; }
.hr-card .btn { width: 100%; }
.hr-pl { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; }
.hr-bets { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .hr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hr-lane { grid-template-columns: 74px 1fr 22px; } .hr-name { font-size: 11px; } .hr-status { font-size: 17px; } }

/* The Mine */
.mn-scene { border-radius: 16px; overflow: hidden; border: 2px solid #2a2638; box-shadow: 0 10px 30px rgba(0,0,0,.35); margin: 12px 0; }
.mn-sky { height: 56px; background: linear-gradient(180deg, #5aa7e8, #bfe3ff); position: relative; }
.mn-sky::after { content: '⛰️'; position: absolute; right: 24px; bottom: -6px; font-size: 40px; }
.mn-rock { position: relative; padding: 16px; min-height: 140px; display: grid; gap: 10px; align-content: center;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.05) 0 6px, transparent 7px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.04) 0 8px, transparent 9px), linear-gradient(180deg, #4b3d33, #2d241f); }
.mn-tunnel { position: relative; height: 64px; border-radius: 32px; background: linear-gradient(180deg, #0f0c0a, #1c1511); box-shadow: inset 0 4px 12px rgba(0,0,0,.8); display: flex; align-items: center; padding: 0 28px; overflow: hidden; }
.mn-miner { font-size: 36px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); transform-origin: 70% 80%; }
.mn-scene.on .mn-miner { animation: mnDig .7s ease-in-out infinite; }
@keyframes mnDig { 50% { transform: rotate(-22deg) translateX(4px); } }
.mn-scene:not(.on) .mn-miner { opacity: .7; }
.mn-spark { position: absolute; left: 76px; font-size: 22px; opacity: 0; }
.mn-spark.pop { animation: mnPop 1s ease-out; }
@keyframes mnPop { 0% { opacity: 1; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translateY(-14px) scale(1.6); } }
.mn-status { color: #f1e4d6; text-align: center; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.mn-scene.hurt .mn-rock { background: linear-gradient(180deg, #4b3036, #2d1e21); }
.mn-ores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.mn-ore { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.mn-ore > div { min-width: 0; flex: 1; font-size: 14px; }
.mn-ico { font-size: 26px; } .mn-n { font-family: 'JetBrains Mono', monospace; font-size: 20px; }
.mn-ore.diamond { border-color: rgba(120,220,255,.5); } .mn-ore.gold { border-color: rgba(255,201,77,.45); }
.mn-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.mn-cols > * { min-width: 0; }
.mn-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.mn-log li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 14px; }
.mn-log li.acc { background: rgba(255,77,109,.1); }
.mn-totals { display: grid; gap: 8px; margin-top: 8px; }
.mn-totals > div { display: flex; justify-content: space-between; gap: 10px; }
.mn-note { font-size: 13px; margin-top: 10px; }
@media (max-width: 720px) { .mn-ores { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mn-cols { grid-template-columns: 1fr; } }
#mnToggle { white-space: nowrap; min-width: 110px; }


/* Tunnel made of blocks that the pickaxe digs through */
.mn-tunnel { padding: 0 4px; }
.mn-blocks { display: flex; position: absolute; inset: 0 4px; align-items: center; z-index: 1; }
.mn-blk { position: relative; flex: 0 0 var(--bs, 56px); height: 100%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.4); image-rendering: pixelated; transition: opacity .12s, transform .12s;
  background: conic-gradient(#7a5230 25%, #6b4628 0 50%, #7a5230 0 75%, #86592f 0) 0 0 / 25% 25%; }
.mn-blk.v1 { background: conic-gradient(#7d7d7d 25%, #6e6e6e 0 50%, #7d7d7d 0 75%, #8a8a8a 0) 0 0 / 25% 25%; }
.mn-blk.v2 { background: radial-gradient(circle at 30% 35%, #2b2b2b 0 3px, transparent 4px), radial-gradient(circle at 68% 66%, #2b2b2b 0 3px, transparent 4px), conic-gradient(#7d7d7d 25%, #6e6e6e 0 50%, #7d7d7d 0 75%, #8a8a8a 0) 0 0 / auto, 25% 25%; }
.mn-blk.v3 { background: radial-gradient(circle at 32% 38%, #d8a77a 0 3px, transparent 4px), radial-gradient(circle at 66% 62%, #d8a77a 0 3px, transparent 4px), conic-gradient(#7d7d7d 25%, #6e6e6e 0 50%, #7d7d7d 0 75%, #8a8a8a 0) 0 0 / auto, 25% 25%; }
.mn-blk.v4 { background: radial-gradient(circle at 30% 40%, #ffc94d 0 3px, transparent 4px), radial-gradient(circle at 70% 65%, #ffc94d 0 3px, transparent 4px), conic-gradient(#7d7d7d 25%, #6e6e6e 0 50%, #7d7d7d 0 75%, #8a8a8a 0) 0 0 / auto, 25% 25%; }
.mn-blk.v5 { background: conic-gradient(#6b4628 25%, #7a5230 0 50%, #6b4628 0 75%, #5f3f24 0) 0 0 / 25% 25%; }
.mn-blk.v6 { background: radial-gradient(circle at 35% 40%, #7fe6ff 0 3px, transparent 4px), radial-gradient(circle at 66% 62%, #7fe6ff 0 3px, transparent 4px), conic-gradient(#7d7d7d 25%, #6e6e6e 0 50%, #7d7d7d 0 75%, #8a8a8a 0) 0 0 / auto, 25% 25%; }
.mn-blk::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.mn-blk[data-c="1"]::after { background: linear-gradient(135deg, transparent 47%, rgba(0,0,0,.65) 48% 52%, transparent 53%); }
.mn-blk[data-c="2"]::after { background: linear-gradient(135deg, transparent 47%, rgba(0,0,0,.65) 48% 52%, transparent 53%), linear-gradient(45deg, transparent 47%, rgba(0,0,0,.65) 48% 52%, transparent 53%); }
.mn-blk[data-c="3"]::after { background: linear-gradient(135deg, transparent 45%, rgba(0,0,0,.75) 46% 54%, transparent 55%), linear-gradient(45deg, transparent 45%, rgba(0,0,0,.75) 46% 54%, transparent 55%), linear-gradient(90deg, transparent 46%, rgba(0,0,0,.7) 47% 53%, transparent 54%); }
.mn-blk.gone { opacity: 0; transform: scale(.6); }
.mn-miner { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.mn-scene.on .mn-miner { animation: mnDig2 .5s ease-in-out infinite; }
@keyframes mnDig2 { 50% { transform: translateY(-50%) rotate(-22deg) translateX(3px); } }
.mn-spark { z-index: 3; top: 6px; }
.mn-count { text-align: center; font-size: 13px; color: #d8c6b2; }
.mn-tunnel { padding-left: 4px; }

/* Crime */
.cr-layout { padding: 24px 24px 40px; max-width: 1200px; margin: 0 auto; display: grid; gap: 18px; }
.cr-layout > * { min-width: 0; }
.cr-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 6px; }
.cr-tier { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.cr-emoji { font-size: 36px; line-height: 1; }
.cr-fee { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 22px; color: var(--gold); }
.cr-facts { flex: 1; line-height: 1.5; font-size: 14px; }
.cr-tier .btn { width: 100%; }
.cr-job { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; margin: 14px 0 0; background: rgba(255,201,77,.08); border: 1px solid rgba(255,201,77,.35); }
.cr-prog { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; }
.cr-prog i { display: block; height: 100%; background: linear-gradient(90deg, #b8860b, #ffc94d); transition: width 1s linear; }
.cr-hist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cr-hist li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 14px; }
.cr-hist li.bad { background: rgba(255,77,109,.08); }
.jail-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; padding: 10px 18px; border-radius: 999px; background: #3a0f1a; border: 2px solid var(--down); color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.6); max-width: calc(100vw - 24px); text-align: center; font-size: 14px; }
.jail-bar.hidden { display: none; }
@media (max-width: 720px) { .cr-tiers { grid-template-columns: 1fr; } .cr-layout { padding: 14px 12px 30px; } }

.cr-target { width: 100%; min-width: 0; font-size: 14px; }
.cr-tier .btn { flex: none; margin-top: auto; } .cr-facts { flex: 0 1 auto; }
.cr-odds { font-size: 14px; font-weight: 700; text-align: center; min-height: 20px; }

.cr-greed { display: grid; gap: 4px; font-size: 14px; } .cr-greed input { width: 100%; accent-color: var(--gold); } .cr-greed.off { opacity: .5; }
.cr-tier .st-result { min-height: 20px; font-size: 14px; }

.lock-chip { background: #3a0f1a; border: 1px solid var(--down); color: #fff; border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lock-chip.mild { background: rgba(255,200,60,.12); border-color: rgba(255,200,60,.5); } .lock-chip.hidden { display: none; }
@media (max-width: 520px) { .lock-chip { padding: 5px 8px; font-size: 12px; } .top .who-wrap { flex-wrap: wrap; } }
