:root {
    --primary-gold: #ffd700;
    --primary-dark: #1a0b2e;
    --accent-red: #ff4136;
    --reel-bg: #f0f0f0;
    --machine-gradient: linear-gradient(180deg, #2b1d42 0%, #150826 100%);
    --glass-bg: rgba(26, 11, 46, 0.95);
    --xp-purple: #9d50bb;
}

.hidden {
    display: none !important;
}

.video-cutscene-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-cutscene-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.skip-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    background-color: #050b05;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2)),
        radial-gradient(circle at 50% 120%, rgba(20, 40, 20, 0.8) 0%, transparent 60%);
    background-size: cover;
    color: white;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main Container Wrapper */
.casino-container {
    width: 95vw;
    max-width: 900px;
    height: auto;
    aspect-ratio: 1 / 1;
    background: url('brGamebg.png') no-repeat center center;
    background-size: 100% 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: none;
    box-shadow: none;
}

@media screen and (max-width: 768px) {
    .casino-container {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        background-size: 100% 100% !important;
        background-position: center !important;
        background-color: #000;
    }

    .casino-container::after {
        background-size: 100% 100% !important;
        background-position: center !important;
        z-index: 10;
        pointer-events: none;
    }

    .slot-machine-frame {
        width: 48.5% !important;
        height: 44.5% !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, calc(-50% + 15px)) !important;
        z-index: 5;
        overflow: visible;
    }

    .bonus-column-left,
    .bonus-column-right {
        width: 45px !important;
        height: 44.5% !important;
        top: 50% !important;
        transform: translateY(calc(-50% + 15px)) !important;
    }

    .bonus-column-left {
        left: 15% !important;
    }

    .bonus-column-right {
        right: 15% !important;
    }

    .game-header {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        height: auto;
    }

    .controls-panel {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        padding: 5px 10px;
    }

    .trigger-img-wrap {
        width: 24px;
        height: 24px;
    }

    .trigger-label {
        font-size: 0.28rem;
    }

    .symbol {
        font-size: 1.5rem !important;
        height: 20% !important;
        /* Forces 5 rows to fit 100% height */
    }

    /* Fix Auto Menu position on mobile */
    .auto-options-menu {
        right: 0 !important;
        left: auto !important;
        bottom: 120% !important;
        width: 140px !important;
        transform: none !important;
        min-width: 120px !important;
    }
}

.casino-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('brGamebgTransp.png') no-repeat center center;
    background-size: 100% 100%;
    z-index: 10;
    pointer-events: none;
}

.gameplay-area {
    position: absolute;
    top: 31.4%;
    left: 26.5%;
    width: 47%;
    height: 41.5%;
    display: flex;
    flex-direction: column;
    background: #000;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.casino-container.free-spins-active {
    border-color: #ff4136;
    animation: revengePulse 2s infinite;
}

@keyframes revengePulse {

    0%,
    100% {
        box-shadow: 0 0 50px rgba(255, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
    }

    50% {
        box-shadow: 0 0 80px rgba(255, 0, 0, 0.8), inset 0 0 30px rgba(255, 0, 0, 0.2);
    }
}

/* Consolidated Header Bar */
.game-header {
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    z-index: 100;
    height: 60px;
}

.header-main-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.header-title {
    margin: 0;
    font-size: clamp(0.9rem, 4vw, 1.4rem);
    font-weight: 900;
    color: var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    white-space: nowrap;
}

.consolidated-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 500px;
}

.top-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.header-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.6rem;
    color: #9d80c4;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2px;
}

#credits {
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    font-weight: 800;
}

#win-amount {
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    color: var(--primary-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    font-weight: 800;
}

/* Silicon South Show Branding */
.sss-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: sssFadeIn 0.8s ease-out;
    padding-bottom: 2px;
}

.sss-label {
    font-size: 0.55rem;
    color: #9d80c4;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 2px;
}

.sss-logo {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
    transition: transform 0.3s ease;
}

.sss-logo:hover {
    transform: scale(1.1);
}

@keyframes sssFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reup-tiny-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    font-size: 0.5rem;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 900;
    margin-left: 5px;
    vertical-align: middle;
}

.header-level-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

.lvl-label {
    font-size: 0.7rem;
    color: var(--primary-gold);
    font-weight: 900;
    white-space: nowrap;
}

.xp-bar-outer {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#xp-progress {
    height: 100%;
    background: linear-gradient(90deg, #9d50bb, #6e48aa);
    box-shadow: 0 0 10px #9d50bb;
    width: 0%;
    transition: width 0.5s ease;
}

#xp-text-tiny {
    font-size: 0.55rem;
    color: #888;
    font-family: 'Monaco', monospace;
    white-space: nowrap;
}

