:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(17, 24, 39, 0.88);
    --border: rgba(148, 163, 184, 0.16);
    --muted: #94a3b8;
    --text: #f8fafc;
    --gold: #f6c453;
    --gold-strong: #f59e0b;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #3b82f6;
    --blue-soft: rgba(59, 130, 246, 0.18);
    --glass: rgba(15, 23, 42, 0.62);
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.48);
}

* {
    box-sizing: border-box;
}

/* ===================================================== */
/* APP SHELL LAYOUT (NEW)                                */
/* ===================================================== */

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(2,6,23,0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.logo {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: .02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance {
    font-weight: 700;
    color: var(--gold);
}

.lang-switch button {
    padding: 6px 10px;
    font-size: .8rem;
}

.profile {
    background: rgba(2,6,23,0.5);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.layout {
    display: flex;
    height: calc(100vh - 64px);
}

.sidebar {
    width: 220px;
    background: rgba(2,6,23,0.75);
    border-right: 1px solid var(--border);
    padding-top: 18px;
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 150ms ease;
}

.nav-item:hover {
    background: rgba(59,130,246,0.12);
}

.nav-item.active {
    background: rgba(59,130,246,0.18);
    border-left: 3px solid var(--blue);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* RTL SUPPORT */

html[dir="rtl"] .layout {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border);
}

html[dir="rtl"] .nav-item.active {
    border-left: none;
    border-right: 3px solid var(--blue);
}

/* ===================================================== */
/* EXISTING STYLES (UNCHANGED BELOW)                     */
/* ===================================================== */

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.2), transparent 28rem),
        radial-gradient(circle at 82% 2%, rgba(34, 197, 94, 0.12), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(246, 196, 83, 0.08), transparent 28rem),
        linear-gradient(135deg, #020617, var(--bg));
    color: var(--text);
    font-family: Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    background: rgba(51, 65, 85, 0.84);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    padding: 11px 16px;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
    background: rgba(71, 85, 105, 0.95);
    border-color: rgba(246, 196, 83, 0.45);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.5);
    opacity: 0.45;
    transform: none;
}

button:disabled:hover {
    background: rgba(51, 65, 85, 0.84);
    border-color: var(--border);
    box-shadow: none;
}

.primary,
#confirmBuy {
    background: linear-gradient(135deg, var(--gold), var(--gold-strong));
    border-color: rgba(246, 196, 83, 0.75);
    color: #111827;
    font-weight: 800;
}

.return-button {
    background: rgba(34, 197, 94, 0.13);
    border-color: rgba(34, 197, 94, 0.5);
    color: #bbf7d0;
    font-weight: 700;
}

.app-header,
.section-heading {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 22px clamp(16px, 4vw, 34px);
}

.app-header {
    backdrop-filter: blur(18px);
    background: rgba(2, 6, 23, 0.72);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    letter-spacing: -0.03em;
}

.eyebrow {
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.user-wallet,
.panel,
.room-card,
.modal-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.92));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.user-wallet {
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    text-align: right;
}

.rooms-list {
    display: grid;
    gap: 18px;
    padding: 0 clamp(16px, 4vw, 34px) 28px;
}

.room-card {
    align-items: center;
    border-radius: 24px;
    display: grid;
    gap: 18px;
    grid-template-columns: 72px 1fr minmax(220px, 280px) auto;
    overflow: hidden;
    padding: 20px;
    position: relative;
}

.room-card::before {
    background: linear-gradient(180deg, rgba(246, 196, 83, 0.34), transparent);
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 4px;
}

.room-prefix {
    align-items: center;
    background: radial-gradient(circle at 30% 20%, #fde68a, var(--gold-strong));
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.2);
    color: #111827;
    display: flex;
    font-size: 2rem;
    font-weight: 900;
    height: 64px;
    justify-content: center;
    width: 64px;
}

.room-details h3 {
    margin-bottom: 6px;
}

.room-id {
    color: #e2e8f0;
    font-weight: 800;
    margin-bottom: 5px;
}

