* {
    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: #0d0518;
}

/* ============================================
   RUNIC BACKGROUND - Magical circles & floating runes
   ============================================ */

.environment-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, #1a0a2e 0%, #0d0518 50%, #050310 100%);
}

/* Outer rotating magic circle */
.magic-circle-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(138, 43, 227, 0.6);
    border-radius: 50%;
    box-shadow: 
        0 0 80px rgba(138, 43, 227, 0.6),
        inset 0 0 80px rgba(138, 43, 227, 0.3);
    animation: rotateCircle 60s linear infinite;
}

.magic-circle-outer::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px dashed rgba(255, 215, 0, 0.25);
    border-radius: 50%;
    animation: rotateCircleReverse 45s linear infinite;
}

/* Inner magic circle */
.magic-circle-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 200, 255, 0.6);
    border-radius: 50%;
    box-shadow: 
        0 0 60px rgba(0, 200, 255, 0.5),
        inset 0 0 60px rgba(0, 200, 255, 0.25);
    animation: rotateCircle 40s linear infinite reverse;
}

.magic-circle-inner::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid rgba(255, 100, 100, 0.25);
    border-radius: 50%;
    animation: rotateCircle 30s linear infinite;
}

/* Center glow */
.magic-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(138, 43, 227, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseCenter 4s ease-in-out infinite;
}

@keyframes rotateCircle {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes rotateCircleReverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes pulseCenter {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.9;
    }
}

/* Floating Runes */
.floating-rune {
    position: absolute;
    font-size: 28px;
    color: rgba(255, 215, 0, 0.8);
    text-shadow: 0 0 15px rgba(255, 215, 0, 1);
    animation: floatRune 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes floatRune {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-30px) rotate(90deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-50px) rotate(180deg);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-20px) rotate(270deg);
        opacity: 0.8;
    }
}

/* Magical particles */
.magic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 255, 200, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.8);
    animation: particleFloat 8s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* Win effect - intensified magic */
.env-runic.win-active .magic-circle-outer {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 
        0 0 100px rgba(255, 215, 0, 0.6),
        inset 0 0 80px rgba(255, 215, 0, 0.3);
    animation-duration: 10s;
}

.env-runic.win-active .magic-circle-inner {
    border-color: rgba(255, 100, 100, 0.5);
    box-shadow: 
        0 0 60px rgba(255, 100, 100, 0.5),
        inset 0 0 50px rgba(255, 100, 100, 0.3);
}

.env-runic.win-active .magic-center {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.5) 0%, transparent 70%);
    animation-duration: 1s;
}

.env-runic.win-active .floating-rune {
    color: rgba(255, 215, 0, 0.9);
    text-shadow: 0 0 20px rgba(255, 215, 0, 1);
    animation-duration: 5s;
}

/* Elemental particles */
.elemental-particle {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    will-change: transform, opacity;
}

.elemental-particle.fire {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ff6b35 0%, #f7931e 40%, transparent 70%);
    border-radius: 50%;
    animation: fireBurst 1.5s ease-out forwards;
    box-shadow: 0 0 20px #ff6b35, 0 0 40px #ff4500;
}

.elemental-particle.water {
    width: 12px;
    height: 16px;
    background: linear-gradient(180deg, #4ecdc4 0%, #44a3aa 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: waterDrop 2s ease-in forwards;
    box-shadow: 0 0 15px #4ecdc4;
}

.elemental-particle.nature {
    font-size: 24px;
    animation: natureFloat 2.5s ease-out forwards;
}

.elemental-particle.arcane {
    width: 8px;
    height: 8px;
    background: #e056fd;
    border-radius: 50%;
    box-shadow: 0 0 15px #e056fd, 0 0 30px #8e44ad;
    animation: arcaneSpark 1.5s ease-out forwards;
}

.elemental-particle.sun-ray {
    width: 4px;
    height: 60px;
    background: linear-gradient(180deg, #ffd700 0%, #ffed4e 50%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 0 20px #ffd700;
    animation: sunRay 1.2s ease-out forwards;
    transform-origin: center bottom;
}

.sun-burst {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
    animation: sunBurst 1.5s ease-out forwards;
    pointer-events: none;
    z-index: 199;
}

@keyframes fireBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes waterDrop {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(150px) scale(0.5);
        opacity: 0;
    }
}

@keyframes natureFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(360deg);
        opacity: 0;
    }
}

