* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #0d0d15;
}

/* ============================================
   INTERACTIVE ENVIRONMENT - WITCH ATMOSPHERE
   ============================================ */

.environment-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
    background: linear-gradient(180deg, #0a0510 0%, #1a0f2e 30%, #0d1f15 70%, #0a0510 100%);
}

/* Mystical fog layers */
.env-witch .fog-layer {
    position: absolute;
    top: 0;
    left: -50%;
    right: -50%;
    height: 100%;
    filter: blur(80px);
    opacity: 0.4;
    animation: fogDrift 25s ease-in-out infinite;
}

.env-witch .fog-layer:nth-child(1) {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(138, 43, 227, 0.25) 30%, 
        rgba(75, 0, 130, 0.2) 50%, 
        rgba(138, 43, 227, 0.25) 70%, 
        transparent 100%);
    animation-delay: 0s;
    top: 20%;
}

.env-witch .fog-layer:nth-child(2) {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 100, 0, 0.2) 25%, 
        rgba(34, 139, 34, 0.15) 50%, 
        rgba(0, 100, 0, 0.2) 75%, 
        transparent 100%);
    animation-delay: -8s;
    animation-duration: 30s;
    top: 50%;
}

.env-witch .fog-layer:nth-child(3) {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(75, 0, 130, 0.15) 35%, 
        rgba(138, 43, 227, 0.1) 65%, 
        transparent 100%);
    animation-delay: -16s;
    animation-duration: 35s;
    top: 70%;
}

/* Floating magical orbs/particles */
.env-witch .magic-orb {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(138, 43, 227, 0.9) 0%, rgba(75, 0, 130, 0.4) 50%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(138, 43, 227, 0.6), 0 0 20px rgba(138, 43, 227, 0.3);
    animation: orbFloat 15s ease-in-out infinite;
}

.env-witch .magic-orb:nth-child(4) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.env-witch .magic-orb:nth-child(5) { left: 25%; animation-delay: -3s; animation-duration: 18s; }
.env-witch .magic-orb:nth-child(6) { left: 40%; animation-delay: -6s; animation-duration: 14s; }
.env-witch .magic-orb:nth-child(7) { left: 60%; animation-delay: -9s; animation-duration: 16s; }
.env-witch .magic-orb:nth-child(8) { left: 75%; animation-delay: -12s; animation-duration: 20s; }
.env-witch .magic-orb:nth-child(9) { left: 90%; animation-delay: -5s; animation-duration: 13s; }

/* Green toxic bubbles rising */
.env-witch .toxic-bubble {
    position: absolute;
    bottom: -20px;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(50, 205, 50, 0.7) 0%, rgba(34, 139, 34, 0.4) 50%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(50, 205, 50, 0.5);
    animation: bubbleRise 10s linear infinite;
}

.env-witch .toxic-bubble:nth-child(10) { left: 15%; animation-delay: 0s; animation-duration: 8s; width: 6px; height: 6px; }
.env-witch .toxic-bubble:nth-child(11) { left: 30%; animation-delay: -2s; animation-duration: 12s; }
.env-witch .toxic-bubble:nth-child(12) { left: 50%; animation-delay: -4s; animation-duration: 9s; width: 10px; height: 10px; }
.env-witch .toxic-bubble:nth-child(13) { left: 70%; animation-delay: -6s; animation-duration: 11s; width: 5px; height: 5px; }
.env-witch .toxic-bubble:nth-child(14) { left: 85%; animation-delay: -8s; animation-duration: 10s; width: 7px; height: 7px; }

/* Win effect - intensify atmosphere */
.env-witch.win-active {
    background: linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 30%, #1a3d25 70%, #1a0a2e 100%);
}

.env-witch.win-active .fog-layer {
    filter: blur(60px) brightness(1.5);
    opacity: 0.7;
}

.env-witch.win-active .magic-orb {
    box-shadow: 0 0 20px rgba(138, 43, 227, 0.9), 0 0 40px rgba(138, 43, 227, 0.5);
    animation-duration: 5s;
}

@keyframes fogDrift {
    0%, 100% { 
        transform: translateX(-20%) scaleY(1);
        opacity: 0.3;
    }
    25% { 
        transform: translateX(10%) scaleY(1.1);
        opacity: 0.5;
    }
    50% { 
        transform: translateX(20%) scaleY(0.9);
        opacity: 0.4;
    }
    75% { 
        transform: translateX(-10%) scaleY(1.05);
        opacity: 0.6;
    }
}

@keyframes orbFloat {
    0%, 100% {
        transform: translateY(100vh) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-10vh) scale(0.5);
        opacity: 0;
    }
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* ============================================
   DARK CONFETTI - Skulls, Bats, Bones
   ============================================ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -30px;
    animation: confettiFall linear forwards;
    will-change: transform;
}

