/* ============================================
   Bustabyte - Crash Game
   Redesigned with purple-tinted dark theme
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Purple-tinted dark palette */
    --bg-primary: #100F1A;
    --bg-secondary: #181726;
    --bg-tertiary: #221F38;
    --bg-card: #1D1A30;
    --bg-elevated: #252240;
    --border: #33305A;
    --border-subtle: #272444;

    /* Text */
    --text-primary: #F0EEF8;
    --text-secondary: #ABA7C8;
    --text-muted: #7B76A0;

    /* Accent — purple primary */
    --accent: #A67CFF;
    --accent-dark: #8B62E0;
    --accent-glow: rgba(166, 124, 255, 0.25);
    --accent-subtle: rgba(166, 124, 255, 0.08);

    /* Functional */
    --green: #5EE0A0;
    --green-dark: #46C888;
    --green-glow: rgba(94, 224, 160, 0.25);
    --green-subtle: rgba(94, 224, 160, 0.08);
    --red: #FF5C6A;
    --red-dark: #E0444F;
    --red-glow: rgba(255, 92, 106, 0.25);
    --red-subtle: rgba(255, 92, 106, 0.08);
    --orange: #FFAD42;
    --orange-glow: rgba(255, 173, 66, 0.25);
    --orange-subtle: rgba(255, 173, 66, 0.08);

    /* Type */
    --font-display: 'Outfit', 'Inter', sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows — tinted to match background */
    --shadow-sm: 0 2px 8px rgba(12, 11, 20, 0.5);
    --shadow: 0 8px 32px rgba(12, 11, 20, 0.6);
    --shadow-lg: 0 16px 48px rgba(12, 11, 20, 0.7);
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Number input spinners --- */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* --- Noise overlay for texture --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* --- Header --- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    z-index: 50;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.header-logo img {
    height: 28px;
    width: auto;
}

.header-logo span {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.balance-group {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
}

.balance-group:hover {
    opacity: 0.85;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--green-subtle);
    border: 1px solid rgba(94, 224, 160, 0.15);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    font-variant-numeric: tabular-nums;
}

.balance-display .bytes-icon {
    font-size: 11px;
    opacity: 0.6;
}

.balance-display.hf-balance {
    background: var(--accent-subtle);
    border-color: rgba(166, 124, 255, 0.15);
    color: var(--accent);
}

.balance-display .hf-icon {
    font-size: 9px;
    font-weight: 800;
    opacity: 0.7;
    letter-spacing: -0.5px;
}

/* --- User Avatar Menu --- */
.user-avatar-menu {
    position: relative;
}

.user-avatar-btn {
    cursor: pointer;
    padding: 2px;
    transition: transform 0.15s;
}

.user-avatar-btn:hover { transform: scale(1.08); }
.user-avatar-btn:active { transform: scale(0.95); }

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    user-select: none;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.user-avatar-menu:hover .user-avatar-circle {
    border-color: var(--accent);
}

.user-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(166, 124, 255, 0.06);
    z-index: 200;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.user-avatar-menu:hover .user-avatar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Profile header */
.user-dd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.user-dd-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.user-dd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dd-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.user-dd-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.user-dd-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

a.user-dd-name:hover {
    color: var(--accent);
}

.user-dd-uid {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.15s, opacity 0.15s;
}

a.user-dd-uid:hover {
    color: var(--accent);
    opacity: 1;
}

.user-dd-member {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.8;
}

/* Stats grid */
.user-dd-stats {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.user-dd-stats-shimmer {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-dd-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-dd-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.user-dd-stat-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.user-dd-stat-value.s-positive { color: var(--green); }
.user-dd-stat-value.s-negative { color: var(--red); }

/* Shimmer animation */
.loading-shimmer {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-subtle) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Links */
.user-dd-links {
    padding: 6px 0;
}

.user-dd-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.user-dd-links a:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

.user-dd-links a.admin-link {
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
}

.user-dd-links a.admin-link svg {
    opacity: 0.9;
}

.user-dd-links a.admin-link:hover {
    background: rgba(166, 124, 255, 0.15);
}

.user-dd-links a svg {
    opacity: 0.6;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.user-dd-links a:hover svg {
    opacity: 1;
}

/* Footer (logout) */
.user-dd-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 4px 0;
}

.user-dd-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.user-dd-footer a svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.user-dd-footer a.danger:hover {
    background: var(--red-subtle);
    color: var(--red);
}

.user-dd-footer a.danger:hover svg {
    opacity: 1;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 0 24px var(--accent-glow);
}

.login-btn:active {
    transform: scale(0.97);
}

/* --- Announcement Banner --- */
.announcement-bar {
    background: linear-gradient(90deg, rgba(166, 124, 255, 0.1) 0%, rgba(139, 98, 224, 0.06) 100%);
    border-bottom: 1px solid rgba(166, 124, 255, 0.15);
    padding: 10px 24px;
    position: relative;
    overflow: hidden;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

.announcement-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    max-width: 800px;
    margin: 0 auto;
}

.announcement-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

/* --- Main Layout --- */
.main-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    height: calc(100dvh - 56px);
    max-width: 100vw;
    overflow: hidden;
}

/* --- Chart Panel --- */
.chart-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    overflow: hidden;
    min-width: 0;
    background: var(--bg-primary);
    position: relative;
}