.header-right-spacer {
    width: 44px;
}

/* Free Spins Status */
.free-spins-indicator {
    display: none;
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-red);
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 0 20px var(--accent-red);
    z-index: 20;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% {
        opacity: 0.8;
        box-shadow: 0 0 10px var(--accent-red);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 30px var(--accent-red);
    }

    100% {
        opacity: 0.8;
        box-shadow: 0 0 10px var(--accent-red);
    }
}

/* Level / XP Bar */
.bonus-column-left,
.bonus-column-right {
    position: absolute;
    top: 32.5%;
    height: 43%;
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.bonus-column-left {
    left: 16%;
}

.bonus-column-right {
    right: 16%;
}

.trigger-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    width: 100%;
}

.trigger-img-wrap {
    width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
    background: #111;
    border: 1px solid #444;
    border-radius: 4px;
}

.trigger-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--primary-gold), transparent);
    opacity: 0.8;
    transition: height 0.3s;
}

.trigger-label {
    font-size: 0.5rem;
    color: var(--primary-gold);
    font-weight: 950;
    text-align: center;
    text-transform: uppercase;
}

.level-container {
    width: 100%;
}

.lines-selection-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.lines-selection-bar .label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}

.line-buttons {
    display: flex;
    gap: 6px;
}

.line-opt-btn {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #888;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Monaco', monospace;
}

.line-opt-btn:hover {
    border-color: var(--primary-gold);
    color: #fff;
}

.line-opt-btn.active {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    border-color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.lines-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 3px 20px;
    border-radius: 20px;
    border: 1px solid #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.lines-badge.pop {
    transform: scale(1.1);
}

.level-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #9d80c4;
    font-weight: bold;
    margin-bottom: 5px;
}

.xp-bar-bg {
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#xp-progress {
    height: 100%;
    width: 30%;
    background: linear-gradient(to right, var(--xp-purple), #6e48aa);
    box-shadow: 0 0 10px var(--xp-purple);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal / Paytable */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--glass-bg);
    width: 90%;
    max-width: 500px;
    border: 2px solid #4a3b69;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-gold);
}

.close-modal {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.paytable-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.pay-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
}

.pay-item .symbol {
    font-size: 2rem;
    height: auto;
}

.pay-item .val {
    font-size: 0.8rem;
    color: var(--primary-gold);
    font-weight: bold;
}

.rule-info {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #ccc;
    line-height: 1.3;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
}

.rule-info p {
    margin: 4px 0;
}

.rule-info b {
    color: var(--primary-gold);
}

.slot-machine-frame {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    position: absolute;
    top: 32.5%;
    left: 26.5%;
    width: 47%;
    height: 44.5%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.reels-container {
    display: flex;
    gap: 2px;
    background: transparent;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.fog-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.7;
}

.fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1) 10%,
            rgba(255, 255, 255, 0.25) 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%);
    filter: blur(30px);
}

.fog-1 {
    animation: drift 30s linear infinite;
}

.fog-2 {
    animation: drift 45s linear infinite reverse;
    opacity: 0.5;
}

/* Anticipation / Madness Effects */
.reel.anticipating {
    z-index: 30;
    /* Higher than fog and other reels */
    outline: 3px solid var(--accent-red);
    outline-offset: -3px;
    transform: scale(1.04) translateZ(0);
    /* Hardware acceleration */
    transition: transform 0.2s ease;
    animation: lightning-flicker 0.15s infinite;
    will-change: transform;
}

.reel-strip.fast-blur {
    filter: blur(4px) brightness(1.3);
    will-change: filter;
}

@keyframes lightning-flicker {

    0%,
    100% {
        outline-color: var(--accent-red);
        filter: brightness(1);
    }

    50% {
        outline-color: #fff;
        filter: brightness(1.4);
    }
}

@keyframes drift {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.reel {
    flex: 1;
    background: #0a0f0a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    /* Create a metallic sheen on reels */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.05);
}

/* The strip of symbols that moves */
.reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Will be transformed by JS */
}

