/* Road Chicken - Custom Styles */

:root {
    --primary-color: #FFD700;
    --secondary-color: #FFA500;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --dark-bg: #1a1a2e;
    --darker-bg: #0f0f1e;
    --card-bg: #16213e;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #2d2d44;

    /* Responsive Sizing Variables */
    --chicken-size: 80px;
    --chicken-font: 3.5rem;
    --car-font: 2rem;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    color: var(--text-light);
}

.container-fluid {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

/* Header */
.game-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--primary-color);
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.balance-display {
    text-align: right;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Start Screen */
.start-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 20px 80px 20px;
    /* Extra bottom padding for fixed footer */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100vh - 180px);
    /* Adjust based on header/footer */
}

.chicken-logo {
    font-size: 6rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.start-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 20px 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}



.bet-input-group {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.bet-input-group .form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.bet-input-group .form-control {
    background: var(--darker-bg);
    border: 2px solid var(--border-color);
    color: var(--text-light);
    font-size: 1.25rem;
    padding: 12px;
    transition: all 0.3s;
}

.bet-input-group .form-control:focus {
    background: var(--darker-bg);
    border-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.bet-input-group .input-group-text {
    background: var(--darker-bg);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    font-size: 1.25rem;
}

.bet-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-preset {
    background: var(--darker-bg);
    border: 2px solid var(--border-color);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-preset:hover {
    background: var(--primary-color);
    color: var(--darker-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}



/* Game Board (High-Fidelity Road Style) */
.game-board-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid #3f3f46;
    display: flex;
    flex-direction: column;
}

.game-board {
    flex: 1;
    min-height: 0;
    position: relative;
    background-color: #334155;
    /* Darker Slate/Asphalt */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.board-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 200;
    pointer-events: none;
}

.lane::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.1) 20px,
            rgba(255, 255, 255, 0.1) 40px);
    transform: translateX(-50%);
    z-index: 1;
}

.live-wins {
    display: flex;
    align-items: center;
    color: #e4e4e7;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    position: absolute;
    top: 8px;
    left: 8px;
}

.win-notification {
    position: absolute;
    top: 45px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 35;
}

.win-notif-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInSlideDown 0.4s ease-out;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notif-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ffd700;
}

.notif-user {
    color: #e4e4e7;
    white-space: nowrap;
}

