:root {
    --layout-max: 1400px;
    --bg: #f0ebe3;
    --surface: #ffffff;
    --surface-2: #f7f3ec;
    --border: #ddd5c8;
    --text: #1c2530;
    --muted: #5f6b7d;
    --accent: #b8860b;
    --accent-hover: #996f00;
    --success: #1e9e55;
    --danger: #d64535;
    --commission: #b8860b;
    --info: #2f7fd4;
    --radius: 8px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --overlay: rgba(26, 36, 48, 0.45);
    --shadow-lg: 0 20px 50px rgba(26, 36, 48, 0.14);
    --logo-shadow: 0 8px 24px rgba(26, 36, 48, 0.12);
    --shell-glow: rgba(184, 134, 11, 0.1);
    --shell-bg-start: #faf7f2;
    --shell-bg-end: #ebe4d8;
    --sidebar-bg: rgba(255, 255, 255, 0.96);
    --sidebar-border: rgba(184, 134, 11, 0.2);
    --sidebar-user-bg: rgba(184, 134, 11, 0.06);
    --sidebar-user-border: rgba(184, 134, 11, 0.22);
    --sidebar-text-strong: #1c2530;
    --sidebar-text-muted: #667085;
    --sidebar-link: #3d4654;
    --sidebar-link-hover: #1c2530;
    --sidebar-link-hover-bg: rgba(184, 134, 11, 0.08);
    --sidebar-section: #8a8172;
    --sidebar-active-text: #1c2530;
    --sidebar-balance: #1e9e55;
    --sidebar-deposit-border: rgba(184, 134, 11, 0.35);
    --sidebar-deposit-bg: rgba(184, 134, 11, 0.1);
    --sidebar-deposit-color: #b8860b;
    --sidebar-footer-border: rgba(184, 134, 11, 0.15);
    --input-bg: #ffffff;
    --input-text: var(--text);
    --input-border: rgba(184, 134, 11, 0.35);
    --picker-bg: #ffffff;
    --accent-panel-bg: rgba(184, 134, 11, 0.06);
    --accent-muted-text: rgba(28, 37, 48, 0.65);
}