.symbol {
    height: 33.333%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Blur effect during spin */
.reel.spinning .reel-strip {
    filter: blur(2px);
}

.payline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#payline-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.neon-gold-line {
    fill: none;
    stroke: #ffd700;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px #ff8c00);
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 0.5s forwards, pulseLine 1.5s infinite 0.5s;
    opacity: 0.9;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulseLine {

    0%,
    100% {
        filter: drop-shadow(0 0 5px #ff8c00);
        stroke-width: 4;
    }

    50% {
        filter: drop-shadow(0 0 15px #ffd700);
        stroke-width: 6;
    }
}

/* Highlight winning symbols */
.symbol.winner {
    animation: pulse 1s infinite;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 20px gold;
    z-index: 5;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Leaderboard Items */
.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 10px;
    border-left: 4px solid #4a3b69;
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.leaderboard-item .rank {
    font-weight: bold;
    color: var(--primary-gold);
    width: 40px;
}

.leaderboard-item .name {
    flex: 1;
    font-weight: bold;
}

.leaderboard-item .lvl {
    font-size: 0.7rem;
    background: var(--xp-purple);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 15px;
}

.leaderboard-item .score {
    font-family: 'Monaco', monospace;
    color: var(--primary-gold);
}

.loading,
.error {
    text-align: center;
    padding: 20px;
    color: #888;
    font-style: italic;
}

.error {
    color: var(--accent-red);
}

.controls-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 2px solid var(--primary-gold);
    margin-top: auto;
    z-index: 100;
}

.side-control-btns {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gold-shadow {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    border: 1px solid var(--primary-gold) !important;
    background: var(--primary-gold) !important;
    color: #1a0b2e !important;
    font-weight: 900;
}

.spin-btn-container {
    position: relative;
    margin-left: auto;
}

.spin-button {
    width: clamp(80px, 20vw, 110px);
    height: clamp(80px, 20vw, 110px);
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 30% 30%, #4aff4a, #008000);
    color: white;
    font-weight: bold;
    font-size: clamp(1rem, 4vw, 1.6rem);
    box-shadow: 0 5px 0 #005000, 0 10px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.1s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    z-index: 5;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.spin-button:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #005000, 0 5px 5px rgba(0, 0, 0, 0.3);
}

.spin-button:disabled {
    filter: grayscale(0.5) brightness(0.7);
    cursor: not-allowed;
}

.spin-button.auto-active:active:not(:disabled) {
    box-shadow: 0 3px 0 #500000, 0 5px 10px rgba(255, 0, 0, 0.4);
}

.spin-button.holding::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 6px;
    background: var(--accent-red);
    animation: fillHold 0.6s linear forwards;
    z-index: 10;
}

.spin-button.auto-active {
    background: radial-gradient(circle at 30% 30%, #ff4136, #800000);
    box-shadow: 0 5px 0 #500000, 0 10px 15px rgba(255, 0, 0, 0.4);
}

.auto-btn-wrapper {
    position: relative;
    display: inline-block;
}

.auto-options-menu {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--primary-gold);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.2);
    min-width: 160px;
    backdrop-filter: blur(10px);
}

.auto-options-menu.hidden {
    display: none;
}

.auto-opt {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.auto-opt:hover {
    background: var(--accent-red);
    border-color: white;
}

.btn-auto-toggle {
    background: #444;
    color: #ccc;
    font-size: 0.8rem;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-auto-toggle.holding::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--accent-red);
    animation: fillHold 0.6s linear forwards;
}

@keyframes fillHold {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.sidebar-utility-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-gold);
}

.sidebar-btn .icon {
    font-size: 1.2rem;
}

button {
    cursor: pointer;
    touch-action: manipulation;
}

/* Landscape Mobile Fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: center;
        /* Center machine in landscape too */
        padding: 5px;
        overflow-y: auto;
    }

    .casino-container {
        max-height: 100vh;
        gap: 5px;
        transform: scale(0.85);
        /* Slightly more aggressive scale for safety */
        transform-origin: center center;
    }

    .reels-container {
        height: clamp(120px, 35vh, 180px);
    }

    .symbol {
        font-size: 2rem;
        height: 60px !important;
        /* Force smaller height */
    }

    .controls-panel {
        padding: 4px;
        gap: 5px;
    }

    .spin-button {
        width: 65px;
        height: 65px;
    }

    h1 {
        font-size: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .bet-controls {
        flex: 1;
        padding: 5px;
    }

    .line-buttons {
        gap: 4px;
    }

    .line-opt-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-bet-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.total-bet-display .label {
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#total-bet {
    color: var(--primary-gold);
    font-weight: 800;
    font-family: 'Monaco', monospace;
    font-size: 1rem;
}

.control-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(to bottom, #ddd, #999);
    font-weight: bold;
    cursor: pointer;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.secondary {
    width: auto;
    border-radius: 5px;
    padding: 5px 10px;
}

.bet-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

#current-bet {
    font-weight: bold;
    color: #fff;
}

/* Animations for coins/wins later */
.win-animation-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: gold;
    text-shadow: 0 0 20px orange;
    z-index: 100;
    animation: popInOut 2s forwards;
    pointer-events: none;
}