.notif-amount {
    color: #22c55e;
    font-weight: 800;
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.road-container {
    flex: 1;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    position: relative;
    gap: 12px;
    padding: 0 25px;
    /* Add padding inside container for scrolling space */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
}

/* Hide scrollbar for cleaner look but keep functionality */
.road-container::-webkit-scrollbar {
    height: 6px;
    background: #0f0e24;
}

.road-container::-webkit-scrollbar-thumb {
    background: #3e3c6e;
    border-radius: 10px;
}

.lane {
    flex: 0 0 100px;
    height: 100%;
    background: transparent;
    border-right: 2px dashed rgba(255, 255, 255, 0.4);
    /* Vertical dashed lines */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    transition: all 0.3s;
    overflow: hidden;
    /* Ensure cars stay in lane */
}

.lane:last-child {
    border-right: none;
}

.sidewalk {
    flex: 0 0 120px;
    height: 100%;
    background-color: #94a3b8;
    background-image:
        linear-gradient(90deg, #64748b 1px, transparent 1px),
        linear-gradient(180deg, #64748b 1px, transparent 1px),
        linear-gradient(to right, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
    background-size: 40px 40px, 40px 40px, 100% 100%;
    position: relative;
    z-index: 5;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidewalk decorative elements */
.sidewalk::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 25px;
    background: #15803d;
    /* Grass border */
    border-right: 2px solid #14532d;
}

.sidewalk-deco {
    position: absolute;
    left: 5px;
    top: 20%;
    font-size: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 80px;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
}

/* Lane Number Indicator */
.lane::before {
    content: attr(id);
    /* We'll set this via JS or CSS counters ideally, but for now simple styling */
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

.lane.crossed {
    opacity: 0.8;
    /* Keep it visible for vibrant barriers */
    filter: grayscale(0.5);
    /* Less grayscale for better colors */
    transform: scale(0.98);
}

.lane.current {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    z-index: 10;
}

.lane-positions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    justify-content: center;
    position: relative;
    z-index: 10;
}

/* Manhole Cover Target (Multiplier) */
.position {
    width: 85px;
    height: 85px;
    background: radial-gradient(circle, #334155 60%, #0f172a 100%);
    border: 6px solid #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 4px 6px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
}

/* Manhole cover detail */
.position::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.5);
    background-image: repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(0, 0, 0, 0.1) 5px);
    pointer-events: none;
}

/* Inner rings for manhole detail */
.position::before {
    content: '';
    position: absolute;
    width: 75%;
    height: 75%;
    border-radius: 50%;
    border: 2px dashed rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.position::after {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: 1px solid #333;
    pointer-events: none;
}

.position:hover:not(.revealed) {
    background: #2a2952;
    border-color: #ff00de;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 0, 222, 0.4);
}

.position.revealed.safe {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    border: none;
    box-shadow: 0 0 20px rgba(150, 201, 61, 0.6);
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.position.revealed.crash {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: none;
    box-shadow: 0 0 20px rgba(255, 75, 43, 0.6);
    animation: shake 0.5s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Barrier */
.barrier {
    position: absolute;
    top: 30%;
    left: 10%;
    right: 10%;
    height: 25px;
    background: repeating-linear-gradient(-45deg,
            #fbbf24,
            #fbbf24 12px,
            #1f2937 12px,
            #1f2937 24px);
    border: 3px solid #b45309;
    border-radius: 3px;
    z-index: 15;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.barrier::before,
.barrier::after {
    content: '';
    position: absolute;
    bottom: -15px;
    width: 4px;
    height: 15px;
    background: #475569;
    border: 1px solid #1e293b;
}

.barrier::before {
    left: 10px;
}

.barrier::after {
    right: 10px;
}

/* Manhole Cover States */
.position.safe::after {
    content: '🍗';
    /* Roasted chicken icon */
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
    z-index: 2;
}

.position.safe {
    background: radial-gradient(circle, #fbbf24 30%, #b45309 100%);
    border: 4px solid #78350f;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.4), 0 0 20px rgba(251, 191, 36, 0.6);
}

.position.safe.revealed {
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Chicken Tooltip */
.chicken-tooltip {
    position: absolute;
    bottom: -42px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    /* Royal Blue */
    color: white;
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 25;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chicken-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #2563eb;
}

/* Branded Vehicles */
.car-animation.taxi {
    background: url('https://img.icons8.com/color/144/taxi.png') no-repeat center/contain;
    width: 60px;
    height: 100px;
    display: block;
}

.car-animation.truck {
    background: url('https://img.icons8.com/color/144/truck.png') no-repeat center/contain;
    width: 75px;
    height: 140px;
    display: block;
}

.car-animation.police {
    background: url('https://img.icons8.com/color/144/police-car.png') no-repeat center/contain;
    width: 60px;
    height: 100px;
    display: block;
}

.car-animation.ambulance {
    background: url('https://img.icons8.com/color/144/ambulance.png') no-repeat center/contain;
    width: 65px;
    height: 110px;
    display: block;
}

.car-animation.bus {
    background: url('https://img.icons8.com/color/240/bus.png') no-repeat center/contain;
    width: 75px;
    height: 140px;
    display: block;
}

.car-animation.van {
    background: url('https://img.icons8.com/color/144/van.png') no-repeat center/contain;
    width: 65px;
    height: 110px;
    display: block;
}

.car-animation.tractor {
    background: url('https://img.icons8.com/color/144/tractor.png') no-repeat center/contain;
    width: 65px;
    height: 100px;
    display: block;
}

.car-animation.garbage {
    background: url('https://img.icons8.com/color/240/garbage-truck.png') no-repeat center/contain;
    width: 80px;
    height: 140px;
    display: block;
}

.car-animation::after {
    content: 'IN OUT';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fbbf24;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.8px;
    white-space: nowrap;
    border: 1.5px solid #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
    z-index: 10;
}



/* Chicken */
.chicken-sprite {
    position: absolute;
    left: 20px;
    width: var(--chicken-size);
    height: var(--chicken-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--chicken-font);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 20;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
    pointer-events: none;
    transform: translate(-50%, -50%);
    /* Center based on coordinate */
}

.chicken-body {
    display: inline-block;
    transform: scaleX(-1);
    /* Face the chicken head right */
}

.chicken-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.chicken-sprite.dead {
    transform: translate(-50%, -50%) rotate(180deg) scale(0.8);
    opacity: 0.8;
}

/* Cars */
.car-animation {
    position: absolute;
    top: -120px;
    /* Start off-screen even during delay */
    left: 50%;
    /* Center horizontally */
    font-size: var(--car-font);
    animation: carDrop 1s linear infinite;
    animation-fill-mode: both;
    /* Apply initial keyframe during delay */
    opacity: 0;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.4));
    z-index: 100;
    /* Over everything */
    transform: translateX(-50%);
    /* Precise centering */
}

.car-brake {
    transition: top 0.5s ease-out;
    animation: none !important;
}

@keyframes carDrop {
    0% {
        top: -100px;
        /* Start well off-screen */
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    100% {
        top: 110%;
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
}

/* Game Message (Top) */
.game-message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    letter-spacing: 0.5px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-game-action {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: var(--darker-bg);
    font-weight: 700;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s;
}

.btn-game-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
}

/* Result Screen */
.result-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.result-icon {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: scaleIn 0.5s;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

#resultTitle {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.result-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin: 20px 0;
}

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

/* Bottom Navigation (Mobile App Style) */
.game-footer {
    background: #18181b;
    border-top: 1px solid #3f3f46;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: 2px solid transparent;
    /* Indicator placeholder */
}

.nav-item span {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.nav-item small {
    font-size: 0.7rem;
    font-weight: 600;
}

.nav-item:hover,
.nav-item:active {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    color: #eab308;
    /* Theme Yellow */
    border-top-color: #eab308;
}

/* Utility Classes */
.d-none {
    display: none !important;
}

.disabled-panel {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 576px) {
    .game-title {
        font-size: 1.2rem;
    }

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

    .chicken-logo {
        font-size: 4rem;
    }

    .start-content h2 {
        font-size: 2rem;
    }

    .road-container {
        height: 100%;
        gap: 6px;
    }

    /* Scaling Overrides */
    :root {
        --chicken-size: 100px;
        --chicken-font: 4.5rem;
        --car-font: 1.4rem;
    }

    .position {
        font-size: 1rem;
    }

    .game-stats {
        flex-direction: column;
        gap: 8px;
    }

    .stat-item {
        padding: 5px;
    }
}

.controls-section {
    flex-shrink: 0;
    padding: 10px;
    padding-bottom: 100px;
    /* Space for fixed footer + safe area */
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

/* Control Panel */
/* Control Panel (1:1 Reference Styling) */
.panel-container {
    background-color: #27272a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Align content to the bottom of the section */
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid #3f3f46;
    flex-shrink: 0;
}

.panel-section {
    display: flex;
    flex-direction: column;
}

/* Bet Section Styles */
.bet-section {
    min-width: 200px;
}

.bet-input-box {
    display: flex;
    align-items: center;
    background-color: #18181b;
    border-radius: 10px;
    padding: 5px;
    border: 1px solid #3f3f46;
}

.btn-min-max {
    background-color: #3f3f46;
    border: none;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-min-max:hover {
    background-color: #52525b;
}

.panel-val-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    min-width: 60px;
    outline: none;
}

/* Chrome, Safari, Edge, Opera - hide spin buttons */
.panel-val-input::-webkit-outer-spin-button,
.panel-val-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Firefox - hide spin buttons */
.panel-val-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.bet-presets-row {
    display: flex;
    gap: 8px;
}

.btn-chip {
    background-color: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-chip:hover {
    background-color: #3f3f46;
    transform: translateY(-2px);
}

.chip-icon {
    font-size: 0.8rem;
    background: #52525b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
}

/* Difficulty Section Styles */
.difficulty-section {
    flex: 1;
    margin: 0 15px;
}

.difficulty-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 5px;
}

.label-primary {
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
}

.label-secondary {
    font-size: 0.85rem;
    color: #a1a1aa;
    opacity: 0.8;
}

.difficulty-pill {
    background-color: #18181b;
    border-radius: 12px;
    display: flex;
    padding: 5px;
    border: 1px solid #3f3f46;
}

.diff-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #a1a1aa;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-btn:hover {
    color: #fff;
}

.diff-btn.active {
    background-color: #3f3f46;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Action Section Styles */
.action-section {
    min-width: 250px;
    height: 100%;
    align-self: flex-start;
    margin-top: 22px;
}

.btn-play-main {
    background: linear-gradient(to bottom, #4ade80, #22c55e);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    width: 100%;
    height: 75px;
    box-shadow: 0 8px 0 #166534, 0 8px 20px rgba(34, 197, 94, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-play-main:hover {
    filter: brightness(1.05);
}

.btn-play-main:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #166534, 0 4px 10px rgba(34, 197, 94, 0.4);
}

.btn-play-main.cashout-style {
    background: linear-gradient(to bottom, #facc15, #eab308);
    box-shadow: 0 8px 0 #854d0e, 0 8px 20px rgba(234, 179, 8, 0.4);
    color: #18181b;
}

.btn-play-main.cashout-style:active {
    box-shadow: 0 4px 0 #854d0e;
}

.action-buttons-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.cashout-label {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 2px;
    opacity: 0.9;
}

.cashout-amount {
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    /* Force 70% height for game screen on mobile */
    .screen {
        flex: 0 0 70%;
        height: 70%;
        min-height: 0;
    }

    /* Controls take remaining space - NO SCROLL requested */
    .controls-section {
        flex: 1;
        overflow: hidden;
        /* Prevent scroll */
        min-height: 0;
        padding: 6px;
    }

    .panel-container {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        /* Give slightly more space to bet section */
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 10px;
        height: 100%;
        align-content: center;
        /* Center vertically if space exists */
    }

    /* Grid Items Placement */
    .bet-section {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        margin-right: 2px;
    }

    .difficulty-section {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        min-width: 0;
    }

    .action-section {
        grid-column: 1 / -1;
        /* Span full width */
        grid-row: 2;
        margin-top: 0;
        height: auto;
        min-width: 0;
    }

    /* Compact Styling for Mobile */
    .difficulty-header {
        display: none;
        /* Hide 'Difficulty' text entirely */
    }

    .difficulty-pill {
        flex-wrap: wrap;
        /* Wrap buttons if needed (likely 2x2 inside) */
        gap: 4px;
        padding: 4px;
    }

    .diff-btn {
        padding: 6px 2px;
        font-size: 0.8rem;
    }

    .btn-play-main {
        height: 50px;
        /* Shorter play button */
        font-size: 1.4rem;
        box-shadow: 0 4px 0 #166534, 0 4px 10px rgba(34, 197, 94, 0.4);
        /* Reduced shadow depth */
    }

    .btn-play-main:active {
        transform: translateY(2px);
        box-shadow: 0 2px 0 #166534;
    }

    .bet-input-box {
        padding: 2px;
    }

    .panel-val-input {
        font-size: 1rem;
        padding: 6px;
    }

    .btn-min-max {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .btn-chip {
        padding: 6px 4px;
        font-size: 0.8rem;
        gap: 0;
        /* Remove gap if icon is hidden */
        justify-content: center;
        /* Center the text */
    }

    .chip-icon {
        display: inline;
        /* Hide icons to save space */
    }

    /* Full width road container for mobile */
    .road-container {
        padding: 0;
    }

    /* Fixed height message for consistency (1 or 2 lines) */
    .game-message {
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
        /* Reduced side padding */
        font-size: 1rem;
        /* Slightly smaller text for 2 lines */
        line-height: 1.2;
    }
}

/* Extra Small Devices (Phones, less than 576px) */
@media (max-width: 576px) {

    html,
    body,
    .game-container {
        height: 100% !important;
    }

    /* Mobile Header Adjustments */
    .game-header h5 {
        font-size: 1.1rem !important;
        /* Smaller title */
        white-space: nowrap;
    }

    .game-header .btn-group-sm .btn {
        font-size: 0.7rem;
        /* Smaller toggle buttons */
        padding: 0.2rem 0.4rem;
    }

    #balanceDisplay {
        font-size: 0.8rem !important;
        /* Smaller balance text */
        padding: 0.35em 0.5em;
    }

    .game-header {
        height: 50px !important;
        /* Slightly compacter header */
    }

    /* Override inline height style from HTML if needed, or better, strictly control content */
}

/* -----------------------------------------------------
   Account Popup & Beautification Styles
   ----------------------------------------------------- */

/* Custom Modal Styling (Glassmorphism) */
.glass-modal-content {
    background: linear-gradient(165deg, #1e293b, #0f172a) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    border-radius: 20px !important;
    overflow: hidden;
}

.glass-modal-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 1.5rem 1.5rem 1rem !important;
}

.glass-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.help-list li {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid #fbbf24;
    color: #e2e8f0;
}

/* Custom Tabs (Pills Style) */
.account-tabs {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 5px;
    margin: 0 1.5rem;
    border-bottom: none !important;
    display: flex;
    gap: 5px;
}

.account-tabs .nav-link {
    border: none !important;
    border-radius: 8px !important;
    color: #94a3b8 !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 15px;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.account-tabs .nav-link:hover {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.05);
}

.account-tabs .nav-link.active {
    background: #3b82f6 !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.account-tabs .nav-link#deposit-tab.active {
    background: #10b981 !important;
    /* Green for deposit */
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.5);
}

.account-tabs .nav-link#withdraw-tab.active {
    background: #ef4444 !important;
    /* Red for withdraw */
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.5);
}

/* Profile Section */
.profile-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    padding-top: 10px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.profile-username {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0;
}

.profile-id {
    font-size: 0.8rem;
    color: #64748b;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
}

/* Stats Cards */
.stats-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stats-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.stats-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 5px;
    font-weight: 600;
}

.stats-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
}

.stats-value.balance {
    color: #fbbf24;
    font-size: 1.4rem;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

/* Custom Table in Modals */
.custom-table-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-table {
    width: 100%;
    margin-bottom: 0;
    color: #ffffff;
    --bs-table-bg: transparent;
    --bs-table-color: #ffffff;
}

.custom-table thead th {
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    text-align: center;
}

.custom-table tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    padding: 12px;
    vertical-align: middle;
    text-align: center;
    color: #ffffff !important;
}

.custom-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

/* Rank Colors */
.custom-table tbody td.rank-gold {
    color: #fbbf24 !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.custom-table tbody td.rank-silver {
    color: #e2e8f0 !important;
    text-shadow: 0 0 10px rgba(226, 232, 240, 0.5);
}

.custom-table tbody td.rank-bronze {
    color: #d97706 !important;
    text-shadow: 0 0 10px rgba(217, 119, 6, 0.5);
}

.custom-table tbody td.text-yellow {
    color: #facc15 !important;
}

/* Rank Row Backgrounds */
.custom-table tbody tr.row-gold {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), transparent);
    border-left: 2px solid #fbbf24;
}

.custom-table tbody tr.row-silver {
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.1), transparent);
    border-left: 2px solid #e2e8f0;
}

.custom-table tbody tr.row-bronze {
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.1), transparent);
    border-left: 2px solid #d97706;
}