:root {
    --felt: #14382c;
    --felt-deep: #0c241c;
    --ink: #07110e;
    --ivory: #f4efe4;
    --gold: #e4c36a;
    --gold-deep: #9a7433;
    --wine: #7c2432;
    --line: rgba(228, 195, 106, 0.35);
    --bs-body-bg: transparent;
    --bs-body-color: var(--ivory);
    --bs-primary: #e4c36a;
    --bs-primary-rgb: 228, 195, 106;
    --bs-link-color: var(--gold);
    --bs-link-hover-color: #f3dfaa;
    --bs-border-radius: 0.45rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ivory);
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(228, 195, 106, 0.16), transparent 55%),
        radial-gradient(700px 380px at 100% 0%, rgba(124, 36, 50, 0.28), transparent 50%),
        linear-gradient(180deg, #16382d 0%, var(--ink) 42%, #0c1814 100%);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

h1, h2, h3, .wordmark {
    font-family: "Iowan Old Style", Palatino, Georgia, serif;
    font-weight: 600;
    letter-spacing: 0.01em;
}

a { color: var(--gold); }

.mast {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.9rem 6vw;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 14, 0.72);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(8px);
}

.wordmark {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.brand-logo,
.hero-logo,
.panel-logo {
    object-fit: cover;
    border: 1px solid var(--line);
    background: #10241d;
}
.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
}
.hero-logo {
    width: 148px;
    height: 148px;
    border-radius: 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    margin-bottom: 0.85rem;
}
.panel-logo {
    width: 84px;
    height: 84px;
    border-radius: 18px;
    margin-bottom: 0.6rem;
}