.chart-container {
    flex: 1;
    position: relative;
    min-height: 280px;
    background: radial-gradient(ellipse at 50% 80%, rgba(166, 124, 255, 0.04) 0%, transparent 60%);
    overflow: hidden;
}

.chart-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 550px;
    height: 550px;
    background: url('/assets/images/logos/bustabyte-logo-white.svg') no-repeat center / contain;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.chart-container canvas {
    position: absolute;
    top: -14px;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    display: block;
}

.chart-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.multiplier-display {
    font-family: var(--font-mono);
    font-size: 80px;
    font-weight: 800;
    letter-spacing: -4px;
    line-height: 1;
    transition: color 0.2s, text-shadow 0.2s;
}

.multiplier-display.phase-betting {
    color: var(--accent);
    text-shadow: 0 0 60px var(--accent-glow);
}

.multiplier-display.phase-running {
    color: var(--green);
    text-shadow: 0 0 60px var(--green-glow), 0 0 120px rgba(94, 224, 160, 0.1);
}

.multiplier-display.phase-crashed {
    color: var(--red);
    text-shadow: 0 0 60px var(--red-glow);
}

.phase-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 12px;
    color: var(--text-muted);
}

.phase-label.betting {
    color: var(--accent);
}

/* --- History Bar --- */
.history-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}

.history-bar::-webkit-scrollbar { display: none; }

/* House edge badge */
.house-edge-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: absolute;
    bottom: 46px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(16, 15, 26, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    z-index: 5;
}

.house-edge-badge:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.house-edge-badge svg {
    opacity: 0.5;
}

/* Styled tooltip */
.house-edge-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    pointer-events: none;
    cursor: default;
    letter-spacing: 0;
}

/* Invisible bridge between badge and tooltip to maintain hover */
.house-edge-tooltip::before {
    content: '';
    position: absolute;
    bottom: -14px;
    right: 0;
    width: 100%;
    height: 14px;
}

.house-edge-badge:hover .house-edge-tooltip,
.house-edge-tooltip:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.house-edge-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 10px;
    height: 10px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
}

.house-edge-tooltip-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.house-edge-tooltip-desc {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 10px;
}

.house-edge-tooltip-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

.house-edge-tooltip-link:hover {
    opacity: 0.8;
}

.history-chip {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-variant-numeric: tabular-nums;
}

.history-chip:hover {
    transform: translateY(-1px);
}

.history-chip.green {
    background: var(--green-subtle);
    color: var(--green);
}

.history-chip.red {
    background: var(--red-subtle);
    color: var(--red);
}

.history-chip.orange {
    background: var(--orange-subtle);
    color: var(--orange);
}

/* --- Right Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

/* --- Bet Controls --- */
.bet-controls {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.bet-controls h3 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.input-group {
    margin-bottom: 10px;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.input-row {
    display: flex;
    gap: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.quick-btn {
    padding: 7px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
}

.quick-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.quick-btn:active {
    transform: scale(0.95);
}

.quick-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-subtle);
    pointer-events: none;
}

.bet-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
    position: relative;
    overflow: hidden;
}

.bet-btn.place-bet {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--bg-primary);
}

.bet-btn.place-bet:hover {
    box-shadow: 0 4px 24px var(--green-glow);
    transform: translateY(-1px);
}

.bet-btn.place-bet:active {
    transform: translateY(0);
}

.bet-btn.place-bet:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.bet-btn.cashout {
    background: linear-gradient(135deg, var(--orange) 0%, #E89830 100%);
    color: var(--bg-primary);
    animation: cashout-pulse 1.5s ease-in-out infinite;
}

.bet-btn.cashout:hover {
    box-shadow: 0 4px 24px var(--orange-glow);
    transform: translateY(-1px);
}

@keyframes cashout-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 173, 66, 0.15); }
    50% { box-shadow: 0 0 28px rgba(255, 173, 66, 0.35); }
}

.bet-btn.waiting {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.bet-info {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    display: none;
}

.bet-info.visible {
    display: block;
}

.bet-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
}

.bet-info-row .label {
    color: var(--text-muted);
}

.bet-info-row .value {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bet-info-row .value.profit {
    color: var(--green);
}

/* --- Auto-Bet / Autoplay --- */
.autoplay-section {
    margin-top: 10px;
}

/* Toggle button */
.autoplay-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: all 0.2s;
}

