/* Enterprise Plinko - Dark Casino UI Theme */

:root {
    --bg-dark: #090a0f;
    --bg-card: #141622;
    --bg-card-hover: #1a1d2e;
    --border-glass: rgba(255, 255, 255, 0.12);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --accent: #d946ef;
    --accent-glow: rgba(217, 70, 239, 0.35);
    --gold: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #c4c9d4;
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

html, body {
    background: #090a0f !important;
    background-image: radial-gradient(circle at 50% 30%, #151829 0%, #090a0f 100%) !important;
    color: #f3f4f6 !important;
    font-family: var(--font-inter), Segoe UI, sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-logo {
    font-family: var(--font-outfit), Segoe UI, sans-serif;
    font-weight: 700;
    color: #f3f4f6;
}

/* Force readable contrast — Bootstrap light utilities render near-black */
.text-muted,
.text-body-secondary,
.text-secondary,
.text-white-50,
.form-label,
.form-check-label,
.lead,
small, .small {
    color: #c4c9d4 !important;
}

.text-white,
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

.text-gold {
    color: var(--gold) !important;
}

.text-primary-casino {
    color: #a5b4fc !important;
}

.text-warning {
    color: #fbbf24 !important;
}

code {
    color: #e5e7eb !important;
    background: transparent !important;
}

/* Solid cards — avoid backdrop-filter (can hide text on some Windows/Chrome builds) */
.glass-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.5);
    color: #f3f4f6 !important;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-card-hover) !important;
}

.glass-input,
.form-control.glass-input,
input.form-control,
select.form-control,
textarea.form-control,
.form-select {
    background: #0d0f18 !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    color: #f3f4f6 !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    transition: all 0.25s ease !important;
}

.glass-input:focus,
.form-control:focus,
.form-select:focus {
    background: #121522 !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px var(--primary-glow) !important;
    color: #ffffff !important;
    outline: none !important;
}

.glass-input::placeholder,
.form-control::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Reusable Casino Buttons */
.btn-primary-casino {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    color: #fff !important;
    font-family: var(--font-outfit), sans-serif;
    font-weight: 600;
    padding: 12px 24px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary-casino:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    filter: brightness(1.1);
    color: #fff !important;
}

.btn-accent-casino {
    background: linear-gradient(135deg, var(--accent) 0%, #c026d3 100%);
    border: none;
    border-radius: 12px;
    color: #fff !important;
    font-family: var(--font-outfit), sans-serif;
    font-weight: 600;
    padding: 12px 24px;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.25s ease;
}

.btn-accent-casino:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.6);
    filter: brightness(1.1);
    color: #fff !important;
}

.btn-gold-casino {
    background: linear-gradient(135deg, var(--gold) 0%, #d97706 100%);
    border: none;
    border-radius: 12px;
    color: #000 !important;
    font-family: var(--font-outfit), sans-serif;
    font-weight: 700;
    padding: 12px 24px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transition: all 0.25s ease;
}

.btn-gold-casino:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    filter: brightness(1.1);
}

/* Glass table headers and grid layouts */
.table-glass {
    color: var(--text-main);
    background: transparent;
}

.table-glass th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-family: var(--font-outfit), sans-serif;
    border-bottom: 2px solid var(--border-glass);
    padding: 14px;
}

.table-glass td {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-glass);
    padding: 14px;
    vertical-align: middle;
    color: #e5e7eb;
}

.table-glass tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

/* Stat Cards */
.stat-value {
    font-family: var(--font-outfit), sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: #ffffff !important;
}

.glow-text-primary {
    text-shadow: 0 0 10px var(--primary-glow);
}

.glow-text-gold {
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Navbar — solid, no blur */
.navbar-casino {
    background: #0c0d14 !important;
    border-bottom: 1px solid var(--border-glass);
}

.navbar-casino .nav-link,
.navbar-casino .btn-outline-light {
    color: #e5e7eb !important;
}

.dropdown-menu-dark,
.dropdown-menu.glass-card {
    background: #1a1d2e !important;
    color: #f3f4f6 !important;
}

.dropdown-item {
    color: #e5e7eb !important;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #fff !important;
}

/* Tip / info panels — never solid white */
.bg-white {
    background-color: #1a1d2e !important;
}

.bg-white.bg-opacity-5,
.bg-opacity-5 {
    background-color: rgba(255, 255, 255, 0.06) !important;
    --bs-bg-opacity: 1;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fecaca !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #a7f3d0 !important;
}

footer, footer span {
    color: #9ca3af !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Dynamic glow cards for admin panel */
.glow-card-green {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.15);
}

.glow-card-red {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.15);
}