@keyframes arcaneSpark {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes sunRay {
    0% {
        transform: scaleY(0) translate(0, 0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scaleY(1) translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

@keyframes sunBurst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Runic confetti particles instead of regular confetti */
.runic-confetti {
    position: absolute;
    font-size: 16px;
    color: rgba(255, 215, 0, 0.8);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: runeFall linear forwards;
    pointer-events: none;
}

@keyframes runeFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}
.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: 10;
    padding: 20px;
    overflow: hidden;
}

.game-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Rules panel - flex item */
.rules-panel {
    position: relative;
    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;
    flex-shrink: 0;
    margin-left: 20px;
}

.slot-machine {
    position: relative;
    z-index: 100;
    background: linear-gradient(145deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 20px 60px rgba(138, 43, 227, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(138, 43, 227, 0.2);
    border: 2px solid rgba(138, 43, 227, 0.5);
    width: 400px;
    flex-shrink: 0;
}

.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: 340px;
        padding: 10px;
        border: 2px solid rgba(138, 43, 227, 0.4);
        box-shadow: 0 10px 30px rgba(138, 43, 227, 0.3);
    }
    
    .machine-header {
        margin-bottom: 6px;
    }
    
    .runic-logo {
        width: 100px;
        height: 30px;
    }
    
    .runic-logo text {
        font-size: 14px;
    }
    
    .reel {
        width: 65px;
        height: 130px;
        border: 2px solid rgba(138, 43, 227, 0.5);
    }
    
    .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;
        border: 2px solid rgba(138, 43, 227, 0.4);
    }
    
    .result-panel.win {
        border-color: #ffd700;
    }
    
    .result-text {
        font-size: 11px;
    }
    
    .win-amount {
        font-size: 14px;
    }
    
    .bet-panel {
        padding: 6px;
        margin-bottom: 6px;
        gap: 6px;
        border: 2px solid rgba(138, 43, 227, 0.3);
    }
    
    .bet-input {
        padding: 6px;
        font-size: 14px;
        border: 2px solid rgba(138, 43, 227, 0.5);
    }
    
    .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;
        border: 2px solid rgba(138, 43, 227, 0.5);
    }
    
    .balance-label {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .balance-value {
        font-size: 14px;
    }
    
    .spin-btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(138, 43, 227, 0.4);
    }
    
    .rules-panel {
        display: none;
    }
    
    .rules-btn {
        display: block;
        width: 26px;
        height: 26px;
        font-size: 12px;
        border: 2px solid #8a2be2;
    }
    
    .mute-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
        border: 2px solid #00c8ff;
    }
    
    .header-buttons {
        gap: 6px;
    }
    
    /* Mobile magic circles - smaller */
    .magic-circle-outer {
        width: 300px;
        height: 300px;
    }
    
    .magic-circle-inner {
        width: 200px;
        height: 200px;
    }
    
    .magic-center {
        width: 80px;
        height: 80px;
    }
    
    .floating-rune {
        font-size: 20px;
    }
}

/* 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 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
}

/* Runic Logo SVG */
.runic-logo {
    width: 140px;
    height: 40px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.runic-logo text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 20px;
    font-weight: 900;
    fill: #ffd700;
    letter-spacing: 4px;
}

.rules-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #8a2be2;
    background: linear-gradient(145deg, rgba(138, 43, 227, 0.3) 0%, rgba(138, 43, 227, 0.1) 100%);
    color: #8a2be2;
    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: linear-gradient(145deg, #8a2be2 0%, #6a1b9a 100%);
    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 */
.mute-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #00c8ff;
    background: linear-gradient(145deg, rgba(0, 200, 255, 0.3) 0%, rgba(0, 200, 255, 0.1) 100%);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.3);
}

.mute-btn:hover {
    background: linear-gradient(145deg, #00c8ff 0%, #0099cc 100%);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.6);
}

.mute-btn.muted {
    border-color: #888;
    background: rgba(100, 100, 100, 0.3);
    opacity: 0.6;
    box-shadow: none;
}

/* Панель результата - фиксированная высота чтобы не прыгала */
.result-panel {
    background: linear-gradient(145deg, rgba(26, 10, 46, 0.9) 0%, rgba(45, 27, 78, 0.9) 100%);
    border: 3px solid rgba(138, 43, 227, 0.5);
    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.2);
}