.autoplay-toggle:hover {
    color: var(--text-secondary);
    border-color: var(--border);
}

.autoplay-toggle.open {
    color: var(--accent);
    border-color: rgba(166, 124, 255, 0.2);
    background: var(--accent-subtle);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom-color: transparent;
}

.autoplay-toggle svg:first-child { flex-shrink: 0; opacity: 0.5; }
.autoplay-toggle.open svg:first-child { opacity: 1; }

.ap-chevron {
    margin-left: auto;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.4;
}

.autoplay-toggle.open .ap-chevron {
    transform: rotate(180deg);
    opacity: 0.7;
}

/* Status badge */
.autoplay-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    background: var(--green-subtle);
    color: var(--green);
    display: none;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.autoplay-status.active { display: inline-block; }

/* Collapsible panel */
.autoplay-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.autoplay-panel.open { max-height: 500px; }

.ap-inner {
    padding: 10px;
    background: rgba(166, 124, 255, 0.03);
    border: 1px solid rgba(166, 124, 255, 0.12);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Shared field styles */
.ap-field label, .ap-strat-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ap-field input[type="number"],
.ap-stop-input {
    width: 100%;
    padding: 7px 9px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ap-field input[type="number"]:focus,
.ap-stop-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.ap-field input:disabled,
.ap-stop-input:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* 3-column row: Bet | Cashout | Rounds */
.ap-row-3 {
    display: grid;
    grid-template-columns: 1fr 0.8fr 0.8fr;
    gap: 6px;
}

.ap-field-grow { grid-column: auto; }

/* Suffix inside input */
.ap-input-suffix { position: relative; }
.ap-input-suffix input { padding-right: 22px; }

.ap-suffix {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
    font-family: var(--font-mono);
    opacity: 0.5;
}

/* Rounds infinity toggle */
.ap-rounds-row { display: flex; gap: 3px; }
.ap-rounds-row input { flex: 1; min-width: 0; }

.ap-inf-btn {
    width: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.ap-inf-btn:hover { border-color: var(--accent); color: var(--accent); }

.ap-inf-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* Strategy rows: label + buttons inline */
.ap-strat-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-strat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    width: 30px;
    flex-shrink: 0;
    text-align: right;
    letter-spacing: 0.2px;
}

.ap-strategy-row {
    display: flex;
    gap: 3px;
    align-items: center;
    flex: 1;
}

.ap-strat-btn {
    padding: 5px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ap-strat-btn:hover { border-color: var(--accent); color: var(--text-secondary); }

.ap-strat-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.ap-pct-wrap { position: relative; flex-shrink: 0; }

.ap-pct-input {
    width: 50px !important;
    text-align: center;
    padding-right: 18px !important;
    font-size: 11px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 5px !important;
    font-family: var(--font-mono) !important;
}

.ap-pct-sign {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
    font-family: var(--font-mono);
    opacity: 0.5;
}

/* Separator */
.ap-sep {
    height: 1px;
    background: var(--border-subtle);
    margin: 0;
}

/* Stop conditions: tight inline rows */
.ap-stop-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-stop-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.ap-stop-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 12px;
    height: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.ap-stop-input {
    width: 80px !important;
    flex-shrink: 0;
    text-align: right;
    font-size: 11px !important;
    padding: 5px 7px !important;
}

/* Start / Stop button */
.ap-start-btn {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 2px;
    transition: all 0.2s;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.ap-start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.ap-start-btn:hover::before { transform: translateX(100%); }
.ap-start-btn:hover { box-shadow: 0 3px 16px var(--accent-glow); transform: translateY(-1px); }
.ap-start-btn:active { transform: translateY(0); }

.ap-start-btn.stop {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
}

.ap-start-btn.stop:hover { box-shadow: 0 3px 16px var(--red-glow); }
.ap-start-btn.stop::before { display: none; }

.ap-start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.ap-start-btn:disabled::before { display: none; }

/* Autoplay-active bet button */
.bet-btn.waiting.autoplay-active {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(166, 124, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.bet-btn.waiting.autoplay-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 30%;
    background: var(--accent);
    border-radius: 1px;
    animation: ap-progress 1.8s ease-in-out infinite;
}

@keyframes ap-progress {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* --- Players List --- */
.players-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.players-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.players-header h3 {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.player-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.players-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.player-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 7px 20px;
    font-size: 13px;
    transition: background 0.15s;
}

.player-row:hover {
    background: rgba(166, 124, 255, 0.03);
}

.player-name {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.15s;
}

a.player-name:hover {
    color: var(--accent);
}

.player-bet {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.player-cashout {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.player-cashout.won { color: var(--green); }
.player-cashout.playing { color: var(--text-muted); }
.player-cashout.lost { color: var(--red); }

/* --- Bottom Tabs --- */
.bottom-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    height: 260px;
    display: flex;
    flex-direction: column;
}

.tab-nav {
    display: flex;
    gap: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 8px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-display);
}

.tab-btn svg {
    opacity: 0.4;
    transition: opacity 0.2s;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn:hover svg {
    opacity: 0.6;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-btn.active svg {
    opacity: 1;
    stroke: var(--accent);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.tab-content.active {
    display: block;
}

/* My bets totals */
.mybets-totals {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Fairness tab */
.fairness-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 0;
    height: 100%;
}

.fairness-main {
    padding: 14px 20px;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.fairness-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.fairness-shield {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--accent-subtle);
    border: 1px solid rgba(166, 124, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.fairness-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.fairness-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Pipeline visualisation */
.fairness-pipeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    flex: 1;
}

.fp-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 8px;
    opacity: 0;
    transform: translateY(8px);
    animation: fp-stage-in 0.5s ease forwards;
}

.fp-stage-1 { animation-delay: 0.1s; }
.fp-stage-2 { animation-delay: 0.4s; }
.fp-stage-3 { animation-delay: 0.7s; }

@keyframes fp-stage-in {
    to { opacity: 1; transform: translateY(0); }
}

.fp-icon-wrap {
    position: relative;
    margin-bottom: 8px;
}

.fp-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: all 0.3s;
}

.fp-stage-1 .fp-icon {
    background: rgba(166, 124, 255, 0.1);
    border: 2px solid rgba(166, 124, 255, 0.25);
    color: var(--accent);
}

.fp-stage-2 .fp-icon {
    background: rgba(255, 173, 66, 0.1);
    border: 2px solid rgba(255, 173, 66, 0.25);
    color: var(--orange);
}

.fp-stage-3 .fp-icon {
    background: rgba(94, 224, 160, 0.1);
    border: 2px solid rgba(94, 224, 160, 0.25);
    color: var(--green);
}

.fp-pulse-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid transparent;
    animation: fp-pulse 3s ease-in-out infinite;
    z-index: 1;
}

.fp-stage-1 .fp-pulse-ring { animation-delay: 0s; border-color: rgba(166, 124, 255, 0.15); }
.fp-stage-2 .fp-pulse-ring { animation-delay: 1s; border-color: rgba(255, 173, 66, 0.15); }
.fp-stage-3 .fp-pulse-ring { animation-delay: 2s; border-color: rgba(94, 224, 160, 0.15); }

@keyframes fp-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0; }
}

.fp-label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.fp-detail {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 160px;
}

/* Connector between stages */
.fp-connector {
    display: flex;
    align-items: center;
    margin-top: 20px;
    flex: 1;
    min-width: 40px;
    position: relative;
}

.fp-connector-line {
    width: 100%;
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.fp-connector-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: fp-flow 2.5s linear infinite;
}

@keyframes fp-flow {
    0% { left: -60%; }
    100% { left: 100%; }
}

.fp-connector-dot {
    position: absolute;
    right: -2px;
    top: 50%;
    margin-top: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
    opacity: 0;
    animation: fp-dot-pulse 2.5s ease-in-out infinite;
}

@keyframes fp-dot-pulse {
    0%, 40% { opacity: 0; }
    50% { opacity: 1; }
    60%, 100% { opacity: 0; }
}

@media (max-width: 700px) {
    .fairness-pipeline {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .fp-stage {
        flex-direction: row;
        text-align: left;
        gap: 10px;
        padding: 0;
    }
    .fp-connector { display: none; }
    .fp-detail { max-width: none; }
    .fp-icon-wrap { margin-bottom: 0; }
}

.fairness-side {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-primary);
}

.fairness-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fairness-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.fairness-stat-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.fairness-hash-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fairness-hash {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    word-break: break-all;
    line-height: 1.4;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    user-select: all;
}

.fairness-limits {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.fairness-verify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-display);
    border-radius: var(--radius);
    transition: all 0.2s;
    margin-top: auto;
}

.fairness-verify-btn:hover {
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

@media (max-width: 700px) {
    .fairness-layout {
        grid-template-columns: 1fr;
    }
    .fairness-main {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

/* --- Data Table --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    position: sticky;
    top: 0;
    padding: 8px 16px;
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
}

.data-table td {
    padding: 7px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td.hash-col {
    white-space: normal;
    word-break: break-all;
}

#tab-history .data-table {
    table-layout: fixed;
}

#tab-history .data-table td {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tr:hover td {
    background: rgba(166, 124, 255, 0.03);
}

/* --- Footer --- */
.site-footer {
    padding: 10px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.footer-left {
    flex: 1;
}

.footer-center {
    flex-shrink: 0;
}

.footer-right {
    flex: 1;
    justify-content: flex-end;
}

.footer-left a,
.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.footer-left a:hover,
.footer-right a:hover {
    color: var(--accent);
}

@media (max-width: 640px) {
    .site-footer {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 12px 16px;
    }
    .footer-left,
    .footer-right {
        flex: none;
    }
    .footer-center {
        order: -2;
    }
    .footer-right {
        order: -1;
    }
    .footer-left {
        order: 1;
    }
    .footer-left a {
        opacity: 0.4;
    }
}

@media (max-width: 480px) {
    .header { padding: 0 12px; }
    .header-logo span { display: none; }
}

.footer-sep {
    color: var(--border);
}

/* --- Profile Page --- */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 32px 60px;
}

/* Hero card (full width) */
.profile-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.profile-card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--bg-elevated) 50%, var(--bg-secondary) 100%);
    opacity: 0.3;
}

.profile-card-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px 36px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(166, 124, 255, 0.3);
}

.profile-info {
    min-width: 0;
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.profile-username {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.profile-you-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid rgba(166, 124, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.profile-dot {
    opacity: 0.4;
}

.profile-hf-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    transition: opacity 0.15s;
}

.profile-hf-link:hover {
    opacity: 0.8;
}

.profile-joined {
    opacity: 0.7;
}

/* Hero profit (right side of card) */
.profile-hero-profit {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.profile-hero-profit-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.profile-hero-profit-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Two-column layout */
.profile-columns {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

.profile-sidebar {
    position: sticky;
    top: 24px;
}

/* Stats grid (sidebar: 2 columns) */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.profile-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.profile-stat-card:hover {
    border-color: var(--border);
}

.profile-stat-card.profile-stat-highlight {
    border-color: rgba(94, 224, 160, 0.12);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(94, 224, 160, 0.03));
}

.profile-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.profile-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* HF Wallet card (own profile only) */
.profile-wallet-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.profile-wallet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
    opacity: 0.8;
}

.profile-wallet-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Win/Loss bar */
.profile-winloss {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 18px;
}

.profile-wl-header {
    margin-bottom: 10px;
}

.profile-wl-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    gap: 2px;
}

.profile-wl-fill.win {
    background: var(--green);
    border-radius: 4px 0 0 4px;
    min-width: 4px;
}

.profile-wl-fill.loss {
    background: var(--red);
    border-radius: 0 4px 4px 0;
    min-width: 4px;
}

.profile-wl-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Section */
.profile-section {
    margin-bottom: 32px;
}

.profile-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.profile-section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-section-count {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Empty state */
.profile-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    font-size: 14px;
    background: var(--bg-secondary);
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
}

/* Bet rows */
.profile-bets-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-bet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    transition: border-color 0.15s;
}

.profile-bet-row:hover {
    border-color: var(--border);
}

.profile-bet-row.win {
    border-left: 3px solid var(--green);
}

.profile-bet-row.loss {
    border-left: 3px solid var(--red);
}

.profile-bet-game {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 100px;
}

.profile-bet-game-id {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-bet-time {
    font-size: 10px;
    color: var(--text-muted);
}

.profile-bet-details {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.profile-bet-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-bet-arrow {
    display: flex;
    align-items: center;
}

.profile-bet-cashout {
    font-size: 13px;
    font-weight: 600;
}

.profile-bet-crash {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

.profile-bet-profit {
    font-size: 14px;
    min-width: 110px;
    text-align: right;
}

/* Tablet: single column, stats go 3-across */
@media (max-width: 960px) {
    .profile-columns {
        grid-template-columns: 1fr;
    }
    .profile-sidebar {
        position: static;
    }
    .profile-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .profile-container {
        padding: 24px 24px 48px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-username {
        font-size: 20px;
    }
    .profile-container {
        padding: 16px 14px 40px;
    }
    .profile-card-content {
        flex-wrap: wrap;
        padding: 20px;
        gap: 14px;
    }
    .profile-hero-profit {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-top: 12px;
        border-top: 1px solid var(--border-subtle);
        margin-left: 0;
    }
    .profile-hero-profit-value {
        font-size: 18px;
    }
    .profile-avatar {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }
    .profile-bet-crash {
        display: none;
    }
    .profile-bet-profit {
        min-width: 80px;
    }
    .profile-bet-game {
        min-width: 70px;
    }
}

/* --- Hash Column --- */
.hash-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.hash-link:hover {
    color: var(--accent);
    background: var(--accent-subtle);
}

.hash-link svg {
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.hash-link:hover svg {
    opacity: 1;
}

.hash-text {
    letter-spacing: -0.3px;
}

@media (max-width: 900px) {
    .hash-col { display: none; }
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 11, 20, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 420px;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 22px;
}

.modal-body .input-group {
    margin-bottom: 16px;
}

.modal-body .input-group input {
    font-size: 16px;
    padding: 12px 14px;
}

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-display);
    transition: all 0.2s;
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
}

.modal-btn.primary:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.modal-btn.primary:active {
    transform: translateY(0);
}

.modal-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.modal-btn.secondary:hover {
    border-color: var(--text-muted);
}

.modal-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* --- Balance Modal --- */
.bal-modal {
    max-width: 440px;
}

.bal-overview {
    display: flex;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.bal-account {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    transition: border-color 0.15s, background 0.15s;
}

.bal-account:hover {
    border-color: var(--border);
    background: rgba(166, 124, 255, 0.02);
}

.bal-account-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.bal-account-icon.bal-bb {
    background: var(--green-subtle);
    border: 1px solid rgba(94, 224, 160, 0.15);
    color: var(--green);
}

.bal-account-icon.bal-hf {
    background: var(--accent-subtle);
    border: 1px solid rgba(166, 124, 255, 0.15);
    color: var(--accent);
    font-size: 10px;
    letter-spacing: -0.5px;
}

.bal-account-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.bal-account-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.bal-account-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Tabs */
.bal-tabs {
    display: flex;
    padding: 0 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.bal-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.bal-tab:hover {
    color: var(--text-secondary);
}

.bal-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.bal-tab svg {
    opacity: 0.6;
}

.bal-tab.active svg {
    opacity: 1;
}

/* Panes */
.bal-pane {
    display: none;
    padding: 22px;
}

.bal-pane.active {
    display: block;
}

/* Direction indicator */
.bal-direction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.bal-dir-from,
.bal-dir-to {
    padding: 5px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.bal-dir-to {
    color: var(--text-primary);
}

.bal-direction svg {
    color: var(--accent);
    opacity: 0.6;
}

/* Amount input */
.bal-input-wrap {
    position: relative;
    margin-bottom: 10px;
}

.bal-input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}

.bal-input {
    width: 100%;
    padding: 16px 16px 16px 38px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color 0.2s;
}

.bal-input:focus {
    border-color: var(--accent);
}

.bal-input::placeholder {
    color: var(--border);
}

/* Quick amounts */
.bal-quick-amounts {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.bal-quick {
    flex: 1;
    padding: 7px 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
}

.bal-quick:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.bal-quick-max {
    font-family: var(--font-sans);
    color: var(--green);
}

.bal-quick-max:hover {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-subtle);
}

/* Available balance */
.bal-withdraw-avail {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    text-align: center;
}

/* Submit buttons */
.bal-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.bal-submit-deposit {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: #0a1421;
}

.bal-submit-deposit:hover {
    box-shadow: 0 4px 20px var(--green-glow);
    transform: translateY(-1px);
}

.bal-submit-withdraw {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
}

.bal-submit-withdraw:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.bal-submit:active {
    transform: translateY(0);
}

.bal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.bal-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bal-spin 0.6s linear infinite;
}

@keyframes bal-spin {
    to { transform: rotate(360deg); }
}

/* Success toast inside modal */
.bal-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--green-subtle);
    border: 1px solid rgba(94, 224, 160, 0.2);
    border-radius: 10px;
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    animation: bal-success-in 0.3s ease;
}

@keyframes bal-success-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Balance Progress Steps --- */
.bal-progress {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    animation: bal-progress-in 0.2s ease;
}

@keyframes bal-progress-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bal-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.bal-progress-step.active {
    color: var(--text-primary);
    font-weight: 600;
}

.bal-progress-step.done {
    color: var(--green);
}

.bal-progress-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bal-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
}

.bal-spinner-sm {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: bal-spin 0.6s linear infinite;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 13px;
    max-width: 320px;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* --- Error Pages --- */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 56px - 37px);
    text-align: center;
    padding: 40px 24px;
}

.error-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--accent-subtle);
    border: 1px solid rgba(166, 124, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 24px;
}

.error-code {
    font-family: var(--font-mono);
    font-size: 64px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -3px;
    line-height: 1;
    margin-bottom: 8px;
}

.error-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.error-message {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.error-actions {
    display: flex;
    gap: 10px;
}

.error-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
    text-decoration: none;
    transition: all 0.2s;
}

.error-btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.error-btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-display);
    text-decoration: none;
    transition: all 0.15s;
}

