/* iOS 26 Style Slot Machine - 3x3 Grid Version with Collapsible Prizes */

:root {
    /* Bright Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-blue: #0d6efd;
    --accent-green: #198754;
    --accent-red: #dc3545;
    --accent-orange: #fd7e14;
    --accent-purple: #6f42c1;
    --accent-pink: #e83e8c;
    --border-color: #dee2e6;
    --shadow-light: rgba(0, 0, 0, 0.075);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Enhanced Dark theme colors */
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-tertiary: #21262d;
        --text-primary: #f0f6fc;
        --text-secondary: #8b949e;
        --accent-blue: #58a6ff;
        --accent-green: #3fb950;
        --accent-red: #f85149;
        --accent-orange: #ffa657;
        --accent-purple: #a5a3ff;
        --accent-pink: #ff7b72;
        --border-color: #30363d;
        --shadow-light: rgba(0, 0, 0, 0.2);
        --shadow-medium: rgba(0, 0, 0, 0.4);
        --shadow-heavy: rgba(0, 0, 0, 0.6);
        --glass-bg: rgba(22, 27, 34, 0.9);
        --glass-border: rgba(240, 246, 252, 0.1);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.container {
    max-width: 450px;
    width: 100%;
    background: var(--glass-bg);
    border-radius: 28px;
    padding: 32px;
    box-shadow: 
        0 8px 32px var(--shadow-light),
        0 1px 0 var(--glass-border);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.slot-machine {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.reels-container {
    position: relative;
    margin-bottom: 20px;
}

.reel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.reel {
    width: 90px;
    height: 90px;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 4px 16px var(--shadow-light),
        0 1px 0 var(--glass-border);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.reel:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 24px var(--shadow-medium),
        0 1px 0 var(--glass-border);
}

.reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.symbol {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    transition: all 0.2s ease;
    line-height: 1;
    border-radius: 10px;
}

.symbol:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    transform: scale(1.05);
}

.symbol.spinning {
    animation: symbol-spin 0.1s linear infinite;
}

.symbol.stopping {
    animation: symbol-stop 0.8s ease-out;
}

@keyframes symbol-spin {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

@keyframes symbol-stop {
    0% { transform: scale(1.1) rotate(360deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.payline {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    border-radius: 2px;
    opacity: 0;
    display: none;
    transform: translateY(-50%);
    box-shadow: 0 0 10px var(--accent-green);
    z-index: 10;
}

.payline.show {
    opacity: 1;
    display: block;
    animation: payline-glow 0.5s ease-in-out;
}

@keyframes payline-glow {
    0% { opacity: 0; transform: translateY(-50%) scaleX(0); }
    50% { opacity: 1; transform: translateY(-50%) scaleX(1.1); }
    100% { opacity: 1; transform: translateY(-50%) scaleX(1); }
}

.spin-button {
    width: 100%;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 8px 24px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: -0.2px;
    position: relative;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px var(--shadow-medium),
        0 1px 0 rgba(255, 255, 255, 0.2);
}

.spin-button:active:not(:disabled) {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 16px var(--shadow-light),
        0 1px 0 rgba(255, 255, 255, 0.1);
}

.spin-button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 8px var(--shadow-light);
}

.button-text {
    font-size: 16px;
    font-weight: 600;
}

.attempts-count {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.result-display {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.result-display.win-animation {
    animation: win-pulse 0.6s ease-in-out;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    color: white;
}

.result-display.lose-animation {
    animation: lose-shake 0.6s ease-in-out;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
    color: white;
}

@keyframes win-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes lose-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.result-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.result-text {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-prize {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.prizes-section {
    margin-bottom: 20px;
}

.prizes-toggle {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.prizes-toggle:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-light);
}

.prizes-toggle.active {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
}

.prizes-icon {
    font-size: 20px;
    margin-right: 12px;
}

.prizes-title {
    flex: 1;
    text-align: left;
}

.prizes-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.prizes-toggle.active .prizes-arrow {
    transform: rotate(180deg);
}

.prizes-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 16px 20px;
    margin-top: -1px;
}

.prize-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.prize-item:last-child {
    border-bottom: none;
}

.prize-item:hover {
    transform: translateX(4px);
}

.prize-emoji {
    font-size: 24px;
    margin-right: 12px;
}

.prize-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.subscribe-info {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.subscribe-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.channel-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.channel-link:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.subscribe-text small {
    color: var(--text-secondary);
    font-size: 12px;
}

.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: confetti-fall linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .reel {
        width: 80px;
        height: 80px;
    }
    
    .symbol {
        font-size: 32px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .result-icon {
        font-size: 40px;
    }
    
    .result-text {
        font-size: 18px;
    }
    
    .spin-button {
        height: 55px;
        font-size: 16px;
    }
    
    .button-text {
        font-size: 14px;
    }
    
    .attempts-count {
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --shadow-light: rgba(0, 0, 0, 0.3);
        --shadow-medium: rgba(0, 0, 0, 0.5);
        --shadow-heavy: rgba(0, 0, 0, 0.7);
    }
    
    @media (prefers-color-scheme: dark) {
        :root {
            --border-color: #ffffff;
            --shadow-light: rgba(255, 255, 255, 0.3);
            --shadow-medium: rgba(255, 255, 255, 0.5);
            --shadow-heavy: rgba(255, 255, 255, 0.7);
        }
    }
}

/* Symbol explosion and pulse effects */
@keyframes symbol-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.explosion-particle {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Enhanced winning line effect */
.payline.show {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 215, 0, 0.3) 20%, 
        rgba(255, 215, 0, 0.8) 50%, 
        rgba(255, 215, 0, 0.3) 80%, 
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: payline-glow 1s ease-in-out 3;
}

@keyframes payline-glow {
    0%, 100% { 
        opacity: 0.8; 
        transform: scaleX(1); 
    }
    50% { 
        opacity: 1; 
        transform: scaleX(1.1); 
    }
}