/* Settings Sidebar */
.settings-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--glass-bg);
    border-right: 2px solid #4a3b69;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateX(0);
    transition: transform 0.3s ease;
    z-index: 1001;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.modal-overlay.hidden .settings-sidebar {
    transform: translateX(-100%);
}

.settings-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.settings-section h3 {
    font-size: 0.8rem;
    color: var(--primary-gold);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.currency-key {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
}

.key-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.key-item span {
    font-weight: 900;
    color: var(--primary-gold);
    font-size: 1rem;
    min-width: 25px;
}

.key-item small {
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
}


.volume-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.vol-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.utility-btns {
    display: flex;
    gap: 5px;
}

@media (max-width: 600px) {
    .casino-container {
        padding: 5px;
        width: 100%;
        border-radius: 0;
        border: none;
    }

    .controls-panel {
        gap: 8px;
        padding: 8px;
    }

    .bet-controls {
        flex: 1;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);
    }

    .auto-controls {
        width: 100%;
        justify-content: space-between;
    }

    .spin-button {
        width: 70px;
        height: 70px;
        font-size: 1rem;
    }

    .vol-slider {
        flex: 1;
        height: 4px;
        appearance: none;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
        outline: none;
    }

    #credits,
    #win-amount {
        font-size: 1.1rem;
    }

    .symbol {
        font-size: 2.2rem;
    }
}

@keyframes popInOut {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* Summary Award Styles */
.summary-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6000;
    backdrop-filter: blur(12px);
    transition: opacity 0.5s ease;
}

.summary-alert-overlay.fade-out {
    opacity: 0;
}