.error-btn-secondary:hover {
    border-color: var(--text-muted);
}

/* --- Landing Page --- */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 56px - 37px);
    text-align: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

.landing::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(166, 124, 255, 0.12) 0%, rgba(166, 124, 255, 0.05) 40%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.landing > * {
    position: relative;
    z-index: 1;
}

.landing-logo {
    width: 100px;
    margin-bottom: 28px;
    filter: drop-shadow(0 0 40px rgba(166, 124, 255, 0.2));
}

.landing h1 {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -2px;
    line-height: 1.05;
}

.landing h1 .accent {
    color: var(--accent);
}

.landing p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 420px;
    margin-bottom: 36px;
    line-height: 1.7;
    text-wrap: balance;
}

.landing .login-btn {
    font-size: 15px;
    padding: 14px 40px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
}

.landing-features {
    display: flex;
    gap: 56px;
    margin-top: 56px;
}

.feature {
    text-align: center;
    max-width: 220px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    background: var(--accent-subtle);
    border: 1px solid rgba(166, 124, 255, 0.12);
    border-radius: 14px;
    color: var(--accent);
}

.feature h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

/* --- Legal Pages --- */
.legal-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 32px 60px;
}

.legal-container h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.legal-updated {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.legal-container section {
    margin-bottom: 28px;
}

.legal-container h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.legal-container h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 14px;
}