.confetti svg {
    width: 20px;
    height: 20px;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) rotate(90deg) translateX(30px);
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-20px);
    }
    75% {
        transform: translateY(75vh) rotate(270deg) translateX(25px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) translateX(0);
        opacity: 0;
    }
}

/* Game container */
.game-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    position: relative;
    z-index: 100;
    padding: 20px;
}

.game-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 700px;
    position: relative;
}

/* Rules panel - witch style */
.rules-panel {
    position: absolute;
    right: -170px;
    top: 0;
    display: block;
    background: linear-gradient(145deg, rgba(20, 10, 30, 0.95) 0%, rgba(40, 20, 60, 0.9) 100%);
    border: 2px solid #8a2be2;
    border-radius: 15px;
    padding: 15px;
    width: 250px;
    box-shadow: 0 0 30px rgba(138, 43, 227, 0.3), inset 0 0 20px rgba(138, 43, 227, 0.1);
}

.slot-machine {
    position: relative;
    z-index: 100;
    background: linear-gradient(145deg, #1a0f2e 0%, #0d1f15 50%, #1a0f2e 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(138, 43, 227, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.05);
    border: 2px solid #4a306d;
    width: 400px;
    flex-shrink: 0;
    margin: 0 auto;
}

.rules-panel h3 {
    color: #9d4edd;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

.rules-panel ul {
    list-style: none;
    color: #c9b1d6;
    font-size: 12px;
}

.rules-panel li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(138, 43, 227, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.rules-panel li:last-child {
    border-bottom: none;
}

.rules-panel li.highlight {
    background: rgba(157, 78, 221, 0.25);
    border-radius: 5px;
    padding: 6px;
    margin: 2px 0;
    animation: highlightPulse 0.5s ease 3;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.4);
}

@keyframes highlightPulse {
    0%, 100% { background: rgba(157, 78, 221, 0.25); }
    50% { background: rgba(157, 78, 221, 0.5); }
}

.rules-panel .symbol-preview {
    width: 60px;
    height: 24px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-panel .symbol-preview img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.rules-panel .payout {
    color: #9d4edd;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(157, 78, 221, 0.5);
}

@media (max-width: 768px) {
    body {
        overflow: hidden;
        min-height: 100vh;
        height: 100vh;
    }
    
    .game-container {
        padding: 3px;
        min-height: 100vh;
        height: 100vh;
        align-items: flex-start;
        padding-top: 5px;
    }
    
    .game-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        width: 100%;
        max-width: 100%;
    }
    
    .slot-machine {
        width: 100%;
        max-width: 360px;
        padding: 8px;
        transform: scale(0.93);
        transform-origin: top center;
    }
    
    .machine-header {
        margin-bottom: 6px;
    }
    
    .game-title {
        width: 120px;
        height: 32px;
    }
    
    .reel {
        width: 65px;
        height: 130px;
    }
    
    .reel-strip {
        transform: translateY(-32px);
    }
    
    @keyframes smoothSpin {
        0% { transform: translateY(-32px); }
        100% { transform: translateY(-98px); }
    }
    
    @keyframes reelBlur {
        0% { transform: translateY(-32px); }
        50% { transform: translateY(-34px); }
        100% { transform: translateY(-32px); }
    }
    
    .symbol {
        width: 65px;
        height: 65px;
    }
    
    .symbol img {
        max-width: 50px;
        max-height: 50px;
    }
    
    .slot-grid {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .payline {
        top: 63px;
        height: 3px;
    }
    
    .result-panel {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        padding: 6px 8px;
        margin-bottom: 6px;
    }
    
    .result-text {
        font-size: 11px;
    }
    
    .win-amount {
        font-size: 14px;
    }
    
    .bet-panel {
        padding: 6px;
        margin-bottom: 6px;
        gap: 6px;
    }
    
    .bet-input {
        padding: 6px;
        font-size: 14px;
    }
    
    .quick-bets {
        flex-wrap: wrap;
        gap: 0px !important;
    }
    
    .bet-btn {
        min-width: 40px;
        padding: 4px 2px;
        font-size: 9px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .balance-display {
        padding: 6px 10px;
    }
    
    .balance-label {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .balance-value {
        font-size: 14px;
    }
    
    .spin-btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .rules-panel {
        display: none;
    }
    
    .rules-btn {
        display: block;
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .mute-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .header-buttons {
        gap: 6px;
    }
}

/* Desktop - hide modal button */
@media (min-width: 769px) {
    .rules-btn {
        display: none;
    }
    
    .rules-modal {
        display: none !important;
    }
}

.machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* SVG Logo styling */
.game-title {
    color: #9d4edd;
    font-size: 0;
    width: 150px;
    height: 40px;
}

.game-title svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(157, 78, 221, 0.6));
}

.rules-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #8a2be2;
    background: transparent;
    color: #9d4edd;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(138, 43, 227, 0.3);
}

.rules-btn:hover {
    background: #8a2be2;
    color: #fff;
    box-shadow: 0 0 20px rgba(138, 43, 227, 0.6);
}

/* Header buttons container */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mute button - witch style */
.mute-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #228b22;
    background: transparent;
    color: #32cd32;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(34, 139, 34, 0.3);
}

.mute-btn:hover {
    background: #228b22;
    color: #fff;
    box-shadow: 0 0 20px rgba(34, 139, 34, 0.6);
}

.mute-btn.muted {
    border-color: #555;
    color: #777;
    opacity: 0.6;
    box-shadow: none;
}

/* Result panel - witch styling */
.result-panel {
    background: linear-gradient(145deg, rgba(20, 10, 30, 0.9) 0%, rgba(30, 20, 40, 0.95) 100%);
    border: 3px solid #4a306d;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 12px;
    text-align: center;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(138, 43, 227, 0.1);
}

.result-panel.win {
    border-color: #9d4edd;
    background: linear-gradient(145deg, rgba(157, 78, 221, 0.3) 0%, rgba(20, 10, 30, 0.9) 100%);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.6), inset 0 0 10px rgba(157, 78, 221, 0.3);
    animation: winPulseStrong 0.6s ease infinite;
}

.result-panel.lose {
    border-color: #8b0000;
    background: linear-gradient(145deg, rgba(139, 0, 0, 0.2) 0%, rgba(20, 10, 30, 0.9) 100%);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.4);
    animation: losePulse 0.5s ease;
}