.summary-content {
    background: linear-gradient(135deg, #2a1b3d, #3b2a50);
    padding: clamp(20px, 5vw, 60px);
    border-radius: 24px;
    border: 3px solid var(--primary-gold);
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
    animation: alertPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    max-width: 90%;
}

.summary-content h2 {
    color: var(--primary-gold);
    font-size: clamp(1.2rem, 6vw, 2.5rem);
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    font-weight: 900;
}

.summary-content .prize {
    font-size: clamp(1.5rem, 8vw, 4rem);
    color: #fff;
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 900;
    margin: 30px 0;
    background: linear-gradient(to bottom, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-btn {
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    color: #1a0b2e;
    border: none;
    padding: 15px 50px;
    font-size: 1.4rem;
    font-weight: 900;
    border-radius: 40px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
}

.summary-btn:active {
    transform: scale(0.95);
}

@keyframes alertPop {
    from {
        transform: scale(0.4);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Respin Mode Styles */
.respin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 5500;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(12px);
}

.respin-inner {
    width: 95%;
    max-width: 800px;
    background: var(--machine-gradient);
    border: 3px solid var(--accent-red);
    border-radius: 24px;
    padding: clamp(10px, 3vw, 30px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 0 60px rgba(255, 65, 54, 0.4);
    animation: alertPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.respin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.respin-title {
    font-size: clamp(1.2rem, 5vw, 2.2rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px var(--accent-red), 0 0 20px var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Respin Lives Indicators */
.respin-lives {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 65, 54, 0.3);
}

.life-light {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #331010;
    box-shadow: inset 0 0 5px #000;
    transition: all 0.3s;
}

.life-light.active {
    background: var(--accent-red);
    box-shadow: 0 0 12px var(--accent-red), inset 0 0 4px #fff;
}

.respin-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(5px, 2vw, 12px);
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 65, 54, 0.2);
    overflow: hidden;
}

.respin-cell {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: clamp(4px, 1vw, 10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.respin-cell.held {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.respin-cell.held.type-BONUS {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--primary-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.respin-cell.held.type-MONEY {
    background: rgba(30, 150, 255, 0.05);
    border: 2px solid #1e96ff;
    box-shadow: 0 0 15px rgba(30, 150, 255, 0.2);
}

.respin-cell .symbol {
    width: 85%;
    height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.respin-cell .respin-value {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: clamp(0.6rem, 2vw, 0.9rem);
    font-weight: 900;
    text-align: center;
    padding: 2px 0;
    font-family: 'Monaco', 'Consolas', monospace;
}

.respin-cell.new-hit {
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.respin-cell.spinning::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: cellBlur 0.15s infinite linear;
}

.respin-cell.anticipating {
    border: 3px solid var(--accent-red) !important;
    background: rgba(255, 65, 54, 0.2) !important;
    box-shadow: 0 0 25px var(--accent-red), inset 0 0 15px var(--accent-red);
    animation: respinPulse 0.4s infinite alternate;
    z-index: 10;
}

.respin-cell.anticipating.spinning::after {
    animation-duration: 0.05s;
    background: linear-gradient(0deg, transparent, rgba(255, 65, 54, 0.3), transparent);
}

@keyframes respinPulse {
    from {
        transform: scale(1);
        filter: brightness(1);
    }

    to {
        transform: scale(1.05);
        filter: brightness(1.5);
    }
}

@keyframes cellBlur {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.3);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.respin-btn-container {
    display: flex;
    justify-content: center;
    margin-top: -10px;
    z-index: 100;
}

.respin-catch-btn {
    background: radial-gradient(circle at 30% 30%, #ff4136, #8b0000);
    border: 3px solid #ffcc00;
    color: white;
    font-size: clamp(1.2rem, 5vw, 2rem);
    font-weight: 900;
    padding: 10px 40px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 65, 54, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: catchBtnPulse 1.5s infinite;
}

@keyframes catchBtnPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 65, 54, 0.6);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255, 65, 54, 0.9);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 65, 54, 0.6);
    }
}

.respin-catch-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-3px) scale(1.05);
}

.respin-catch-btn:active {
    transform: translateY(1px) scale(0.95);
}

.respin-catch-btn:disabled {
    filter: grayscale(1) opacity(0.5);
    cursor: not-allowed;
    animation: none;
}

.respin-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    text-align: center;
    color: #9d80c4;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.coin {
    position: fixed;
    width: clamp(20px, 4vw, 30px);
    height: clamp(20px, 4vw, 30px);
    background: radial-gradient(circle at 30% 30%, #ffd700, #ff8c00);
    border: 2px solid #b8860b;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.coin::after {
    content: '$';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #b8860b;
    font-weight: bold;
    font-size: 0.8rem;
}

/* New Bonus Triggers Area */
.bonus-triggers-area {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: clamp(10px, 2vw, 20px);
    border-radius: 20px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    margin: 10px 0;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.trigger-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.trigger-box:hover {
    transform: translateY(-5px) scale(1.05);
}

.trigger-img-wrap {
    width: clamp(80px, 15vw, 110px);
    height: clamp(80px, 15vw, 110px);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.4));
    border: 3px solid rgba(255, 215, 0, 0.4);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.trigger-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
}

.trigger-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    /* Dynamic */
    background: linear-gradient(to top, var(--primary-gold), transparent);
    z-index: 1;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.6;
}

.trigger-label {
    font-size: 0.75rem;
    color: #ffd700;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Side Control Buttons (MAX / LINES) */
.side-control-btns {
    display: flex;
    gap: 15px;
    flex: 1;
}

.line-cycle-btn-large {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    background: linear-gradient(180deg, #444, #222) !important;
    border: 2px solid #666 !important;
    padding: 8px !important;
    border-radius: 12px !important;
}

.line-cycle-btn-large #current-lines-display {
    font-family: 'Monaco', monospace;
    font-weight: 950;
    color: var(--primary-gold);
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.gold-shadow {
    flex: 1;
    height: auto;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
}

/* Jackpot Wheel Styles */
.wheel-modal-content {
    background: radial-gradient(circle at center, #2e1a47 0%, #0d061a 100%);
    width: 95%;
    max-width: 600px;
    border: 4px solid var(--primary-gold);
    border-radius: 40px;
    padding: 30px;
    position: relative;
    box-shadow: 0 0 100px rgba(255, 215, 0, 0.3);
    text-align: center;
}

.wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 30px auto;
    border: 10px solid #1a0b2e;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-gold);
}

.wheel-pointer {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: var(--primary-gold);
    filter: drop-shadow(0 2px 5px #000);
    z-index: 10;
}

.the-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.15, 0, 0.15, 1);
    transform: rotate(0deg);
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    left: 50%;
    top: 0;
    transform-origin: 0% 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    box-sizing: border-box;
}

.wheel-segment-content {
    transform: rotate(15deg);
    /* Center text in segment */
    font-weight: 900;
    font-size: 0.8rem;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wheel-result-text {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-gold);
    min-height: 2.5rem;
    margin-top: 20px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.test-btn {
    font-size: 0.65rem !important;
    background: rgba(255, 65, 54, 0.1) !important;
    border-color: rgba(255, 65, 54, 0.3) !important;
}

.test-btn:hover {
    background: rgba(255, 65, 54, 0.3) !important;
}

/* Smoke/Collection Effect */
.collector-particle {
    position: fixed;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}