.legal-container p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
}

.legal-container ul {
    list-style: none;
    padding: 0;
    margin-bottom: 10px;
}

.legal-container li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 18px;
    position: relative;
    margin-bottom: 4px;
}

.legal-container li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

.legal-container a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

.legal-container a:hover {
    opacity: 0.8;
}

/* --- Verify Page --- */
.verify-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 32px 60px;
}

/* Hero */
.vf-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.vf-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(166, 124, 255, 0.3);
}

.vf-hero h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.vf-hero-sub {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Two-column layout */
.vf-columns {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.vf-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vf-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cards */
.vf-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
}

.vf-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--accent);
}

.vf-card-header h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.vf-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Verify form */
.vf-form {
    margin: 0;
}

.vf-input-wrap {
    display: flex;
    gap: 8px;
}

.vf-hash-input {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.vf-hash-input:focus {
    border-color: var(--accent);
}

.vf-hash-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.vf-verify-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.vf-verify-btn:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.vf-verify-btn:active {
    transform: translateY(0);
}

/* Result */
.vf-result {
    margin-top: 20px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
}

.vf-result-crash {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.vf-result-crash-value {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
}

.vf-result-crash-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vf-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.vf-badge-ok {
    background: var(--green-subtle);
    border: 1px solid rgba(94, 224, 160, 0.2);
    color: var(--green);
}

.vf-badge-fail {
    background: var(--red-subtle);
    border: 1px solid rgba(255, 92, 106, 0.2);
    color: var(--red);
}

.vf-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.vf-result-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vf-result-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.vf-result-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Hash rows */
.vf-result-hashes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vf-hash-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.vf-hash-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    min-width: 80px;
}

.vf-hash-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
}