[data-theme="dark"] {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface-2: #243044;
    --border: #2d3f56;
    --text: #e8edf4;
    --muted: #8b9cb3;
    --accent: #d4a017;
    --accent-hover: #e6b422;
    --success: #2ecc71;
    --danger: #e74c3c;
    --commission: #e6c200;
    --info: #3498db;
    --overlay: rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    --logo-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shell-glow: #1a2332;
    --shell-bg-start: #0f1419;
    --shell-bg-end: #121a24;
    --sidebar-bg: rgba(0, 0, 0, 0.32);
    --sidebar-border: rgba(212, 175, 55, 0.15);
    --sidebar-user-bg: rgba(0, 0, 0, 0.22);
    --sidebar-user-border: rgba(212, 175, 55, 0.22);
    --sidebar-text-strong: #f5e6b8;
    --sidebar-text-muted: rgba(245, 230, 184, 0.5);
    --sidebar-link: rgba(245, 230, 184, 0.78);
    --sidebar-link-hover: #f5e6b8;
    --sidebar-link-hover-bg: rgba(255, 255, 255, 0.04);
    --sidebar-section: rgba(245, 230, 184, 0.4);
    --sidebar-active-text: #fff8e7;
    --sidebar-balance: #7fff9a;
    --sidebar-deposit-border: rgba(212, 175, 55, 0.45);
    --sidebar-deposit-bg: rgba(212, 175, 55, 0.12);
    --sidebar-deposit-color: #d4af37;
    --sidebar-footer-border: rgba(212, 175, 55, 0.12);
    --input-bg: rgba(8, 8, 12, 0.72);
    --input-text: #f5e6b8;
    --input-border: rgba(212, 175, 55, 0.35);
    --picker-bg: #121018;
    --accent-panel-bg: rgba(0, 0, 0, 0.22);
    --accent-muted-text: rgba(245, 230, 184, 0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

body.app-with-sidebar {
    display: block;
    overflow: hidden;
    height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container {
    width: 100%;
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.site-logo-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    background: transparent;
}

.site-logo-image-header {
    max-height: 52px;
}

.site-logo-image-sidebar {
    width: 100%;
    max-height: 72px;
}

.site-logo-image-hero {
    max-width: min(100%, 420px);
    margin: 0 auto 1.25rem;
    filter: drop-shadow(var(--logo-shadow));
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.main-nav a {
    color: var(--muted);
    font-size: 0.95rem;
}

.main-nav a:hover { color: var(--text); }
.main-nav a.nav-active { color: var(--accent); font-weight: 600; }

.user-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.username { color: var(--muted); font-size: 0.9rem; }
.balance { font-weight: 700; color: var(--success); }

main.container {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* App shell — sidebar + content (matches casino game nav) */
.app-shell {
    display: flex;
    height: 100vh;
    min-height: 0;
    background:
        radial-gradient(ellipse at 50% 0%, var(--shell-glow) 0%, transparent 55%),
        linear-gradient(180deg, var(--shell-bg-start) 0%, var(--shell-bg-end) 100%);
}

.app-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-panel-inner {
    flex: 1;
    overflow-y: auto;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.site-sidebar {
    flex-shrink: 0;
    width: 240px;
    height: 100%;
    min-height: 0;
    padding: 1.1rem 0.85rem 1.25rem;
    border-right: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.site-sidebar-brand {
    display: block;
    padding: 0 0.25rem 1rem;
    line-height: 0;
    text-decoration: none;
}

.site-sidebar-brand:hover .site-logo-image {
    filter: brightness(1.08);
}

.site-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0.35rem 1rem;
    padding: 0.65rem 0.55rem;
    border-radius: 10px;
    border: 1px solid var(--sidebar-user-border);
    background: var(--sidebar-user-bg);
}

.site-sidebar-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(145deg, #5c3d0a 0%, #2a1810 100%);
    border: 2px solid rgba(212, 175, 55, 0.45);
    font-size: 0.82rem;
    font-weight: 800;
    color: #f5e6b8;
}

.site-sidebar-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-sidebar-user-meta {
    min-width: 0;
    flex: 1;
}

.site-sidebar-username {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sidebar-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-sidebar-torn-id {
    margin: 0.08rem 0 0;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--sidebar-text-muted);
    letter-spacing: 0.02em;
}

.site-sidebar-balance-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.site-sidebar-balance {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--sidebar-balance);
}

.site-sidebar-deposit-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--sidebar-deposit-border);
    background: var(--sidebar-deposit-bg);
    color: var(--sidebar-deposit-color);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-sidebar-deposit-btn:hover {
    background: var(--sidebar-link-hover-bg);
    border-color: var(--sidebar-deposit-border);
    color: var(--sidebar-link-hover);
}

.site-sidebar-section {
    margin: 0 0.5rem 0.55rem;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sidebar-section);
}

.site-sidebar-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--sidebar-link);
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.site-sidebar-link:hover {
    background: var(--sidebar-link-hover-bg);
    color: var(--sidebar-link-hover);
}

.site-sidebar-link.is-active {
    background: color-mix(in srgb, var(--nav-accent, #d4af37) 14%, transparent);
    border-color: color-mix(in srgb, var(--nav-accent, #d4af37) 45%, transparent);
    color: var(--sidebar-active-text);
    box-shadow: inset 3px 0 0 var(--nav-accent, #d4af37);
}

.site-sidebar-game.is-active {
    box-shadow: inset 3px 0 0 var(--nav-accent, #d4af37);
}

.site-sidebar-icon {
    width: 1.25rem;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.site-sidebar-game-title {
    line-height: 1.25;
}

.site-sidebar-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sidebar-footer-border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-sidebar-logout {
    color: var(--sidebar-text-muted);
}

.site-theme-toggle,
.site-theme-toggle-guest {
    cursor: pointer;
}

.site-theme-toggle {
    width: 100%;
    border: none;
    background: none;
    font: inherit;
    text-align: left;
}

.site-theme-toggle-guest {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

body.guest-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.guest-layout main.container {
    flex: 1;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2, .card h3 { margin-bottom: 1rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #111;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #111;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.factory-reset-card {
    border-color: rgba(231, 76, 60, 0.45);
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.alert-success { background: rgba(46, 204, 113, 0.15); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(231, 76, 60, 0.15); border: 1px solid var(--danger); color: var(--danger); }
.alert-info { background: rgba(52, 152, 219, 0.15); border: 1px solid var(--info); color: var(--info); }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 600; }

.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.hero {
    text-align: center;
    padding: 3rem 1rem;
}

.hero h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.auth-box {
    max-width: 420px;
    margin: 2rem auto;
}

.auth-discord {
    margin-bottom: 1rem;
}

.auth-discord-note {
    font-size: 0.9rem;
    margin: 0 0 0.65rem;
    text-align: center;
}

.auth-discord-secondary {
    display: block;
    width: 100%;
    text-align: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-discord {
    display: block;
    width: 100%;
    background: #5865f2;
    color: #fff;
    text-align: center;
}

.btn-discord:hover {
    background: #4752c4;
    color: #fff;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.text-win { color: var(--success); }
.text-loss { color: var(--danger); }
.text-commission { color: var(--commission); }

.house-net-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.house-net-totals {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.house-net-total {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
}

.house-net-total-label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
    white-space: nowrap;
}

.house-net-total-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.house-net-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.house-net-breakdown-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.75rem;
    text-align: center;
}

.house-net-breakdown-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.house-net-breakdown-value {
    font-size: 0.95rem;
    font-weight: 700;
}

.treasury-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.treasury-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.treasury-list li:last-child {
    border-bottom: none;
}

.playing-card {
    display: inline-block;
    min-width: 2.4rem;
    padding: 0.35rem 0.45rem;
    margin: 0.15rem;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.playing-card-red {
    color: #c0392b;
}

.hand-replay-section {
    margin-bottom: 1.25rem;
}

.hand-replay-section h4 {
    margin-bottom: 0.5rem;
}

.hand-replay-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ledger-amount-link,
.ledger-type-link {
    text-decoration: none;
}

.hand-replay-trigger {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: inherit;
}

.hand-replay-trigger.ledger-amount-link:hover,
.hand-replay-trigger.ledger-type-link:hover,
.hand-replay-trigger.hand-net-link:hover {
    text-decoration: underline;
}

.hand-replay-trigger.badge {
    padding: 0.2rem 0.5rem;
}

body.hand-modal-open {
    overflow: hidden;
}

.hand-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.hand-modal[hidden] {
    display: none;
}

.hand-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
}

.hand-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(85vh, 900px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.hand-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.hand-modal-header h3 {
    margin: 0;
}

.hand-modal-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.hand-modal-body {
    padding: 1.25rem;
}

.hand-replay-meta {
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-deposit { background: rgba(46, 204, 113, 0.2); color: var(--success); }
.badge-withdraw { background: rgba(52, 152, 219, 0.2); color: var(--info); }
.badge-win { background: rgba(46, 204, 113, 0.2); color: var(--success); }
.badge-loss { background: rgba(231, 76, 60, 0.2); color: var(--danger); }
.badge-push,
.badge-tie { background: rgba(149, 165, 166, 0.22); color: #bdc3c7; }
.badge-bet { background: rgba(212, 160, 23, 0.2); color: var(--accent); }

.game-card {
    transition: border-color 0.15s;
}

.game-card:hover {
    border-color: var(--accent);
}

.card-display {
    display: inline-block;
    background: #fff;
    color: #111;
    padding: 0.5rem 0.65rem;
    border-radius: 4px;
    margin: 0.15rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
}

.game-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.deposit-code {
    font-family: monospace;
    font-size: 1.25rem;
    background: var(--surface-2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    display: inline-block;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .user-bar { margin-left: 0; }
}

/* Casino mode — React games in app panel */
body.casino-mode {
    overflow: hidden;
}

.casino-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    max-width: none;
    width: 100%;
    overflow: hidden;
}

body.casino-mode #root {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.casino-footer {
    flex-shrink: 0;
    padding: 0.5rem 0;
}

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    body.app-with-sidebar {
        overflow: auto;
        height: auto;
    }

    .site-sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    }

    .site-sidebar-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .site-sidebar-link.is-active {
        box-shadow: inset 0 -2px 0 var(--nav-accent, #d4af37);
    }

    .site-sidebar-footer {
        margin-top: 0;
    }
}

.verify-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-top: 1rem;
}

.verify-form .form-group {
    flex: 1 1 320px;
    margin: 0;
}

.verify-result h2 {
    margin-top: 0;
}

.verify-details {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    margin: 1rem 0;
}

.verify-details dt {
    font-weight: 600;
    color: var(--text-muted, #888);
}

.verify-details dd {
    margin: 0;
    word-break: break-all;
}

.verify-hash,
.verify-details code {
    font-size: 0.85rem;
}

.verify-deck {
    columns: 4;
    column-gap: 1.5rem;
    max-height: 420px;
    overflow: auto;
    padding-left: 1.25rem;
    list-style: decimal;
}

.verify-deck-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.verify-deck-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verify-deck-card code {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.verify-deck-card .playing-card {
    background: #fff;
    color: #111;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.verify-deck-card .playing-card-red {
    color: #c0392b;
}

.verify-deck-role {
    display: inline-block;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    min-width: 1.35rem;
    padding: 0.22rem 0.35rem;
    border-radius: 4px;
    text-align: center;
    letter-spacing: 0.02em;
}

.verify-deck-role--player {
    background: rgba(46, 204, 113, 0.18);
    border: 1px solid rgba(46, 204, 113, 0.45);
    color: #6ee7a0;
}

.verify-deck-role--dealer {
    background: rgba(231, 76, 60, 0.18);
    border: 1px solid rgba(231, 76, 60, 0.45);
    color: #f1948a;
}

.verify-deck-role--community {
    background: rgba(52, 152, 219, 0.16);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: #85c1e9;
}

.verify-deck-role--burn {
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid rgba(243, 156, 18, 0.45);
    color: #f5b041;
}

.hand-replay-burn .playing-card {
    opacity: 0.85;
    border-style: dashed;
}

.verify-deal-card .playing-card {
    min-width: 2.2rem;
    text-align: center;
}

.verify-deal-sequence {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.verify-deal-sequence li {
    display: grid;
    grid-template-columns: 2rem minmax(120px, 1fr) auto;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.verify-deal-step {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(245, 230, 184, 0.55);
    text-align: center;
}

.verify-deal-mismatch {
    background: rgba(196, 30, 58, 0.12);
}

.verify-deal-label {
    font-size: 0.9rem;
    color: var(--text-muted, #888);
}

.verify-deck-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    break-inside: avoid;
    margin-bottom: 0.35rem;
}

.hand-replay-fairness code {
    word-break: break-all;
}

.fairness-hash code {
    font-size: 0.85rem;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-muted, #888);
}

.deposit-items-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.deposit-items-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.deposit-item-select-col {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}

.deposit-item-select-col input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.deposit-item-create-modal-dialog {
    width: min(640px, 100%);
}

.deposit-item-edit-modal-dialog {
    width: min(640px, 100%);
}

.deposit-item-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.deposit-items-sync-form {
    display: none;
}

.deposit-item-section-title {
    margin: 1.25rem 0 0.75rem;
    font-size: 0.95rem;
    color: #d4af37;
}

.item-search {
    position: relative;
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
}

.item-search-label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

.item-search-input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--input-text);
}

.item-search-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
}

.item-search-picker {
    display: none;
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% - 0.15rem);
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    background: var(--picker-bg);
    box-shadow: var(--shadow-lg);
}

.item-search-picker.open {
    display: block;
}

.item-search-option,
.item-search-empty {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
}

.item-search-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.95rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.item-search-option:last-child {
    border-bottom: 0;
}

.item-search-option:hover,
.item-search-option.is-active {
    background: rgba(212, 175, 55, 0.12);
}

.item-search-option-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.item-search-option-main strong {
    color: #f8edd0;
}

.item-search-option-meta {
    font-size: 0.82rem;
    color: rgba(245, 230, 184, 0.65);
}

.item-search-option-value {
    flex-shrink: 0;
    font-size: 0.88rem;
    color: #8fd694;
    font-weight: 700;
}

.item-search-empty {
    padding: 0.9rem 0.95rem;
    color: rgba(245, 230, 184, 0.7);
}

.item-search-status {
    margin: 0.55rem 0 0;
    min-height: 1.1rem;
    font-size: 0.82rem;
}

.form-group.is-disabled input[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.deposit-item-rate {
    white-space: nowrap;
}

.deposit-item-rate-credits {
    margin-right: 0.45rem;
}

.deposit-item-rate-worth {
    font-size: 0.78rem;
    color: rgba(245, 230, 184, 0.62);
}

.deposit-value-list-intro {
    margin: 0 0 1rem;
    font-size: 0.88rem;
}

.deposit-value-list {
    display: grid;
    gap: 0.85rem;
}

.deposit-value-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(28, 22, 16, 0.92) 0%, rgba(14, 11, 9, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.06);
}

.deposit-value-card-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35));
    border: 1px solid rgba(212, 175, 55, 0.18);
}

.deposit-value-card-image {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.deposit-value-card--out-of-stock .deposit-value-card-image {
    opacity: 0.42;
    filter: grayscale(0.35);
}

.deposit-value-card-cross-disabled {
    position: absolute;
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    object-fit: contain;
    pointer-events: none;
}

.deposit-value-card-body {
    min-width: 0;
}

.deposit-value-card-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.35rem;
}

.deposit-value-card-name {
    margin: 0;
    font-size: 1.05rem;
    color: #f8edd0;
}

.deposit-value-card-type {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.82);
}

.deposit-value-card-rate {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: #f5e6b8;
}

.deposit-value-card-rate-label,
.deposit-value-card-rate-suffix {
    font-size: 0.88rem;
    color: rgba(245, 230, 184, 0.72);
}

.deposit-value-card-rate strong {
    margin: 0 0.3rem;
    font-size: 1.15rem;
    color: #8fd694;
}

.deposit-value-card-worth {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(245, 230, 184, 0.62);
}

.deposit-value-card-market {
    color: rgba(245, 230, 184, 0.48);
}

.deposit-value-card-stock {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: rgba(245, 230, 184, 0.82);
}

.withdraw-stock-note {
    margin: 0 0 1rem;
    font-size: 0.85rem;
}

.player-audit-net-intro {
    margin: 0 0 1rem;
    font-size: 0.88rem;
}

.player-audit-summary-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.player-audit-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}

.player-audit-stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 230, 184, 0.62);
}

.player-audit-stat strong {
    font-size: 1.1rem;
    color: #f5e6b8;
}

.player-audit-stat-net {
    border-color: rgba(212, 175, 55, 0.42);
}

.player-audit-adjust-form {
    display: grid;
    gap: 0.85rem;
    max-width: 28rem;
}

.casino-item-balance {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.casino-item-balance-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.casino-item-balance-title {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 230, 184, 0.78);
}

.casino-item-balance-total {
    font-size: 1.55rem;
}

.casino-item-balance-note {
    margin: 0.35rem 0 0.75rem;
    font-size: 0.82rem;
}

.casino-item-balance-meta {
    margin-bottom: 0;
}

.casino-item-balance-modal-dialog {
    width: min(820px, 100%);
}

.casino-item-balance-modal-intro {
    margin: 0 0 1rem;
    font-size: 0.88rem;
}

.casino-item-balance-rate {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 6.5rem;
}

.casino-item-balance-rate-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.88rem;
    white-space: nowrap;
}

.casino-item-balance-rate-label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 230, 184, 0.55);
}

.casino-item-balance-modal-dialog tfoot th,
.casino-item-balance-modal-dialog tfoot td {
    font-weight: 600;
    border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.casino-item-balance-surplus-row th,
.casino-item-balance-surplus-row td {
    border-top-width: 2px;
}

@media (min-width: 720px) {
    .deposit-value-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dashboard-free-play-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.dashboard-free-play-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.92rem;
}

.dashboard-free-play-label {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(245, 230, 184, 0.55);
}

.free-play-chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 2px solid rgba(212, 175, 55, 0.55);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 248, 220, 0.35), transparent 45%),
        linear-gradient(145deg, #8b1a1a 0%, #5c1010 55%, #3a0808 100%);
    box-shadow:
        inset 0 0 0 3px rgba(0, 0, 0, 0.25),
        inset 0 0 0 5px rgba(212, 175, 55, 0.22),
        0 2px 8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.free-play-chip-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.85);
    box-shadow:
        inset 0 0 0 3px rgba(0, 0, 0, 0.25),
        inset 0 0 0 5px rgba(212, 175, 55, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.free-play-chip-btn.can-claim {
    border-color: rgba(120, 200, 120, 0.75);
    animation: free-play-chip-pulse 2s ease-in-out infinite;
}

@keyframes free-play-chip-pulse {
    0%, 100% {
        box-shadow:
            inset 0 0 0 3px rgba(0, 0, 0, 0.25),
            inset 0 0 0 5px rgba(120, 200, 120, 0.25),
            0 0 0 0 rgba(120, 200, 120, 0.35);
    }
    50% {
        box-shadow:
            inset 0 0 0 3px rgba(0, 0, 0, 0.25),
            inset 0 0 0 5px rgba(120, 200, 120, 0.45),
            0 0 0 6px rgba(120, 200, 120, 0.12);
    }
}

.free-play-chip-icon {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px dashed rgba(245, 230, 184, 0.55);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.free-play-chip {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 1.55rem;
    height: 1.55rem;
    margin-left: -0.775rem;
    border: 2px solid rgba(212, 175, 55, 0.55);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 248, 220, 0.35), transparent 45%),
        linear-gradient(145deg, #8b1a1a 0%, #5c1010 55%, #3a0808 100%);
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.25),
        inset 0 0 0 3px rgba(212, 175, 55, 0.18),
        0 1px 3px rgba(0, 0, 0, 0.35);
    transform: translateY(calc(var(--chip-index, 0) * -0.28rem)) translateX(var(--chip-x, 0));
    z-index: calc(var(--chip-index, 0) + 1);
}

.free-play-chip:nth-child(odd) {
    --chip-x: -1px;
}

.free-play-chip:nth-child(even) {
    --chip-x: 1px;
}

.free-play-chip-stack {
    --stack-count: 1;
    position: relative;
    width: 1.85rem;
    height: calc(1.55rem + (var(--stack-count) - 1) * 0.28rem);
    margin: 0.1rem 0 0.05rem;
    flex-shrink: 0;
}

.free-play-modal-dialog {
    width: min(760px, 100%);
}

.free-play-modal-intro {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.free-play-modal-balance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.45rem;
    background: var(--accent-panel-bg);
    border: 1px solid var(--input-border);
}

.free-play-modal-balance-label {
    font-size: 0.82rem;
    color: var(--accent-muted-text);
}

.free-play-modal-balance-value {
    font-size: 1.15rem;
}

.free-play-track {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 1.15rem;
}

.free-play-track-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
    min-height: 5.85rem;
    padding: 0.5rem 0.35rem 0.45rem;
    border: 1px solid var(--input-border);
    border-radius: 0.45rem;
    background: var(--accent-panel-bg);
    text-align: center;
    overflow: hidden;
}