.result-panel.win {
    border-color: #ffd700;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2) 0%, rgba(26, 10, 46, 0.9) 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.2);
    animation: winPulseStrong 0.6s ease infinite;
}

.result-panel.lose {
    border-color: #ff4444;
    background: linear-gradient(145deg, rgba(255, 68, 68, 0.2) 0%, rgba(26, 10, 46, 0.9) 100%);
    box-shadow: 0 0 20px rgba(255, 68, 68, 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;
}

/* Reel styling */
.reel {
    width: 100px;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(145deg, #2a1a4e 0%, #1a0a2e 100%);
    border: 3px solid rgba(138, 43, 227, 0.6);
    border-radius: 10px;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(138, 43, 227, 0.3),
        0 0 15px rgba(138, 43, 227, 0.3);
    transition: box-shadow 0.3s ease;
}

.reel:hover {
    box-shadow: 
        inset 0 0 20px rgba(138, 43, 227, 0.4),
        0 0 20px rgba(138, 43, 227, 0.5);
}

/* 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;
}

/* Win animation classes for winning symbols */
.symbol.win-shake {
    animation: winShake 0.5s ease infinite;
}

.symbol.win-bounce {
    animation: winBounce 0.6s ease infinite;
}

.symbol.win-pulse {
    animation: winPulseSymbol 0.5s ease infinite;
}

.symbol.win-sparkle {
    animation: winSparkle 0.8s ease infinite;
}

@keyframes winShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

@keyframes winBounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

@keyframes winPulseSymbol {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

@keyframes winSparkle {
    0%, 100% { 
        filter: brightness(1);
        transform: scale(1);
    }
    25% { 
        filter: brightness(1.5);
        transform: scale(1.05);
    }
    50% { 
        filter: brightness(1);
        transform: scale(1);
    }
    75% { 
        filter: brightness(1.3);
        transform: scale(1.08);
    }
}

/* Win animation for symbols */
.symbol.win-glow {
    animation: symbolWinPulse 0.6s ease infinite;
}

.symbol.win-glow img {
    filter: drop-shadow(0 0 20px #ffd700) drop-shadow(0 0 40px #ffed4e);
    animation: symbolWinScale 0.6s ease infinite;
}

@keyframes symbolWinPulse {
    0%, 100% {
        box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: inset 0 0 60px rgba(255, 215, 0, 0.9), 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

@keyframes symbolWinScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Elemental glow effects for specific runes */
.symbol.fire-glow img {
    filter: drop-shadow(0 0 15px #ff4444) drop-shadow(0 0 30px #ff6b35);
}

.symbol.water-glow img {
    filter: drop-shadow(0 0 15px #44a3aa) drop-shadow(0 0 30px #4ecdc4);
}

.symbol.nature-glow img {
    filter: drop-shadow(0 0 15px #4ade80) drop-shadow(0 0 30px #22c55e);
}

.symbol.arcane-glow img {
    filter: drop-shadow(0 0 15px #a855f7) drop-shadow(0 0 30px #e056fd);
}

.symbol.sun-glow img {
    filter: drop-shadow(0 0 20px #ffd700) drop-shadow(0 0 40px #ffed4e);
}

/* 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 button with runic style */
.spin-btn {
    flex: 1;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(145deg, #8a2be2 0%, #6a1b9a 50%, #4a148c 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 
        0 10px 30px rgba(138, 43, 227, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        0 0 20px rgba(138, 43, 227, 0.3);
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.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 {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 40px rgba(138, 43, 227, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        0 0 30px rgba(138, 43, 227, 0.5);
}

.spin-btn:hover::before {
    left: 100%;
}

.spin-btn:active {
    transform: translateY(2px);
    box-shadow: 0 5px 20px rgba(138, 43, 227, 0.4);
}

.spin-btn:disabled {
    background: linear-gradient(145deg, #4a4a4a 0%, #2a2a2a 100%);
    cursor: not-allowed;
    box-shadow: none;
    text-shadow: none;
}

.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;
}

.rules-fallback li:last-child {
    border-bottom: none;
}

.rules-fallback .symbol-preview {
    font-size: 24px;
    margin-right: 10px;
}

.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);
    }
}