/* Calculator */
.vf-calc-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.vf-calc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vf-calc-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.vf-calc-hash {
    flex: 1;
}

.vf-calc-divisor {
    width: 90px;
    flex-shrink: 0;
}

.vf-calc-field input {
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.vf-calc-field input:focus {
    border-color: var(--accent);
}

.vf-calc-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.vf-calc-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.vf-local-result {
    margin-top: 14px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.vf-local-crash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vf-local-crash-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 800;
}

/* Steps */
.vf-steps {
    display: flex;
    flex-direction: column;
}

.vf-step {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.vf-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vf-step:first-child {
    padding-top: 0;
}

.vf-step-num {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--accent-subtle);
    border: 1px solid rgba(166, 124, 255, 0.15);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vf-step-text strong {
    font-family: var(--font-display);
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}

.vf-step-text p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.vf-step-text code {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
}

/* Chain stats */
.vf-chain-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.vf-chain-stat {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vf-chain-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.vf-chain-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Terminal hash */
.vf-terminal {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.vf-terminal-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vf-terminal-hash {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
}

.vf-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.vf-copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* House edge display */
.vf-edge-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.vf-edge-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    flex-shrink: 0;
}

.vf-edge-detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Formula card */
.vf-formula-code {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    line-height: 1.8;
    white-space: pre;
    overflow-x: auto;
}

@media (max-width: 960px) {
    .vf-columns {
        grid-template-columns: 1fr;
    }
    .vf-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .verify-container {
        padding: 20px 14px 40px;
    }
    .vf-hero h1 {
        font-size: 22px;
    }
    .vf-input-wrap {
        flex-direction: column;
    }
    .vf-calc-row {
        flex-direction: column;
        align-items: stretch;
    }
    .vf-calc-divisor {
        width: 100%;
    }
    .vf-chain-stats {
        grid-template-columns: 1fr;
    }
    .vf-result-crash-value {
        font-size: 28px;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chart-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .chart-container { min-height: 240px; }
    .chart-container::after { width: 200px; height: 200px; }
    .multiplier-display { font-size: 52px; letter-spacing: -2px; }

    .sidebar { height: auto; }
    .players-panel { max-height: 240px; }

    .bottom-panel {
        height: auto;
        min-height: 200px;
    }

    .landing h1 { font-size: 34px; letter-spacing: -1px; }
    .landing-features { flex-direction: column; gap: 20px; }
}

/* --- Leaderboard Tabs --- */
.leaderboard-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.lb-tab {
    padding: 5px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-family: var(--font-display);
}

.lb-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.lb-tab.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

/* --- Bet Limits Info --- */
.bet-limits {
    font-size: 11px;
    color: var(--text-muted);
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    line-height: 1.5;
    display: none;
}

.bet-limits.visible {
    display: block;
}

.bet-limits span {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* --- Win Animations --- */
.balance-win-pulse {
    animation: balance-pulse 1.5s ease;
}

@keyframes balance-pulse {
    0% { box-shadow: 0 0 0 0 var(--green-glow); }
    20% { box-shadow: 0 0 20px var(--green-glow); transform: scale(1.05); }
    40% { box-shadow: 0 0 10px var(--green-glow); transform: scale(1.02); }
    100% { box-shadow: none; transform: scale(1); }
}

.balance-floater {
    position: absolute;
    top: -4px;
    right: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: var(--green);
    pointer-events: none;
    animation: float-up 1.2s ease forwards;
    z-index: 10;
    text-shadow: 0 0 10px var(--green-glow);
    white-space: nowrap;
}

@keyframes float-up {
    0% { opacity: 1; transform: translateY(0); }
    60% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-28px); }
}

.win-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--green);
    pointer-events: none;
    z-index: 10;
    animation: sparkle-burst 0.8s ease forwards;
    box-shadow: 0 0 6px var(--green);
}

@keyframes sparkle-burst {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* Multiplier flash on cashout */
.multiplier-display.flash-win {
    animation: multiplier-flash 0.6s ease;
}

@keyframes multiplier-flash {
    0% { text-shadow: 0 0 40px var(--green-glow); }
    30% { text-shadow: 0 0 80px rgba(94, 224, 160, 0.6), 0 0 120px rgba(94, 224, 160, 0.3); transform: scale(1.08); }
    100% { text-shadow: 0 0 40px var(--green-glow); transform: scale(1); }
}

/* --- Input Error State --- */
.input-error {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px var(--red-subtle) !important;
}

/* --- Inline Errors --- */
.inline-error {
    font-size: 12px;
    color: var(--red);
    padding: 0;
    margin-top: 8px;
    min-height: 0;
    line-height: 1.4;
    display: none;
    font-weight: 500;
}

.inline-error.visible {
    display: block;
}

/* Game result notification */
.inline-error.game-result {
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
    animation: result-slide 0.3s ease;
}

.result-card {
    display: flex;
    align-items: stretch;
}

.result-icon {
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon svg {
    width: 20px;
    height: 20px;
}

.result-body {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-multiplier {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.result-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.result-amount {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Loss variant */
.result-card.loss {
    background: var(--red-subtle);
    border: 1px solid rgba(255, 92, 106, 0.15);
}

.result-card.loss .result-icon {
    background: rgba(255, 92, 106, 0.1);
    color: var(--red);
}

.result-card.loss .result-multiplier {
    color: var(--red);
}

.result-card.loss .result-label {
    color: var(--red);
}

.result-card.loss .result-amount {
    color: var(--text-secondary);
}

/* Win variant */
.result-card.win {
    background: var(--green-subtle);
    border: 1px solid rgba(94, 224, 160, 0.15);
}

.result-card.win .result-icon {
    background: rgba(94, 224, 160, 0.1);
    color: var(--green);
}

.result-card.win .result-multiplier {
    color: var(--green);
}

.result-card.win .result-label {
    color: var(--green);
}

.result-card.win .result-amount {
    color: var(--text-secondary);
}

@keyframes result-slide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes result-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(4px); }
}

/* --- Leaderboard --- */
.lb-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.lb-row:hover {
    border-color: var(--border);
    background: rgba(166, 124, 255, 0.04);
}

.lb-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.lb-medal-1 {
    border-color: rgba(255, 199, 0, 0.25);
}
.lb-medal-1 .lb-rank {
    background: rgba(255, 199, 0, 0.15);
    color: #FFC700;
}
.lb-medal-2 {
    border-color: rgba(192, 192, 210, 0.2);
}
.lb-medal-2 .lb-rank {
    background: rgba(192, 192, 210, 0.12);
    color: #C0C0D2;
}
.lb-medal-3 {
    border-color: rgba(205, 140, 80, 0.2);
}
.lb-medal-3 .lb-rank {
    background: rgba(205, 140, 80, 0.12);
    color: #CD8C50;
}

.lb-user {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    text-decoration: none;
    transition: color 0.15s;
}

a.lb-user:hover {
    color: var(--accent);
}

.lb-stats {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.lb-stat {
    font-size: 12px;
    color: var(--text-muted);
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.lb-value {
    font-weight: 700;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}

.lb-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .lb-stats {
        display: none;
    }
    .lb-row {
        gap: 10px;
        padding: 8px 10px;
    }
    .lb-value {
        min-width: auto;
    }
}

/* --- Utility --- */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.fw-600 { font-weight: 600; }

/* --- Focus Ring --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

input:focus-visible {
    outline: none;
}
