/* -- Design Tokens (SwitchGG wireframe palette) -- */
:root {
    /* Surfaces — near-black panels on a darker page */
    --sgg-bg: #0c0c0f;
    --sgg-surface: #181818;
    --sgg-surface-2: #16161c;
    --sgg-surface-3: #1c1c24;
    --sgg-elevated: #1a1a22;
    --sgg-border: #23232e;
    --sgg-border-strong: #2c2c3a;

    /* Text */
    --sgg-text: #e8e8ee;
    --sgg-text-muted: #9a9aac;
    --sgg-text-dim: #62626f;

    /* Primary accent — gold/orange (logo, REGISTER, active states) */
    --sgg-gold: #f5a623;
    --sgg-gold-strong: #ff9d12;
    --sgg-gold-hover: #ffb23f;
    --sgg-gold-soft: rgba(245, 166, 35, 0.14);

    /* Secondary accent — teal */
    --sgg-teal: #3dc0d0;
    --sgg-teal-soft: rgba(61, 192, 208, 0.14);

    /* Tertiary accent — violet (deposit / rain pool join) */
    --sgg-violet: #7c5cfc;
    --sgg-violet-soft: rgba(124, 92, 252, 0.16);

    /* Positive / negative */
    --sgg-green: #4ade80;
    --sgg-red: #ef4444;
}

/* -- Fonts -- */
/* Barlow Semi Condensed (Google Fonts, OFL licensed) — used everywhere the
   design previously referenced the (unavailable) 'Gineso' font. */