.room-audit {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.room-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.room-stats span,
.card-meta span,
.player-section-heading > span,
.player-stats span {
    background: rgba(2, 6, 23, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    color: #cbd5e1;
    padding: 7px 11px;
}

.next-session-box {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 18px;
    color: #fde68a;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px;
}

.next-session-box.empty {
    background: rgba(2, 6, 23, 0.42);
    border-color: var(--border);
    color: var(--muted);
}

.next-session-box small {
    color: #cbd5e1;
    line-height: 1.35;
    max-height: 54px;
    overflow-y: auto;
}

.private-room-create,
.private-room-tools {
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.private-room-create {
    align-items: center;
    grid-template-columns: 1fr auto;
    margin: 0 clamp(16px, 4vw, 34px) 18px;
}

.private-room-create h3,
.private-room-create p {
    margin-bottom: 4px;
}

.private-room-controls,
.private-room-tools {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
}

.private-room-tools label,
.private-room-controls {
    min-width: 180px;
}

.private-room-tools span {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.private-room-tools input,
.private-room-controls input {
    background: rgba(2, 6, 23, 0.66);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    padding: 10px 12px;
    width: 100%;
}

.room-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toolbar {
    align-items: center;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border);
    border-radius: 22px;
    display: flex;
    gap: 12px;
    margin: 20px clamp(16px, 4vw, 34px);
    padding: 14px;
}

.toolbar small {
    color: var(--muted);
    display: block;
}

#roomTitle {
    display: block;
    font-weight: 900;
}

.status-badge,
.remaining-badge,
.hot-label,
.winner-label {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    padding: 7px 11px;
    text-transform: uppercase;
}

.status-waiting,
.status-ready {
    background: rgba(56, 189, 248, 0.15);
    color: #bae6fd;
}

.status-starting {
    background: rgba(246, 196, 83, 0.18);
    color: #fde68a;
}

.status-running {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.status-finished {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.speaker-button[aria-pressed="true"] {
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(34, 197, 94, 0.55);
}

.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 clamp(16px, 4vw, 34px) 34px;
}

.panel {
    border-radius: 22px;
    padding: 18px;
}

.stat-panel {
    overflow: hidden;
    position: relative;
}

.wide {
    grid-column: span 2;
}

.draw-number {
    align-items: center;
    aspect-ratio: 1;
    background: radial-gradient(circle at 30% 25%, #fff7ed, var(--gold), var(--gold-strong));
    border-radius: 50%;
    box-shadow: 0 18px 45px rgba(245, 158, 11, 0.28);
    color: #111827;
    display: inline-flex;
    font-size: clamp(2.2rem, 8vw, 4.8rem);
    font-weight: 1000;
    justify-content: center;
    margin: 8px 0 0;
    min-width: 110px;
    padding: 18px;
}

.draw-pop {
    animation: drawPop 520ms cubic-bezier(0.2, 1.6, 0.35, 1);
}

.metrics {
    color: #cbd5e1;
    margin-bottom: 12px;
}

.metrics strong {
    color: var(--gold);
    font-size: 1.4rem;
}

.progress-track {
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
    border-radius: inherit;
    box-shadow: 0 0 22px rgba(246, 196, 83, 0.34);
    height: 100%;
    transition: width 420ms ease;
    width: 0;
}

.remaining-badge {
    margin-top: 13px;
}

.remaining-high {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.remaining-mid {
    background: rgba(246, 196, 83, 0.18);
    color: #fde68a;
}

.remaining-low {
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
}

#roomInfo {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.session-countdown {
    align-items: center;
    background:
        radial-gradient(circle at 20% 30%, rgba(246, 196, 83, 0.24), transparent 18rem),
        rgba(2, 6, 23, 0.48);
    border: 1px solid rgba(246, 196, 83, 0.42);
    border-radius: 22px;
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 16px;
    overflow: hidden;
    padding: 18px;
    position: relative;
    text-align: center;
}

.session-countdown::after {
    animation: shine 2.2s linear infinite;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.18), transparent 80%);
    content: "";
    inset: 0;
    position: absolute;
    transform: translateX(-140%);
}

.session-countdown span,
.session-countdown small {
    color: var(--muted);
    position: relative;
    z-index: 1;
}

.session-countdown strong {
    animation: drawPop 720ms cubic-bezier(0.2, 1.6, 0.35, 1);
    color: var(--gold);
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1;
    position: relative;
    text-shadow: 0 0 28px rgba(246, 196, 83, 0.38);
    z-index: 1;
}

#roomInfo div {
    background: rgba(2, 6, 23, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px;
}

#roomInfo span {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.winner-pill {
    background: rgba(56, 189, 248, 0.11);
    border: 1px solid rgba(56, 189, 248, 0.26);
    border-radius: 18px;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 10px 10px 0;
    padding: 12px 14px;
}

.winner-pill.gold {
    background: rgba(246, 196, 83, 0.14);
    border-color: rgba(246, 196, 83, 0.42);
}

.winner-pill span,
.winner-pill small {
    color: var(--muted);
}

.cards-container {
    overflow: visible;
}

.player-section + .player-section {
    margin-top: 28px;
}

.player-section-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.player-section-heading h3 {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    margin-bottom: 4px;
}

.player-section-heading p {
    color: var(--muted);
    margin-bottom: 0;
}

.players-grid {
    display: grid;
    gap: 22px;
}

.player-panel {
    backdrop-filter: blur(18px);
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.78), rgba(17, 24, 39, 0.58)),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 18rem);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: clamp(14px, 2.4vw, 22px);
    position: relative;
    overflow: hidden;
}

.player-panel::before {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.6), rgba(34, 197, 94, 0.35), transparent);
    content: "";
    height: 1px;
    inset: 0 18px auto;
    position: absolute;
}

.player-panel-mine {
    border-color: rgba(59, 130, 246, 0.44);
    box-shadow: var(--shadow), 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.player-panel-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.player-identity {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.player-avatar {
    align-items: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 28px rgba(2, 6, 23, 0.26);
    display: flex;
    font-size: 1.5rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.bot-avatar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(8, 47, 73, 0.82));
}

.human-avatar {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(20, 83, 45, 0.68));
}