@keyframes winPulseStrong {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(157, 78, 221, 0.6), inset 0 0 10px rgba(157, 78, 221, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(157, 78, 221, 0.9), inset 0 0 20px rgba(157, 78, 221, 0.5);
    }
}

@keyframes losePulse {
    0%, 100% { }
    50% { }
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.result-text {
    color: #888;
    font-size: 14px;
    font-weight: 600;
}

.result-panel.win .result-text {
    color: #9d4edd;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

.result-panel.lose .result-text {
    color: #cd5c5c;
    font-weight: 600;
}

.win-amount {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

/* Slot grid */
.slot-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}

/* Reel styling - witch theme */
.reel {
    width: 100px;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(145deg, #2a1f3e 0%, #1a0f2e 100%);
    border: 3px solid #4a306d;
    border-radius: 10px;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(138, 43, 227, 0.2);
    transition: all 0.3s ease;
}

.reel:hover {
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(138, 43, 227, 0.4);
}

/* Payline indicator */
.payline {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 98px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #9d4edd 30%, #9d4edd 70%, transparent 100%);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.8), 0 0 20px rgba(157, 78, 221, 0.5);
    z-index: 10;
    pointer-events: none;
}

.reel-strip {
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(-50px);
}

.reel-strip.spinning {
    animation: reelBlur 0.05s linear infinite;
}

@keyframes reelBlur {
    0% { transform: translateY(-50px); }
    50% { transform: translateY(-52px); }
    100% { transform: translateY(-50px); }
}

.symbol {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #1a0f2e 0%, #0d0a15 100%);
    position: relative;
}

.symbol img {
    max-width: 75px;
    max-height: 75px;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* ============================================
   SYMBOL WIN ANIMATIONS
   ============================================ */

/* Pentagram - glow and pulse purple */
.symbol.pentagram-win img {
    animation: pentagramGlow 1s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(138, 43, 227, 0.9));
}

@keyframes pentagramGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(138, 43, 227, 0.8)) drop-shadow(0 0 30px rgba(138, 43, 227, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 25px rgba(138, 43, 227, 1)) drop-shadow(0 0 50px rgba(138, 43, 227, 0.8));
    }
}

/* Crystal Ball - spiral animation inside */
.symbol.crystal-win {
    position: relative;
}

.symbol.crystal-win::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, #4169e1, #8a2be2, #4b0082, transparent);
    animation: crystalSpiral 2s linear infinite;
    opacity: 0.7;
    z-index: 0;
}

.symbol.crystal-win img {
    position: relative;
    z-index: 1;
    animation: crystalFloat 2s ease-in-out infinite;
}

@keyframes crystalSpiral {
    0% { transform: rotate(0deg) scale(0.8); }
    100% { transform: rotate(360deg) scale(0.8); }
}