@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('fonts/BarlowSemiCondensed-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('fonts/BarlowSemiCondensed-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('fonts/BarlowSemiCondensed-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('fonts/BarlowSemiCondensed-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('fonts/BarlowSemiCondensed-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* -- Reset & Base -- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0e0e10;
    color: #e5e5e5;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "kern" 1, "liga" 1;
}

/* Tabular numbers everywhere values change dynamically */
.wallet-amount,
.session-stat-value,
.multiplier,
.profit,
.game-stat,
.balance {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* -- Page transitions -- */
body {
    opacity: 1;
    transition: opacity 0.18s ease;
}

/* -- Skeleton shimmer -- */
.skeleton {
    background: linear-gradient(90deg, #1a1a2e 25%, #22223a 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    display: block;
    flex-shrink: 0;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* -- Sidebar collapse -- */
.sidebar.collapsed {
    width: 0;
    border-right: none;
}

/* -- App Shell Layout -- */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    background: #080808;
    flex-direction: column;
}

.content-body {
    flex: 1;
}

.content-area.theater-mode {
    padding: 0 !important;
    overflow-y: hidden !important;
    display: flex;
    flex-direction: column;
}

.content-area.theater-mode .content-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* -- Sidebar -- */
.sidebar {
    width: 288px;
    height: 100%;
    background: #121418;
    border-right: 1px solid var(--sgg-border);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    margin: 6px;
    padding: 8px 1px;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Group wrapper: border + slightly darker background than the nav items,
   so the section header blends into the same background as the group. */
.sidebar-group {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--sgg-border);
    border-radius: 0;
    background: var(--sgg-surface-2);
    overflow: hidden;
    flex-shrink: 0;
}

/* Flat section header (Games / More) */
.sidebar-section-title {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    background: var(--sgg-surface-2);
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Barlow Semi Condensed', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    white-space: nowrap;
    border-bottom: 1px solid #222531;
    overflow: hidden;
}

/* Decorative diagonal-line texture flanking both sides of section headers,
   using the designer-provided SVG assets (left/right side diagonals). */
.sidebar-section-title::before,
.sidebar-section-title::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22px;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% auto;
    pointer-events: none;
}

.sidebar-section-title::before {
    left: 0;
    background-image: url('images/nav/left-side-diagonal.svg');
}

.sidebar-section-title::after {
    right: 0;
    width: 91px;
    background-image: url('images/nav/right-side-diagonal.svg');
}

.sidebar .nav-item {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-left: 2px solid transparent;
    border-radius: 0;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Barlow Semi Condensed', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(90deg, #1f2229 0%, rgba(25, 25, 35, 0) 100%);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sidebar .nav-item:hover {
    border-left-color: #7818ff;
}

.sidebar .nav-item.active {
    background: linear-gradient(90deg, rgba(120, 24, 255, 0.5) 0%, rgba(25, 25, 35, 0) 100%);
    border-left-color: #7818ff;
    color: #fff;
    animation: sgg-nav-active-in 0.35s ease;
}

@keyframes sgg-nav-active-in {
    from {
        opacity: 0.55;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* -- Coming soon placeholder page -- */
.coming-soon-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.coming-soon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    max-width: 420px;
}

.coming-soon-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
    color: var(--sgg-text-muted);
}

.coming-soon-icon img,
.coming-soon-icon svg {
    width: 100%;
    height: 100%;
}

.coming-soon-title {
    font-family: 'Barlow Semi Condensed', 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}

.coming-soon-description {
    color: #9898b8;
    font-size: 0.92rem;
    line-height: 1.5;
}

.coming-soon-badge {
    margin-top: 0.4rem;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--sgg-violet);
    background: var(--sgg-violet-soft);
    color: var(--sgg-violet);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4rem 0.75rem;
    background: none;
    border: none;
    color: #55556a;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    margin-top: 0.25rem;
}

.nav-category:hover {
    color: #8888a8;
    background: #1a1a26;
}

.nav-category-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.nav-chevron.chevron-open {
    transform: rotate(180deg);
}

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.nav-sub-item {
    padding-left: 2.5rem !important;
    font-size: 0.82rem !important;
}

/* -- Top Bar -- */
.top-bar {
    height: 72px;
    background: #080808;
    border-bottom: 1px solid var(--sgg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #1b1e24;
    border: 1px solid #22262e;
    border-radius: 6px;
    color: #e6e7e7;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: #262a33;
    border-color: #2e333d;
    color: #ffffff;
}

.sidebar-toggle-btn:active {
    background: #17191f;
    border-color: #2e333d;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Top-bar auth buttons (scoped so site-wide .btn styles are untouched) */
.top-bar-right .btn {
    height: 40px;
    padding: 0 1.1rem 2px;
    border-radius: 8px;
    font-family: 'Barlow Semi Condensed', 'Orbitron', sans-serif;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: background 0.15s, transform 0.05s;
}

.top-bar-right .btn .btn-label {
    position: relative;
    z-index: 1;
}

.top-bar-right .btn:active {
    transform: translateY(1px);
}

/* Sign in — purple game button with beveled bottom edge */
.top-bar-right .btn-ghost {
    background: linear-gradient(180deg, #7717ff 0%, #984fff 100%);
    border: 2px solid #7717ff;
    border-bottom: none;
    box-shadow: 0 2px 0 #974eff, 0 3px 0 #7717ff, 0 0 0 1px #af76ff;
}

.top-bar-right .btn-ghost:hover {
    background: linear-gradient(180deg, #8630ff 0%, #a86bff 100%);
}

.top-bar-right .btn-ghost:active {
    background: linear-gradient(180deg, #710dff 0%, #8f40ff 100%);
    box-shadow: 0 1px 0 #9f5cff, 0 0 0 1px #af76ff;
}

/* Register — gold game button with beveled bottom edge */
.top-bar-right .btn-primary {
    background: linear-gradient(180deg, #e28400 0%, #ffa11e 100%);
    border: 2px solid #d67d00;
    border-bottom: none;
    box-shadow: 0 2px 0 #ffb956, 0 3px 0 #d67d00;
}

/* Diagonal chevron texture across the lower half (matches design SVG) */
.top-bar-right .btn-primary::before {
    content: "";
    position: absolute;
    inset: 50% 0 0 0;
    background-image: repeating-linear-gradient(
        110deg,
        rgba(175, 153, 255, 0.55) 0,
        rgba(175, 153, 255, 0.55) 6px,
        transparent 6px,
        transparent 16px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 100%);
    mix-blend-mode: soft-light;
    pointer-events: none;
    z-index: 0;
}

.top-bar-right .btn-primary:hover {
    background: linear-gradient(180deg, #ff9500 0%, #ffaa33 100%);
}

.top-bar-right .btn-primary:active {
    background: linear-gradient(180deg, #c97600 0%, #ff9400 100%);
    box-shadow: 0 1px 0 #ffae3d;
}

.chat-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #1b1e24;
    border: 1px solid #22262e;
    border-radius: 6px;
    color: #e6e7e7;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.chat-toggle-btn:hover {
    background: #262a33;
    border-color: #2e333d;
    color: #ffffff;
}

.chat-toggle-btn:active {
    background: #17191f;
    border-color: #2e333d;
}

.chat-toggle-active {
    border-color: var(--sgg-gold);
    background: var(--sgg-gold-soft);
    color: var(--sgg-gold);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    text-decoration: none;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
    padding: 0 0.5rem;
}

.logo:hover {
    opacity: 0.9;
}

.logo-img {
    height: 22px;
    width: auto;
    display: block;
}

.logo-icon {
    width: 36px;
    height: 36px;
}

.logo-switch {
    color: var(--sgg-text);
}

.logo-gg {
    color: var(--sgg-gold);
}

/* -- User Menu -- */
.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    color: #e5e5e5;
    transition: background 0.15s;
}

.user-trigger:hover {
    background: #1e1e2a;
}

.user-menu .avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-menu .user-name {
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu .chevron {
    transition: transform 0.15s;
}

.user-menu.open .chevron {
    transform: rotate(180deg);
}

.user-menu .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: var(--sgg-surface-2);
    border: 1px solid var(--sgg-border-strong);
    border-radius: 8px;
    padding: 0.25rem;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.user-menu.open .dropdown {
    display: block;
}

.user-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: #c8c8d0;
    text-align: left;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.user-menu .dropdown-item:hover {
    background: var(--sgg-surface-3);
    color: var(--sgg-text);
}

.user-menu .dropdown-divider {
    border: none;
    border-top: 1px solid var(--sgg-border-strong);
    margin: 0.25rem 0;
}

a {
    color: #7c5cfc;
    text-decoration: none;
}

a:hover {
    color: #9b82fc;
}

a.cashier-tab {
    color: rgba(230, 231, 231, 0.7);
    text-decoration: none;
}

a.cashier-tab:hover:not(.cashier-tab--active) {
    color: rgba(255, 255, 255, 0.7);
}

a.cashier-tab.cashier-tab--active {
    color: #fff;
}

/* -- Form Controls -- */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

input[type="text"]:not(.amodal-input):not(.wd-input),
input[type="email"]:not(.amodal-input),
input[type="password"]:not(.amodal-input) {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 6px;
    color: #e5e5e5;
    transition: border-color 0.15s;
}

input[type="text"]:not(.amodal-input):not(.wd-input):focus,
input[type="email"]:not(.amodal-input):focus,
input[type="password"]:not(.amodal-input):focus {
    outline: none;
    border-color: #7c5cfc;
    box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.25);
}

/* -- Buttons -- */
button {
    cursor: pointer;
    border: none;
    background: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background-color 0.15s, opacity 0.15s;
}

.btn-primary {
    background: #7c5cfc;
    color: #fff;
}

.btn-primary:hover {
    background: #6a4ae0;
}

.btn-ghost {
    background: transparent;
    color: #e5e5e5;
    border: 1px solid #2a2a3e;
}

.btn-ghost:hover {
    background: #1a1a2e;
}

/* -- Validation -- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #ff6b6b;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* -- Error Boundary -- */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

h1:focus {
    outline: none;
}

/* ══════════════════════════════════════════════════
   Bootstrap-compatible utilities for SSR Account pages.
   These replace Bootstrap so Identity scaffolded pages
   render correctly with the dark theme.
   ══════════════════════════════════════════════════ */

/* ── Layout / Grid ── */
.row { display: flex; flex-wrap: wrap; gap: 2rem; }
.col-lg-6, .col-lg-4 { flex: 1; min-width: 280px; }
.col-lg-offset-2 { margin-left: 0; }

/* ── Spacing ── */
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.ps-3 { padding-left: 1rem; }

/* ── Flex ── */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }

/* ── Sizing ── */
.w-100 { width: 100%; }

/* ── Form Controls (Bootstrap names) ── */
.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 6px;
    color: #e5e5e5;
    font: inherit;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #7c5cfc;
    box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.25);
}

.form-floating {
    position: relative;
}

.form-floating > .form-control {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > label {
    font-size: 0.75rem;
    color: #9898a6;
    position: absolute;
    top: 0.375rem;
    left: 0.75rem;
    pointer-events: none;
    transition: all 0.15s;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #c8c8d0;
    margin-bottom: 0.375rem;
}

.form-check-input {
    appearance: auto;
    margin-right: 0.5rem;
    accent-color: #7c5cfc;
}

/* ── Buttons (Bootstrap names) ── */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: #7c5cfc;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
}

.btn-link:hover {
    color: #9b82fc;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
}

/* ── Provably Fair Verifier (global — used inside child components) ── */
.pf-panel {
    background: #0e0e1a;
    border: 1px solid #2a2a3e;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
}

.pf-tagline {
    font-size: 0.82rem;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

.pf-howlink {
    font-size: 0.75rem;
    color: #555;
    margin: 0;
}

.pf-howlink a { color: #7c5cfc; text-decoration: none; }
.pf-howlink a:hover { text-decoration: underline; }

.pf-result {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.pf-result-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1rem;
}

.pf-result-header.pass {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.pf-result-header.fail {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.pf-icon { font-size: 1rem; }

.pf-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pf-step {
    background: #111120;
    border-radius: 8px;
    border-left: 3px solid #2a2a3e;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pf-step.step-pass { border-left-color: #10b981; }
.pf-step.step-fail { border-left-color: #ef4444; }
.pf-step.step-info { border-left-color: #7c5cfc; }

.pf-step-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #c8c8d0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pf-step-icon { font-size: 0.85rem; }

.pf-step-desc {
    font-size: 0.76rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.pf-step-desc code {
    background: #0a0a14;
    color: #818cf8;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-size: 0.72rem;
}

.pf-kv {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.pf-k {
    font-size: 0.7rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    min-width: 140px;
}

.pf-v {
    font-size: 0.73rem;
    color: #9898a6;
    word-break: break-all;
    background: #0a0a14;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.pf-dim { color: #333; }

.pf-match {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.match-ok  { color: #10b981; }
.match-fail { color: #ef4444; }

.pf-rerun {
    align-self: flex-start;
    margin-top: 0.25rem;
}

.pf-mine-grid {
    display: grid;
    grid-template-columns: repeat(5, 34px);
    gap: 4px;
    margin-top: 0.4rem;
}

.pf-tile {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
}

.pf-tile-mine {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-size: 0.9rem;
}

.pf-tile-safe {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    color: #4b5563;
}

/* ── Verify Modal ─────────────────────────────────────────────────────────── */
.pf-verify-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.pf-verify-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.val-match {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3) !important;
    background: rgba(16, 185, 129, 0.06) !important;
}

.val-mismatch {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3) !important;
    background: rgba(239, 68, 68, 0.06) !important;
}

/* ── Copy button ─────────────────────────────────────────────────────────── */
.pf-copyrow {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.pf-copyrow .pf-v,
.pf-copyrow .modal-seed-val {
    flex: 1;
    min-width: 0;
}

.copy-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid #2a2a3e;
    border-radius: 4px;
    color: #555;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.copy-btn:hover {
    color: #aaa;
    background: rgba(255,255,255,0.08);
    border-color: #3a3a54;
}

.copy-btn-done {
    color: #10b981 !important;
    border-color: rgba(16,185,129,0.4) !important;
    background: rgba(16,185,129,0.08) !important;
}

/* ── Custom scrollbars ───────────────────────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: #2a2a3e #0a0a14;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: #0a0a14;
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb {
    background: #2a2a3e;
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #3a3a54;
}

*::-webkit-scrollbar-corner {
    background: #0a0a14;
}

/* ── Verify Modal ─────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-panel {
    background: #12121e;
    border: 1px solid #252540;
    border-radius: 16px;
    width: 100%;
    max-width: 660px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(129,140,248,0.06);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #1c1c32;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(129,140,248,0.04) 0%, transparent 100%);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e5e5;
}

.modal-game-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: #a5b4fc;
    background: rgba(129, 140, 248, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.28);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.modal-close {
    background: none;
    border: 1px solid transparent;
    color: #444;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem 0.45rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.modal-close:hover {
    color: #ccc;
    background: #1e1e30;
    border-color: #2a2a3e;
}

.modal-body {
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.modal-bet-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    background: linear-gradient(135deg, #0e0e1c 0%, #111120 100%);
    border: 1px solid #1e1e32;
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-stat-label {
    font-size: 0.62rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.modal-stat-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d0d0e0;
}

.modal-seeds {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #0d0d1a;
    border: 1px solid #1c1c30;
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.modal-seed-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.modal-seed-label {
    font-size: 0.62rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.modal-seed-val {
    font-size: 0.74rem;
    color: #8888a8;
    word-break: break-all;
    background: #080812;
    border: 1px solid #1c1c2e;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    flex: 1;
    min-width: 0;
}

.modal-seed-locked {
    font-size: 0.78rem;
    color: #3a3a5a;
    font-style: italic;
}

.modal-seed-divider {
    height: 1px;
    background: #1e1e32;
    margin: 0.2rem 0;
}

.modal-seed-roll {
    color: #e5e5e5 !important;
    font-size: 0.82rem !important;
    font-weight: 600;
    background: #0f0f20 !important;
    border: 1px solid #2a2a44 !important;
}

.badge-win {
    display: inline-block;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.03em;
}

.badge-loss {
    display: inline-block;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.03em;
}

.val-win { color: #10b981; }
.val-loss { color: #ef4444; }

.modal-locked-msg {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #555;
    background: #0e0e18;
    border: 1px solid #1e1e30;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.modal-hint {
    font-size: 0.8rem;
    color: #555;
}

/* ── Verify result block ─────────────────────────────────────────────────── */
.pf-result {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pf-friendly-blurb {
    font-size: 0.8rem;
    color: #8888b0;
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

/* Verify manually — collapsible code snippet */
.pf-manual {
    width: 100%;
}

.pf-manual-toggle {
    font-size: 0.75rem;
    color: #555;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.pf-manual-toggle:hover {
    color: #888;
}

.pf-snippet-wrap {
    position: relative;
    margin-top: 0.5rem;
}

.pf-snippet-wrap .copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
}

.pf-snippet {
    background: #07070f;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    padding: 0.85rem 2.5rem 0.85rem 1rem;
    font-size: 0.72rem;
    color: #7c9afc;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Consolas', 'Fira Code', monospace;
    width: 100%;
}

/* Snippet reveal button */
.btn-verify-snippet {
    background: transparent;
    border: 1px solid #252540;
    color: #6666aa;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

/* ── Bet Table (global — used by BetHistory component) ── */
.bet-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bet-table-header,
.bet-card-main {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 1fr 1fr 70px 140px 80px;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
}

.bet-table-header {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    margin-bottom: 0.15rem;
}

.bet-table-header span {
    font-size: 0.65rem;
    font-weight: 700;
    color: #3e3e58;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.bet-table-header span:last-child { justify-self: end; }

.bet-card {
    background: #111120;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}

.bet-card:hover { border-color: #2a2a44; background: #13132a; }
.bet-card-win  { border-left: 3px solid rgba(16, 185, 129, 0.55); }
.bet-card-loss { border-left: 3px solid rgba(239, 68, 68, 0.35); }

.bet-card-main { padding-top: 0.6rem; padding-bottom: 0.6rem; }

.bet-col {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.bet-col-label { display: none; }

.bet-col-val {
    font-size: 0.84rem;
    color: #c8c8dc;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.val-win  { color: #10b981; }
.val-loss { color: #ef4444; }
.bet-game { justify-self: start; }

.bet-game-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a5b4fc;
    background: rgba(129, 140, 248, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 5px;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-win  { color: #10b981; font-weight: 700; font-size: 0.8rem; }
.badge-loss { color: #ef4444; font-weight: 700; font-size: 0.8rem; }

.bet-time { font-size: 0.78rem; color: #55557a; white-space: nowrap; }

.bet-col-verify { justify-self: end; }

.btn-verify {
    background: transparent;
    border: 1px solid #2a2a44;
    color: #7070a0;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-verify:hover { color: #a5b4fc; border-color: #4a4a70; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.page-info { font-size: 0.8rem; color: #555; }

.empty {
    color: #444;
    font-size: 0.9rem;
    padding: 2rem 0;
    text-align: center;
}

.error-msg {
    background: #2a1215;
    border: 1px solid #5a2a2e;
    color: #f87171;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-top: 1rem;
}

@media (max-width: 680px) {
    .bet-table-header { display: none; }

    .bet-card-main {
        grid-template-columns: 1fr 1fr;
        padding: 0.75rem 1rem;
        gap: 0.6rem 1.25rem;
    }

    .bet-col-label {
        display: block;
        font-size: 0.6rem;
        color: #44445a;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 600;
    }

    .bet-game { grid-column: 1 / -1; }

    .bet-col-verify {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .btn-verify { width: 100%; text-align: center; padding: 0.4rem; }
    .btn-share { width: 100%; text-align: center; padding: 0.4rem; }
}

.btn-verify-snippet:hover {
    color: #9999cc;
    border-color: #3a3a5e;
    background: rgba(129,140,248,0.05);
}

/* Snippet manual header */
.pf-manual-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

.pf-manual-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8888b0;
}

.pf-manual-hint {
    font-size: 0.72rem;
    color: #44445a;
}

.pf-manual-hint a {
    color: #6677cc;
    text-decoration: underline;
}

/* JS syntax highlight tokens */
.hl-kw  { color: #c792ea; }
.hl-str { color: #c3e88d; }
.hl-num { color: #f78c6c; }
.hl-cmt { color: #546e7a; font-style: italic; }
.hl-bi  { color: #82aaff; }

/* Verify button on bet cards */
.bet-col-verify {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    gap: 0.4rem;
}

.btn-verify {
    background: rgba(124, 92, 252, 0.1);
    border: 1px solid rgba(124, 92, 252, 0.25);
    color: #9b82fc;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.btn-verify:hover {
    background: rgba(124, 92, 252, 0.2);
    border-color: rgba(124, 92, 252, 0.45);
    color: #b49dff;
}

.btn-share {
    background: transparent;
    border: 1px solid #2a2a44;
    color: #7070a0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.btn-share:hover {
    color: #a5b4fc;
    border-color: #4a4a70;
}

/* ── Responsive modal ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .modal-panel {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .modal-bet-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}


.btn-danger:hover {
    background: #bb2d3b;
}

/* ── Text ── */
.text-danger { color: #ff6b6b; }
.text-secondary { color: #9898a6; }

/* ── Table ── */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #2a2a3e;
}

/* ── Shared game layout: controls left, game right ────────────────────────── */
.game-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
    width: 100%;
}

.game-layout-controls {
    min-width: 0;
}

.game-layout-main {
    min-width: 0;
}

/* Narrow screens: game on top, controls below */
@media (max-width: 720px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
    .game-layout-controls { order: 2; min-width: 0; }
    .game-layout-main     { order: 1; min-width: 0; }
}

/* Popout window: always single-column stacked */
.game-shell--popout .game-layout {
    grid-template-columns: 1fr;
}
.game-shell--popout .game-layout-controls { order: 2; }
.game-shell--popout .game-layout-main     { order: 1; }

/* ── Shared bet controls panel ───────────────────────────────────────────── */
.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bet-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.field-label {
    font-size: 0.8125rem;
    color: #9898a6;
    display: block;
}

/* Primary action (Bet / Sign in / Cash out) — full-width, same size on every original */
.bet-controls > .btn,
.bet-controls > .signin-btn,
.bet-controls > .crash-bet-active-actions,
.bet-controls > .crash-queued,
.bet-controls > .crash-cashed-out,
.bet-controls > .crash-lost {
    width: 100%;
    box-sizing: border-box;
    align-self: stretch;
}

.bet-controls > .btn,
.bet-controls > .signin-btn {
    min-height: 48px;
    padding: 0.875rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.bet-controls > .signin-btn {
    display: flex;
    height: auto;
}

/* Mobile / popout: action first so you can bet without scrolling past settings */
@media (max-width: 720px) {
    .bet-controls > .btn,
    .bet-controls > .signin-btn,
    .bet-controls > .crash-bet-active-actions,
    .bet-controls > .crash-queued,
    .bet-controls > .crash-cashed-out,
    .bet-controls > .crash-lost {
        order: -1;
        margin-top: 0;
    }
}

.game-shell--popout .bet-controls > .btn,
.game-shell--popout .bet-controls > .signin-btn,
.game-shell--popout .bet-controls > .crash-bet-active-actions,
.game-shell--popout .bet-controls > .crash-queued,
.game-shell--popout .bet-controls > .crash-cashed-out,
.game-shell--popout .bet-controls > .crash-lost {
    order: -1;
    margin-top: 0;
}

.double-bet-controls {
    max-width: 280px;
}

/* ── Theater mode: padding for all games ────────────────────────────────── */
.game-shell--theater .game-layout {
    padding: 0.75rem;
    gap: 0.75rem;
}

/* ── Theater mode: Mines — fill vertical space, grid centered ───────────── */
.game-shell--theater .mines-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.game-shell--theater .mines-page .game-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.game-shell--theater .mines-page .game-layout-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

/* ── Theater mode: HighRoll — fill vertical space, center slider ─────────── */
.game-shell--theater .highroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.game-shell--theater .highroll .game-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.game-shell--theater .highroll .game-layout-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.game-shell--theater .highroll .highroll-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Theater mode: Plinko — fill vertical space, board centered ──────────── */
.game-shell--theater .plinko-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.game-shell--theater .plinko-page .game-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.game-shell--theater .plinko-page .game-layout-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.game-shell--theater .plinko-page .plinko-board-wrap {
    flex: 1;
    min-height: 0;
    align-items: center;
}

.game-shell--theater .plinko-page .plinko-board {
    max-width: none;
    height: 100%;
    aspect-ratio: unset;
}

/* ── Theater mode: Crash chart fills vertical space ─────────────────────── */
.game-shell--theater .crash-game {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.game-shell--theater .crash-game .game-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.game-shell--theater .crash-game .game-layout-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.game-shell--theater .crash-game .crash-chart-wrap {
    flex: 1;
    min-height: 0;
    height: auto;
}

.table th {
    color: #9898a6;
    font-weight: 600;
    font-size: 0.8125rem;
}

/* ── Checkbox label ── */
.checkbox label, .form-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #c8c8d0;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ── Alerts ── */
[role="alert"] {
    color: #ff6b6b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* ── Horizontal rule ── */
hr {
    border: none;
    border-top: 1px solid #2a2a3e;
    margin: 1rem 0;
}

/* ── Navbar (SSR Account nav) ── */
.nav-link {
    color: #9898a6;
    padding: 0.5rem 0;
    display: block;
    text-decoration: none;
    font-size: 0.875rem;
}

.nav-link:hover {
    color: #e5e5e5;
}

.nav-link.active {
    color: #7c5cfc;
    font-weight: 600;
}

/* ── SSR page container ── */
.auth-section {
    max-width: 480px;
}


@keyframes switch-spin {
    0%   { transform: rotate(0deg); }
    40%  { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

.fairness-btn {
    font-size: 0.8rem;
    white-space: nowrap;
}

/* -- Auth flow pages (ResetPassword, ConfirmEmail, 2FA, Lockout, etc.) -- */
.auth-flow-page,
.confirm-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.auth-flow-card,
.confirm-card {
    position: relative;
    background: var(--sgg-surface);
    border: 1px solid var(--sgg-border);
    border-radius: 16px;
    padding: 2.25rem 1.75rem 1.85rem;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.auth-flow-card::before,
.confirm-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sgg-gold) 0%, var(--sgg-violet) 100%);
}

.auth-flow-brand {
    margin: 0;
    text-align: center;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--sgg-text);
}

.auth-flow-brand span {
    color: #7818FF;
}

.auth-flow-mark {
    width: 52px;
    height: 52px;
    margin: 0.15rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--sgg-violet-soft);
    border: 1px solid rgba(124, 92, 252, 0.35);
    color: var(--sgg-violet);
}

.auth-flow-mark--ok {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
    color: var(--sgg-green);
}

.auth-flow-mark--warn {
    background: var(--sgg-gold-soft);
    border-color: rgba(245, 166, 35, 0.35);
    color: var(--sgg-gold);
}

.auth-flow-icon {
    font-size: 2.25rem;
    text-align: center;
    line-height: 1;
}

.auth-flow-title,
.confirm-title {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    text-align: center;
    color: var(--sgg-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.auth-flow-sub,
.confirm-sub {
    font-size: 0.92rem;
    color: var(--sgg-text-muted);
    text-align: center;
    line-height: 1.6;
    margin: -0.35rem 0 0;
}

.auth-flow-sub strong,
.confirm-sub strong {
    color: var(--sgg-text);
    font-weight: 700;
}

.auth-flow-email-chip {
    display: block;
    margin: 0.15rem auto 0;
    padding: 0.35rem 0.75rem;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    background: var(--sgg-surface-2);
    border: 1px solid var(--sgg-border);
    color: var(--sgg-text);
    font-size: 0.82rem;
    word-break: break-all;
}

.auth-flow-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--sgg-text-muted);
    cursor: pointer;
}

.auth-flow-footer {
    font-size: 0.85rem;
    color: var(--sgg-text-dim);
    text-align: center;
    margin: 0;
}

.auth-flow-footer a,
.confirm-home {
    color: var(--sgg-violet);
    text-decoration: none;
}

.auth-flow-footer a:hover,
.confirm-home:hover {
    color: var(--sgg-gold);
}

.confirm-home {
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.25rem;
}

.auth-flow-devnote {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--sgg-violet-soft);
    border: 1px dashed var(--sgg-violet);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    color: var(--sgg-text-muted);
    width: 100%;
}

.auth-flow-devnote a {
    color: var(--sgg-violet);
    word-break: break-all;
}

/* Standalone amodal-* overrides for use outside AuthModal */
.auth-flow-card .amodal-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-flow-card .amodal-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sgg-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-flow-card .amodal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--sgg-surface-2);
    border: 1px solid var(--sgg-border);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.auth-flow-card .amodal-input-wrap:focus-within {
    border-color: var(--sgg-violet);
    box-shadow: 0 0 0 3px var(--sgg-violet-soft);
}

.auth-flow-card .amodal-input-wrap--locked,
.auth-flow-card .amodal-input-wrap--locked:focus-within {
    border-color: var(--sgg-border);
    box-shadow: none;
    background: #121218;
}

.auth-flow-card .amodal-icon {
    flex-shrink: 0;
    margin-left: 0.75rem;
    color: var(--sgg-text-dim);
    pointer-events: none;
}

.auth-flow-card .amodal-input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--sgg-text);
    font-size: 0.92rem;
    padding: 0.72rem 0.75rem;
    outline: none;
}

.auth-flow-card .amodal-input::placeholder {
    color: #3d3d4a;
}

.auth-flow-card .amodal-input:disabled,
.auth-flow-card .amodal-input[readonly] {
    color: var(--sgg-text-muted);
    cursor: default;
    opacity: 1;
}

.auth-flow-card .amodal-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.85rem;
    padding: 0.65rem 0.9rem;
}

.auth-flow-card .amodal-alert a {
    color: var(--sgg-gold);
}

.auth-flow-card .amodal-btn,
.auth-flow-card a.amodal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, #e28400 0%, #ffa11e 100%);
    border: 2px solid #d67d00;
    border-bottom: none;
    border-radius: 10px;
    box-shadow: 0 2px 0 #ffb956, 0 3px 0 #d67d00;
    color: #fff;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.78rem 1rem 0.88rem;
    cursor: pointer;
    transition: filter 0.15s, transform 0.08s;
    text-decoration: none;
}

.auth-flow-card .amodal-btn:hover:not(:disabled),
.auth-flow-card a.amodal-btn:hover {
    filter: brightness(1.06);
}

.auth-flow-card .amodal-btn:active:not(:disabled),
.auth-flow-card a.amodal-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #ffb956, 0 0 0 #d67d00;
}

.auth-flow-card .amodal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

.auth-flow-card .amodal-eye {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--sgg-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
}

.auth-flow-card .amodal-eye:hover {
    color: var(--sgg-text-muted);
}

.auth-flow-card .amodal-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: auto;
}

.auth-flow-card .pw-strength {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.auth-flow-card .pw-strength-bar {
    display: flex;
    gap: 3px;
    height: 4px;
}

.auth-flow-card .pw-strength-seg {
    flex: 1;
    border-radius: 99px;
    background: var(--sgg-border-strong);
    transition: background 0.25s;
}

.auth-flow-card .pw-strength-seg.filled-1 { background: var(--sgg-red); }
.auth-flow-card .pw-strength-seg.filled-2 { background: #f97316; }
.auth-flow-card .pw-strength-seg.filled-3 { background: #eab308; }
.auth-flow-card .pw-strength-seg.filled-4 { background: var(--sgg-green); }

.auth-flow-card .pw-strength-label {
    font-size: 0.72rem;
    color: var(--sgg-text-dim);
}

.auth-flow-card .pw-reqs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.15rem;
}

.auth-flow-card .pw-req {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--sgg-text-dim);
    transition: color 0.2s;
}

.auth-flow-card .pw-req.met {
    color: var(--sgg-green);
}

.auth-flow-card .pw-req-icon {
    font-size: 0.8rem;
    width: 1rem;
    text-align: center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Toast Notifications ──────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 2.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    pointer-events: none;
    width: min(420px, calc(100vw - 3rem));
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 2.1rem .75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--sgg-border, #23232e);
    background: var(--sgg-surface, #181818);
    box-shadow: none;
    pointer-events: all;
    overflow: hidden;
    will-change: transform, opacity;
}

/* Left accent stripe */
.toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--toast-accent, #7c5cfc);
}

/* Bottom progress bar */
.toast::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--toast-accent, #7c5cfc);
    opacity: .4;
    transform-origin: left center;
    animation: toast-progress 4s linear forwards;
}

.toast--exit::after { animation-play-state: paused; }

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0);   max-height: 140px; margin-bottom: .75rem; }
    to   { opacity: 0; transform: translateY(-8px); max-height: 0;    margin-bottom: 0;
           padding-top: 0; padding-bottom: 0; border-width: 0; }
}

.toast--enter {
    animation: toast-in .28s ease-out both;
}

.toast--exit {
    animation: toast-out .28s ease-out both;
}

.toast--error   { --toast-accent: var(--sgg-red, #ef4444); }
.toast--success { --toast-accent: var(--sgg-green, #4ade80); }
.toast--warning { --toast-accent: #f59e0b; }
.toast--info    { --toast-accent: var(--sgg-violet, #7c5cfc); }

.toast-message {
    flex: 1;
    font-size: .85rem;
    font-weight: 500;
    color: var(--sgg-text, #e8e8ee);
    line-height: 1.45;
}

.toast-close {
    position: absolute;
    top: .45rem;
    right: .45rem;
    background: transparent;
    border: none;
    color: var(--sgg-text-dim, #62626f);
    font-size: .75rem;
    line-height: 1;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, background-color .15s ease;
}

.toast-close:hover {
    color: var(--sgg-text, #e8e8ee);
    background: var(--sgg-surface-2, #16161c);
}


/* -- Custom Blazor unhandled-error UI --------------------------------------- */
#blazor-error-ui.sgg-error-ui {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 18, 0.72);
    backdrop-filter: blur(6px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#blazor-error-ui.sgg-error-ui[style*="display: block"],
#blazor-error-ui.sgg-error-ui[style*="display:block"] {
    display: flex !important;
}

.sgg-error-ui__card {
    background: linear-gradient(180deg, #1a1f2e 0%, #131826 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    padding: 28px 28px 22px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    color: #e6e9f2;
    font-family: 'Inter', sans-serif;
}

.sgg-error-ui__icon { font-size: 38px; margin-bottom: 8px; }
.sgg-error-ui__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.sgg-error-ui__text { font-size: 14px; color: #a8b0c2; margin-bottom: 20px; line-height: 1.45; }

.sgg-error-ui__actions { display: flex; gap: 10px; justify-content: center; }

.sgg-error-ui__btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 18px; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; text-decoration: none;
    transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.sgg-error-ui__btn:active { transform: translateY(1px); }

.sgg-error-ui__btn--primary {
    background: linear-gradient(180deg, #2dd4bf 0%, #14b8a6 100%);
    color: #06231f;
}
.sgg-error-ui__btn--primary:hover { filter: brightness(1.06); }

.sgg-error-ui__btn--ghost {
    background: transparent;
    color: #cbd2e0;
    border-color: rgba(255,255,255,0.12);
}
.sgg-error-ui__btn--ghost:hover { background: rgba(255,255,255,0.04); }

/* -- Full-screen app loading overlay -- */
.sgg-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: #0B0D11;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.sgg-loading-overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

.sgg-loading-overlay__logo {
    height: 48px;
    width: auto;
    animation: sgg-loading-pulse 1.6s ease-in-out infinite;
}

.sgg-loading-overlay__text {
    font-family: 'Barlow Semi Condensed', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #a8b0c2;
    text-align: center;
    min-height: 18px;
}

.sgg-loading-overlay__bar {
    width: 180px;
    height: 4px;
    border-radius: 2px;
    background: #2A2D3D;
    overflow: hidden;
}

.sgg-loading-overlay__bar-fill {
    height: 100%;
    width: 0%;
    background: #4ade80;
    border-radius: 2px;
    transition: width 1.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes sgg-loading-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(0.96); }
}

/* -- Mobile layout: bottom navigation bar -- */
@media (max-width: 720px) {
    .app-body {
        flex-direction: column;
    }

    /* Sidebar becomes a full-screen slide-up overlay, opened via the mobile Menu button.
       Sits below the top bar and above the bottom nav so both stay visible/usable. */
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 64px;
        width: 100% !important;
        height: auto;
        flex-direction: column;
        border-right: none;
        z-index: 40;
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .sidebar.mobile-open {
        transform: translateY(0);
    }

    .sidebar-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 8px 1px 16px;
        gap: 8px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* The game/page list has grown too tall for a single vertical list on
       phones (that's what was "overflowing" — the menu sheet needed a lot of
       scrolling to reach the bottom items). A compact icon grid keeps every
       option reachable at a glance in a fraction of the height, similar to
       the app-menu pattern used by most mobile casino/gambling apps. */
    .sidebar-group {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .sidebar-section-title {
        grid-column: 1 / -1;
    }

    .sidebar .nav-item {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        height: auto;
        min-height: 76px;
        padding: 10px 6px;
        text-align: center;
        border-left: none;
        border-bottom: 2px solid transparent;
        background: rgba(255, 255, 255, 0.02);
    }

    /* Thin column dividers between adjacent tiles (skipped at the start of
       each row so the group's outer border stays clean). The section title
       is the grid's first child, so the first tile in each row is the 2nd,
       5th, 8th… child overall. */
    .sidebar .nav-item:not(:nth-child(3n+2)) {
        border-left: 1px solid var(--sgg-border);
    }

    /* Row dividers — every tile from the second row onward (the first row
       sits directly under the section title, which already has its own
       bottom border). */
    .sidebar .nav-item:nth-child(n+5) {
        border-top: 1px solid var(--sgg-border);
    }

    .sidebar .nav-item .nav-icon {
        width: 22px;
        height: 22px;
    }

    .sidebar .nav-item .sidebar-label {
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        white-space: normal;
    }

    .sidebar .nav-item:hover {
        border-bottom-color: #7818ff;
        background: rgba(120, 24, 255, 0.08);
    }

    .sidebar .nav-item.active {
        background: rgba(120, 24, 255, 0.16);
        border-bottom-color: #7818ff;
        animation: none;
    }

    .main-area {
        padding-bottom: 64px;
    }

    .content-area,
    .content-with-chat .content-area {
        width: 100% !important;
        height: 100% !important;
        padding: 1.25rem 1rem;
    }

    .sidebar-toggle-btn {
        display: none;
    }

    /* Fixed bottom nav: Menu + Chat (more to come) */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 64px;
        background: var(--sgg-surface);
        border-top: 1px solid var(--sgg-border);
        z-index: 70;
    }

    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--sgg-text-muted);
        font-family: 'Barlow Semi Condensed', 'Inter', sans-serif;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        cursor: pointer;
        position: relative;
    }

    .mobile-nav-btn + .mobile-nav-btn::before {
        content: "";
        position: absolute;
        left: 0;
        top: 12px;
        bottom: 12px;
        width: 1px;
        background: var(--sgg-border);
    }

    .mobile-nav-btn.active {
        color: var(--sgg-gold);
    }

    /* -- Top bar: mobile layout (logo left, auth/wallet right) -- */
    .top-bar {
        padding: 0 0.85rem;
        height: 60px;
        position: relative;
        z-index: 70;
    }

    .top-bar-left {
        gap: 0.5rem;
    }

    .chat-toggle-btn {
        display: none;
    }

    .top-bar-identity {
        display: none;
    }
}

@media (min-width: 721px) {
    .mobile-bottom-nav {
        display: none;
    }
}

/* Mobile-only Profile/Account sidebar entries — desktop already has these
   in the UserMenu dropdown in the top bar. */
.sidebar-group--mobile-account {
    display: none;
}

@media (max-width: 720px) {
    .sidebar-group--mobile-account {
        display: grid;
    }

    /* Hide the username text in the top bar on phones; Profile/Account are
       reachable via the mobile Menu instead. */
    .user-menu .user-name {
        display: none;
    }
}