.glow-card-gold {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.15);
}

/* Plinko-specific canvas wrapping */
.canvas-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-glass);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
}

/* Nav links in player sidebar */
.nav-link {
    color: #c4c9d4 !important;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff !important;
}

.badge.bg-secondary {
    background: #374151 !important;
    color: #f3f4f6 !important;
}

/* ========== Player shell ========== */
.player-shell {
    max-width: 1400px;
    margin: 0 auto;
}

.player-nav {
    border-radius: 18px !important;
}

.player-nav-kicker {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b93a7 !important;
    margin-bottom: 0.15rem;
}

.player-nav-list {
    gap: 0.25rem;
}

.player-nav-link {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem !important;
    border-radius: 12px;
    color: #b8bfcc !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.player-nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    color: #7c879c;
    transition: color 0.2s ease;
}

.player-nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff !important;
    transform: translateX(2px);
}

.player-nav-link:hover i {
    color: #fbbf24;
}

.player-nav-link.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.04));
    color: #fff !important;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.player-nav-link.active i {
    color: #fbbf24;
}

.btn-play-now {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 12px;
    color: #111 !important;
    font-family: var(--font-outfit), sans-serif;
    font-weight: 700;
    padding: 0.75rem 1rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-play-now:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    color: #111 !important;
}

/* ========== Dashboard ========== */
.dash-page {
    padding-bottom: 2rem;
}

.dash-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8b93a7 !important;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.dash-hint {
    color: #8b93a7 !important;
    font-size: 0.85rem;
}

.dash-eyebrow {
    font-size: 0.85rem;
    color: #fbbf24 !important;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.dash-title {
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem 0;
    color: #fff !important;
}

.dash-subtitle {
    color: #a8b0c0 !important;
    margin: 0;
    max-width: 36rem;
}

.dash-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.2rem 0;
    color: #fff !important;
}

.dash-welcome {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.btn-dash-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    border: none;
    border-radius: 12px;
    color: #111 !important;
    font-family: var(--font-outfit), sans-serif;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.btn-dash-primary:hover {
    transform: translateY(-2px);
    color: #111 !important;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.35);
}

.btn-dash-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #e5e7eb !important;
    font-weight: 600;
    padding: 0.75rem 1.15rem;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-dash-secondary:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
    color: #fff !important;
}

.dash-hero-balance {
    background:
        radial-gradient(ellipse at 80% 20%, rgba(245, 158, 11, 0.18), transparent 55%),
        radial-gradient(ellipse at 10% 90%, rgba(16, 185, 129, 0.1), transparent 50%),
        #12141f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.75rem 1.75rem 1.6rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.dash-hero-balance::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 70%);
    pointer-events: none;
}

.dash-hero-balance-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.dash-hero-amount {
    font-family: var(--font-outfit), sans-serif;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #fff !important;
    margin: 0.15rem 0 0.35rem;
}

.dash-vip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
}

.dash-vip i {
    font-size: 1.4rem;
    color: #fbbf24;
}

.dash-vip strong {
    display: block;
    color: #fff !important;
    font-size: 1.05rem;
}

.dash-wallet-tile {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: #141622;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.15rem 1.2rem;
    height: 100%;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.dash-wallet-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16);
}

.dash-wallet-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}

.tone-win .dash-wallet-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.tone-bonus .dash-wallet-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.tone-locked .dash-wallet-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.dash-wallet-value {
    font-family: var(--font-outfit), sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.dash-wallet-link {
    color: #34d399 !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.dash-wallet-link:hover {
    color: #6ee7b7 !important;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.dash-stat {
    background: #141622;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.15rem;
}

.dash-stat-value {
    font-family: var(--font-outfit), sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: -0.02em;
}

.dash-stat-value.text-success {
    color: #34d399 !important;
}

.dash-stat-value.text-danger {
    color: #f87171 !important;
}

.dash-activity {
    padding: 1.35rem 1.35rem 0.5rem;
    border-radius: 18px !important;
}

.dash-activity-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-link {
    color: #fbbf24 !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.dash-link:hover {
    color: #fcd34d !important;
}

.dash-table {
    --bs-table-bg: transparent;
    --bs-table-color: #d1d5db;
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
    color: #d1d5db !important;
}

.dash-table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b93a7 !important;
    font-weight: 600;
    border-bottom-width: 1px;
    padding: 0.65rem 0.75rem;
    background: transparent;
}

