/* ═══════════════════════════════════════════
   POKER APP — Noir Casino Theme
   ═══════════════════════════════════════════ */

:root {
    /* Surfaces */
    --bg-deep: #070a0f;
    --bg-base: #0d1117;
    --bg-card: #151c25;
    --bg-elevated: #1a2332;
    --bg-hover: #1e2a38;

    /* Gold System */
    --gold: #c9a96e;
    --gold-light: #e2c88f;
    --gold-dim: #8a7a52;
    --gold-glow: rgba(201, 169, 110, 0.15);
    --gold-glow-strong: rgba(201, 169, 110, 0.3);

    /* Semantic */
    --success: #3a9d6a;
    --danger: #c4545a;
    --warning: #d4a944;

    /* Text */
    --text-primary: #e8e0d4;
    --text-secondary: #b0a898;
    --text-muted: #6a6560;

    /* Borders */
    --border: #1e262f;
    --border-light: #2a3440;

    /* Fonts */
    --font-head: 'Bricolage Grotesque', 'Georgia', serif;
    --font-body: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --sidebar-w: 250px;
    --nav-h: 68px;

    /* Shadows */
    --shadow-card: 0 2px 8px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(201,169,110,0.08);
}

/* ═══ Reset ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-deep);
    line-height: 1.55;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; margin-bottom: 0.5rem; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea { font-family: var(--font-body); }
table { border-collapse: collapse; width: 100%; }
strong { font-weight: 600; }
.mono { font-family: var(--font-mono); }
.bold { font-weight: 600; }
.gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; display: block; }

/* ═══ Layout ═══ */
#app-layout { display: flex; min-height: 100dvh; }

/* ═══ Sidebar (Desktop) ═══ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    display: flex; flex-direction: column;
}
.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.6rem;
}
.brand-diamond { color: var(--gold); font-size: 1.4rem; }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--gold); }
.sidebar-links { list-style: none; padding: 0.75rem 0; flex: 1; }
.sidebar-links li { margin: 0; }
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem; font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--gold); background: var(--gold-glow); border-left-color: var(--gold); }
.nav-link svg { opacity: 0.6; flex-shrink: 0; }
.nav-link.active svg { opacity: 1; stroke: var(--gold); }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

/* ═══ Content ═══ */
.content {
    flex: 1; padding: 1.25rem; padding-bottom: calc(var(--nav-h) + 1.5rem);
    min-height: 100dvh;
}
.container { max-width: 900px; margin: 0 auto; }

/* ═══ User Bar (Mobile) ═══ */
.user-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0; margin-bottom: 0.75rem;
}
.user-info { display: flex; align-items: center; gap: 0.6rem; }
.user-name { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.btn-logout {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 0.3rem 0.65rem; border-radius: var(--radius-xs); font-size: 0.75rem;
    display: flex; align-items: center; gap: 0.35rem;
    transition: all 0.15s;
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ═══ Bottom Nav (Mobile) ═══ */
.bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card); border-top: 1px solid var(--border);
    z-index: 100; height: var(--nav-h);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.btab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.65rem; gap: 0.3rem;
    text-decoration: none; position: relative; transition: color 0.15s;
}
.btab.active { color: var(--gold); }
.btab.active::before {
    content: ''; position: absolute; top: 0; left: 25%; right: 25%;
    height: 2px; background: var(--gold); border-radius: 0 0 2px 2px;
}
.btab svg { opacity: 0.5; }
.btab.active svg { opacity: 1; stroke: var(--gold); }

/* ═══ Desktop ═══ */
@media (min-width: 768px) {
    .content { margin-left: var(--sidebar-w); padding: 2rem; padding-bottom: 2rem; }
    .bottom-nav { display: none !important; }
    .user-bar { display: none !important; }
    .container { max-width: 960px; }
    .players-grid { grid-template-columns: repeat(3, 1fr); }
    .players-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; }
}
@media (min-width: 1024px) { .players-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) { .sidebar { display: none !important; } }

/* ═══ Page Header ═══ */
.page-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem;
}
.page-head h1 { margin: 0; }
.back-link { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 0.2rem; }

