* {
    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;
}

/* ============================================
   PIRATE ENVIRONMENT - OCEAN & WAVES
   ============================================ */

.environment-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
    background: linear-gradient(180deg, 
        #050a12 0%, 
        #0a1628 20%,
        #0d1f35 50%, 
        #0a1929 80%,
        #050d18 100%);
}

/* Starfield */
.env-pirate .star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
    will-change: opacity;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Moon */
.env-pirate .moon {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, 
        #fffacd 0%,
        #fff8dc 20%,
        #f0e68c 50%,
        #ffd700 80%,
        transparent 100%);
    border-radius: 50%;
    top: 8%;
    right: 15%;
    box-shadow: 
        0 0 60px 20px rgba(255, 215, 0, 0.3),
        0 0 100px 40px rgba(255, 215, 0, 0.15),
        inset -10px -10px 20px rgba(218, 165, 32, 0.2);
    z-index: 1;
    animation: moonGlow 4s ease-in-out infinite alternate;
    will-change: opacity;
}

@keyframes moonGlow {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Clouds in sky - clear and visible */
.cloud {
    position: absolute;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 248, 255, 0.8) 50%,
        rgba(230, 240, 250, 0.6) 100%);
    border-radius: 100px;
    filter: blur(3px);
    animation: cloudMove linear infinite;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
}

.cloud::before {
    content: '';
    position: absolute;
    width: 50%;
    height: 100%;
    background: inherit;
    border-radius: 100px;
    top: -50%;
    left: 15%;
}

.cloud::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 120%;
    background: inherit;
    border-radius: 100px;
    top: -60%;
    right: 10%;
}

@keyframes cloudMove {
    0% {
        transform: translateX(-200px);
    }
    100% {
        transform: translateX(calc(100vw + 200px));
    }
}

/* Cloud reflections in water - blurry and dim */
.cloud-reflection {
    position: absolute;
    bottom: 2%;
    width: 150px;
    height: 50px;
    background: linear-gradient(180deg,
        rgba(200, 210, 220, 0.2) 0%,
        rgba(180, 190, 200, 0.1) 40%,
        transparent 100%);
    border-radius: 75px;
    filter: blur(15px);
    z-index: 11;
    animation: cloudReflectionMove linear infinite;
    opacity: 0.6;
    will-change: transform;
}

.cloud-reflection::before {
    content: '';
    position: absolute;
    width: 50%;
    height: 100%;
    background: inherit;
    border-radius: 75px;
    top: -40%;
    left: 15%;
}

.cloud-reflection::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 120%;
    background: inherit;
    border-radius: 75px;
    top: -50%;
    right: 10%;
}

@keyframes cloudReflectionMove {
    0% {
        transform: translateX(-200px);
    }
    100% {
        transform: translateX(calc(100vw + 200px));
    }
}

/* Horizon line - dark for night time */
.horizon {
    position: absolute;
    bottom: 35%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(30, 60, 100, 0.6) 20%, 
        rgba(50, 80, 120, 0.8) 50%, 
        rgba(30, 60, 100, 0.6) 80%, 
        transparent 100%);
    z-index: 9;
    box-shadow: 0 0 8px rgba(50, 80, 120, 0.2);
}