.dash-table tbody td {
    padding: 0.9rem 0.75rem;
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.06);
    color: #e5e7eb !important;
}

.dash-mono {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-outfit), sans-serif;
}

.dash-chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-weight: 600;
    color: #d1d5db !important;
}

.dash-empty {
    text-align: center;
    padding: 3rem 1.5rem 3.5rem;
}

.dash-empty-visual {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.dash-empty-visual i {
    font-size: 0.65rem;
    color: #f59e0b;
    animation: dash-bounce 1.4s ease-in-out infinite;
}

.dash-empty-visual i:nth-child(2) {
    animation-delay: 0.15s;
    color: #34d399;
}

.dash-empty-visual i:nth-child(3) {
    animation-delay: 0.3s;
    color: #60a5fa;
}

.dash-empty h3 {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.dash-empty p {
    color: #9ca3af !important;
    margin-bottom: 1.25rem;
}

@keyframes dash-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-8px); opacity: 1; }
}

.dash-animate {
    animation: dash-rise 0.55s ease both;
}

.dash-delay-1 { animation-delay: 0.06s; }
.dash-delay-2 { animation-delay: 0.12s; }
.dash-delay-3 { animation-delay: 0.18s; }
.dash-delay-4 { animation-delay: 0.24s; }

@keyframes dash-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767.98px) {
    .dash-stats {
        grid-template-columns: 1fr;
    }

    .dash-welcome {
        align-items: flex-start;
    }

    .dash-welcome-actions {
        width: 100%;
    }

    .btn-dash-primary,
    .btn-dash-secondary {
        flex: 1;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dash-animate,
    .dash-empty-visual i,
    .dash-wallet-tile,
    .player-nav-link,
    .btn-dash-primary {
        animation: none !important;
        transition: none !important;
    }
}


/* ========== Global mobile / responsive UX ========== */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    padding-bottom: env(safe-area-inset-bottom);
}

img, canvas, svg, video {
    max-width: 100%;
    height: auto;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.form-control,
.form-select,
.glass-input,
.btn {
    min-height: 44px;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-lg {
    min-height: 48px;
}

.login-container {
    max-width: 440px;
    margin: 24px auto;
    padding: 0 4px;
}

@media (min-width: 768px) {
    .login-container {
        margin: 60px auto;
    }
}

/* Hide global play CTA on game page */
body:has(.page-game) .player-mobile-cta {
    display: none !important;
}

.player-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #141622;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #f3f4f6 !important;
    font-weight: 600;
    padding: 0.85rem 1rem;
    min-height: 48px;
}

.player-menu-toggle:hover,
.player-menu-toggle:focus {
    background: #1a1d2e;
    color: #fff !important;
}

.player-mobile-cta {
    position: sticky;
    bottom: 0;
    z-index: 1030;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #090a0f 70%, rgba(9, 10, 15, 0));
}

.player-mobile-cta .btn-play-now {
    min-height: 48px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.player-shell {
    padding-bottom: 4.5rem;
}

@media (min-width: 992px) {
    .player-shell {
        padding-bottom: 1rem;
    }
    .player-mobile-cta {
        display: none !important;
    }
}

.navbar-brand .brand-text {
    font-size: 0.95rem;
}

@media (max-width: 575.98px) {
    .navbar-brand .brand-text {
        font-size: 0.82rem;
    }

    .glass-card {
        border-radius: 14px !important;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    main.site-main {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Stacked auth / forms */
@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        --bs-gutter-x: 1rem;
    }

    h2, .h2 {
        font-size: 1.35rem !important;
    }

    h5, .h5 {
        font-size: 1.05rem !important;
    }

    .table {
        font-size: 0.85rem;
    }

    .table td, .table th {
        white-space: nowrap;
    }

    .dash-hero-amount {
        font-size: 2.2rem;
    }

    .dash-activity {
        padding: 1rem 0.75rem 0.25rem;
    }

    .dash-empty {
        padding: 2rem 1rem 2.5rem;
    }

    /* Admin grids */
    .admin-nav .player-nav-link {
        min-height: 44px;
    }
}

/* Touch: remove hover stickiness quirks */
@media (hover: none) {
    .glass-card:hover {
        border-color: var(--border-glass);
    }

    .dash-wallet-tile:hover {
        transform: none;
    }

    .player-nav-link:hover {
        transform: none;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .player-mobile-cta {
        padding: 0.4rem 0.75rem;
    }

    .hero-section {
        padding: 24px 0 32px 0 !important;
    }
}