/* ═══ Cards ═══ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-card);
    position: relative;
}
.card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}
.card-hover { transition: border-color 0.15s, transform 0.1s; text-decoration: none; color: inherit; display: block; }
.card-hover:hover { border-color: var(--gold-dim); transform: translateY(-2px); color: inherit; }
.card-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.card-row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-meta { display: flex; gap: 1.25rem; color: var(--text-muted); font-size: 0.85rem; }

/* ═══ Badges ═══ */
.badge {
    padding: 0.2rem 0.6rem; border-radius: 20px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-active { background: rgba(58,157,106,0.15); color: var(--success); }
.badge-warning { background: rgba(212,169,68,0.15); color: var(--warning); }
.badge-muted { background: rgba(106,101,96,0.15); color: var(--text-muted); }

/* ═══ Buttons ═══ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.6rem 1.2rem; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; border: none;
    transition: all 0.15s; cursor: pointer;
}
.gold-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0d1117; box-shadow: 0 2px 8px rgba(201,169,110,0.2);
}
.gold-btn:hover { box-shadow: 0 4px 16px rgba(201,169,110,0.3); transform: translateY(-1px); }
.gold-btn:active { transform: translateY(0); }
.gold-btn:disabled { opacity: 0.5; transform: none; cursor: default; box-shadow: none; }
.outline-btn { background: transparent; border: 1px solid var(--border-light); color: var(--text-secondary); }
.outline-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.danger-btn { background: transparent; border: 1px solid rgba(196,84,90,0.3); color: var(--danger); }
.danger-btn:hover { background: rgba(196,84,90,0.1); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-icon {
    background: none; border: none; color: var(--text-muted);
    padding: 0.35rem; border-radius: var(--radius-xs);
    display: flex; align-items: center; transition: all 0.15s;
}
.btn-icon:hover { color: var(--gold); background: var(--gold-glow); }
.btn-icon.danger:hover { color: var(--danger); background: rgba(196,84,90,0.1); }

/* ═══ Inputs ═══ */
.input-group { margin-bottom: 0.85rem; }
.input-group label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.3rem; }
.input-field, input[type="text"], input[type="number"], input[type="tel"], input[type="password"], input[type="date"], select, textarea {
    width: 100%; padding: 0.65rem 0.85rem;
    background: var(--bg-base) !important; color: var(--text-primary) !important;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.9rem; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    color-scheme: dark;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow);
}
input:-webkit-autofill, input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-base) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
}
input::placeholder, select::placeholder { color: var(--text-muted); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6' fill='%236a6560'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2.2rem; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

.form-row { display: flex; gap: 0.75rem; align-items: center; }
.form-row .btn { flex-shrink: 0; }

/* ═══ Stats ═══ */
.stats-row { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.stat-card {
    flex: 1; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.85rem; text-align: center;
}
.stat-val { display: block; font-size: 1.4rem; font-weight: 700; font-family: var(--font-head); color: var(--gold); }
.stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══ Players Grid ═══ */
.players-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.player-card { padding: 1rem; }
.pc-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.pc-name { font-weight: 600; font-size: 0.95rem; }
.pc-stats { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.5rem; }
.pc-result { display: flex; justify-content: space-between; font-size: 0.85rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.pc-actions {
    display: flex; align-items: center; justify-content: center; gap: 0;
    border-top: 1px solid var(--border); padding-top: 0.65rem; margin-top: 0.4rem;
}
.bank-display { width: 2.5rem; text-align: center; font-size: 1.1rem; font-weight: 600; color: var(--gold); }
.bank-display-editable { cursor: pointer; border-bottom: 1px dashed var(--gold-dim); padding-bottom: 1px; user-select: none; }
.bank-display-editable:hover { color: var(--gold); border-bottom-color: var(--gold); }
.btn-bank {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; border: none; cursor: pointer;
    transition: all 0.15s;
}
.btn-bank-plus {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0d1117;
}
.btn-bank-plus:hover { box-shadow: 0 0 12px var(--gold-glow-strong); }
.btn-bank-minus { background: var(--bg-base); color: var(--text-muted); border: 1px solid var(--border) !important; }
.btn-bank-minus:hover { color: var(--danger); border-color: var(--danger) !important; }

/* ═══ Bank History ═══ */
.bank-history-section { margin-bottom: 1.25rem; }
.bank-history-panel {
    margin-top: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
}
.bank-history-panel.hidden { display: none; }
.bh-group { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.bh-group:last-child { border-bottom: none; }
.bh-group-head {
    display: flex; align-items: center; gap: 0.55rem;
    margin-bottom: 0.4rem;
}
.bh-group-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
.bh-group-total { font-size: 0.8rem; color: var(--gold); }
.bh-list { list-style: none; padding: 0 0 0 2.6rem; margin: 0; }
.bh-row {
    display: grid;
    grid-template-columns: 3rem 4rem 1fr;
    align-items: center;
    font-size: 0.78rem;
    padding: 0.2rem 0;
}
.bh-delta { font-weight: 700; }
.bh-running { font-size: 0.75rem; }
.bh-time { text-align: right; font-size: 0.72rem; }

/* ═══ Players List ═══ */
.player-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
.player-row-left { display: flex; align-items: center; gap: 0.75rem; }
.player-row-actions { display: flex; gap: 0.25rem; }

/* ═══ Avatars ═══ */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-elevated); border: 2px solid var(--gold-dim);
    font-family: var(--font-head); font-weight: 700; font-size: 0.8rem;
    color: var(--gold); flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; border-width: 2px; }
.avatar-sm { width: 30px; height: 30px; font-size: 0.65rem; }
.avatar-xs { width: 22px; height: 22px; font-size: 0.55rem; border-width: 1.5px; }

/* ═══ Action Stack ═══ */
.action-stack { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; }

/* ═══ Steps Bar ═══ */
.steps-bar { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 0.25rem; padding: 0 1rem; }
.step-dot {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-elevated); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
    transition: all 0.3s;
}
.step-dot.active { background: var(--gold); border-color: var(--gold); color: #0d1117; }
.step-line { flex: 1; height: 2px; background: var(--border); transition: background 0.3s; max-width: 80px; }
.step-line.active { background: var(--gold); }
.step-labels {
    display: flex; justify-content: space-between; padding: 0 0.5rem;
    font-size: 0.7rem; color: var(--text-muted); margin-bottom: 1.25rem;
}

/* ═══ Chip Inputs ═══ */
.chip-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.chip-row label { flex: 1; font-size: 0.9rem; }
.chip-row input { width: 130px; flex-shrink: 0; }

/* ═══ Validation Bar ═══ */
.val-bar {
    display: flex; justify-content: space-between;
    padding: 0.6rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 600;
    font-family: var(--font-mono);
    background: var(--bg-base); border: 1px solid var(--border);
    margin: 0.75rem 0;
}
.val-bar.valid { border-color: var(--success); color: var(--success); }
.val-bar.invalid { border-color: var(--danger); color: var(--danger); }

/* ═══ Data Table ═══ */
.table-wrap { overflow-x: auto; margin: 0 -0.25rem; }
.data-table { font-size: 0.82rem; }
.data-table th, .data-table td { padding: 0.55rem 0.5rem; text-align: right; border-bottom: 1px solid var(--border); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:last-child td { border-bottom: none; }

/* ═══ Settlement Rows ═══ */
.settle-row {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.settle-row:last-child { border-bottom: none; }
.settle-from, .settle-to { font-weight: 600; font-size: 0.9rem; }
.settle-arrow { flex-shrink: 0; }
.settle-row .mono { margin-left: auto; }
.settle-row .btn { flex-shrink: 0; }
.settle-info { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.settle-right { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }

/* ═══ Balance Row ═══ */
.balance-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.balance-row:last-child { border-bottom: none; }

/* ═══ Tabs ═══ */
.tabs-bar { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab {
    flex: 1; padding: 0.7rem; background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    color: var(--text-muted); font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: all 0.15s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ═══ Player Picker ═══ */
.player-pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.pick-chip {
    cursor: pointer; display: block;
}
.pick-chip input { display: none; }
.chip-inner {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.85rem; border-radius: var(--radius-sm);
    background: var(--bg-base); border: 1px solid var(--border);
    font-size: 0.85rem; transition: all 0.15s;
}
.pick-chip input:checked + .chip-inner {
    border-color: var(--gold); background: var(--gold-glow);
    box-shadow: 0 0 8px var(--gold-glow);
}
.pick-chip input:checked + .chip-inner .avatar-xs { border-color: var(--gold); }

/* ═══ Dialog ═══ */
.dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(7, 10, 15, 0.75);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 1rem;
}
.dialog-overlay.hidden { display: none; }
.dialog {
    background: var(--bg-card);
    border: 1px solid rgba(201, 169, 110, 0.12);
    border-radius: var(--radius);
    padding: 1.5rem; max-width: 400px; width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), var(--shadow-glow);
}
.dialog-wide { max-width: 480px; }
.dialog h3 { margin-bottom: 0.5rem; }
.dialog p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.75rem; }
.dialog-input { margin-bottom: 0.75rem; }
.dialog-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

/* ═══ Toast ═══ */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    padding: 0.7rem 1.1rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; max-width: 320px;
    transform: translateX(120%); transition: transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--bg-elevated); color: var(--gold); border: 1px solid var(--gold-dim); }

/* ═══ Login ═══ */
.login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 100dvh; padding: 1.5rem;
    background: radial-gradient(ellipse at center, rgba(201,169,110,0.04) 0%, transparent 70%), var(--bg-deep);
}
.login-card {
    width: 100%; max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4), var(--shadow-glow);
    position: relative;
}
.login-brand { text-align: center; margin-bottom: 1.75rem; }
.brand-diamond { font-size: 2.2rem; color: var(--gold); display: block; margin-bottom: 0.4rem; text-shadow: 0 0 30px rgba(201,169,110,0.3); }
.login-brand h1 { font-family: var(--font-head); font-size: 1.6rem; color: var(--gold); margin: 0; }
.login-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }
.login-form { display: flex; flex-direction: column; gap: 0.25rem; }