/* Star sky reflection in water - larger and brighter stars */
.star-sky-reflection {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    z-index: 99;
    pointer-events: none;
    background: 
        radial-gradient(2px 2px at 10% 10%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(2px 2px at 30% 15%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(2px 2px at 40% 40%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 50% 20%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 60% 35%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(2px 2px at 70% 12%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 80% 28%, rgba(255,255,255,0.38) 0%, transparent 100%),
        radial-gradient(2px 2px at 90% 45%, rgba(255,255,255,0.32) 0%, transparent 100%),
        radial-gradient(2px 2px at 15% 50%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(2px 2px at 25% 65%, rgba(255,255,255,0.28) 0%, transparent 100%),
        radial-gradient(2px 2px at 35% 80%, rgba(255,255,255,0.32) 0%, transparent 100%),
        radial-gradient(2px 2px at 45% 55%, rgba(255,255,255,0.42) 0%, transparent 100%),
        radial-gradient(2px 2px at 55% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 65% 85%, rgba(255,255,255,0.38) 0%, transparent 100%),
        radial-gradient(2px 2px at 75% 60%, rgba(255,255,255,0.33) 0%, transparent 100%),
        radial-gradient(2px 2px at 85% 75%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(2px 2px at 95% 50%, rgba(255,255,255,0.27) 0%, transparent 100%),
        radial-gradient(3px 3px at 5% 25%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(3px 3px at 33% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(3px 3px at 66% 40%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(3px 3px at 88% 70%, rgba(255,255,255,0.38) 0%, transparent 100%);
    filter: blur(0.3px);
    opacity: 0.9;
}

/* Moon reflection on water - high z-index to be visible */
.moon-reflection {
    position: absolute;
    bottom: 8%;
    right: 15%;
    width: 60px;
    height: 100px;
    background: linear-gradient(180deg,
        rgba(255, 248, 220, 0.6) 0%,
        rgba(255, 215, 0, 0.4) 30%,
        rgba(255, 215, 0, 0.2) 60%,
        transparent 100%);
    border-radius: 50%;
    filter: blur(10px);
    animation: reflectionShimmer 4s ease-in-out infinite;
    z-index: 100;
    pointer-events: none;
    will-change: opacity;
}

@keyframes reflectionShimmer {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Simple water shimmer effect - subtle blue tint only */
.water-shimmer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 200px 50px at 20% 30%, rgba(100,150,200,0.05) 0%, transparent 100%),
        radial-gradient(ellipse 150px 40px at 70% 60%, rgba(80,130,180,0.04) 0%, transparent 100%),
        radial-gradient(ellipse 100px 30px at 50% 80%, rgba(60,110,160,0.03) 0%, transparent 100%);
    animation: waterShimmer 8s ease-in-out infinite;
    z-index: 12;
    will-change: opacity;
}

@keyframes waterShimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Remove all old wave styles */
.wave, .wave-back, .wave-mid, .wave-front, .wave1, .wave2, .wave3, .wave-foam {
    display: none !important;
}

/* Ships properly oriented - nose is on LEFT in original image */
.ship-sprite {
    position: absolute;
    left: 0;
    z-index: 15;
    pointer-events: none;
    will-change: transform;
}

.ship-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

/* LTR (left to right): flip handled in JS on img element */
.ship-ltr img {
    transform: scaleX(-1);
}

/* RTL (right to left): no flip needed */

@keyframes shipSailLTR {
    0% { transform: translateX(-150px); }
    100% { transform: translateX(calc(100vw + 150px)); }
}

@keyframes shipSailRTL {
    0% { transform: translateX(calc(100vw + 150px)); }
    100% { transform: translateX(-150px); }
}

/* Ship reflection in water */
.ship-reflection {
    position: absolute;
    left: 0;
    z-index: 14;
    opacity: 0.3;
    filter: blur(3px);
    pointer-events: none;
    will-change: transform;
}

.ship-reflection img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* Star reflections in water - subtle, dim reflections */
.star-reflection {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    filter: blur(2px);
    z-index: 11;
    animation: starTwinkle 4s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

/* Win effect for ocean */
.env-pirate.win-active {
    animation: oceanWinPulse 0.5s ease;
}

.env-pirate.win-active .wave-front {
    animation: waveMove 4s linear infinite, waveGlow 0.5s ease;
}

@keyframes waveGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3) drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); }
}

/* ============================================
   PIRATE TREASURE EFFECT (replacing confetti)
   ============================================ */

.treasure-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.treasure-item {
    position: absolute;
    top: -50px;
    animation: treasureFall linear forwards;
    will-change: transform;
}

.treasure-item svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.treasure-coin {
    width: 24px;
    height: 24px;
}

.treasure-doubloon {
    width: 32px;
    height: 32px;
}

.treasure-gem {
    width: 20px;
    height: 20px;
}

.treasure-skull {
    width: 28px;
    height: 28px;
}

@keyframes treasureFall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) rotate(90deg) translateX(15px);
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-8px);
    }
    75% {
        transform: translateY(75vh) rotate(270deg) translateX(12px);
        opacity: 0.9;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) translateX(0);
        opacity: 0;
    }
}