.player-name {
    color: #f8fafc;
    font-size: 1.02rem;
    font-weight: 900;
    max-width: 34ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-status {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.84rem;
    gap: 7px;
    margin-top: 3px;
}

.player-status span {
    animation: onlinePulse 1.8s ease-in-out infinite;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
    height: 8px;
    width: 8px;
}

.player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.cards-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.bingo-card {
    backdrop-filter: blur(16px);
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.18), transparent 12rem),
        linear-gradient(145deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.32);
    overflow: hidden;
    padding: 16px;
    position: relative;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.bingo-card:hover {
    border-color: rgba(59, 130, 246, 0.42);
    box-shadow: 0 24px 58px rgba(2, 6, 23, 0.42), 0 0 0 1px rgba(59, 130, 246, 0.08);
    transform: translateY(-4px);
}

.bingo-card-topline,
.card-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.card-number {
    color: #bfdbfe;
    font-size: 1.05rem;
    font-weight: 1000;
}

.card-owner {
    color: #e2e8f0;
    margin: 8px 0 10px;
}

.hot-label {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.34) !important;
    color: #fde68a !important;
}

.winner-label {
    background: rgba(246, 196, 83, 0.2);
    color: #fde68a;
}

.bingo-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    margin-top: 14px;
}

.number-cell {
    align-items: center;
    aspect-ratio: 1;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 13px;
    color: #f8fafc;
    display: flex;
    font-size: clamp(0.72rem, 1.8vw, 0.98rem);
    font-weight: 900;
    justify-content: center;
    position: relative;
    transition: background 220ms ease, color 220ms ease, transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.number-cell.empty {
    background:
        linear-gradient(135deg, rgba(30, 41, 59, 0.26) 25%, transparent 25%, transparent 50%, rgba(30, 41, 59, 0.26) 50%, rgba(30, 41, 59, 0.26) 75%, transparent 75%),
        rgba(15, 23, 42, 0.28);
    background-size: 12px 12px;
    border-style: dashed;
    opacity: 0.5;
}

.number-cell.marked {
    background: linear-gradient(135deg, #86efac, var(--green), #15803d);
    border-color: rgba(134, 239, 172, 0.86);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1), 0 10px 24px rgba(34, 197, 94, 0.28);
    color: #052e16;
    transform: scale(1.04);
}

.number-cell.marked::after {
    align-items: center;
    background: #dcfce7;
    border-radius: 50%;
    color: #166534;
    content: "✓";
    display: flex;
    font-size: 0.58rem;
    font-weight: 1000;
    height: 15px;
    justify-content: center;
    position: absolute;
    right: -4px;
    top: -4px;
    width: 15px;
}

.number-cell.newly-marked {
    animation: markPulse 780ms ease;
}

.hot-card {
    border-color: rgba(245, 158, 11, 0.5);
}

.winning-card {
    animation: winningGlow 1.7s ease-in-out infinite;
    border-color: rgba(246, 196, 83, 0.75);
}

.winning-card::after {
    animation: shine 2.4s linear infinite;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.28), transparent 80%);
    content: "";
    inset: 0;
    position: absolute;
    transform: translateX(-140%);
}

.empty-state {
    background: rgba(2, 6, 23, 0.38);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    color: var(--muted);
    padding: 18px;
}

.modal {
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(2, 6, 23, 0.75);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 30;
}

.modal-card {
    border-radius: 24px;
    max-width: 440px;
    padding: 24px;
    width: calc(100% - 32px);
}

.modal-card label {
    color: #cbd5e1;
    display: block;
    margin-bottom: 8px;
}

.modal-card input {
    background: rgba(2, 6, 23, 0.66);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: white;
    padding: 12px;
    width: 100%;
}

.input-hint {
    color: var(--muted);
    display: block;
    margin-top: 8px;
}

.buy-total {
    color: var(--gold);
    font-weight: 900;
    margin-top: 12px;
}

.error-text,
.error-box {
    color: #fca5a5;
    margin-top: 10px;
}

