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

body {
    font-family: 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0a0008;
    overflow-x: hidden;
    color: #fff;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === MACHINE FRAME === */
.machine {
    position: relative;
    z-index: 1;
    width: 95%;
    max-width: 750px;
    background: linear-gradient(180deg, #2a0a3a, #1a0525, #0f0218);
    border: 3px solid #ff00aa;
    border-radius: 20px;
    padding: 0;
    box-shadow:
        0 0 30px rgba(255, 0, 170, 0.4),
        0 0 80px rgba(255, 0, 170, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* === TOP MARQUEE === */
.machine-top {
    background: linear-gradient(180deg, #1a0028, #2a0a3a);
    padding: 10px 0 5px;
    border-bottom: 2px solid rgba(255, 0, 170, 0.3);
}

.marquee {
    text-align: center;
    padding: 8px 0;
}

.marquee h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.4rem;
    background: linear-gradient(90deg, #ff00aa, #ffdd00, #ff00aa, #00ffcc, #ff00aa);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: neonShift 4s linear infinite;
    text-shadow: none;
}

@keyframes neonShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 300% center; }
}

/* === CHASER LIGHTS === */
.lights {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 4px 10px;
    flex-wrap: wrap;
}

.lights span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff00aa;
    box-shadow: 0 0 6px #ff00aa;
    animation: chaserBlink 1.5s ease-in-out infinite;
}

.lights span:nth-child(3n)   { animation-delay: 0s; background: #ffdd00; box-shadow: 0 0 6px #ffdd00; }
.lights span:nth-child(3n+1) { animation-delay: 0.5s; background: #00ffcc; box-shadow: 0 0 6px #00ffcc; }
.lights span:nth-child(3n+2) { animation-delay: 1s; background: #ff00aa; box-shadow: 0 0 6px #ff00aa; }

@keyframes chaserBlink {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* === SCREEN === */
.screen {
    position: relative;
    margin: 12px;
    background: #050510;
    border: 2px solid #333;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 255, 200, 0.05);
}

.screen-inner {
    padding: 16px 12px;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 200, 0.015) 2px,
        rgba(0, 255, 200, 0.015) 4px
    );
    pointer-events: none;
    z-index: 2;
}

.screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 3;
}

/* === SET LABELS === */
.set-labels {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 8px;
    top: 16px;
    gap: 12px;
    z-index: 1;
}

.set-labels span {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    color: rgba(0, 255, 200, 0.4);
    line-height: 54px;
    letter-spacing: 1px;
}

/* === BALL ROWS === */
.all-sets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 50px;
}

.number-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 0, 170, 0.08);
}

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

/* === BALLS === */
.ball {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: rgba(255,255,255,0.15);
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.05), transparent 60%),
                linear-gradient(145deg, #1a1a2e, #0a0a18);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    transition: transform 0.3s;
}

.ball.empty {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
}

/* Ball color ranges - neon casino style */
.ball.range-1 {
    background: radial-gradient(circle at 30% 30%, #fff7a8, #f7d046 40%, #c89b00);
    border: 2px solid #ffe066;
    color: #5a3e00;
    box-shadow: 0 0 12px rgba(247, 208, 70, 0.6), inset 0 -3px 6px rgba(0,0,0,0.2);
    text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}

.ball.range-2 {
    background: radial-gradient(circle at 30% 30%, #a8d8ff, #3a9ff5 40%, #1a5fc0);
    border: 2px solid #5eb3f6;
    color: #fff;
    box-shadow: 0 0 12px rgba(58, 159, 245, 0.6), inset 0 -3px 6px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.ball.range-3 {
    background: radial-gradient(circle at 30% 30%, #ffa8a8, #f54040 40%, #c01a1a);
    border: 2px solid #f55;
    color: #fff;
    box-shadow: 0 0 12px rgba(245, 64, 64, 0.6), inset 0 -3px 6px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.ball.range-4 {
    background: radial-gradient(circle at 30% 30%, #d8d8d8, #888 40%, #555);
    border: 2px solid #aaa;
    color: #fff;
    box-shadow: 0 0 12px rgba(150, 150, 150, 0.4), inset 0 -3px 6px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.ball.range-5 {
    background: radial-gradient(circle at 30% 30%, #a8ffb8, #30d050 40%, #1a8f2a);
    border: 2px solid #5cd65c;
    color: #fff;
    box-shadow: 0 0 12px rgba(48, 208, 80, 0.6), inset 0 -3px 6px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Rolling state */
.ball.rolling {
    border: 1px solid rgba(0, 255, 200, 0.3);
    background: linear-gradient(145deg, #1a1a3e, #0a0a28);
    color: #00ffcc;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    animation: slotFlicker 0.06s steps(1) infinite;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.2);
}

@keyframes slotFlicker {
    0%   { text-shadow: 0 0 8px rgba(0, 255, 200, 0.8); }
    50%  { text-shadow: 0 0 2px rgba(0, 255, 200, 0.3); }
}

/* Reveal */
.ball.revealed {
    animation: slamIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slamIn {
    0%   { transform: scale(1.8) rotate(-15deg); opacity: 0; }
    50%  { transform: scale(0.9) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Row flash when complete */
.number-row.complete {
    animation: rowFlash 0.6s ease-out;
}

@keyframes rowFlash {
    0%   { background: rgba(255, 0, 170, 0.2); }
    100% { background: transparent; }
}

/* === ARCADE BUTTON === */
.controls {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

.arcade-btn {
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.1s;
}

.arcade-btn:active {
    transform: translateY(4px);
}

.arcade-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-face {
    display: block;
    padding: 16px 48px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(180deg, #ff2288, #cc0066);
    border: 3px solid #ff66aa;
    border-radius: 12px;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    box-shadow:
        0 6px 0 #880044,
        0 8px 20px rgba(255, 0, 100, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: box-shadow 0.1s;
}

.arcade-btn:active .btn-face {
    box-shadow:
        0 2px 0 #880044,
        0 3px 10px rgba(255, 0, 100, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.arcade-btn:hover .btn-face {
    background: linear-gradient(180deg, #ff3399, #dd1177);
    box-shadow:
        0 6px 0 #880044,
        0 8px 30px rgba(255, 0, 100, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* === BOTTOM LIGHTS === */
.bottom-lights {
    padding: 10px 20px 14px;
    border-top: 2px solid rgba(255, 0, 170, 0.2);
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.3));
}

/* === CONFETTI === */
.confetti {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    animation: confettiFall 2.5s ease-in forwards;
}

@keyframes confettiFall {
    0%   { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(100vh) rotate(1080deg) scale(0.3); }
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .machine { width: 98%; }
    .marquee h1 { font-size: 0.8rem; }
    .ball { width: 40px; height: 40px; font-size: 0.8rem; }
    .number-row { gap: 6px; }
    .all-sets { padding-left: 36px; gap: 8px; }
    .set-labels span { font-size: 0.35rem; line-height: 40px; }
    .set-labels { gap: 8px; }
    .btn-face { padding: 12px 28px; font-size: 0.65rem; }
    .lights span { width: 6px; height: 6px; }
}