/* Player Avatars */
.player-avatars {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.avatar-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
    padding: 0.85rem 0.5rem; border-radius: var(--radius);
    background: var(--bg-base); border: 1px solid var(--border);
    color: var(--text-primary); cursor: pointer; transition: all 0.15s;
}
.avatar-btn:hover { border-color: var(--gold-dim); background: var(--gold-glow); }
.avatar-btn .avatar { width: 44px; height: 44px; font-size: 0.95rem; }
.avatar-name { font-size: 0.75rem; font-weight: 500; }
.bio-btn { margin-top: 0.25rem; }
.bio-btn svg { stroke: var(--gold); }

/* PIN Pad */
.pin-back {
    position: absolute; top: 1rem; left: 1rem;
    background: none; border: none; color: var(--text-muted);
    font-size: 0.85rem; cursor: pointer; padding: 0.25rem;
}
.pin-back:hover { color: var(--gold); }
.pin-player { text-align: center; margin-bottom: 1.5rem; }
.pin-player .avatar { margin: 0 auto 0.5rem; }
.pin-player h2 { font-size: 1.15rem; margin: 0 0 0.15rem; }

.pin-dots {
    display: flex; justify-content: center; gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--gold-dim);
    background: transparent;
    transition: all 0.2s;
}
.dot.filled { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px rgba(201,169,110,0.3); }
.dot.pop { animation: dotPop 0.2s ease; }
.dot.error { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 8px rgba(196,84,90,0.3); }

