/* Lightning Casino - Premium UI */

/* Hide both screens initially to prevent login flash on page load */
/* JavaScript will show the appropriate screen after session validation */
#login-screen,
#casino-app {
    display: none !important;
}

/* When ready, these classes override the initial hide */
#login-screen.ready {
    display: flex !important;
}

#casino-app.ready {
    display: block !important;
}

:root {
    --primary: #f7931a;
    --primary-dark: #e67e00;
    --primary-light: #ffb84d;
    --secondary: #4a90d9;
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-elevated: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
    --border: #30363d;
    --glow: rgba(247, 147, 26, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    /* Prevent address bar from causing layout shifts on mobile */
    height: -webkit-fill-available;
}

body {
    font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1f2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* Ensure body starts at top */
    padding-top: 0;
    margin-top: 0;
}

/* === HEADER === */
.casino-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.casino-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.casino-logo svg {
    width: 40px;
    height: 40px;
    fill: var(--primary);
}

.casino-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.balance-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: transform 0.2s, color 0.3s;
}

/* Balance animation classes - applied to .balance-display container */
.balance-display.balance-up {
    animation: balancePulse 1.5s ease-out forwards;
}

.balance-display.balance-up-win {
    animation: balancePulseWin 3s ease-out forwards;
}

.balance-display.balance-up-win .balance-amount {
    animation: balanceTextWin 3s ease-out forwards;
}

.balance-display.balance-up-jackpot {
    animation: balancePulseJackpot 4s ease-out forwards;
}

.balance-display.balance-up-jackpot .balance-amount {
    animation: balanceTextJackpot 4s ease-out forwards;
}