.error-box {
    background: rgba(127, 29, 29, 0.8);
    border-radius: 16px;
    padding: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.hidden {
    display: none !important;
}

/* ===================================================== */
/* CRASH GAME                                            */
/* ===================================================== */

.crash-view {
    display: grid;
    gap: 22px;
}

.crash-hero-panel,
.crash-card {
    background:
        radial-gradient(circle at 16% 0%, rgba(59, 130, 246, 0.24), transparent 22rem),
        radial-gradient(circle at 92% 20%, rgba(168, 85, 247, 0.18), transparent 20rem),
        linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    box-shadow: var(--shadow), 0 0 32px rgba(59, 130, 246, 0.08);
}

.crash-hero-panel,
.crash-card {
    padding: clamp(20px, 4vw, 34px);
}

.crash-topline,
.crash-round-meta,
.crash-actions,
.crash-bet-row,
.crash-feed-item {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.crash-topline h1 {
    font-size: clamp(2.4rem, 7vw, 5.8rem);
    line-height: 0.95;
    margin: 4px 0 0;
    text-shadow: 0 0 26px rgba(59, 130, 246, 0.52);
}

.crash-status {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    color: #e2e8f0;
    font-weight: 900;
    padding: 10px 14px;
}

.crash-status.waiting {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

.crash-status.running {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.crash-status.crashed,
.crash-status.settlement {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.crash-stage {
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 16px;
    display: grid;
    margin-top: 24px;
    min-height: 320px;
    overflow: hidden;
    padding: 26px;
    place-items: center;
    position: relative;
    text-align: center;
}

.crash-grid-lines {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    inset: 0;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 78%, transparent);
    position: absolute;
}

.crash-multiplier {
    color: #f8fafc;
    font-size: clamp(4.2rem, 14vw, 10rem);
    font-weight: 1000;
    letter-spacing: 0;
    position: relative;
    text-shadow:
        0 0 22px rgba(34, 197, 94, 0.5),
        0 0 56px rgba(59, 130, 246, 0.38);
    transition: transform 120ms ease, color 120ms ease;
}

.crash-stage.running .crash-multiplier {
    animation: crashPulse 900ms ease-in-out infinite;
    color: #86efac;
}

.crash-stage.crashed .crash-multiplier,
.crash-stage.settlement .crash-multiplier {
    color: #f87171;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.52);
}

.crash-round-meta,
.crash-countdown {
    color: var(--muted);
    position: relative;
}

.crash-countdown {
    font-weight: 800;
    margin-top: -60px;
}

.crash-countdown.danger {
    color: #fca5a5;
}

.crash-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
}

.section-heading.compact {
    margin-bottom: 18px;
}

.section-heading.compact h2 {
    font-size: 1.25rem;
}

.crash-bet-panel label {
    color: var(--muted);
    display: block;
    font-size: 0.86rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.crash-bet-panel input {
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 900;
    padding: 14px;
    width: 100%;
}

.crash-actions {
    margin: 16px 0;
}

.cashout-button:not(:disabled) {
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    color: white;
}

.crash-my-bet {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.24);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    padding: 14px;
}

.crash-my-bet span,
.crash-my-bet small,
.crash-hint,
.empty-feed,
.fairness-list dt {
    color: var(--muted);
}

.crash-my-bet strong {
    color: #86efac;
    font-size: 1.25rem;
}

.crash-bets-list,
.crash-feed,
.fairness-list {
    display: grid;
    gap: 10px;
}

.crash-bet-row,
.crash-feed-item {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 12px 14px;
}

.crash-bet-row.cashed_out,
.crash-feed-item:first-child {
    border-color: rgba(34, 197, 94, 0.28);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.08);
}

.crash-bet-row.lost {
    border-color: rgba(239, 68, 68, 0.22);
}

.crash-bet-row span,
.crash-feed-item span {
    color: #e2e8f0;
    font-weight: 800;
}

.crash-bet-row strong {
    color: var(--gold);
}

.crash-bet-row em,
.crash-feed-item small {
    color: var(--muted);
    font-style: normal;
}

.fairness-list {
    margin: 0;
}

.fairness-list div {
    min-width: 0;
}

.fairness-list dd {
    color: #bfdbfe;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

@keyframes crashPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.035);
    }
}

@keyframes drawPop {
    0% { transform: scale(0.72); opacity: 0.5; }
    62% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes markPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.68), 0 0 26px rgba(34, 197, 94, 0.5); transform: scale(0.9); }
    72% { box-shadow: 0 0 0 16px rgba(34, 197, 94, 0), 0 0 34px rgba(34, 197, 94, 0.28); transform: scale(1.12); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 10px 24px rgba(34, 197, 94, 0.28); transform: scale(1.04); }
}

@keyframes winningGlow {
    0%, 100% { box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(246, 196, 83, 0.3); }
    50% { box-shadow: 0 26px 62px rgba(0, 0, 0, 0.34), 0 0 0 4px rgba(246, 196, 83, 0.22), 0 0 34px rgba(246, 196, 83, 0.36); }
}

@keyframes shine {
    100% { transform: translateX(140%); }
}

@keyframes cardIn {
    0% { opacity: 0; transform: translateY(10px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelIn {
    0% { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes onlinePulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12); }
    50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.04); }
}