@keyframes crystalFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Broom - sweeping animation */
.symbol.broom-win img {
    animation: broomSweep 0.8s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes broomSweep {
    0%, 100% { transform: rotate(-15deg) translateX(0); }
    25% { transform: rotate(10deg) translateX(10px); }
    50% { transform: rotate(-5deg) translateX(5px); }
    75% { transform: rotate(15deg) translateX(-5px); }
}

/* Cauldron - bubbling green bubbles */
.symbol.cauldron-win {
    position: relative;
    overflow: hidden;
}

.symbol.cauldron-win::before,
.symbol.cauldron-win::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #32cd32 0%, #228b22 50%, transparent 70%);
    border-radius: 50%;
    animation: bubbleRiseUp 1.5s ease-out infinite;
}

.symbol.cauldron-win::before {
    left: 35%;
    bottom: 20px;
    animation-delay: 0s;
}

.symbol.cauldron-win::after {
    left: 55%;
    bottom: 25px;
    width: 6px;
    height: 6px;
    animation-delay: 0.5s;
}

.symbol.cauldron-win .bubble-3 {
    position: absolute;
    left: 45%;
    bottom: 30px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #7fff00 0%, #32cd32 50%, transparent 70%);
    border-radius: 50%;
    animation: bubbleRiseUp 1.2s ease-out infinite;
    animation-delay: 0.8s;
}

@keyframes bubbleRiseUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-60px) scale(0.3);
        opacity: 0;
    }
}

.symbol.cauldron-win img {
    animation: cauldronShake 0.3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes cauldronShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

/* Witch Hat - pulse and rotate */
.symbol.hat-win img {
    animation: hatMagic 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(138, 43, 227, 0.8));
}

@keyframes hatMagic {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 15px rgba(138, 43, 227, 0.8));
    }
    25% {
        transform: scale(1.05) rotate(-5deg);
        filter: drop-shadow(0 0 25px rgba(157, 78, 221, 1));
    }
    50% {
        transform: scale(1.1) rotate(0deg);
        filter: drop-shadow(0 0 35px rgba(138, 43, 227, 1));
    }
    75% {
        transform: scale(1.05) rotate(5deg);
        filter: drop-shadow(0 0 25px rgba(157, 78, 221, 1));
    }
}

/* Bet panel - witch style */
.bet-panel {
    background: linear-gradient(145deg, rgba(20, 10, 30, 0.8) 0%, rgba(30, 20, 40, 0.9) 100%);
    border: 2px solid #4a306d;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 0 15px rgba(138, 43, 227, 0.1);
}

.bet-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bet-label {
    color: #8a7a9e;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
}

