/* casino.css — one sober night-time theme for all four pages */
:root {
  --bg: #0d1412;
  --bg2: #121c19;
  --panel: #17231f;
  --panel2: #1d2b26;
  --line: #2a3b35;
  --text: #e8efe9;
  --muted: #9db0a7;
  --faint: #6f8279;
  --felt: #0f5132;
  --felt2: #0b3f27;
  --gold: #e5b94e;
  --gold2: #b98e2a;
  --red: #e5534b;
  --red-soft: #3a1d1c;
  --green: #4cc38a;
  --green-soft: #15362a;
  --amber: #e9a23b;
  --amber-soft: #3a2c14;
  --blue: #6cb6ff;
  --card: #fbfaf5;
  --card-ink: #1b1b1b;
  --card-red: #c62828;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--gold); }
a:hover { color: #ffd77a; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
code, .mono { font-family: var(--mono); font-size: .92em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(13, 20, 18, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--felt); border: 2px solid var(--gold); display: grid; place-items: center; color: var(--gold); font-size: 14px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: var(--bg); background: var(--gold); font-weight: 600; }
.nav .num { opacity: .65; margin-right: 4px; }

/* ---------- page bits ---------- */
.hero { padding: 48px 0 24px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel.tight { padding: 12px 14px; }
.panel h3:first-child, .panel h2:first-child { margin-top: 0; }
.big-link { display: block; text-decoration: none; color: var(--text); transition: transform .12s, border-color .12s; }
.big-link:hover { transform: translateY(-2px); border-color: var(--gold2); color: var(--text); }
.big-link .n { font-size: 2.2rem; font-weight: 800; color: var(--gold); line-height: 1; }
.callout { border-left: 4px solid var(--gold); background: var(--panel); padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; }
.callout.red { border-color: var(--red); background: var(--red-soft); }
.callout.green { border-color: var(--green); background: var(--green-soft); }
footer { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.help-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.help-strip b { color: var(--text); }

/* ---------- edges / tags ---------- */
.edge { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.e-low { color: var(--green); }
.e-mid { color: var(--amber); }
.e-high { color: var(--red); }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.gold { color: var(--bg); background: var(--gold); border-color: var(--gold); font-weight: 700; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }

/* ---------- buttons, inputs ---------- */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: background .12s, border-color .12s; }
button:hover:not(:disabled) { border-color: var(--gold2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--gold); color: #1b1404; border-color: var(--gold); font-weight: 700; }
button.primary:hover:not(:disabled) { background: #f3c95e; }
button.danger { background: var(--red-soft); border-color: var(--red); }
button.ghost { background: transparent; }
button.sm { padding: 4px 10px; font-size: .88rem; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { width: 46px; height: 46px; border-radius: 50%; padding: 0; font-weight: 800; font-size: .8rem; border: 3px dashed rgba(255, 255, 255, .55); color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.chip[data-v="1"] { background: #e8e8e8; color: #222; border-color: #999; }
.chip[data-v="5"] { background: #c62828; }
.chip[data-v="25"] { background: #2e7d32; }
.chip[data-v="100"] { background: #212121; }
.chip[data-v="500"] { background: #6a1b9a; }
.chip.on { outline: 3px solid var(--gold); outline-offset: 2px; }
select, input[type=number], input[type=text] { font: inherit; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; max-width: 100%; }
input[type=range] { width: 100%; accent-color: var(--gold); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
label.field output { color: var(--text); font-family: var(--mono); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- formulas ---------- */
.formula { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif; font-size: 1.25rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 12px 0; overflow-x: auto; white-space: nowrap; }
.formula .lbl { font-family: var(--sans); font-size: .8rem; color: var(--muted); display: block; margin-bottom: 4px; white-space: normal; }
.formula var { font-style: italic; }
.formula sub, .formula sup { font-size: .7em; }
.where { font-size: .92rem; color: var(--muted); }
.where dt { display: inline; font-family: var(--mono); color: var(--text); }
.where dd { display: inline; margin: 0 14px 0 4px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; margin-top: 2px; }
.stat .v.neg { color: var(--red); }
.stat .v.pos { color: var(--green); }
.stat .s { font-size: .78rem; color: var(--faint); }

/* ---------- guide ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 20px; }
.filters button.on { background: var(--gold); color: #1b1404; border-color: var(--gold); font-weight: 700; }
.game-card { scroll-margin-top: 80px; }
.game-card header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.game-card header h3 { margin: 0; font-size: 1.35rem; }
.game-card .tagline { color: var(--gold); font-style: italic; margin-bottom: 10px; }
.game-card ol { padding-left: 1.3em; margin: 0 0 12px; }
.game-card ol li { margin-bottom: 4px; }
.knows { background: var(--bg2); border-radius: 10px; padding: 10px 14px; margin-top: 12px; border: 1px dashed var(--line); }
.knows h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); margin: 0 0 6px; }
.knows ul { margin: 0; padding-left: 1.1em; }
.knows li { margin-bottom: 4px; color: var(--muted); }

/* ---------- play ---------- */
.play-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .play-layout { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; }
.tabs button { white-space: nowrap; }
.tabs button.on { background: var(--gold); color: #1b1404; border-color: var(--gold); font-weight: 700; }
.felt { background: radial-gradient(ellipse at 50% 0%, #17734a 0%, var(--felt) 45%, var(--felt2) 100%); border: 8px solid #3b2a17; border-radius: 22px; padding: 18px; min-height: 380px; box-shadow: inset 0 0 40px rgba(0, 0, 0, .45), var(--shadow); position: relative; }
.felt h3 { color: #f1e6c4; font-weight: 600; }
.felt .rules { color: #cfe3d6; font-size: .85rem; opacity: .85; }
.felt-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; justify-content: center; margin: 10px 0; }
.hand { text-align: center; min-width: 120px; }
.hand .lbl { color: #f1e6c4; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.hand .tot { color: #fff; font-weight: 700; margin-top: 6px; font-family: var(--mono); }
.hand.active { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 8px; }
.cards { display: flex; justify-content: center; min-height: 86px; }
.pc { width: 58px; height: 84px; background: var(--card); color: var(--card-ink); border-radius: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); margin-left: -16px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px; font-weight: 800; font-size: 1.05rem; line-height: 1; animation: deal .22s ease-out; position: relative; }
.pc:first-child { margin-left: 0; }
.pc.red { color: var(--card-red); }
.pc .s2 { align-self: flex-end; font-size: 1.5rem; }
.pc.back { background: repeating-linear-gradient(45deg, #8b1d1d 0 6px, #a52a2a 6px 12px); border: 3px solid #fff; }
.pc.dim { opacity: .45; }
.pc.held::after { content: "HELD"; position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: .65rem; color: var(--gold); letter-spacing: .1em; }
@keyframes deal { from { transform: translateY(-14px) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.bet-spots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.spot { border: 2px solid rgba(241, 230, 196, .6); color: #f1e6c4; background: rgba(0, 0, 0, .12); border-radius: 12px; padding: 10px 12px; min-width: 104px; text-align: center; cursor: pointer; user-select: none; position: relative; }
.spot:hover { background: rgba(0, 0, 0, .25); }
.spot .nm { font-weight: 700; }
.spot .py { font-size: .75rem; opacity: .8; }
.spot .amt { font-family: var(--mono); font-weight: 800; color: var(--gold); min-height: 1.3em; }
.spot.win { box-shadow: 0 0 0 3px var(--green); }
.spot.lose { opacity: .55; }
.spot.locked { cursor: default; }
.msg { min-height: 1.6em; text-align: center; color: #fff; font-weight: 700; font-size: 1.1rem; margin: 8px 0; }
.msg.win { color: #9ff0c4; }
.msg.lose { color: #ffb4ae; }
.controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.hint { color: #f1e6c4; font-size: .9rem; text-align: center; min-height: 1.4em; }
.side .panel { margin-bottom: 12px; }
.side .stats { grid-template-columns: 1fr 1fr; }
.side .stat .v { font-size: 1.1rem; }
.bankroll { font-family: var(--mono); font-size: 2rem; font-weight: 800; color: var(--gold); }
.play-money { display: inline-block; background: repeating-linear-gradient(45deg, #3a2c14 0 8px, #4a3818 8px 16px); color: var(--gold); font-weight: 800; letter-spacing: .12em; font-size: .72rem; padding: 3px 8px; border-radius: 5px; border: 1px solid var(--gold2); }
.history { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.history span { font-family: var(--mono); font-size: .75rem; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, .3); color: #fff; }
.history span.red { background: #b71c1c; }
.history span.black { background: #111; }
.history span.green { background: #1b5e20; }

/* roulette board */
.rboard { display: grid; grid-template-columns: 44px repeat(12, minmax(28px, 1fr)) 50px; gap: 3px; max-width: 760px; margin: 10px auto; }
.rboard .cell { background: rgba(0, 0, 0, .2); border: 1px solid rgba(241, 230, 196, .4); color: #fff; text-align: center; padding: 8px 0; border-radius: 4px; cursor: pointer; font-weight: 700; font-size: .85rem; position: relative; user-select: none; }
.rboard .cell.red { background: #b71c1c; }
.rboard .cell.black { background: #161616; }
.rboard .cell.green { background: #1b5e20; }
.rboard .cell:hover { filter: brightness(1.25); }
.rboard .cell .b { position: absolute; top: -8px; right: -6px; background: var(--gold); color: #1b1404; border-radius: 99px; font-size: .65rem; padding: 1px 5px; font-family: var(--mono); z-index: 2; }
.rboard .cell.hit { box-shadow: 0 0 0 3px var(--gold); z-index: 1; }
.rboard .outside { background: rgba(0, 0, 0, .25); }
.wheel-result { display: flex; justify-content: center; margin: 6px 0; }
.ball { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: #fff; border: 4px solid var(--gold); box-shadow: var(--shadow); }
.ball.red { background: #b71c1c; } .ball.black { background: #161616; } .ball.green { background: #1b5e20; }
.ball.spin { animation: spin .5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* dice */
.dice { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.die { width: 54px; height: 54px; background: #fbfaf5; border-radius: 10px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 7px; box-shadow: 0 3px 8px rgba(0, 0, 0, .45); animation: roll .35s ease-out; }
.die.red { background: #c62828; }
.die i { width: 10px; height: 10px; border-radius: 50%; background: #1b1b1b; place-self: center; }
.die.red i { background: #fff; }
@keyframes roll { from { transform: rotate(-90deg) scale(.6); opacity: .2; } to { transform: none; opacity: 1; } }

/* slot machines */
.machine { background: linear-gradient(#2b1d0e, #1a1108); border: 3px solid var(--gold2); border-radius: 18px; padding: 16px; max-width: 520px; margin: 0 auto; box-shadow: var(--shadow); }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #000; padding: 8px; border-radius: 10px; position: relative; }
.reel { background: linear-gradient(#ddd, #fff 30%, #fff 70%, #ddd); border-radius: 6px; overflow: hidden; }
.reel div { height: 58px; display: grid; place-items: center; font-weight: 900; font-size: 1.5rem; color: #222; border-bottom: 1px solid #eee; }
.reel div.mid { background: rgba(229, 185, 78, .25); }
.reel div.seven { color: #c62828; }
.reel div.blank { color: #bbb; font-size: 1rem; }
.reels.spinning .reel div { filter: blur(2px); }
.payline { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(229, 53, 53, .8); pointer-events: none; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; background: #000; padding: 6px; border-radius: 10px; }
.grid5 .c { aspect-ratio: 1; background: #1f1630; border-radius: 6px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; font-weight: 800; position: relative; }
.grid5 .c.coin { background: radial-gradient(circle, #ffe08a, #c7962b); color: #3a2604; font-size: .95rem; }
.grid5 .c.fresh { animation: pop .35s ease-out; }
.grid5 .c.win { box-shadow: inset 0 0 0 3px var(--green); }
.grid5 .c.empty { background: #120d1c; }
@keyframes pop { from { transform: scale(.4); } to { transform: none; } }
.lcd { background: #000; color: #ff5b4d; font-family: var(--mono); padding: 6px 10px; border-radius: 6px; text-align: center; font-weight: 700; margin-top: 10px; min-height: 2em; }
.lcd.win { color: #6dffa8; }
.paytable { font-size: .82rem; color: #e9dcc0; margin-top: 10px; }
.paytable td { padding: 2px 6px; border: 0; }

/* keno board */
.kboard { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; max-width: 520px; margin: 8px auto; }
.kboard div { text-align: center; padding: 6px 0; background: rgba(0, 0, 0, .25); color: #fff; border-radius: 4px; cursor: pointer; font-size: .82rem; font-weight: 700; user-select: none; }
.kboard div.pick { background: var(--gold); color: #1b1404; }
.kboard div.drawn { box-shadow: inset 0 0 0 2px #ff6b6b; }
.kboard div.pick.drawn { background: #4cc38a; color: #08210f; box-shadow: none; }

/* big six */
.bigsix-result { font-size: 2rem; font-weight: 900; color: var(--gold); text-align: center; min-height: 1.4em; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal-bg.show { display: grid; }
.modal { background: var(--panel); border: 1px solid var(--gold2); border-radius: 16px; max-width: 520px; width: 100%; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { color: var(--gold); }

/* charts */
.chart { width: 100%; height: 280px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }

/* psychology cards */
.psy { border-top: 3px solid var(--red); }
.psy .def { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--green); font-size: .95rem; }
.psy .def b { color: var(--green); }

.toc { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.toc a { font-size: .88rem; text-decoration: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }
.toc a:hover { color: var(--text); border-color: var(--gold2); }
section { scroll-margin-top: 70px; }
.mt0 { margin-top: 0; }
.center { text-align: center; }
@media (max-width: 560px) {
  .pc { width: 46px; height: 68px; font-size: .9rem; margin-left: -14px; }
  .pc .s2 { font-size: 1.2rem; }
  .rboard { grid-template-columns: 30px repeat(12, 1fr) 34px; gap: 2px; }
  .rboard .cell { font-size: .68rem; padding: 6px 0; }
  .felt { padding: 12px 8px; border-width: 5px; }
  .spot { min-width: 84px; padding: 8px; }
  .formula { font-size: 1.05rem; }
}