.free-play-track-day.is-next {
    border-color: rgba(120, 200, 120, 0.55);
    box-shadow: inset 0 0 0 1px rgba(120, 200, 120, 0.18);
}

.free-play-track-day.is-next .free-play-chip {
    border-color: rgba(140, 215, 140, 0.65);
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.25),
        inset 0 0 0 3px rgba(120, 200, 120, 0.22),
        0 1px 4px rgba(0, 0, 0, 0.35);
}

.free-play-track-day.is-redeemed {
    opacity: 0.72;
}

.free-play-track-day.is-redeemed .free-play-chip {
    filter: grayscale(0.35) brightness(0.85);
}

.free-play-track-day-num {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-muted-text);
}

.free-play-track-day-amount {
    font-size: 0.78rem;
    line-height: 1.2;
}

.free-play-track-x {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.free-play-track-x::before,
.free-play-track-x::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 12%;
    width: 76%;
    height: 3px;
    background: rgba(220, 70, 70, 0.92);
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.free-play-track-x::before {
    transform: translateY(-50%) rotate(38deg);
}

.free-play-track-x::after {
    transform: translateY(-50%) rotate(-38deg);
}

.free-play-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .free-play-track {
        display: flex;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scroll-snap-type: x mandatory;
    }

    .free-play-track-day {
        flex: 0 0 4.85rem;
        min-height: 5.85rem;
        scroll-snap-align: start;
    }
}

@media (min-width: 720px) {
    .deposit-value-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.withdraw-form {
    max-width: 420px;
}

.withdraw-preview {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(245, 230, 184, 0.12);
}

.withdraw-preview p {
    margin: 0;
}

.withdraw-preview p + p {
    margin-top: 0.35rem;
}

.deposit-items-table-hint {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
}

.deposit-items-table table {
    min-width: 920px;
}

.deposit-item-preview-credits {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.deposit-item-preview-trend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.deposit-item-preview-trend-up {
    color: var(--success);
}

.deposit-item-preview-trend-down {
    color: var(--danger);
}

.deposit-item-actions {
    min-width: 220px;
}

.deposit-item-actions form,
.deposit-item-actions details {
    display: inline-block;
    margin: 0.15rem 0.15rem 0.15rem 0;
}

.deposit-item-edit summary {
    cursor: pointer;
    list-style: none;
}

.deposit-item-edit summary::-webkit-details-marker {
    display: none;
}

.deposit-item-remove-form {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.deposit-item-form .form-group {
    margin-bottom: 0.75rem;
}