.bet-input {
    background: linear-gradient(145deg, #0a0510 0%, #1a0f1e 100%);
    border: 2px solid #4a306d;
    border-radius: 8px;
    padding: 10px;
    color: #9d4edd;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    width: 100%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.bet-input:focus {
    outline: none;
    border-color: #8a2be2;
    box-shadow: 0 0 15px rgba(138, 43, 227, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.quick-bets {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.bet-btn {
    flex: 1;
    padding: 8px 5px;
    background: linear-gradient(145deg, #2a1f3e 0%, #1a0f2e 100%);
    border: 2px solid #4a306d;
    border-radius: 6px;
    color: #c9b1d6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bet-btn:hover {
    background: linear-gradient(145deg, #3a2f4e 0%, #2a1f3e 100%);
    border-color: #6a509d;
    color: #fff;
    box-shadow: 0 0 10px rgba(138, 43, 227, 0.3);
}

.bet-btn.reset-btn {
    background: linear-gradient(145deg, #4a1515 0%, #2a0a0a 100%);
    border-color: #8b0000;
    color: #ff6b6b;
}

.bet-btn.reset-btn:hover {
    background: linear-gradient(145deg, #6a2020 0%, #4a1515 100%);
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.4);
}

.bet-btn.active {
    background: linear-gradient(145deg, #6a2d9d 0%, #4a1d7a 100%);
    border-color: #9d4edd;
    color: #fff;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Balance display - witch style */
.balance-display {
    background: linear-gradient(145deg, #0a0510 0%, #1a0f1e 100%);
    border-radius: 10px;
    padding: 15px 25px;
    border: 2px solid #4a306d;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.balance-label {
    color: #8a7a9e;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.balance-value {
    color: #9d4edd;
    font-size: 24px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
    transition: transform 0.3s ease;
}

.balance-value.pulse {
    animation: balancePulse 0.5s ease;
}

@keyframes balancePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Win amount fly animation */
.win-fly {
    position: fixed;
    color: #9d4edd;
    font-size: 24px;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(157, 78, 221, 0.8);
    pointer-events: none;
    z-index: 1000;
    transition: all 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Spin button - mystical style */
.spin-btn {
    flex: 1;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(145deg, #6a2d9d 0%, #4a1d7a 50%, #2d1052 100%);
    border: 2px solid #9d4edd;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 
        0 10px 30px rgba(106, 45, 157, 0.4),
        0 0 20px rgba(157, 78, 221, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.spin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.spin-btn:hover::before {
    left: 100%;
}

.spin-btn:hover {
    background: linear-gradient(145deg, #8a3dbd 0%, #6a2d9d 50%, #4a1d7a 100%);
    box-shadow: 
        0 15px 40px rgba(106, 45, 157, 0.6),
        0 0 30px rgba(157, 78, 221, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.spin-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 5px 15px rgba(106, 45, 157, 0.4),
        0 0 15px rgba(157, 78, 221, 0.3);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal styling - witch theme */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 5, 16, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #1a0f2e 0%, #0d1f15 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 2px solid #8a2be2;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(138, 43, 227, 0.3);
    animation: slideUp 0.3s ease;
}

.rules-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: #9d4edd;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.result-symbols {
    font-size: 50px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.result-symbols img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

#resultMessage {
    color: #c9b1d6;
    font-size: 18px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-btn {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, #6a2d9d 0%, #4a1d7a 100%);
    border: 2px solid #9d4edd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(138, 43, 227, 0.3);
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(157, 78, 221, 0.5);
    background: linear-gradient(145deg, #8a3dbd 0%, #6a2d9d 100%);
}

.close-rules {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #8a7a9e;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-rules:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

.rules-image-container {
    display: none;
    margin: 20px 0;
}

.rules-image-container.active {
    display: block;
}

.rules-image-container img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.rules-fallback {
    display: none;
}

.rules-fallback.active {
    display: block;
}

.rules-fallback h3 {
    color: #9d4edd;
    margin-bottom: 15px;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.3);
}

.rules-fallback ul {
    list-style: none;
    text-align: left;
    color: #c9b1d6;
}

.rules-fallback li {
    padding: 10px;
    border-bottom: 1px solid rgba(138, 43, 227, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.rules-fallback li span:first-child {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-fallback .symbol-preview {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
    margin-left: auto;
}

.rules-fallback .symbol-preview img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.rules-fallback .payout {
    color: #9d4edd;
    font-weight: bold;
}

/* Loader - witch style */
.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 5, 16, 0.9);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.loader.active {
    display: flex;
}

.loader span {
    color: #9d4edd;
    font-size: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(138, 43, 227, 0.3);
    border-top-color: #9d4edd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes spinReel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Smooth spin animation for reels */
.reel.spinning .reel-strip {
    animation: smoothSpin 0.15s linear infinite;
}

@keyframes smoothSpin {
    0% { transform: translateY(-50px); }
    100% { transform: translateY(-150px); }
}

.win-animation {
    animation: winPulse 0.5s ease 3;
}

@keyframes winPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: inset 0 0 20px rgba(157, 78, 221, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: inset 0 0 40px rgba(157, 78, 221, 1), 0 0 30px rgba(157, 78, 221, 0.5);
    }
}

/* Reel win animation */
.reel.win-animation {
    animation: reelWinPulse 0.5s ease 3;
}

@keyframes reelWinPulse {
    0%, 100% { 
        box-shadow: inset 0 0 20px rgba(157, 78, 221, 0.5), 0 0 20px rgba(157, 78, 221, 0.3);
    }
    50% { 
        box-shadow: inset 0 0 40px rgba(157, 78, 221, 1), 0 0 40px rgba(157, 78, 221, 0.6);
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ============================================
   INTERACTIVE ENVIRONMENT - AURORA
   ============================================ */

.environment-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

/* --- AURORA ENVIRONMENT --- */
.env-aurora {
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
}

.env-aurora .aurora-layer {
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    height: 150%;
    filter: blur(60px);
    opacity: 0.6;
    animation: auroraWave 15s ease-in-out infinite;
    transition: filter 2s ease, opacity 2s ease;
}

.env-aurora .aurora-layer:nth-child(1) {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0,255,150,0.3) 25%, 
        rgba(0,200,255,0.2) 50%, 
        rgba(150,0,255,0.3) 75%, 
        transparent 100%);
    animation-delay: 0s;
}

.env-aurora .aurora-layer:nth-child(2) {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,0,200,0.2) 25%, 
        rgba(0,255,200,0.3) 50%, 
        rgba(200,100,255,0.2) 75%, 
        transparent 100%);
    animation-delay: -5s;
    animation-duration: 20s;
}

.env-aurora .aurora-layer:nth-child(3) {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(100,255,100,0.2) 30%, 
        rgba(255,200,0,0.15) 60%, 
        transparent 100%);
    animation-delay: -10s;
    animation-duration: 25s;
}

.env-aurora.win-active .aurora-layer {
    filter: blur(40px) brightness(2);
    opacity: 0.9;
}

@keyframes auroraWave {
    0%, 100% { 
        transform: translateX(-10%) skewX(-5deg) rotate(-2deg);
        opacity: 0.4;
    }
    25% { 
        transform: translateX(5%) skewX(3deg) rotate(1deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateX(10%) skewX(-3deg) rotate(2deg);
        opacity: 0.5;
    }
    75% { 
        transform: translateX(-5%) skewX(5deg) rotate(-1deg);
        opacity: 0.7;
    }
}

/* Конфетти */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -30px;
    animation: confettiFall linear forwards;
    will-change: transform;
}

.confetti svg {
    width: 12px;
    height: 12px;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) rotate(180deg) translateX(20px);
    }
    50% {
        transform: translateY(50vh) rotate(360deg) translateX(-10px);
    }
    75% {
        transform: translateY(75vh) rotate(540deg) translateX(15px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(110vh) rotate(720deg) translateX(0);
        opacity: 0;
    }
}

/* Game container - slots centered, rules absolute positioned */
.game-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    position: relative;
    z-index: 100;
    padding: 20px;
}

.game-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 700px;
    position: relative;
}

/* Rules panel - absolute on right side, wider towards game */
.rules-panel {
    position: absolute;
    right: -170px;
    top: 0;
    display: block;
    background: linear-gradient(145deg, rgba(0,0,0,0.8) 0%, rgba(30,30,30,0.9) 100%);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 15px;
    width: 250px;
}

.slot-machine {
    position: relative;
    z-index: 100;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
    width: 400px;
    flex-shrink: 0;
    margin: 0 auto;
}

.rules-panel h3 {
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rules-panel ul {
    list-style: none;
    color: #fff;
    font-size: 12px;
}

.rules-panel li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.rules-panel li:last-child {
    border-bottom: none;
}

.rules-panel li.highlight {
    background: rgba(255, 215, 0, 0.2);
    border-radius: 5px;
    padding: 6px;
    margin: 2px 0;
    animation: highlightPulse 0.5s ease 3;
}

@keyframes highlightPulse {
    0%, 100% { background: rgba(255, 215, 0, 0.2); }
    50% { background: rgba(255, 215, 0, 0.5); }
}

.rules-panel .symbol-preview {
    font-size: 16px;
    margin-right: 5px;
}

.rules-panel .payout {
    color: #ffd700;
    font-weight: bold;
}

@media (max-width: 768px) {
    body {
        overflow: hidden;
        min-height: 100vh;
        height: 100vh;
    }
    
    .game-container {
        padding: 3px;
        min-height: 100vh;
        height: 100vh;
        align-items: flex-start;
        padding-top: 5px;
    }
    
    .game-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        width: 100%;
        max-width: 100%;
    }
    
    .slot-machine {
        width: 100%;
        max-width: 360px;
        padding: 8px;
        transform: scale(0.93);
        transform-origin: top center;
    }
    
    .machine-header {
        margin-bottom: 6px;
    }
    
    .game-title {
        font-size: 16px;
    }
    
    .reel {
        width: 65px;
        height: 130px;
    }
    
    .reel-strip {
        transform: translateY(-32px);
    }
    
    @keyframes smoothSpin {
        0% { transform: translateY(-32px); }
        100% { transform: translateY(-98px); }
    }
    
    @keyframes reelBlur {
        0% { transform: translateY(-32px); }
        50% { transform: translateY(-34px); }
        100% { transform: translateY(-32px); }
    }
    
    .symbol {
        width: 65px;
        height: 65px;
        font-size: 32px;
    }
    
    .symbol img {
        max-width: 42px;
        max-height: 42px;
    }
    
    .slot-grid {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .payline {
        top: 63px;
        height: 3px;
    }
    
    .result-panel {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        padding: 6px 8px;
        margin-bottom: 6px;
    }
    
    .result-text {
        font-size: 11px;
    }
    
    .win-amount {
        font-size: 14px;
    }
    
    .bet-panel {
        padding: 6px;
        margin-bottom: 6px;
        gap: 6px;
    }
    
    .bet-input {
        padding: 6px;
        font-size: 14px;
    }
    
    .quick-bets {
        flex-wrap: wrap;
        gap: 0px !important;
    }
    
    .bet-btn {
        min-width: 40px;
        padding: 4px 2px;
        font-size: 9px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .balance-display {
        padding: 6px 10px;
    }
    
    .balance-label {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .balance-value {
        font-size: 14px;
    }
    
    .spin-btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .rules-panel {
        display: none;
    }
    
    .rules-btn {
        display: block;
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .mute-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .header-buttons {
        gap: 6px;
    }
}

/* Desktop - hide modal button */
@media (min-width: 769px) {
    .rules-btn {
        display: none;
    }
    
    .rules-modal {
        display: none !important;
    }
}

.machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.game-title {
    color: #ffd700;
    font-size: 22px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 3px;
}

.rules-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffd700;
    background: transparent;
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rules-btn:hover {
    background: #ffd700;
    color: #1a1a2e;
}

/* Header buttons container */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mute button */
.mute-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffd700;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mute-btn:hover {
    background: #ffd700;
}

.mute-btn.muted {
    border-color: #888;
    opacity: 0.6;
}

/* Панель результата - фиксированная высота чтобы не прыгала */
.result-panel {
    background: linear-gradient(145deg, rgba(0,0,0,0.8) 0%, rgba(30,30,30,0.9) 100%);
    border: 3px solid #444;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 12px;
    text-align: center;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.result-panel.win {
    border-color: #ffd700;
    background: linear-gradient(145deg, rgba(255,215,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 0 10px rgba(255, 215, 0, 0.3);
    animation: winPulseStrong 0.6s ease infinite;
}

.result-panel.lose {
    border-color: #ff4444;
    background: linear-gradient(145deg, rgba(255,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    animation: losePulse 0.5s ease;
}

@keyframes winPulseStrong {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.9), inset 0 0 20px rgba(255, 215, 0, 0.5);
    }
}

@keyframes losePulse {
    0%, 100% { }
    50% { }
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.result-text {
    color: #888;
    font-size: 14px;
    font-weight: 600;
}

.result-panel.win .result-text {
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.result-panel.lose .result-text {
    color: #ff6b6b;
    font-weight: 600;
}

.win-amount {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Slot grid - 3 reels horizontal */
.slot-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}

/* Single reel container - shows center row full + half top/bottom (1.5 rows total) */
.reel {
    width: 100px;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(145deg, #2a2a3e 0%, #1a1a2e 100%);
    border: 3px solid #ffd700;
    border-radius: 10px;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 215, 0, 0.3);
}

/* Payline indicator - positioned in center of slot-grid */
.payline {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 98px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #ff0000 30%, #ff0000 70%, transparent 100%);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* Position reel-strip to show center row in the middle with partial top/bottom */
.reel-strip {
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(-50px);
}

.reel-strip.spinning {
    animation: reelBlur 0.05s linear infinite;
}

/* No blur - just position change for crisp emojis */
@keyframes reelBlur {
    0% { transform: translateY(-50px); }
    50% { transform: translateY(-52px); }
    100% { transform: translateY(-50px); }
}

.symbol {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    flex-shrink: 0;
    background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
}

.symbol img {
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
}

.symbol.emoji {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Bet panel */
.bet-panel {
    background: linear-gradient(145deg, rgba(0,0,0,0.6) 0%, rgba(30,30,30,0.8) 100%);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bet-label {
    color: #888;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
}

.bet-input {
    background: linear-gradient(145deg, #000 0%, #1a1a1a 100%);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 10px;
    color: #ffd700;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.bet-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.quick-bets {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.bet-btn {
    flex: 1;
    padding: 8px 5px;
    background: linear-gradient(145deg, #444 0%, #333 100%);
    border: 2px solid #555;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bet-btn:hover {
    background: linear-gradient(145deg, #555 0%, #444 100%);
    border-color: #666;
}

.bet-btn.reset-btn {
    background: linear-gradient(145deg, #c41e3a 0%, #a01729 100%);
    border-color: #e94560;
    color: #fff;
}

.bet-btn.reset-btn:hover {
    background: linear-gradient(145deg, #e94560 0%, #c41e3a 100%);
    border-color: #ff6b6b;
}

.bet-btn.active {
    background: linear-gradient(145deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ffd700;
    color: #1a1a2e;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.balance-display {
    background: linear-gradient(145deg, #000 0%, #1a1a1a 100%);
    border-radius: 10px;
    padding: 15px 25px;
    border: 2px solid #ffd700;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.balance-label {
    color: #888;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.balance-value {
    color: #ffd700;
    font-size: 24px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: transform 0.3s ease;
}

.balance-value.pulse {
    animation: balancePulse 0.5s ease;
}

@keyframes balancePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Win amount fly animation */
.win-fly {
    position: fixed;
    color: #ffd700;
    font-size: 24px;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    z-index: 1000;
    transition: all 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.spin-btn {
    flex: 1;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(145deg, #e94560 0%, #c41e3a 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 
        0 10px 30px rgba(233, 69, 96, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 2px solid #ffd700;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.rules-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: #ffd700;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.result-symbols {
    font-size: 50px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.result-symbols img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.result-symbols .emoji {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#resultMessage {
    color: #fff;
    font-size: 18px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-btn {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(145deg, #ffd700 0%, #ffed4e 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.close-rules {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-rules:hover {
    color: #fff;
}

.rules-image-container {
    display: none;
    margin: 20px 0;
}

.rules-image-container.active {
    display: block;
}

.rules-image-container img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.rules-fallback {
    display: none;
}

.rules-fallback.active {
    display: block;
}

.rules-fallback h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 18px;
}

.rules-fallback ul {
    list-style: none;
    text-align: left;
    color: #fff;
}

.rules-fallback li {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.rules-fallback li span:first-child {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-fallback .symbol-preview {
    font-size: 24px;
    margin-right: 10px;
    order: 2;
    margin-left: auto;
}

.rules-fallback .payout {
    color: #ffd700;
    font-weight: bold;
}

.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.loader.active {
    display: flex;
}

.loader span {
    color: #ffd700;
    font-size: 16px;
    letter-spacing: 2px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes spinReel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Smooth spin animation for reels */
.reel.spinning .reel-strip {
    animation: smoothSpin 0.15s linear infinite;
}

@keyframes smoothSpin {
    0% { transform: translateY(-50px); }
    100% { transform: translateY(-150px); }
}

.win-animation {
    animation: winPulse 0.5s ease 3;
}

@keyframes winPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: inset 0 0 40px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

/* Reel win animation */
.reel.win-animation {
    animation: reelWinPulse 0.5s ease 3;
}

@keyframes reelWinPulse {
    0%, 100% { 
        box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% { 
        box-shadow: inset 0 0 40px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

/* ============================================
   FLYING WITCH SPRITE
   ============================================ */
.flying-witch {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    opacity: 0.18;
    filter: blur(1.5px) drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
    will-change: transform;
}

.flying-witch img {
    width: 120px;
    height: auto;
    display: block;
}

/* Path 1: left-to-right, slight upward angle */
.flying-witch-1 {
    animation: witchFly1 18s linear infinite;
    animation-delay: 0s;
}

@keyframes witchFly1 {
    0% {
        transform: translate(-150px, 60vh) rotate(-8deg);
        opacity: 0;
    }
    5% { opacity: 0.18; }
    90% { opacity: 0.18; }
    100% {
        transform: translate(110vw, 15vh) rotate(-8deg);
        opacity: 0;
    }
}

/* Path 2: left-to-right, steeper diagonal downward */
.flying-witch-2 {
    animation: witchFly2 24s linear infinite;
    animation-delay: -8s;
}

.flying-witch-2 img {
    width: 90px;
}

@keyframes witchFly2 {
    0% {
        transform: translate(-130px, 10vh) rotate(12deg);
        opacity: 0;
    }
    5% { opacity: 0.14; }
    90% { opacity: 0.14; }
    100% {
        transform: translate(110vw, 75vh) rotate(12deg);
        opacity: 0;
    }
}

/* Path 3: left-to-right, high arc */
.flying-witch-3 {
    animation: witchFly3 22s linear infinite;
    animation-delay: -14s;
}

.flying-witch-3 img {
    width: 70px;
}

@keyframes witchFly3 {
    0% {
        transform: translate(-120px, 45vh) rotate(-15deg);
        opacity: 0;
    }
    5% { opacity: 0.12; }
    30% {
        transform: translate(30vw, 8vh) rotate(-5deg);
        opacity: 0.12;
    }
    70% {
        transform: translate(70vw, 12vh) rotate(-10deg);
        opacity: 0.12;
    }
    90% { opacity: 0.12; }
    100% {
        transform: translate(110vw, 35vh) rotate(-3deg);
        opacity: 0;
    }
}

/* ============================================
   WIN SYMBOL ANIMATIONS
   ============================================ */
.symbol.win-shake {
    animation: winShakeAnim 0.5s ease-in-out 3;
}
@keyframes winShakeAnim {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px) rotate(-3deg); }
    40% { transform: translateX(6px) rotate(3deg); }
    60% { transform: translateX(-4px) rotate(-2deg); }
    80% { transform: translateX(4px) rotate(2deg); }
}

.symbol.win-bounce {
    animation: winBounceAnim 0.6s ease-in-out 3;
}
@keyframes winBounceAnim {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-10px) scale(1.08); }
    50% { transform: translateY(0) scale(0.95); }
    70% { transform: translateY(-5px) scale(1.04); }
}

.symbol.win-pulse {
    animation: winPulseAnim 0.7s ease-in-out 3;
}
@keyframes winPulseAnim {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.12); filter: brightness(1.4); }
}

.symbol.win-sparkle {
    animation: winSparkleAnim 0.8s ease-in-out 3;
}
@keyframes winSparkleAnim {
    0%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
    25% { transform: scale(1.1) rotate(3deg); filter: brightness(1.3); }
    50% { transform: scale(0.95) rotate(-3deg); filter: brightness(1.5); }
    75% { transform: scale(1.08) rotate(2deg); filter: brightness(1.2); }
}