@keyframes balancePulse {
    0% { transform: scale(1); }
    20% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes balancePulseWin {
    0% { transform: scale(1); }
    8% { transform: scale(1.25); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1.15); }
    75% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes balancePulseJackpot {
    0% { transform: scale(1); }
    5% { transform: scale(1.35); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1.25); }
    50% { transform: scale(1.18); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Text color animations for the balance number */
@keyframes balanceTextWin {
    0% { color: var(--text-primary); text-shadow: none; }
    8% { color: #22c55e; text-shadow: 0 0 20px rgba(34, 197, 94, 1), 0 0 40px rgba(34, 197, 94, 0.6); }
    25% { color: #22c55e; text-shadow: 0 0 15px rgba(34, 197, 94, 0.9), 0 0 30px rgba(34, 197, 94, 0.5); }
    50% { color: #4ade80; text-shadow: 0 0 10px rgba(34, 197, 94, 0.7), 0 0 20px rgba(34, 197, 94, 0.4); }
    75% { color: #86efac; text-shadow: 0 0 5px rgba(34, 197, 94, 0.4); }
    100% { color: var(--text-primary); text-shadow: none; }
}

@keyframes balanceTextJackpot {
    0% { color: var(--text-primary); text-shadow: none; }
    5% { color: #f7931a; text-shadow: 0 0 30px rgba(247, 147, 26, 1), 0 0 60px rgba(247, 147, 26, 0.7); }
    15% { color: #fbbf24; text-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 0 0 50px rgba(251, 191, 36, 0.6); }
    30% { color: #22c55e; text-shadow: 0 0 20px rgba(34, 197, 94, 0.8), 0 0 40px rgba(34, 197, 94, 0.5); }
    50% { color: #4ade80; text-shadow: 0 0 15px rgba(34, 197, 94, 0.6), 0 0 30px rgba(34, 197, 94, 0.3); }
    75% { color: #86efac; text-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
    100% { color: var(--text-primary); text-shadow: none; }
}

.balance-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.action-history {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: -0.25rem;
}

a.history-link,
a.history-link:visited {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

a.history-link:hover {
    color: var(--text-secondary);
    opacity: 1;
    text-decoration: underline;
}

a.home-link,
a.home-link:visited,
a.logout-link,
a.logout-link:visited {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

a.home-link:hover,
a.logout-link:hover {
    color: var(--primary);
    opacity: 1;
}

/* === MAIN LAYOUT === */
.casino-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .casino-main {
        grid-template-columns: 1fr;
    }
}

/* === SLOT MACHINE === */
.slot-machine-container {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.slot-machine {
    background: linear-gradient(180deg, #2d333b 0%, #1c2128 100%);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: visible;
    /* Smooth transition for dimming after last spin */
    transition: opacity 0.4s ease;
}

.slot-machine.dimmed {
    opacity: 0.5;
}

.slot-machine::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, var(--glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    border-radius: 20px;
}

.slot-machine.spinning::before {
    opacity: 1;
    animation: glow-pulse 0.5s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Sound Toggle Button */
.sound-toggle {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.sound-toggle:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--accent);
}

.sound-icon {
    font-size: 1.25rem;
    display: block;
}

/* Slot Lever */
.slot-lever {
    position: absolute;
    right: -45px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: transform 0.1s;
}

.slot-lever:hover {
    transform: translateY(-50%) scale(1.05);
}

.slot-lever:active,
.slot-lever.pulled {
    transform: translateY(-50%) translateY(20px);
}

.lever-ball {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

.lever-arm {
    width: 8px;
    height: 80px;
    background: linear-gradient(90deg, #6b7280 0%, #9ca3af 50%, #6b7280 100%);
    border-radius: 4px;
    margin-top: -4px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3);
}

.lever-base {
    width: 24px;
    height: 16px;
    background: linear-gradient(180deg, #4b5563 0%, #374151 100%);
    border-radius: 0 0 8px 8px;
    margin-top: -2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Reels Container */
.reels-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #000;
    border-radius: 16px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.8);
    margin-bottom: 2rem;
}

.reel {
    width: 120px;
    height: 140px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(247, 147, 26, 0.1);
}

.reel-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s;
}

.reel.spinning .reel-inner {
    animation: spin-reel 0.1s linear infinite;
}

@keyframes spin-reel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-140px); }
}

.symbol {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

/* Bitcoin symbol styling - orange color to match Bitcoin branding */
.btc-symbol {
    color: #f7931a;
    font-weight: 700;
    display: inline-block;
    padding: 0 0.15em;
    font-size: 1.1em;
    text-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

/* Result Display */
.result-display {
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.result-label {
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.result-label.show {
    opacity: 1;
    transform: scale(1);
}

.result-label.win {
    color: var(--success);
    text-shadow: 0 0 20px rgba(63, 185, 80, 0.5);
}

.result-label.jackpot {
    color: var(--primary);
    text-shadow: 0 0 30px var(--glow);
    animation: jackpot-glow 0.5s ease-in-out infinite alternate;
}

@keyframes jackpot-glow {
    from { text-shadow: 0 0 20px var(--glow); }
    to { text-shadow: 0 0 40px var(--glow), 0 0 60px var(--glow); }
}

.result-label.lose {
    color: var(--text-secondary);
}

.result-amount {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.result-amount.positive {
    color: var(--success);
}

.result-amount.negative {
    color: var(--danger);
}

/* Spin Button */
.spin-btn {
    width: 100%;
    margin-top: 0;
    padding: 1.25rem 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #000;
    box-shadow: 
        0 4px 20px rgba(247, 147, 26, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.spin-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.spin-btn:hover::before {
    left: 100%;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px rgba(247, 147, 26, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

.spin-btn:disabled {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

.spin-btn:disabled::before {
    display: none;
}

/* === BET SELECTOR === */
.bet-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.bet-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
}

.bet-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.1);
}

.bet-btn.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #000;
    box-shadow: 0 2px 10px rgba(247, 147, 26, 0.3);
}

.bet-btn.disabled,
.bet-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.bet-btn.disabled:hover,
.bet-btn:disabled:hover {
    border-color: var(--border);
    background: var(--bg-card);
}

.wager-info {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* === SIDEBAR === */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-deposit {
    background: linear-gradient(135deg, var(--success), #2ea043);
    color: #fff;
}

.btn-deposit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(63, 185, 80, 0.4);
}

.btn-withdraw {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-withdraw:hover {
    background: var(--border);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stats-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.stats-grid-3 .stat-item {
    padding: 0.75rem 0.5rem;
}

.stats-grid-3 .stat-value {
    font-size: 1.1rem;
}

.stat-item {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Recent Spins */
.recent-spins {
    max-height: 300px;
    overflow-y: auto;
}

.spin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--bg-elevated);
}

.spin-symbols {
    display: flex;
    gap: 0.25rem;
    font-size: 1.25rem;
}

.spin-result {
    font-weight: 600;
}

.spin-result.win { color: var(--success); }
.spin-result.lose { color: var(--text-secondary); }

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    border: 1px solid var(--border);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.qr-container {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin: 1rem 0;
}

.qr-container img {
    max-width: 200px;
}

/* === LOGIN SCREEN === */
.login-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-anchor: none;
}

.login-wrapper {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    padding-top: max(2rem, env(safe-area-inset-top, 2rem));
}

.login-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-back-link,
.login-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.login-back-link:hover,
.login-home-link:hover {
    color: var(--primary);
}

.login-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    border: 1px solid var(--border);
    text-align: center;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-btn {
    padding: 1.25rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.login-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #000;
}

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

.login-btn:hover {
    transform: translateY(-2px);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

.recovery-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 12px;
}

.recovery-code {
    font-family: monospace;
    font-size: 1rem;
    color: var(--primary);
    background: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    word-break: break-all;
}

/* === ANIMATIONS === */
@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-in {
    animation: slide-up 0.5s ease forwards;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    /* Ensure proper scroll behavior on mobile */
    html {
        scroll-padding-top: env(safe-area-inset-top, 0);
    }

    /* Add safe area to body so sticky header doesn't hide behind notch */
    body {
        padding-top: env(safe-area-inset-top, 0);
    }

    .casino-header {
        /* Match main site header padding (1rem) */
        padding: 0.75rem 1rem;
        /* Sticky at safe area, not at 0 which is behind notch/dynamic island */
        top: env(safe-area-inset-top, 0);
    }

    .header-inner {
        gap: 0.25rem;
    }

    .casino-logo span {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .balance-amount {
        font-size: 1.25rem;
    }

    .balance-label {
        font-size: 0.7rem;
    }

    a.home-link,
    a.logout-link {
        font-size: 0.7rem;
    }

    .header-right {
        gap: 0.5rem;
    }

    .casino-main {
        padding: 0.75rem;
        max-width: 100vw;
        overflow-x: hidden;
        /* Prevent scroll anchoring when content changes (spin results, deposit prompt) */
        overflow-anchor: none;
    }

    .slot-machine-container {
        padding: 0.75rem;
        max-width: 100%;
        overflow: hidden;
    }

    .reels-container {
        gap: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .reel {
        width: 80px;
        height: 100px;
    }

    .symbol {
        height: 100px;
        font-size: 2.75rem;
    }

    .spin-btn {
        font-size: 1.1rem;
        padding: 0.875rem;
        margin-top: 0;
    }

    .first-deposit-banner {
        padding: 0.75rem;
    }

    .deposit-banner-content {
        gap: 0.75rem;
    }

    .prize-table {
        padding: 0.75rem;
    }

    .prize-row {
        font-size: 0.8rem;
    }

    .sidebar {
        padding: 0;
    }

    .card {
        padding: 0.75rem;
    }
}

/* ========== Enhanced Login Page Styles ========== */

.how-it-works {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.step-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-text strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.step-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Desktop: horizontal steps */
@media (min-width: 768px) {
    .step {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
        padding-bottom: 0;
        border-bottom: none;
    }

    .step-icon {
        width: 28px;
        height: 28px;
    }

    .step-text strong {
        font-size: 0.875rem;
    }

    .step-text span {
        font-size: 0.75rem;
    }
}

.info-box {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.info-text strong {
    color: var(--text-primary);
}

.recovery-input-section {
    display: none;
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.login-btn-text {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.login-btn-text:hover {
    color: var(--text-primary);
    background: transparent;
}

/* ========== Welcome Modal Styles ========== */

.welcome-modal {
    max-width: 480px;
    text-align: center;
}

.welcome-header {
    margin-bottom: 1.5rem;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.welcome-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.recovery-code-display {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.recovery-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recovery-code-box {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    letter-spacing: 0.05em;
    word-break: break-all;
    margin-bottom: 1rem;
    user-select: all;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
}

.warning-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.warning-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
}

.warning-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.warning-text strong {
    color: var(--warning);
}

.save-options {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.save-tip {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

/* ========== First Deposit Prompt ========== */

.first-deposit-banner {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    /* Hidden by default - no space taken */
    display: none;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(-10px);
}

.first-deposit-banner.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeSlideIn 0.4s ease forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.deposit-banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.first-deposit-banner .prompt-icon {
    font-size: 2.5rem;
}

.first-deposit-banner .prompt-text {
    text-align: left;
}

.first-deposit-banner h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.first-deposit-banner p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.85rem;
}

.first-deposit-banner .btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* ========== Prize Table ========== */

.prize-table {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.prize-table-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.prize-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prize-row:last-child {
    border-bottom: none;
}

.prize-name {
    color: var(--text-secondary);
}

.prize-amount {
    font-weight: 600;
    color: var(--text-secondary);
}

.prize-amount.win {
    color: var(--success);
}

.prize-amount.ultra {
    color: #a855f7;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.prize-amount.mega {
    color: #ec4899;
    font-weight: 700;
}

.prize-amount.jackpot {
    color: var(--primary);
    font-weight: 700;
}

.prize-amount.push {
    color: var(--text-secondary);
}

.prize-amount.lose {
    color: var(--text-secondary);
    opacity: 0.6;
}

.prize-row.highlighted {
    background: rgba(247, 147, 26, 0.2);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    margin: 0 -0.5rem;
    border-bottom-color: transparent;
    animation: prize-highlight 0.5s ease;
}

.prize-row.highlighted .prize-name,
.prize-row.highlighted .prize-amount {
    color: var(--text-primary);
}

@keyframes prize-highlight {
    0% {
        background: rgba(247, 147, 26, 0.5);
        transform: scale(1.02);
    }
    100% {
        background: rgba(247, 147, 26, 0.2);
        transform: scale(1);
    }
}

/* ========== Enhanced Modal Styles ========== */

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.quick-amounts {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.quick-amount {
    flex: 1;
    min-width: 50px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-amount:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--primary);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
}

.invoice-info {
    text-align: center;
    margin-bottom: 1rem;
}

.invoice-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Withdrawal balance change display */
.withdraw-amount-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.withdraw-balance-change {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
}

.withdraw-balance-change .balance-before {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

.withdraw-balance-change .balance-after {
    color: var(--primary);
    font-weight: 600;
}

/* Success modal balance change */
.success-balance-change {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-weight: 500;
}

.success-balance-change .balance-before {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

.success-balance-change .balance-after {
    color: #22c55e;
    font-weight: 600;
}

.invoice-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--warning);
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.status-dot.pending {
    background: var(--warning);
}

.status-dot.success {
    background: var(--success);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.invoice-instructions {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.invoice-instructions p {
    margin: 0;
    padding: 0.375rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.balance-info {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-max {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-max:hover {
    background: rgba(245, 158, 11, 0.1);
}

.lnurl-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
}

/* ========== Recovery Card Mini ========== */

.recovery-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.recovery-code-mini {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    word-break: break-all;
    color: var(--primary);
    user-select: all;
}

.recovery-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-icon:hover {
    opacity: 1;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
    font-size: 0.875rem;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    font-family: inherit;
    font-size: 0.75rem;
}

/* ========== LNURL-Auth Styles ========== */

.lnurl-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
}

.qr-login-container {
    text-align: center;
    padding: 1.5rem 0;
}

.qr-login-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.qr-login-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--warning);
}

.qr-login-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

.lnurl-upgrade-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ========== Mobile Responsive Fixes ========== */

@media (max-width: 480px) {
    /* Header fixes for small screens */
    .casino-logo span {
        font-size: 0.75rem;
    }

    .balance-amount {
        font-size: 1.1rem;
    }

    .balance-label {
        font-size: 0.65rem;
    }

    .balance-display {
        gap: 0.25rem;
    }

    a.home-link,
    a.logout-link {
        font-size: 0.6rem;
    }

    .header-right {
        gap: 0.25rem;
    }

    /* Smaller reels */
    .reel {
        width: 65px;
        height: 80px;
    }

    .symbol {
        height: 80px;
        font-size: 2.25rem;
    }

    .spin-btn {
        font-size: 1rem;
        padding: 0.75rem;
        margin-top: 0;
    }

    .bet-selector {
        gap: 0.35rem;
        margin: 0.75rem 0;
    }

    .bet-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-width: 50px;
    }

    .prize-row {
        font-size: 0.75rem;
        padding: 0.35rem 0;
    }

    .prize-symbols {
        font-size: 0.9rem;
    }

    /* BTC symbol needs extra padding in prize table - narrower than emoji */
    .prize-symbols .btc-symbol {
        padding: 0 0.35em;
    }

    /* First deposit banner */
    .first-deposit-banner .prompt-icon {
        font-size: 2rem;
    }

    .first-deposit-banner h3 {
        font-size: 1rem;
    }

    .first-deposit-banner p {
        font-size: 0.75rem;
    }

    .first-deposit-banner .btn-large {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Info box - stack icon above text on mobile */
    .info-box {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .info-icon {
        font-size: 1.5rem;
    }

    .info-text {
        text-align: left;
    }

    /* Login wrapper - consistent padding on mobile */
    .login-wrapper {
        padding: 1rem;
        padding-top: max(1rem, env(safe-area-inset-top, 1rem));
    }

    /* Login nav - flex row, no absolute positioning */
    .login-nav {
        margin-bottom: 1rem;
    }

    .login-home-link {
        font-size: 0.8rem;
    }

    /* Login card adjustments - symmetric margins */
    .login-card {
        padding: 1.25rem;
        margin: 0;
        border-radius: 16px;
    }

    /* Ensure login screen can scroll */
    .login-container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-logo {
        font-size: 2.5rem;
        margin-bottom: 0.25rem;
    }

    .login-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .login-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .how-it-works {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        margin: 0.5rem 0;
        padding: 0.75rem;
    }

    .step {
        flex: 1;
        padding-bottom: 0;
        border-bottom: none;
        gap: 0.25rem;
    }

    .step-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .step-text strong {
        font-size: 0.7rem;
    }

    .step-text span {
        display: none;
    }

    /* Smaller QR codes on mobile */
    .qr-container img {
        width: 180px;
        height: 180px;
    }

    /* Warning box - stack on mobile */
    .warning-box {
        flex-direction: column;
        text-align: center;
    }

    .warning-text {
        text-align: left;
    }

    /* Welcome modal adjustments */
    .welcome-modal {
        margin: 1rem;
        padding: 1.25rem;
    }

    .recovery-code-box {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .save-options {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Wallet list on mobile */
    .lnurl-help {
        font-size: 0.7rem;
        line-height: 1.4;
    }

    /* Quick amounts grid */
    .quick-amounts {
        gap: 0.375rem;
    }

    .quick-amount {
        padding: 0.375rem;
        font-size: 0.75rem;
        min-width: 40px;
    }
}

@media (max-width: 360px) {
    .step-icon {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }

    .login-card {
        padding: 1rem;
    }

    .qr-container img {
        width: 160px;
        height: 160px;
    }
}

/* ========== Clickable QR Codes for Mobile ========== */

.qr-container {
    position: relative;
    cursor: pointer;
}

.qr-container img {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qr-container:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.qr-container:active img {
    transform: scale(0.98);
}

.qr-tap-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
}

.qr-tap-hint .mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .qr-tap-hint .mobile-only {
        display: inline;
    }

    .qr-tap-hint .desktop-only {
        display: none;
    }
}

/* Copy feedback */
.qr-container.copied::after {
    content: "Copied!";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: fadeInOut 1.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* === HISTORY === */
.modal-large {
    max-width: 700px;
    width: 95%;
}

.history-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.history-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.history-tab:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.history-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
    font-weight: 600;
}

.history-content {
    max-height: 400px;
    overflow-y: auto;
}

.history-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.history-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.history-amount.withdrawal {
    color: var(--secondary);
}

.history-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.completed {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.history-status.pending {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.history-status.failed,
.history-status.expired {
    background: rgba(248, 81, 73, 0.2);
    color: var(--danger);
}

.history-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: grid;
    gap: 0.25rem;
}

.history-details span {
    display: flex;
    gap: 0.5rem;
}

.history-details .label {
    color: var(--text-secondary);
    min-width: 80px;
}

.history-details .value {
    color: var(--text-primary);
    word-break: break-all;
}

.history-hash {
    font-family: monospace;
    font-size: 0.7rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    word-break: break-all;
    cursor: pointer;
    transition: background 0.2s;
}

.history-hash:hover {
    background: var(--bg-dark);
}

.history-hash-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

/* ========== Withdrawal Success State ========== */

.withdraw-success-content {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.withdraw-success-content .success-icon {
    font-size: 4rem;
    animation: successBounce 0.6s ease;
}

@keyframes successBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.withdraw-success-content h3 {
    font-size: 1.5rem;
    color: var(--success);
    margin: 1rem 0 0.5rem;
}

.withdraw-success-content .success-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.withdraw-success-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Confetti animation */
.success-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece:nth-child(1) { left: 10%; animation-delay: 0s; background: #f7931a; }
.confetti-piece:nth-child(2) { left: 20%; animation-delay: 0.1s; background: #3fb950; }
.confetti-piece:nth-child(3) { left: 30%; animation-delay: 0.2s; background: #4a90d9; }
.confetti-piece:nth-child(4) { left: 40%; animation-delay: 0.15s; background: #f85149; }
.confetti-piece:nth-child(5) { left: 50%; animation-delay: 0.05s; background: #d29922; }
.confetti-piece:nth-child(6) { left: 60%; animation-delay: 0.25s; background: #a855f7; }
.confetti-piece:nth-child(7) { left: 70%; animation-delay: 0.1s; background: #ec4899; }
.confetti-piece:nth-child(8) { left: 80%; animation-delay: 0.2s; background: #3fb950; }
.confetti-piece:nth-child(9) { left: 90%; animation-delay: 0.15s; background: #f7931a; }
.confetti-piece:nth-child(10) { left: 15%; animation-delay: 0.3s; background: #4a90d9; }
.confetti-piece:nth-child(11) { left: 25%; animation-delay: 0.35s; background: #d29922; }
.confetti-piece:nth-child(12) { left: 35%; animation-delay: 0.4s; background: #f85149; }
.confetti-piece:nth-child(13) { left: 45%; animation-delay: 0.45s; background: #a855f7; }
.confetti-piece:nth-child(14) { left: 55%; animation-delay: 0.5s; background: #ec4899; }
.confetti-piece:nth-child(15) { left: 65%; animation-delay: 0.55s; background: #3fb950; }
.confetti-piece:nth-child(16) { left: 75%; animation-delay: 0.6s; background: #f7931a; }
.confetti-piece:nth-child(17) { left: 85%; animation-delay: 0.65s; background: #4a90d9; }
.confetti-piece:nth-child(18) { left: 5%; animation-delay: 0.7s; background: #d29922; }
.confetti-piece:nth-child(19) { left: 95%; animation-delay: 0.75s; background: #a855f7; }
.confetti-piece:nth-child(20) { left: 50%; animation-delay: 0.8s; background: #3fb950; }

/* ========== Provably Fair Styles ========== */

/* Subtle footer link below slot machine */
.fairness-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.fairness-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.fairness-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.fairness-lock {
    font-size: 0.875rem;
}

.fairness-seed-preview {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 0.7rem;
    color: var(--primary);
    opacity: 0.8;
}

.fairness-nonce {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.fairness-info-icon {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Game stats footer with provably fair button */
.game-stats-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.fairness-toggle-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.fairness-toggle-compact:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.fairness-toggle-compact .fairness-lock {
    font-size: 0.9rem;
}

.fairness-toggle-compact .fairness-label-text {
    font-weight: 500;
    color: var(--text-primary);
}

.fairness-toggle-compact .fairness-seed-preview {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.fairness-toggle-compact .fairness-nonce {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.fairness-toggle-compact .fairness-info-icon {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Expandable fairness panel */
.fairness-panel {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
    animation: slideDown 0.2s ease;
}

.fairness-panel.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fairness-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.fairness-panel-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fairness-panel-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.fairness-panel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.fairness-row {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.fairness-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fairness-value {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fairness-value .copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.fairness-value .copy-btn:hover {
    opacity: 1;
}

.fairness-value .copy-btn.copied {
    color: var(--success);
    opacity: 1;
}

/* Client seed input */
.fairness-client-seed {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fairness-client-seed input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.fairness-client-seed input:focus {
    outline: none;
    border-color: var(--primary);
}

.fairness-client-seed button {
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
    border-radius: 6px;
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.fairness-client-seed button:hover {
    background: var(--primary-light);
}

.fairness-client-seed button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Nonce display */
.fairness-nonce-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fairness-nonce-value {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.fairness-nonce-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Rotate seed button */
.fairness-rotate-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fairness-rotate-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.fairness-rotate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Help link */
.fairness-help-link {
    text-align: center;
}

.fairness-help-link a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.fairness-help-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Last spin fairness info (shown after each spin) */
.last-spin-fairness {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid rgba(247, 147, 26, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.last-spin-fairness-title {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.last-spin-roll {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.last-spin-roll-value {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.last-spin-roll-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Seed Revealed Modal */
.seed-revealed-modal {
    max-width: 500px;
}

.seed-revealed-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.seed-revealed-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.seed-revealed-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.seed-revealed-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.revealed-seed-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.revealed-seed-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.revealed-seed-value {
    font-family: "SF Mono", Monaco, "Courier New", monospace;
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 6px;
    word-break: break-all;
    user-select: all;
}

.revealed-games-count {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.revealed-games-count strong {
    color: var(--text-primary);
}

.revealed-actions {
    display: flex;
    gap: 0.75rem;
}

.revealed-actions button {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-seed {
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
}

.btn-copy-seed:hover {
    background: var(--primary-light);
}

.btn-copy-seed.copied {
    background: var(--success);
}

.btn-close-reveal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-close-reveal:hover {
    background: rgba(255, 255, 255, 0.15);
}

.verify-link {
    text-align: center;
    margin-top: 1rem;
}

.verify-link a {
    font-size: 0.8rem;
    color: var(--secondary);
    text-decoration: none;
}

.verify-link a:hover {
    text-decoration: underline;
}

/* Fairness status indicator in header or sidebar */
.fairness-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    color: var(--success);
    background: rgba(63, 185, 80, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.fairness-status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

/* Mobile adjustments for fairness UI */
@media (max-width: 768px) {
    .fairness-toggle {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
    }

    .fairness-seed-preview {
        font-size: 0.65rem;
    }

    .fairness-panel {
        padding: 1rem;
    }

    .fairness-value {
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .fairness-client-seed {
        flex-direction: column;
    }

    .fairness-client-seed button {
        width: 100%;
    }

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

    .seed-revealed-modal {
        margin: 0.5rem;
    }
}

@media (max-width: 480px) {
    .fairness-toggle {
        flex-wrap: wrap;
        justify-content: center;
    }

    .fairness-nonce {
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }
}