/* Sparkle effect for treasure */
.treasure-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffd700 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkle 0.5s ease-out forwards;
}

@keyframes sparkle {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(3); 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, #3d2817 0%, #2a1a0f 50%, #1a0f08 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 0 rgba(139, 90, 43, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4);
    border: 4px solid #8b5a2b;
    width: 400px;
    flex-shrink: 0;
    margin: 0 auto;
    position: relative;
}

/* Wood texture overlay */
.slot-machine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        );
    pointer-events: none;
}

.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 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.2);
    letter-spacing: 3px;
    font-family: 'Georgia', serif;
    background: linear-gradient(180deg, #ffd700 0%, #ffed4e 50%, #d4a017 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rules-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #cd7f32;
    background: linear-gradient(145deg, #3d2817 0%, #2a1a0f 100%);
    color: #cd7f32;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(139, 90, 43, 0.3);
}

.rules-btn:hover {
    background: linear-gradient(145deg, #cd7f32 0%, #b87333 100%);
    color: #1a0f08;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

/* 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 #cd7f32;
    background: linear-gradient(145deg, #3d2817 0%, #2a1a0f 100%);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(139, 90, 43, 0.3);
    color: #cd7f32;
}

.mute-btn:hover {
    background: linear-gradient(145deg, #cd7f32 0%, #b87333 100%);
    color: #1a0f08;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

.mute-btn.muted {
    border-color: #666;
    opacity: 0.6;
    color: #666;
}

/* Панель результата - фиксированная высота чтобы не прыгала */
.result-panel {
    background: linear-gradient(145deg, rgba(20,10,5,0.9) 0%, rgba(40,25,15,0.95) 100%);
    border: 3px solid #5c4033;
    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 2px 10px rgba(0,0,0,0.5);
}

.result-panel.win {
    border-color: #ffd700;
    background: linear-gradient(145deg, rgba(255,215,0,0.15) 0%, rgba(20,10,5,0.9) 100%);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5), 
        inset 0 0 15px rgba(255, 215, 0, 0.2),
        inset 0 2px 10px rgba(0,0,0,0.5);
    animation: winPulseStrong 0.6s ease infinite;
}

.result-panel.lose {
    border-color: #8b0000;
    background: linear-gradient(145deg, rgba(139,0,0,0.15) 0%, rgba(20,10,5,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(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, #1a0f08 0%, #2a1a0f 50%, #3d2817 100%);
    border: 3px solid #8b5a2b;
    border-radius: 10px;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(139, 90, 43, 0.3),
        inset 0 2px 0 rgba(139, 90, 43, 0.2);
}

/* Metal frame effect for reels */
.reel::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 13px;
    background: linear-gradient(145deg, #cd7f32 0%, #8b5a2b 50%, #5c4033 100%);
    z-index: -1;
}

/* 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%, #ff4444 30%, #ffd700 50%, #ff4444 70%, transparent 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px 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, #f5f5dc 0%, #e8e4c9 30%, #d4d0a8 100%);
    border-bottom: 1px solid rgba(139, 90, 43, 0.2);
}

.symbol:last-child {
    border-bottom: none;
}

.symbol img {
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.symbol.emoji {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Win animation for symbols */
.symbol.winning {
    animation: symbolWin 0.5s ease 3;
}

@keyframes symbolWin {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)) brightness(1.2);
    }
}

/* Symbol shine effect */
.symbol::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.symbol.winning::after {
    left: 100%;
    transition: left 0.8s ease;
}

/* Bet panel */
.bet-panel {
    background: linear-gradient(145deg, rgba(20,10,5,0.8) 0%, rgba(40,25,15,0.9) 100%);
    border: 2px solid #5c4033;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.4);
}

.bet-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bet-label {
    color: #cd7f32;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
}

.bet-input {
    background: linear-gradient(145deg, #0d0804 0%, #1a0f08 100%);
    border: 2px solid #8b5a2b;
    border-radius: 8px;
    padding: 10px;
    color: #ffd700;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    width: 100%;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.bet-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.4), inset 0 2px 5px rgba(0,0,0,0.5);
    border-color: #cd7f32;
}

.quick-bets {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.bet-btn {
    flex: 1;
    padding: 8px 5px;
    background: linear-gradient(145deg, #3d2817 0%, #2a1a0f 100%);
    border: 2px solid #5c4033;
    border-radius: 6px;
    color: #cd7f32;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.bet-btn:hover {
    background: linear-gradient(145deg, #5c4033 0%, #3d2817 100%);
    border-color: #cd7f32;
    color: #ffd700;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.4);
}

.bet-btn.reset-btn {
    background: linear-gradient(145deg, #5c1a1a 0%, #3d0f0f 100%);
    border-color: #8b0000;
    color: #ff6b6b;
}

.bet-btn.reset-btn:hover {
    background: linear-gradient(145deg, #8b0000 0%, #5c1a1a 100%);
    border-color: #ff4444;
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.4);
}

.bet-btn.active {
    background: linear-gradient(145deg, #cd7f32 0%, #b87333 100%);
    border-color: #ffd700;
    color: #1a0f08;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.balance-display {
    background: linear-gradient(145deg, #0d0804 0%, #1a0f08 100%);
    border-radius: 10px;
    padding: 15px 25px;
    border: 2px solid #8b5a2b;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(139, 90, 43, 0.2);
}

.balance-label {
    color: #cd7f32;
    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 15px rgba(255, 215, 0, 0.5);
    transition: transform 0.3s ease;
    font-family: 'Georgia', serif;
}

.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);
    font-family: 'Georgia', serif;
}

.spin-btn {
    flex: 1;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #1a0f08;
    background: linear-gradient(145deg, #cd7f32 0%, #b87333 50%, #8b5a2b 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 215, 0, 0.3),
        0 0 0 3px #3d2817,
        0 0 0 5px #8b5a2b;
    position: relative;
    overflow: hidden;
    font-family: 'Georgia', serif;
    text-shadow: 0 1px 0 rgba(255, 215, 0, 0.3);
}

.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 ease;
}

.spin-btn:hover {
    background: linear-gradient(145deg, #ffd700 0%, #cd7f32 50%, #b87333 100%);
    box-shadow: 
        0 10px 30px rgba(205, 127, 50, 0.5),
        inset 0 2px 0 rgba(255, 215, 0, 0.4),
        0 0 0 3px #3d2817,
        0 0 0 5px #cd7f32;
    transform: translateY(-2px);
}

.spin-btn:hover::before {
    left: 100%;
}

.spin-btn:disabled {
    background: linear-gradient(145deg, #444 0%, #333 100%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
    color: #888;
    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);
    }
}

/* Winning symbol animations */
.symbol.win-shake {
    animation: winShake 0.4s ease infinite;
}

.symbol.win-bounce {
    animation: winBounce 0.5s ease infinite;
}

.symbol.win-pulse {
    animation: winPulseSymbol 0.6s ease infinite;
}

.symbol.win-sparkle {
    animation: winSparkle 0.5s ease infinite;
}

@keyframes winShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px) rotate(-2deg); }
    75% { transform: translateX(4px) rotate(2deg); }
}

@keyframes winBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.1); }
}

@keyframes winPulseSymbol {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.15);
        filter: brightness(1.4) drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    }
}

@keyframes winSparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    25% { 
        transform: scale(1.05) rotate(2deg);
        filter: brightness(1.3);
    }
    50% { 
        transform: scale(1.12) rotate(0deg);
        filter: brightness(1.5) drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
    75% { 
        transform: scale(1.05) rotate(-2deg);
        filter: brightness(1.3);
    }
}