.pin-pad {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    max-width: 260px; margin: 0 auto;
}
.pin-key {
    height: 54px; border-radius: var(--radius-sm);
    background: var(--bg-base); border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500;
    cursor: pointer; transition: all 0.1s;
    display: flex; align-items: center; justify-content: center;
}
.pin-key:hover { background: var(--bg-hover); border-color: var(--border-light); }
.pin-key:active, .pin-key-press { background: var(--gold-glow); border-color: var(--gold-dim); transform: scale(0.95); }
.pin-key-bio { background: transparent; border-color: var(--gold-dim); }
.pin-key-bio svg { stroke: var(--gold); }
.pin-key-del { background: transparent; }
.pin-key-del svg { stroke: var(--text-muted); }

/* ═══ Animations ═══ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes dotPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.fade-in { animation: fadeSlideUp 0.35s ease both; }
.shake { animation: shake 0.4s ease; }

/* ═══ Utilities ═══ */
.loading { color: var(--text-muted); text-align: center; padding: 2rem; }
.error { color: var(--danger); text-align: center; padding: 2rem; }
.empty-state { color: var(--text-muted); text-align: center; padding: 3rem 1rem; font-size: 1rem; }

/* ═══ Settle Summary ═══ */
.settle-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.65rem 0; border-bottom: 1px solid var(--border); gap: 0.75rem;
}
.settle-summary-row:last-child { border-bottom: none; }
.settle-player { display: flex; align-items: center; gap: 0.6rem; }
.settle-player div { display: flex; flex-direction: column; }
.settle-status { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.dist-row { margin-bottom: 0.25rem; }

/* ═══ Pool Card ═══ */
.pool-card {
    text-align: center; padding: 1.5rem;
    border-radius: var(--radius); margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.pool-zero { background: var(--bg-card); }
.pool-active { background: linear-gradient(135deg, rgba(201,169,110,0.08), rgba(201,169,110,0.02)); border-color: var(--gold-dim); }
.pool-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; margin-bottom: 0.25rem; }
.pool-amount { font-size: 2.2rem; font-weight: 700; font-family: var(--font-head); color: var(--gold); }
.pool-zero .pool-amount { color: var(--text-muted); }
.pool-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ═══ Ledger Rows ═══ */
.ledger-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.7rem 0; border-bottom: 1px solid var(--border); gap: 0.5rem;
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row-left { display: flex; align-items: center; gap: 0.65rem; }
.ledger-row-info { display: flex; flex-direction: column; }
.ledger-row-meta { display: flex; gap: 0.75rem; font-size: 0.8rem; }
.ledger-row-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.ledger-total-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0.65rem; margin-bottom: 0.5rem;
    background: var(--bg-base); border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ═══ Transaction Log ═══ */
.tx-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.tx-row:last-child { border-bottom: none; }
.tx-icon {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0; font-weight: 700;
}
.tx-in { background: rgba(58,157,106,0.15); color: var(--success); }
.tx-out { background: rgba(201,169,110,0.15); color: var(--gold); }
.tx-info { flex: 1; font-size: 0.88rem; }
.tx-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; flex-shrink: 0; }
.tx-actions { display: flex; gap: 0.15rem; }

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
