/* DIGITAL REEL */
#cinematic-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 500;
    transition: opacity 0.5s;
}

#cinematic-layer.active {
    opacity: 1;
    pointer-events: all;
}

.cinematic-controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.cinematic-controls.show {
    opacity: 1;
    pointer-events: all;
}

#respin-btn, #remove-respin-btn {
    background: #ff0000;
    color: #fff;
    border: 2px solid #ffd700;
    padding: 12px 30px;
    font-family: 'Lexend', sans-serif;
    font-weight: 900;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    text-transform: uppercase;
    transition: transform 0.2s, filter 0.2s;
}

#respin-btn:hover, #remove-respin-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

#remove-respin-btn.alt-btn {
    background: transparent;
    color: #ff3333;
    border: 1px solid #ff3333;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    font-size: 12px;
    padding: 10px 20px;
}

#remove-respin-btn.alt-btn:hover {
    background: rgba(255, 0, 0, 0.15);
}

.cinematic-controls p {
    color: rgba(255,255,255,0.5);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.reel-window {
    width: 320px;
    height: 140px;
    background: #000;
    border: 4px solid #ffd700;
    position: relative;
    box-shadow: 0 0 100px rgba(255, 215, 0, 0.3), inset 0 0 50px #000;
    overflow: hidden;
}

.digital-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.04));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 20;
}

.reel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 1) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 1) 100%);
    z-index: 10;
}

.slot-item {
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 34px;/* Default */
    font-weight: 900;
    color: #fff;
    font-family: 'Lexend', sans-serif;
    padding: 0 15px;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.1; /* Tight for Viet accents */
    word-wrap: break-word;
}

.slot-item.winner {
    color: #ffd700;
    text-shadow: 0 0 20px #ffd700, 0 0 40px #ff0000;
    font-size: 42px;
    animation: victory-glow 1s infinite alternate;
}

@keyframes victory-glow {
    from {
        filter: brightness(1);
        transform: scale(1);
    }
    to {
        filter: brightness(1.5) contrast(1.2);
        transform: scale(1.05);
    }
}

/* FUTURISTIC LEVER */
.lever-container {
    position: absolute;
    right: -25px;
    top: 220px;
    z-index: 600;
    transform-style: preserve-3d;
    cursor: pointer;
}

.lever-socket {
    position: absolute;
    left: 0;
    top: 120px;
    width: 20px;
    height: 40px;
    background: #1a1a1a;
    border: 1px solid #ffd700;
    border-radius: 0 5px 5px 0;
    box-shadow: 5px 0 15px rgba(255, 215, 0, 0.3);
    z-index: 5;
}

.lever-arm {
    width: 14px;
    height: 140px;
    background: linear-gradient(to right, #666, #ffd700, #666);
    border: 1px solid #8b6b23;
    border-radius: 5px;
    transform-origin: bottom center;
    transition: transform 0.4s;
    margin-left: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 10;
    transform: translateZ(10px);
}

.lever-glow {
    position: relative;
    top: -15px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #ff5555, #800);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8), 0 0 30px #ff0000;
    flex-shrink: 0;
}

/* ADVANCED LEVER PHYSICS */
.lever-pull .lever-arm {
    animation: lever-bounce 0.8s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

@keyframes lever-bounce {
    0% { transform: rotateX(0deg) translateZ(10px); }
    25% { transform: rotateX(-75deg) scaleY(0.8) translateZ(10px); }
    40% { transform: rotateX(-75deg) scaleY(0.8) translateZ(10px); }
    60% { transform: rotateX(15deg) scaleY(1.05) translateZ(10px); }
    80% { transform: rotateX(-5deg) scaleY(0.98) translateZ(10px); }
    100% { transform: rotateX(0deg) scaleY(1) translateZ(10px); }
}

.lever-pull .lever-glow {
    background: #fff;
    box-shadow: 0 0 40px #fff, 0 0 80px #ff0000;
}

/* HYPER-DRIVE CINEMATIC TRANSITION */
.casino-cabinet {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cabinet-zoom {
    transform: scale(1.15) rotateX(5deg) translateY(-20px);
}

#transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    background: white;
}

.trigger-flash {
    animation: flash-out 0.6s forwards;
}

@keyframes flash-out {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

/* Digital Glitch Noise */
.trigger-glitch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(255, 215, 0, 0.1) 0px, transparent 1px, rgba(255, 0, 0, 0.1) 2px);
    z-index: 1001;
    animation: glitch-anim 0.2s infinite;
}

@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-5px, 5px); }
    40% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); }
    80% { transform: translate(5px, -5px); }
    100% { transform: translate(0); }
}

.blur-ui {
    filter: blur(25px) brightness(0.3) contrast(1.5);
    transform: scale(0.9);
    transition: filter 0.5s, transform 0.5s;
}

/* PROGRESS BAR */
#progress-container {
    position: absolute;
    right: 10px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    z-index: 100;
}

#progress-bar {
    width: 100%;
    height: 0%;
    position: absolute;
    bottom: 0;
    background: #ffd700;
    box-shadow: 0 0 15px #ffd700;
    transition: height 0.1s linear;
}

/* CELEBRATION SPARKS */
.spark {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 15px #ffd700, 0 0 30px #ff0000;
}

@keyframes spark-fly {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

.digital-footer {
    position: absolute;
    bottom: 10px; /* More padding */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 25px;
    opacity: 0.8; /* Higher visibility */
    pointer-events: none;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.digital-footer span {
    font-size: 10px; /* Slightly bigger */
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

#entropy-pulse {
    color: #fff;
    transition: color 0.1s;
}

/* SUPREME POLISH - RESPONSIVE & SHIMMER */
@media (max-width: 450px),
(max-height: 700px) {
    #app-container {
        transform: scale(0.8);
    }
}

@media (max-height: 600px) {
    #app-container {
        transform: scale(0.65);
    }
}

::selection {
    background: #ff3333;
    color: #fff;
    text-shadow: 0 0 5px #fff;
}