@media (min-width: 1180px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1500px) {
    .cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 860px) and (max-width: 1179px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .crash-layout {
        grid-template-columns: 1fr;
    }

    .room-card {
        grid-template-columns: 64px 1fr;
    }

    .next-session-box,
    .room-actions {
        grid-column: span 2;
    }

    .room-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .app-header,
    .section-heading,
    .toolbar,
    .player-section-heading,
    .player-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .wide {
        grid-column: span 1;
    }

    .room-card {
        grid-template-columns: 1fr;
    }

    .next-session-box,
    .room-actions {
        grid-column: span 1;
    }

    .bingo-card {
        border-radius: 18px;
        padding: 10px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .bingo-grid {
        gap: 4px;
    }

    .number-cell {
        border-radius: 9px;
        font-size: 0.68rem;
    }

    .crash-topline,
    .crash-round-meta,
    .crash-actions,
    .crash-bet-row,
    .crash-feed-item {
        align-items: stretch;
        flex-direction: column;
    }

    .crash-stage {
        min-height: 260px;
    }
}

/* ===================================================== */
/* WINMIND PRODUCTION SHELL EXTENSIONS                   */
/* ===================================================== */

/* ---- General UI ---- */

.btn-small {
    font-size: 0.78rem;
    padding: 8px 12px;
}

.btn-block {
    width: 100%;
}

.btn-success-soft {
    background: rgba(34, 197, 94, 0.13);
    border-color: rgba(34, 197, 94, 0.5);
    color: #bbf7d0;
    font-weight: 700;
}

.input {
    background: rgba(2, 6, 23, 0.66);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: white;
    padding: 12px 14px;
    width: 100%;
}

.loading-state {
    color: var(--muted);
    padding: 18px 0;
    text-align: center;
}

.boot-state {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-weight: 700;
    justify-content: center;
    min-height: 100vh;
}

.avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--blue), var(--green));
    border-radius: 999px;
    color: #04121f;
    display: inline-flex;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    margin-inline-end: 8px;
    width: 24px;
}

/* ---- Connection status ---- */

.ws-status {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 7px 12px;
    text-transform: uppercase;
}

.ws-live {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #bbf7d0;
}

.ws-offline,
.ws-reconnecting {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fecaca;
}

/* ---- Auth view ---- */

.auth-view {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    backdrop-filter: blur(18px);
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    max-width: 460px;
    padding: 38px;
    width: 100%;
}

.auth-logo {
    font-size: 3rem;
    text-align: center;
}

.auth-card h1 {
    font-size: 2rem;
    margin: 12px 0 2px;
    text-align: center;
}

.auth-card h2 {
    font-size: 1.2rem;
    margin: 22px 0 6px;
}

.auth-tagline {
    color: var(--gold);
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.auth-subtitle {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 18px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.auth-footnote {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 22px;
    padding-top: 14px;
}

/* ---- Wallet ---- */

.wallet-notice {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 16px;
    color: #bfdbfe;
    margin: 0 0 20px;
    padding: 14px 16px;
}

.transactions-table {
    margin-top: 12px;
    overflow-x: auto;
}

.transactions-table-content {
    border-collapse: collapse;
    color: #cbd5e1;
    font-size: 0.88rem;
    width: 100%;
}

.transactions-table-content th,
.transactions-table-content td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}

.transactions-table-content th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.transaction-type {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
}

.transaction-type.deposit {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.transaction-type.withdraw {
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
}

.amount-positive {
    color: #86efac;
}

.amount-negative {
    color: #fca5a5;
}

/* ---- Bingo room info ---- */

.room-info-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.room-info-grid div {
    background: rgba(2, 6, 23, 0.35);
    border-radius: 12px;
    padding: 8px 12px;
}

.room-info-grid span {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.room-info-grid strong {
    color: var(--text);
    display: block;
    font-size: 0.95rem;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

/* ---- Claim buttons ---- */

.claim-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* ---- Toasts ---- */

#toast-root {
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    position: fixed;
    right: 20px;
    z-index: 50;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    color: var(--text);
    max-width: 340px;
    opacity: 0;
    padding: 14px 16px;
    transform: translateY(12px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.55);
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.55);
}

/* ---- Notes / misc ---- */

.section-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* ---- Responsive additions ---- */

@media (max-width: 760px) {
    .header {
        height: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 16px;
    }

    .header-center {
        order: 3;
        width: 100%;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar .ws-status {
        align-self: flex-start;
    }

    .auth-card {
        padding: 26px 20px;
    }

    .claim-actions {
        flex-direction: column;
    }

    #toast-root {
        left: 16px;
        right: 16px;
    }

    .toast {
        max-width: none;
    }
}

/* ============================================================
   Account / RBAC panels (auth tabs, owner/admin/profile views)
   ============================================================ */

.auth-tabs {
    background: rgba(2, 6, 23, 0.66);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    gap: 4px;
    margin: 8px 0 18px;
    padding: 4px;
}

.auth-tab {
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    flex: 1;
    font-weight: 700;
    padding: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-tab.active {
    background: var(--accent);
    color: #06121f;
}

.success-box {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    color: #6ee7b7;
    margin-top: 10px;
    padding: 12px;
}

.panel-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-nav .active {
    background: var(--accent);
    color: #06121f;
}

.stat-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 18px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
}

.stat-card strong {
    color: var(--gold);
    font-size: 1.6rem;
}

.stat-card .stat-icon {
    font-size: 1.3rem;
}

.stat-card span:last-child {
    color: var(--muted);
    font-size: 0.85rem;
}

.system-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.module-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 18px;
}

.module-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.module-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.module-card .module-icon {
    font-size: 1.5rem;
}

.module-card small {
    color: var(--muted);
}

.data-table {
    border-collapse: collapse;
    width: 100%;
}

.data-table th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    padding: 10px 12px;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    border-top: 1px solid var(--border);
    padding: 12px;
    vertical-align: middle;
}