.mast-links, .mast-side { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.mast-links { flex: 1; }
.mast-links a, .linkish {
    color: var(--ivory);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
}
.gold-link { color: var(--gold) !important; }
.chip-pill {
    border: 1px solid var(--gold);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.hero, .floor, .auth-wrap { padding: 2.5rem 6vw 4rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); max-width: 12ch; margin: 0.2rem 0 0.8rem; }
.lede { max-width: 42rem; font-size: 1.15rem; color: #ddd4c2; }
.kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    color: var(--gold);
    margin: 0;
}
.hero-actions, .actions, .outside { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.btn-primary {
    --bs-btn-bg: var(--gold);
    --bs-btn-border-color: #c6a45a;
    --bs-btn-color: #1a1408;
    --bs-btn-hover-bg: #f0d48a;
    --bs-btn-hover-border-color: #f0d48a;
    --bs-btn-hover-color: #1a1408;
}
.btn-outline-light { --bs-btn-color: var(--ivory); --bs-btn-border-color: var(--line); }

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.game-tile, .panel, .table-shell {
    background: linear-gradient(180deg, rgba(20, 56, 44, 0.92), rgba(10, 28, 22, 0.94));
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.1rem 1.15rem 1.2rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.game-tile h2 { margin: 0.35rem 0; font-size: 1.55rem; }
.game-tile p { color: #ddd4c2; min-height: 3.2rem; }
.panel { max-width: 28rem; }
.panel.wide { max-width: 46rem; }
.auth-wrap { display: flex; justify-content: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; }
.stack { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.7rem 0; color: #efe6d4; }
.form-control, .form-select {
    background: #10211b;
    color: var(--ivory);
    border-color: var(--line);
}
.form-control:focus, .form-select:focus {
    background: #10211b;
    color: var(--ivory);
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(228, 195, 106, 0.2);
}
small { color: #e7a0a8; }
.fine { color: #cbbfa6; }
.banner { border-radius: 0.6rem; padding: 0.7rem 0.9rem; }
.banner.bad { background: rgba(124, 36, 50, 0.45); }
.banner.good { background: rgba(47, 107, 79, 0.45); }
.banner.warn { background: rgba(154, 116, 51, 0.35); }
.floor.narrow { max-width: 960px; }
.section-head { margin: 2.2rem 0 1rem; }
.rules li { margin: 0.35rem 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; margin: 1rem 0 2rem; }
.facts div { border-top: 1px solid var(--line); padding-top: 0.4rem; }
.facts dt { color: var(--gold); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sheet { width: 100%; border-collapse: collapse; margin-bottom: 2rem; font-size: 0.92rem; }
.sheet th, .sheet td { border-bottom: 1px solid rgba(244, 239, 228, 0.12); padding: 0.45rem 0.4rem; text-align: left; }
.table-shell { max-width: 980px; margin: 0 auto; }
.table-head h1 { margin: 0.15rem 0; }
.rack, .rules { color: #d9d0bf; }
.felt {
    margin-top: 1rem;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 40%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0 2px, transparent 2px 7px),
        var(--felt);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid rgba(228, 195, 106, 0.25);
}
.hand, .picks { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.8rem; }
.playing-card {
    width: 68px;
    height: 98px;
    border-radius: 8px;
    background: #fbfaf6;
    color: #1c1c1c;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.35rem 0.45rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
    font-family: Georgia, serif;
}
.playing-card.red { color: #a32030; }
.playing-card.back {
    background:
        repeating-linear-gradient(45deg, #6e1e2a 0 6px, #4c1420 6px 12px);
    border: 3px solid #f3e6c4;
}
.playing-card .suit { text-align: center; font-size: 1.4rem; }
.playing-card .bottom { transform: rotate(180deg); }
.player-hand.active { outline: 1px solid var(--gold); border-radius: 0.6rem; padding: 0.4rem; }
.number-grid, .keno-grid, .scratch-grid, .bingo-card { display: grid; gap: 0.35rem; margin-top: 0.8rem; }
.number-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.number-grid button, .keno-grid label, .keno-grid span, .scratch-cell, .bingo-col span {
    border: 0;
    border-radius: 0.35rem;
    min-height: 42px;
    background: #10211b;
    color: var(--ivory);
}
.number-grid button.red { background: var(--wine); }
.number-grid button.black { background: #1a1a1a; }
.number-grid button.green { background: #1d6b45; }
.keno-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.keno-grid label { position: relative; }
.keno-grid input { position: absolute; opacity: 0; }
.keno-grid span, .keno-grid label span {
    display: grid;
    place-items: center;
    border-radius: 0.35rem;
    min-height: 42px;
    background: #10211b;
}
.keno-grid input:checked + span, .keno-grid .picked { outline: 2px solid var(--gold); }
.keno-grid .drawn { background: #3d4d7a; }
.keno-grid .hit { background: #1d6b45; }
.scratch-grid { grid-template-columns: repeat(3, 90px); }
.scratch-cell { font-weight: 700; color: transparent; background: #8d7344; }
.scratch-cell.revealed { color: #1a1408; background: #f3e6c4; }
.reels { display: flex; gap: 0.6rem; justify-content: center; }
.reel { display: flex; flex-direction: column; gap: 0.35rem; background: #08140f; padding: 0.45rem; border-radius: 0.6rem; min-width: 110px; }
.reel span { text-align: center; padding: 0.55rem 0.2rem; border-radius: 0.3rem; background: #f4efe4; color: #1a1408; font-size: 0.78rem; letter-spacing: 0.04em; }
.reel span.pay { outline: 2px solid var(--gold); }
.dice-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dice { background: #f4efe4; color: #1a1408; border-radius: 0.5rem; padding: 0.4rem 0.55rem; display: flex; gap: 0.35rem; align-items: center; }
.wheel { width: 180px; height: 180px; border-radius: 50%; display: grid; place-items: center; margin: 0.5rem auto; border: 8px solid var(--gold); background: #10211b; }
.wheel.red { background: var(--wine); }
.wheel.black { background: #161616; }
.wheel.green, .wheel:not(.red):not(.black) { background: #1d6b45; }
.wheel strong { font-size: 3rem; font-family: Georgia, serif; }
.bingo-card { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 420px; }
.bingo-col { display: grid; gap: 0.3rem; }
.bingo-col strong, .bingo-col span { display: grid; place-items: center; min-height: 42px; }
.bingo-col .marked { background: var(--gold); color: #1a1408; }
.chess-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 520px; border: 4px solid var(--gold-deep); }
.square { aspect-ratio: 1; border: 0; background: #e7d7b6; color: #1a1408; font-size: clamp(1.2rem, 3vw, 2rem); }
.square.dark { background: #8d5a32; color: #f6f1e6; }
.square.selected { outline: 3px solid var(--gold); outline-offset: -3px; }
.checkers .man { display: grid; place-items: center; width: 78%; height: 78%; margin: 11%; border-radius: 50%; }
.checkers .w, .checkers .W { background: #f4efe4; color: #1a1408; }
.checkers .b, .checkers .B { background: #1a1408; color: #f4efe4; }
.carrom-board {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1;
    margin: 0.6rem 0 1rem;
    background:
        radial-gradient(circle at 50% 50%, transparent 0 18%, rgba(0,0,0,0.15) 19% 20%, transparent 21%),
        #d8b56a;
    border-radius: 0.4rem;
    border: 10px solid #6b3e22;
}
.pocket { position: absolute; width: 7%; height: 7%; border-radius: 50%; background: #140c08; transform: translate(-50%, 50%); }
.coin { position: absolute; width: 4.6%; height: 4.6%; border-radius: 50%; transform: translate(-50%, 50%); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25); }
.coin.WHITE { background: #f7f4ee; }
.coin.BLACK { background: #1b1b1b; }
.coin.QUEEN { background: #b4233a; }
.actions.wrap button { font-variant-numeric: tabular-nums; }
.colophon { padding: 1rem 6vw 2rem; color: #b7ad9a; font-size: 0.9rem; }
@media (max-width: 720px) {
    .split { grid-template-columns: 1fr; }
    .mast { flex-wrap: wrap; }
    .keno-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