.data-table .row-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.role-badge {
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 4px 10px;
}

.role-owner {
    background: rgba(250, 204, 21, 0.16);
    border-color: rgba(250, 204, 21, 0.5);
    color: #fde047;
}

.role-admin {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.5);
    color: #7dd3fc;
}

.role-user {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

.perm-pill {
    background: rgba(2, 6, 23, 0.66);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gold);
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    margin: 2px;
    padding: 3px 9px;
}

.perm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perm-row {
    align-items: center;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
}

.checkbox-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}

.checkbox-item {
    align-items: center;
    display: flex;
    gap: 8px;
    padding-left: 2px;
}

.checkbox-item input {
    accent-color: var(--accent);
    width: auto;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid .form-span {
    grid-column: 1 / -1;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.form-stack label {
    color: var(--muted);
    font-size: 0.85rem;
}

.filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-bar .input {
    flex: 1;
    min-width: 220px;
}

.accounts-table {
    overflow-x: auto;
}

.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

.guard-view {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
    min-height: 320px;
}

.profile-summary {
    align-items: center;
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-summary > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.avatar-lg {
    font-size: 1.8rem;
    height: 64px;
    width: 64px;
}

.panel-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.modal-card {
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ---- Owner: role registry cards ---- */
.role-card {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
}
.role-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.role-card-perms {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ---- Help Center index (bilingual) ---- */
.help-guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.help-guide-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}
.help-guide-icon {
    font-size: 28px;
    line-height: 1;
}
.help-guide-body {
    flex: 1;
    min-width: 0;
}
.help-guide-body h3 {
    margin: 0 0 4px;
    font-size: 15px;
}
.help-guide-body p {
    margin: 0;
    font-size: 12.5px;
    opacity: 0.75;
}
.help-index-view .help-header-content h1 {
    margin-bottom: 2px;
}
.help-index-view .help-header-content p {
    margin: 0;
    font-size: 13px;
    opacity: 0.8;
}
[dir="rtl"] .help-guide-card { text-align: right; }

/* ---- Owner audit diff ---- */
.audit-diff {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 11.5px;
    margin: 4px 0 0;
    opacity: 0.85;
}

/* ---- Owner: role default-permission editor ---- */
.role-editor {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}
.role-editor summary { cursor: pointer; font-size: 12.5px; }
.role-editor .checkbox-grid { margin: 10px 0; }

/* ---- auth: password recovery link ---- */
.auth-link {
    display: inline-block;
    color: var(--accent, #6ea8fe);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 6px;
}
.auth-link:hover { text-decoration: underline; }


/* ============================================================
   Platform settings & analytics panels
   ============================================================ */

.mono { font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace; }
.tiny { font-size: 0.78rem; }

.settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chip {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

.chip.active {
    background: #7c5cff;
    border-color: #7c5cff;
    color: #fff;
}

.chip-count {
    background: rgba(0, 0, 0, 0.28);
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 4px;
    font-size: 0.75rem;
}

.settings-search {
    min-width: 220px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.22);
    color: inherit;
}

.settings-table td { vertical-align: top; padding: 12px 10px; }
.setting-label strong { display: inline; }
.setting-customized { background: rgba(124, 92, 255, 0.08); }
.setting-dangerous { background: rgba(255, 120, 60, 0.07); }
.setting-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

.badge {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.68rem;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.badge-custom { background: rgba(124, 92, 255, 0.28); color: #d9cdff; }
.badge-danger { background: rgba(255, 120, 60, 0.24); color: #ffd9c2; }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: #7c5cff; }

.setting-select, .settings-table input[type="number"], .settings-table input[type="text"] {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.24);
    color: inherit;
    min-width: 150px;
}

.input-money { display: inline-flex; align-items: center; gap: 6px; }
.input-suffix { opacity: 0.7; font-size: 0.8rem; }

.bar-chart { display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 130px; gap: 10px; align-items: center; }
.bar-label { font-size: 0.78rem; opacity: 0.75; }
.bar-track { background: rgba(255, 255, 255, 0.07); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #7c5cff, #4ecdc4); border-radius: 6px; min-width: 2px; }
.bar-fill.bar-out { background: linear-gradient(90deg, #ff6b6b, #ffa94d); }
.bar-val { font-size: 0.78rem; text-align: right; }

/* ===================================================== */
/* POKER (Texas Hold'em)                                 */
/* ===================================================== */

.poker-view { display: flex; flex-direction: column; gap: 18px; }
.poker-view .view-header.compact { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.poker-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; align-items: center; }
.poker-meta .poker-pot b { color: var(--gold); }
.header-actions { display: flex; gap: 8px; }

.poker-section { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.poker-section .section-title { margin: 0 0 12px; font-size: 16px; }

.poker-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.poker-lobby-card { background: var(--glass); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.poker-lobby-card.private { border-color: rgba(246, 196, 83, 0.35); }
.poker-lobby-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.poker-lobby-rows { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.poker-lobby-rows > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.poker-lobby-rows b { color: var(--text); font-weight: 600; }
.poker-phase { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); color: #93c5fd; }
.poker-phase.phase-betting { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.poker-phase.phase-settlement { background: rgba(246, 196, 83, 0.16); color: var(--gold); }
.poker-phase.phase-idle { background: rgba(148, 163, 184, 0.12); }

.poker-create-panel { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.poker-create-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.poker-create-panel input, .poker-create-panel select {
    background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 10px; min-width: 110px;
}
.poker-notice { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.35); color: #bfdbfe; padding: 8px 12px; border-radius: 10px; font-size: 13px; }

/* table felt */
.poker-felt {
    position: relative; border-radius: 26px; padding: 22px 18px 16px;
    background: radial-gradient(120% 140% at 50% 0%, #14532d 0%, #0b3b21 55%, #072a18 100%);
    border: 1px solid rgba(246, 196, 83, 0.25); box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45), var(--shadow);
    display: flex; flex-direction: column; gap: 18px; min-height: 300px;
}
.poker-board { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.poker-blinds-tag { width: 100%; text-align: center; font-size: 11px; color: rgba(248, 250, 252, 0.65); margin-top: 4px; }

.pcard {
    display: inline-flex; align-items: center; gap: 3px; justify-content: center;
    min-width: 40px; height: 56px; padding: 0 6px; border-radius: 8px;
    background: #f8fafc; color: #0f172a; font-weight: 700; font-size: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}
.pcard.red { color: #b91c1c; }
.pcard.back { color: #1e3a8a; background: repeating-linear-gradient(45deg, #1d4ed8 0 4px, #172554 4px 8px); font-size: 18px; }
.pcard b { font-size: 16px; }

.poker-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.poker-seat {
    background: rgba(2, 6, 23, 0.55); border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px;
    position: relative; transition: border-color 0.2s, box-shadow 0.2s;
}
.poker-seat.turn { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(246, 196, 83, 0.35); }
.poker-seat.me { background: rgba(59, 130, 246, 0.14); }
.poker-seat.folded { opacity: 0.5; }
.poker-seat-name { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.poker-seat-cards { display: flex; gap: 4px; min-height: 30px; }
.poker-seat-cards .pcard { min-width: 30px; height: 42px; font-size: 12px; }
.poker-seat-stack { font-size: 13px; color: var(--gold); font-weight: 700; }
.poker-seat-bet { font-size: 11px; color: #bbf7d0; }
.poker-seat-tags { display: flex; gap: 6px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.poker-seat-tags .allin { color: #fca5a5; font-weight: 700; }
.poker-seat-tags .disc { color: #fde68a; }
.poker-dealer {
    position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
    background: #f8fafc; color: #0f172a; font-weight: 800; font-size: 12px;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.badge-you { background: var(--blue-soft); color: #93c5fd; padding: 1px 7px; border-radius: 999px; font-size: 10px; }
.badge-bot { font-size: 10px; }

/* result banner */
.poker-result { background: var(--panel-strong); border: 1px solid rgba(246, 196, 83, 0.4); border-radius: 14px; padding: 12px 14px; }
.poker-result-title { font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.poker-result-row { display: flex; gap: 10px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.poker-result-row span { color: var(--green); font-weight: 700; }
.poker-result-row em { color: var(--muted); font-style: normal; }

/* controls */
.poker-controls { display: flex; flex-direction: column; gap: 10px; }
.poker-actions { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.poker-action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.poker-action-buttons .btn { flex: 1 1 130px; min-height: 46px; font-size: 14px; }
.btn-danger { background: linear-gradient(135deg, #7f1d1d, #b91c1c); color: #fff; border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-warning { background: linear-gradient(135deg, #78350f, #b45309); color: #fff; border: 1px solid rgba(245, 158, 11, 0.45); }
.poker-raise-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.poker-raise-row input {
    background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 10px; width: 130px;
}
.poker-timer { font-weight: 800; font-size: 16px; color: var(--gold); min-height: 20px; }
.poker-timer.low { color: var(--red); animation: pokerPulse 1s infinite; }
@keyframes pokerPulse { 50% { opacity: 0.45; } }
.poker-idle-bar { color: var(--muted); font-size: 13px; min-height: 20px; }

.poker-buyin-panel, .poker-seat-panel, .poker-invite-panel {
    background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 14px;
    display: flex; flex-direction: column; gap: 8px;
}
.poker-buyin-panel h2, .poker-invite-panel h2 { margin: 0; font-size: 15px; }
.poker-buyin-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.poker-buyin-row input {
    background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 12px; width: 150px; font-size: 15px;
}
.poker-buyin-row.compact input { width: 130px; padding: 8px 10px; font-size: 13px; }

.poker-foot { display: flex; gap: 12px; align-items: center; }
.poker-history { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.poker-history-row { display: flex; gap: 10px; align-items: center; font-size: 12px; flex-wrap: wrap; justify-content: space-between; }
.poker-history-row b.pos { color: var(--green); }
.poker-history-row b.neg { color: var(--red); }

/* mobile / touch */
@media (max-width: 760px) {
    .poker-felt { border-radius: 18px; padding: 14px 10px 10px; }
    .poker-players { grid-template-columns: repeat(2, 1fr); }
    .poker-action-buttons .btn { flex: 1 1 45%; min-height: 52px; }
    .pcard { min-width: 34px; height: 48px; font-size: 13px; }
    .poker-seat { padding: 8px; }
    .poker-buyin-row input, .poker-raise-row input { width: 100%; flex: 1; }
    .poker-meta { font-size: 12px; gap: 8px; }
}


/* ============================================================
   Support Center (owner/admin) + customer support card
   ============================================================ */
.support-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.support-chip { background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; }
.support-note { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.support-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.support-toolbar .input { padding: 7px 10px; font-size: 13px; min-width: 130px; }
#supportSearch { flex: 1; min-width: 220px; }
.support-split { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 980px) { .support-split { grid-template-columns: 1fr; } }
.support-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; padding-right: 4px; }
.support-ticket { text-align: left; background: rgba(15, 23, 42, 0.55); border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; color: inherit; transition: border-color .15s; }
.support-ticket:hover { border-color: rgba(96, 165, 250, 0.5); }
.support-ticket.active { border-color: #3b82f6; background: rgba(59, 130, 246, 0.10); }
.st-row1 { display: flex; align-items: center; gap: 8px; }
.st-row1 strong { font-size: 14px; }
.st-status { margin-inline-start: auto; font-size: 11px; opacity: .8; }
.st-subject { font-size: 13px; margin: 4px 0 6px; opacity: .92; }
.st-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; opacity: .65; }
.support-priority { font-size: 10px; font-weight: 700; letter-spacing: .5px; border-radius: 6px; padding: 2px 7px; }
.p-low { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
.p-normal { background: rgba(59, 130, 246, .16); color: #93c5fd; }
.p-high { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.p-urgent { background: rgba(239, 68, 68, .2); color: #fca5a5; }
.support-detail { background: rgba(15, 23, 42, 0.4); border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px; padding: 14px; min-height: 300px; display: flex; flex-direction: column; gap: 10px; }
.sd-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sd-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sd-actions .input { padding: 6px 8px; font-size: 12px; }
.sd-thread { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; padding: 4px; }
.sd-msg { border-radius: 12px; padding: 10px 12px; max-width: 88%; }
.sd-msg.from-customer { background: rgba(148, 163, 184, 0.10); border: 1px solid rgba(148, 163, 184, 0.16); }
.sd-msg.from-staff { background: rgba(59, 130, 246, 0.10); border: 1px solid rgba(59, 130, 246, 0.30); align-self: flex-end; }
.sd-msg.from-system { background: transparent; border: 1px dashed rgba(148, 163, 184, 0.3);
  align-self: center; font-size: 12px; opacity: .8; max-width: 96%; }
.sd-msg-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11px; margin-bottom: 6px; }
.sd-msg-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.sd-badge { background: rgba(148, 163, 184, 0.14); border-radius: 6px; padding: 1px 7px; font-size: 10.5px; }
.sd-badge.chan { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; }
.sd-delivery { border-radius: 6px; padding: 1px 7px; font-size: 10.5px; background: rgba(245, 158, 11, .16); color: #fcd34d; }
.sd-delivery.d-delivered { background: rgba(16, 185, 129, .14); color: #6ee7b7; }
.sd-delivery.d-failed { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.sd-msg-atts { margin-top: 6px; }
.sd-att { display: inline-block; font-size: 12px; color: #93c5fd; text-decoration: none; margin-inline-end: 8px; }
.sd-att:hover { text-decoration: underline; }
.sd-compose { border-top: 1px solid rgba(148, 163, 184, 0.14); padding-top: 10px; }
.sd-compose textarea { width: 100%; resize: vertical; }
.sd-compose-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.sd-footer { display: flex; gap: 8px; }
.support-addrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.support-addrow .input { flex: 1; min-width: 150px; }
.pad { padding: 14px; }
.mysupport-thread { margin-top: 14px; border-top: 1px solid rgba(148, 163, 184, 0.15); padding-top: 10px; }
.mysupport-msg { border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 13px; }
.mysupport-msg.mine { background: rgba(148, 163, 184, 0.1); }
.mysupport-msg.staff { background: rgba(59, 130, 246, 0.1); }
.mysupport-msg p { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 720px) { .sd-msg { max-width: 100%; } .support-toolbar .input { min-width: 100px; } }

/* ------------------------------------------------------------
   Auth pages: language bar, alt-account line, dev reset link box
   ------------------------------------------------------------ */
.auth-langbar {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.auth-altline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.92em;
    color: var(--text-muted, #9aa7c7);
}
button.auth-link {
    background: none;
    border: none;
    color: #6ea8ff;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}
.auth-devbox {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed #3a4a7a;
    border-radius: 8px;
    font-size: 0.85em;
    background: rgba(46, 70, 130, 0.14);
}
.auth-muted {
    color: var(--text-muted, #9aa7c7);
    font-size: 0.85em;
    margin: 6px 0 10px 0;
}
