/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Enhanced Space Background */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -10;
}

/* Multi-layered Stars for Depth */
.stars-layer-1, .stars-layer-2, .stars-layer-3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
}

.stars-layer-1 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="100" cy="100" r="0.8" fill="white" opacity="0.9"/><circle cx="300" cy="200" r="0.6" fill="white" opacity="0.7"/><circle cx="500" cy="150" r="1" fill="white" opacity="0.8"/><circle cx="700" cy="300" r="0.5" fill="white" opacity="0.6"/><circle cx="900" cy="100" r="0.7" fill="white" opacity="0.8"/><circle cx="200" cy="400" r="0.9" fill="white" opacity="0.9"/><circle cx="600" cy="500" r="0.4" fill="white" opacity="0.5"/><circle cx="800" cy="450" r="0.8" fill="white" opacity="0.7"/><circle cx="150" cy="600" r="0.6" fill="white" opacity="0.6"/><circle cx="450" cy="700" r="1.2" fill="white" opacity="1"/></svg>') repeat;
    animation: starsMove1 20s linear infinite;
    z-index: -9;
}

.stars-layer-2 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><circle cx="80" cy="120" r="0.5" fill="cyan" opacity="0.8"/><circle cx="250" cy="180" r="0.4" fill="cyan" opacity="0.6"/><circle cx="420" cy="100" r="0.7" fill="cyan" opacity="0.9"/><circle cx="600" cy="250" r="0.3" fill="cyan" opacity="0.5"/><circle cx="750" cy="80" r="0.6" fill="cyan" opacity="0.7"/><circle cx="180" cy="350" r="0.8" fill="cyan" opacity="0.8"/><circle cx="500" cy="400" r="0.4" fill="cyan" opacity="0.6"/><circle cx="680" cy="380" r="0.5" fill="cyan" opacity="0.7"/></svg>') repeat;
    animation: starsMove2 15s linear infinite;
    z-index: -8;
}

.stars-layer-3 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600"><circle cx="60" cy="90" r="0.3" fill="gold" opacity="0.7"/><circle cx="180" cy="140" r="0.2" fill="gold" opacity="0.5"/><circle cx="320" cy="80" r="0.4" fill="gold" opacity="0.8"/><circle cx="450" cy="200" r="0.2" fill="gold" opacity="0.4"/><circle cx="550" cy="60" r="0.3" fill="gold" opacity="0.6"/><circle cx="140" cy="280" r="0.5" fill="gold" opacity="0.7"/><circle cx="380" cy="320" r="0.2" fill="gold" opacity="0.5"/></svg>') repeat;
    animation: starsMove3 25s linear infinite;
    z-index: -7;
}

/* Enhanced Nebula */
.nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(138, 43, 226, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(255, 215, 0, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 10% 70%, rgba(255, 20, 147, 0.12) 0%, transparent 55%);
    animation: nebulaFloat 30s ease-in-out infinite;
    z-index: -6;
}

/* Warp Stars - Light Speed Effect */
.warp-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: -5;
    transition: opacity 1s ease-in-out;
}

.warp-stars.active {
    opacity: 1;
}

/* Space Particles */
.space-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -4;
}

/* Distant Galaxies */
.distant-galaxies {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 25%, rgba(138, 43, 226, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 85% 75%, rgba(0, 245, 255, 0.02) 0%, transparent 25%),
        radial-gradient(circle at 70% 15%, rgba(255, 215, 0, 0.025) 0%, transparent 20%);
    animation: galaxyRotate 60s linear infinite;
    z-index: -3;
}

/* Animations */
@keyframes starsMove1 {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-100px) translateY(-50px); }
}

@keyframes starsMove2 {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-150px) translateY(-75px); }
}

@keyframes starsMove3 {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-80px) translateY(-40px); }
}

@keyframes nebulaFloat {
    0%, 100% { 
        transform: translateX(0) translateY(0) scale(1);
        opacity: 0.8;
    }
    33% { 
        transform: translateX(20px) translateY(-15px) scale(1.05);
        opacity: 0.9;
    }
    66% { 
        transform: translateX(-15px) translateY(10px) scale(0.95);
        opacity: 0.7;
    }
}

@keyframes galaxyRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 20px 0;
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    height: 80px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(0, 245, 255, 0.3));
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(0, 245, 255, 0.5));
}

/* Wallet Section */
.wallet-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wallet-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 245, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.3);
}

.balance-label {
    font-size: 14px;
    color: #00F5FF;
}

.balance-amount {
    font-weight: 600;
    color: #FFD700;
}

.wallet-address {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #aaa;
}

.connect-wallet-btn, .disconnect-btn {
    padding: 12px 24px;
    background: linear-gradient(45deg, #00F5FF, #8A2BE2);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connect-wallet-btn:hover, .disconnect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 245, 255, 0.4);
}

.disconnect-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    padding: 6px 12px;
    font-size: 12px;
}

/* Wallet Modal */
.wallet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.wallet-modal-content {
    background: rgba(20, 20, 30, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.3);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.wallet-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.wallet-modal-header h2 {
    color: #00F5FF;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-options {
    display: grid;
    gap: 12px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.wallet-option:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: rgba(0, 245, 255, 0.3);
    transform: translateY(-2px);
}

.wallet-icon {
    font-size: 24px;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 120px);
}

/* Mobile: ensure content starts below sticky header */
@media (max-width: 1024px) {
    .main-content { padding-top: 88px; }
}

/* Game Panels */
.game-panel {
    background: rgba(20, 20, 30, 0.8);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.2);
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

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

.panel-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00F5FF, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-header p {
    color: #aaa;
    font-size: 16px;
}

/* Betting Controls */
.betting-controls {
    max-width: 500px;
    margin: 0 auto;
}

.bet-input-group {
    margin-bottom: 25px;
}

.bet-input-group label {
    display: block;
    margin-bottom: 12px;
    color: #00F5FF;
    font-weight: 600;
    font-size: 16px;
}

.input-with-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.bet-preset {
    flex: 1;
    padding: 10px;
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    color: #00F5FF;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.bet-preset:hover, .bet-preset.active {
    background: rgba(0, 245, 255, 0.2);
    transform: translateY(-2px);
}

.bet-input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 18px;
    text-align: center;
    font-weight: 600;
}

.bet-input:focus {
    outline: none;
    border-color: #00F5FF;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

/* Risk Buttons */
.multiplier-section {
    margin-bottom: 30px;
}

.multiplier-section label {
    display: block;
    margin-bottom: 15px;
    color: #00F5FF;
    font-weight: 600;
    font-size: 16px;
}

.risk-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.risk-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.risk-btn.active {
    background: rgba(0, 245, 255, 0.2);
    border-color: #00F5FF;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.risk-btn:hover {
    transform: translateY(-2px);
}

.risk-label {
    color: white;
    font-weight: 600;
    margin-bottom: 4px;
}

.risk-multiplier {
    color: #FFD700;
    font-size: 14px;
    font-weight: 500;
}

/* Start Game Button */
.start-game-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, #FFD700, #FF6B35);
    border: none;
    border-radius: 15px;
    color: #0a0a0f;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.start-game-btn:not(.disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.start-game-btn.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #666;
    cursor: not-allowed;
}

/* Game Board */
.game-board {
    background: rgba(20, 20, 30, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.3);
    padding: 25px;
    backdrop-filter: blur(15px);
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 480px) {
    .game-header { gap: 12px; }
    .stat { padding: 8px 10px; }
    .stat-label { font-size: 11px; }
    .stat-value { font-size: 14px; }
}

.game-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Quality selector styling */
.quality-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(0, 245, 255, 0.08);
    border: 1px solid rgba(0, 245, 255, 0.25);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.12) inset;
}

.quality-select {
    appearance: none;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    padding: 6px 24px 6px 10px;
    font-size: 12px;
    outline: none;
    position: relative;
}

.quality-select:focus {
    border-color: #00F5FF;
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.3);
}

@media (max-width: 480px) {
    .quality-selector label { display: none; }
    .quality-select { padding: 4px 20px 4px 8px; font-size: 11px; }
}

.tutorial-btn-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 245, 255, 0.2);
    border: 1px solid rgba(0, 245, 255, 0.4);
    color: #00F5FF;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-btn-small:hover {
    background: rgba(0, 245, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.5);
}

.game-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 245, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 245, 255, 0.3);
}

.stat-label {
    font-size: 12px;
    color: #00F5FF;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
}

.cash-out-btn {
    padding: 12px 24px;
    background: linear-gradient(45deg, #32CD32, #228B22);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

.cash-out-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4);
}

/* Game Grid */
.game-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    width: 100%;
}

/* In-Game Notifications */
.game-notification {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(138, 43, 226, 0.15));
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #00F5FF;
    backdrop-filter: blur(10px);
    z-index: 15;
    transition: all 0.3s ease;
    animation: pulseNotification 2s ease-in-out infinite;
}

.game-notification.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

.game-notification.warning {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.15), rgba(255, 69, 0, 0.15));
    border-color: rgba(255, 165, 0, 0.4);
    color: #FFA500;
}

.game-notification.warning {
    animation: pulseWarning 2s ease-in-out infinite;
}

.game-notification.success {
    background: linear-gradient(135deg, rgba(50, 205, 50, 0.15), rgba(0, 255, 127, 0.15));
    border-color: rgba(50, 205, 50, 0.4);
    color: #32CD32;
}

@keyframes pulseWarning {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
        border-color: rgba(255, 165, 0, 0.4);
    }
    50% { 
        box-shadow: 0 0 20px rgba(255, 165, 0, 0.7);
        border-color: rgba(255, 165, 0, 0.7);
    }
}

@keyframes pulseNotification {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
        border-color: rgba(0, 245, 255, 0.3);
    }
    50% { 
        box-shadow: 0 0 20px rgba(0, 245, 255, 0.6);
        border-color: rgba(0, 245, 255, 0.6);
    }
}

/* Game Hints */
.game-hints {
    position: absolute;
    width: 600px;
    height: 500px;
    pointer-events: none;
    z-index: 2;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.hint {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 25px;
    color: #00F5FF;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(15px);
    animation: hintPulse 4s ease-in-out infinite;
    opacity: 0.6;
    white-space: nowrap;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2);
}

.hint-left {
    left: -200px;
    top: 50%;
    transform: translateY(-50%);
    animation-delay: 0s;
}

.hint-right {
    right: -200px;
    top: 50%;
    transform: translateY(-50%);
    animation-delay: 1s;
}

.hint-top {
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 2s;
}

.hint-bottom {
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 3s;
}

.hint-icon {
    font-size: 16px;
}

@keyframes hintPulse {
    0%, 100% { 
        opacity: 0.6;
        transform: translateY(-50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateY(-50%) scale(1.05);
    }
}

.hint-top {
    animation: hintPulseTop 3s ease-in-out infinite;
}

.hint-bottom {
    animation: hintPulseBottom 3s ease-in-out infinite;
}

@keyframes hintPulseTop {
    0%, 100% { 
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

@keyframes hintPulseBottom {
    0%, 100% { 
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

/* First Move Demo */
.first-move-demo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-hand {
    position: absolute;
    font-size: 32px;
    animation: demoHandMove 4s ease-in-out infinite;
    z-index: 12;
}

.demo-path {
    position: absolute;
    width: 3px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #FFD700, transparent);
    border-radius: 2px;
    animation: demoPathGlow 4s ease-in-out infinite;
    z-index: 11;
}

.demo-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #FFD700;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: demoTextPulse 4s ease-in-out infinite;
    z-index: 12;
}

@keyframes demoHandMove {
    0%, 100% { 
        transform: translate(-20px, -40px);
        opacity: 0.8;
    }
    25% { 
        transform: translate(-20px, -20px);
        opacity: 1;
    }
    50% { 
        transform: translate(0px, 0px);
        opacity: 1;
    }
    75% { 
        transform: translate(20px, 20px);
        opacity: 1;
    }
}

@keyframes demoPathGlow {
    0%, 100% { 
        opacity: 0.3;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% { 
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

@keyframes demoTextPulse {
    0%, 100% { 
        opacity: 0.7;
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 16px;
    border: 2px solid rgba(0, 245, 255, 0.3);
    width: 480px;
    height: 480px;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.2);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.gem {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gem:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.gem.selected {
    border: 3px solid #FFD700;
    box-shadow: 
        0 0 25px rgba(255, 215, 0, 0.8),
        inset 0 0 15px rgba(255, 215, 0, 0.3),
        0 0 40px rgba(255, 215, 0, 0.4);
    transform: scale(1.15);
    z-index: 10;
    position: relative;
    animation: selectedGemPulse 1.5s ease-in-out infinite;
}

.gem.selected::before {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 14px;
    animation: sparkle 2s ease-in-out infinite;
    z-index: 11;
}

.gem.selected::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #FFD700;
    border-radius: 12px;
    animation: selectedBorder 2s linear infinite;
    z-index: 9;
}

/* Special gems */
.special-gem {
    position: relative;
}
.special-gem::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    border: 2px dashed rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
    pointer-events: none;
}
.special-line::before {
    content: '—';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFD700;
    text-shadow: 0 0 8px #FFD700;
}
.special-bomb::before {
    content: '💥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    filter: drop-shadow(0 0 6px #FFD700);
}

.gem.matching {
    animation: epicDestruction 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 20;
}

.gem.matching::before {
    content: '💥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    animation: explosionIcon 1s ease-out;
    z-index: 21;
}

.gem.matching::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    animation: shockwave 0.8s ease-out;
    z-index: 19;
}

.gem-hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.gem-pressed {
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transition: all 0.1s ease;
}

.gem-ripple {
    animation: rippleEffect 0.4s ease-out;
}

.gem.demo-highlight {
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8) !important;
    animation: demoGemPulse 2s ease-in-out infinite !important;
    z-index: 5;
}

@keyframes rippleEffect {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes demoGemPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 35px rgba(255, 215, 0, 1);
    }
}

/* Gem Types */
.gem.blue { background: linear-gradient(135deg, #00F5FF, #0080FF); }
.gem.purple { background: linear-gradient(135deg, #8A2BE2, #DA70D6); }
.gem.gold { background: linear-gradient(135deg, #FFD700, #FFA500); }
.gem.green { background: linear-gradient(135deg, #32CD32, #00FF7F); }
.gem.red { background: linear-gradient(135deg, #FF4500, #FF1493); }
.gem.white { background: linear-gradient(135deg, #FFFFFF, #F0F8FF); }

/* Game Settings */
.game-settings {
    margin-bottom: 30px;
}

.settings-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 120px;
    justify-content: center;
}

.settings-btn:hover {
    border-color: #00F5FF;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.3);
    transform: translateY(-2px);
    background: rgba(0, 245, 255, 0.1);
}

.settings-btn .btn-icon {
    font-size: 18px;
}

.tutorial-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.1);
}

.sound-btn.muted {
    border-color: rgba(255, 69, 0, 0.5);
    background: rgba(255, 69, 0, 0.1);
}

.sound-btn.muted .btn-icon {
    opacity: 0.6;
}

.sound-btn.muted:hover {
    border-color: #FF4500;
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.3);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    width: 100%;
}

.boost-btn, .quit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.boost-btn {
    background: linear-gradient(45deg, #FFD700, #FF6B35);
    color: #0a0a0f;
}

.quit-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
}

.boost-btn:hover, .quit-btn:hover {
    transform: translateY(-2px);
}

/* Game Results */
.game-results {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.results-content {
    background: rgba(20, 20, 30, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.3);
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.result-indicator {
    animation: slideInUp 0.5s ease-out;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.result-indicator h2 {
    font-size: 32px;
    margin-bottom: 25px;
    background: linear-gradient(45deg, #00F5FF, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-stats {
    margin-bottom: 30px;
}

.result-stat {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-label {
    color: #aaa;
}

.result-value {
    color: #FFD700;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.play-again-btn, .return-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-again-btn {
    background: linear-gradient(45deg, #00F5FF, #8A2BE2);
    color: white;
}

.return-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.tutorial-result-btn {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(138, 43, 226, 0.2));
    border: 1px solid rgba(0, 245, 255, 0.3);
    color: #00F5FF;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 10px;
}

.tutorial-result-btn:hover {
    border-color: #00F5FF;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.3), rgba(138, 43, 226, 0.3));
    color: #FFD700;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tutorial-result-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

/* Connect Required */
.connect-required {
    text-align: center;
    padding: 60px 20px;
}

.connect-content {
    max-width: 400px;
    margin: 0 auto;
}

.connect-icon {
    font-size: 180px;
    margin-bottom: 25px;
}

.connect-required h2 {
    font-size: 36px;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #00F5FF, #8A2BE2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connect-required p {
    color: #aaa;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.connect-cta-btn {
    padding: 18px 36px;
    background: linear-gradient(45deg, #00F5FF, #8A2BE2);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connect-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.4);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    max-width: 350px;
}

.toast {
    padding: 14px 18px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    min-width: 280px;
    max-width: 350px;
    animation: slideInLeft 0.4s ease-out;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
}

.toast.success {
    background: linear-gradient(135deg, rgba(50, 205, 50, 0.95), rgba(34, 139, 34, 0.95));
    border-color: rgba(50, 205, 50, 0.7);
    box-shadow: 0 8px 32px rgba(50, 205, 50, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.95), rgba(220, 20, 60, 0.95));
    border-color: rgba(255, 69, 0, 0.7);
    box-shadow: 0 8px 32px rgba(255, 69, 0, 0.3);
}

.toast.info {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.95), rgba(138, 43, 226, 0.95));
    border-color: rgba(0, 245, 255, 0.7);
    box-shadow: 0 8px 32px rgba(0, 245, 255, 0.3);
}

.toast.warning {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.95), rgba(255, 140, 0, 0.95));
    border-color: rgba(255, 165, 0, 0.7);
    box-shadow: 0 8px 32px rgba(255, 165, 0, 0.3);
}

/* Toast Animations */
@keyframes slideInLeft {
    0% { 
        transform: translateX(-100%);
        opacity: 0;
    }
    100% { 
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes matchPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 25px rgba(255, 215, 0, 0.8); }
    100% { transform: scale(1); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1600;
    animation: fadeIn 0.5s ease-out;
}

.tutorial-content {
    background: rgba(20, 20, 30, 0.98);
    border-radius: 25px;
    border: 2px solid rgba(0, 245, 255, 0.4);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2001;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
}

.tutorial-header h2 {
    font-size: 28px;
    background: linear-gradient(45deg, #00F5FF, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.skip-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer !important;
    transition: all 0.3s ease;
    font-size: 14px;
    pointer-events: auto !important;
    position: relative;
    z-index: 2001 !important;
}

.skip-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ff6b6b;
}

.tutorial-step {
    display: none;
    text-align: center;
    animation: slideInUp 0.5s ease-out;
}

.tutorial-step.active {
    display: block;
}

.tutorial-animation {
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.2);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated Gems Demo */
.animated-gems {
    display: flex;
    gap: 20px;
    align-items: center;
}

.demo-gem {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: gemFloat 2s ease-in-out infinite;
    position: relative;
}

.demo-gem.blue { 
    background: linear-gradient(135deg, #00F5FF, #0080FF);
    animation-delay: 0s;
}
.demo-gem.purple { 
    background: linear-gradient(135deg, #8A2BE2, #DA70D6);
    animation-delay: 0.3s;
}
.demo-gem.gold { 
    background: linear-gradient(135deg, #FFD700, #FFA500);
    animation-delay: 0.6s;
}

.demo-gem.selected {
    border-color: #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    animation: gemPulse 1s ease-in-out infinite;
}

/* Demo Grid */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.selection-arrow {
    font-size: 24px;
    animation: bounce 1s ease-in-out infinite;
    color: #FFD700;
}

/* Score Demo */
.score-demo {
    position: relative;
}

.score-popup {
    font-size: 24px;
    font-weight: bold;
    color: #32CD32;
    animation: scorePopup 2s ease-in-out infinite;
    margin-bottom: 15px;
}

.multiplier-demo {
    font-size: 20px;
    color: #FFD700;
    animation: multiplierGlow 2s ease-in-out infinite;
}

.particle-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: particleExplosion 2s ease-out infinite;
    transform: translate(-50%, -50%);
}

/* Cash Out Demo */
.cashout-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.demo-cashout-btn {
    padding: 15px 30px;
    background: linear-gradient(45deg, #32CD32, #228B22);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
}

.demo-cashout-btn.pulsing {
    animation: cashoutPulse 1.5s ease-in-out infinite;
}

.winnings-display {
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Timer Demo */
.timer-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.demo-timer {
    font-size: 32px;
    font-weight: bold;
    padding: 15px 25px;
    background: rgba(255, 69, 0, 0.2);
    border: 2px solid rgba(255, 69, 0, 0.5);
    border-radius: 20px;
    color: #FF4500;
}

.demo-timer.urgent {
    animation: timerUrgent 1s ease-in-out infinite;
}

.strategy-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip {
    font-size: 16px;
    color: #00F5FF;
    padding: 8px 15px;
    background: rgba(0, 245, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.3);
    animation: tipFadeIn 0.5s ease-out;
}

.tip:nth-child(1) { animation-delay: 0.2s; }
.tip:nth-child(2) { animation-delay: 0.4s; }
.tip:nth-child(3) { animation-delay: 0.6s; }

.tutorial-text {
    margin-bottom: 30px;
}

.tutorial-text h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #00F5FF;
}

.tutorial-text p {
    font-size: 16px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tutorial-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00F5FF, #FFD700);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.tutorial-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2001;
}

.tutorial-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer !important;
    transition: all 0.3s ease;
    font-size: 16px;
    min-width: 120px;
    pointer-events: auto !important;
    position: relative;
    z-index: 2001 !important;
}

.tutorial-btn.primary {
    background: linear-gradient(45deg, #00F5FF, #8A2BE2);
    color: white;
}

.tutorial-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tutorial-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 245, 255, 0.4);
}

/* Tutorial Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gemFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes gemPulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 35px rgba(255, 215, 0, 1);
        transform: scale(1.05);
    }
}

/* Enhanced Gem Movement Animations */
@keyframes gemDrop {
    0% { 
        transform: translateY(-120px) scale(0.6) rotate(-10deg);
        opacity: 0;
        filter: blur(2px);
    }
    30% {
        transform: translateY(-20px) scale(0.9) rotate(5deg);
        opacity: 0.7;
        filter: blur(1px);
    }
    60% {
        transform: translateY(15px) scale(1.15) rotate(-2deg);
        opacity: 0.9;
        filter: blur(0px);
    }
    80% {
        transform: translateY(-5px) scale(1.05) rotate(1deg);
        opacity: 1;
    }
    100% { 
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes gemBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-10px) scale(1.05);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
}

@keyframes gemShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes gemGlow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

@keyframes selectedGemPulse {
    0%, 100% { 
        transform: scale(1.15);
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 1),
            inset 0 0 20px rgba(255, 215, 0, 0.4),
            0 0 50px rgba(255, 215, 0, 0.6),
            0 0 80px rgba(255, 215, 0, 0.3);
    }
    50% { 
        transform: scale(1.25);
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 1),
            inset 0 0 25px rgba(255, 215, 0, 0.6),
            0 0 70px rgba(255, 215, 0, 0.8),
            0 0 100px rgba(255, 215, 0, 0.4);
    }
}

@keyframes sparkle {
    0%, 100% { 
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
    25% { 
        opacity: 0.7;
        transform: rotate(90deg) scale(1.2);
    }
    50% { 
        opacity: 1;
        transform: rotate(180deg) scale(0.8);
    }
    75% { 
        opacity: 0.8;
        transform: rotate(270deg) scale(1.1);
    }
}

@keyframes selectedBorder {
    0% { 
        border-color: #FFD700;
        opacity: 1;
    }
    25% { 
        border-color: #FFA500;
        opacity: 0.8;
    }
    50% { 
        border-color: #FF6B35;
        opacity: 1;
    }
    75% { 
        border-color: #00F5FF;
        opacity: 0.9;
    }
    100% { 
        border-color: #FFD700;
        opacity: 1;
    }
}

@keyframes epicDestruction {
    0% { 
        transform: scale(1.15);
        opacity: 1;
        filter: brightness(1);
    }
    20% { 
        transform: scale(1.3);
        opacity: 1;
        filter: brightness(2) saturate(2);
    }
    40% { 
        transform: scale(1.5) rotate(10deg);
        opacity: 0.8;
        filter: brightness(3) saturate(3) hue-rotate(45deg);
    }
    60% { 
        transform: scale(0.8) rotate(-5deg);
        opacity: 0.6;
        filter: brightness(1.5) saturate(1.5) blur(2px);
    }
    80% { 
        transform: scale(0.3) rotate(15deg);
        opacity: 0.3;
        filter: brightness(0.5) blur(4px);
    }
    100% { 
        transform: scale(0) rotate(45deg);
        opacity: 0;
        filter: brightness(0) blur(8px);
    }
}

@keyframes explosionIcon {
    0% { 
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
        filter: brightness(1);
    }
    20% { 
        transform: translate(-50%, -50%) scale(1.2) rotate(90deg);
        opacity: 1;
        filter: brightness(1.5);
    }
    50% { 
        transform: translate(-50%, -50%) scale(2) rotate(180deg);
        opacity: 1;
        filter: brightness(2);
    }
    80% { 
        transform: translate(-50%, -50%) scale(2.5) rotate(270deg);
        opacity: 0.6;
        filter: brightness(1.5);
    }
    100% { 
        transform: translate(-50%, -50%) scale(3.5) rotate(360deg);
        opacity: 0;
        filter: brightness(1);
    }
}

@keyframes shockwave {
    0% { 
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    50% { 
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.4;
    }
    100% { 
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Gem interaction states with enhanced animations */
.gem {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gem:active {
    animation: gemBounce 0.6s ease-out;
}

.gem.selected {
    animation: gemGlow 1s ease-in-out infinite;
}

.gem.dropping {
    animation: gemDrop 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gem.shaking {
    animation: gemShake 0.5s ease-in-out;
}

.gem.gem-entering {
    z-index: 15;
    position: relative;
}

.gem.gem-entering::before {
    content: '⭐';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    animation: starTwinkle 1s ease-in-out;
    z-index: 16;
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 0;
        transform: translateX(-50%) scale(0) rotate(0deg);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.5) rotate(180deg);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

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

@keyframes multiplierGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 215, 0, 1); }
}

@keyframes particleExplosion {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

@keyframes cashoutPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(50, 205, 50, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(50, 205, 50, 0.8);
    }
}

@keyframes timerUrgent {
    0%, 100% { 
        background: rgba(255, 69, 0, 0.2);
        border-color: rgba(255, 69, 0, 0.5);
    }
    50% { 
        background: rgba(255, 69, 0, 0.4);
        border-color: rgba(255, 69, 0, 0.8);
    }
}

@keyframes tipFadeIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Game Enhancement Animations */
@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes countdownPulse {
    0% { 
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes floatingScore {
    0% { 
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -80px) scale(1);
        opacity: 0;
    }
}

@keyframes screenFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes timerUrgent {
    0%, 100% { 
        color: #FF4500;
        text-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
    }
    50% { 
        color: #FF1493;
        text-shadow: 0 0 20px rgba(255, 20, 147, 0.8);
    }
}

/* Enhanced Gem Effects */
.gem.matching {
    animation: enhancedMatchPulse 0.8s ease-in-out;
}

@keyframes enhancedMatchPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }
    25% { 
        transform: scale(1.3);
        box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 40px rgba(255, 215, 0, 1);
    }
    75% { 
        transform: scale(1.2);
        box-shadow: 0 0 35px rgba(255, 215, 0, 0.8);
    }
    100% { 
        transform: scale(0);
        box-shadow: 0 0 50px rgba(255, 215, 0, 0);
        opacity: 0;
    }
}

@keyframes victoryFlash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes defeatFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Lock background scroll when a modal/overlay is open */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logo {
        order: 1;
    }
    
    .logo-image {
        height: 60px;
        max-width: 250px;
    }
    
    .wallet-section {
        order: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .wallet-info {
        align-items: center;
        width: 100%;
        max-width: 400px;
    }
    
    .balance {
        justify-content: center;
        min-width: 140px;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .game-grid {
        width: 360px;
        height: 360px;
        padding: 12px;
    }
    
    .gem {
        font-size: 16px;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .risk-buttons {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .toast {
        min-width: 250px;
    }
    
    /* Mobile hints positioning */
    .game-hints {
        width: 400px;
        height: 400px;
    }
    
    .hint {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .hint-left {
        left: -160px;
    }
    
    .hint-right {
        right: -160px;
    }
    
    .hint-top {
        top: -70px;
    }
    
    .hint-bottom {
        bottom: -70px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .game-panel {
        padding: 20px;
    }
    
    .logo-image {
        height: 50px;
        max-width: 200px;
    }
    
    .game-grid {
        width: 320px;
        height: 320px;
        padding: 10px;
    }
    
    .gem {
        font-size: 14px;
    }
    
    /* Very small screens */
    .game-hints {
        width: 320px;
        height: 320px;
    }
    
    .hint {
        font-size: 10px;
        padding: 6px 10px;
    }
    
    .hint-left {
        left: -140px;
    }
    
    .hint-right {
        right: -140px;
    }
    
    .hint-top {
        top: -60px;
    }
    
    .hint-bottom {
        bottom: -60px;
    }
    
    .demo-text {
        font-size: 12px;
        padding: 6px 12px;
    }
}/
* ===== WARP SPEED EFFECT STYLES ===== */

@keyframes warpStreak {
    0% {
        transform: scale(1) translateX(0);
        opacity: 1;
    }
    50% {
        transform: scale(20, 1) translateX(200px);
        opacity: 0.8;
    }
    100% {
        transform: scale(50, 1) translateX(500px);
        opacity: 0;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translateX(20px) translateY(-15px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-10px) translateY(10px) rotate(180deg);
        opacity: 1;
    }
    75% {
        transform: translateX(15px) translateY(-5px) rotate(270deg);
        opacity: 0.6;
    }
    100% {
        transform: translateX(0) translateY(0) rotate(360deg);
        opacity: 0.3;
    }
}

/* Warp Stars Enhanced */
.warp-star {
    transition: all 0.3s ease;
}

.warp-stars.active .warp-star {
    filter: blur(0.5px);
}

/* Space Particles Enhanced */
.space-particle {
    transition: all 0.1s ease;
    pointer-events: none;
}

.space-particle:nth-child(odd) {
    animation-direction: reverse;
}

.space-particle:nth-child(3n) {
    animation-duration: 20s;
}

.space-particle:nth-child(5n) {
    animation-duration: 12s;
}

/* Enhanced Nebula for Warp Effect */
.space-background.warp-mode .nebula {
    animation: nebulaWarp 2s ease-in-out;
}

@keyframes nebulaWarp {
    0% {
        transform: scale(1);
        filter: blur(0px);
    }
    50% {
        transform: scale(1.2);
        filter: blur(2px);
    }
    100% {
        transform: scale(1);
        filter: blur(0px);
    }
}

/* Hyperspace Lines Effect */
.hyperspace-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: -2;
    transition: opacity 0.5s ease;
}

.hyperspace-lines.active {
    opacity: 1;
}

.hyperspace-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, white, transparent);
    animation: hyperspaceMove 0.8s linear infinite;
}

@keyframes hyperspaceMove {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100vw);
        opacity: 0;
    }
}

/* Planet Transition Effect */
.planet-transition {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4169E1, #191970);
    box-shadow: 
        0 0 50px rgba(65, 105, 225, 0.5),
        inset -20px -20px 50px rgba(0, 0, 0, 0.3);
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
    transition: all 1s ease;
}

.planet-transition.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
}

.planet-transition.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .space-particle {
        width: 2px !important;
        height: 2px !important;
    }
    
    .warp-star {
        width: 1px !important;
        height: 1px !important;
    }
    
    @keyframes warpStreak {
        0% {
            transform: scale(1) translateX(0);
        }
        100% {
            transform: scale(30, 1) translateX(300px);
        }
    }
}/
* Claim System Styles */
.claim-section {
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.claim-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.claim-label {
    color: #00F5FF;
    font-weight: 600;
}

.claim-amount {
    color: #FFD700;
    font-weight: bold;
    font-size: 20px;
}

.claim-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.claim-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.claim-btn:disabled {
    background: rgba(255, 215, 0, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.claim-history-btn {
    background: rgba(0, 245, 255, 0.2);
    color: #00F5FF;
    border: 1px solid #00F5FF;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.claim-history-btn:hover {
    background: rgba(0, 245, 255, 0.3);
    transform: translateY(-2px);
}

/* Claim Modal Styles */
.claim-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.claim-modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #00F5FF;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 245, 255, 0.3);
}

.claim-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0, 245, 255, 0.3);
    padding-bottom: 15px;
}

.claim-modal-header h2 {
    color: #00F5FF;
    margin: 0;
    font-size: 24px;
}

.claim-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 245, 255, 0.1);
    border-radius: 12px;
}

.claim-stat {
    text-align: center;
}

.claim-stat .stat-label {
    display: block;
    color: #00F5FF;
    font-size: 14px;
    margin-bottom: 5px;
}

.claim-stat .stat-value {
    display: block;
    color: #FFD700;
    font-size: 20px;
    font-weight: bold;
}

.claim-list {
    max-height: 300px;
    overflow-y: auto;
}

.claim-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.claim-item:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: rgba(0, 245, 255, 0.4);
}

.claim-item.unclaimed {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.claim-item-info {
    flex: 1;
}

.claim-item-amount {
    color: #FFD700;
    font-weight: bold;
    font-size: 18px;
}

.claim-item-details {
    color: #ccc;
    font-size: 12px;
    margin-top: 5px;
}

.claim-item-tier {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.claim-item-tier.bronze {
    background: #CD7F32;
    color: white;
}

.claim-item-tier.silver {
    background: #C0C0C0;
    color: black;
}

.claim-item-tier.gold {
    background: #FFD700;
    color: black;
}

.claim-item-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.claim-item-status.claimed {
    background: #4CAF50;
    color: white;
}

.claim-item-status.unclaimed {
    background: #FF9800;
    color: white;
}

.claim-item-status.processing {
    background: #2196F3;
    color: white;
}

.claim-item-actions {
    display: flex;
    gap: 10px;
}

.claim-single-btn {
    background: #FFD700;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.claim-single-btn:hover {
    background: #FFA500;
    transform: translateY(-1px);
}

.claim-single-btn:disabled {
    background: rgba(255, 215, 0, 0.3);
    cursor: not-allowed;
    transform: none;
}

/* Loading states */
.claim-btn.loading {
    position: relative;
    color: transparent;
}

.claim-btn.loading::after {
    content: '🔄';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive design for claim system */
@media (max-width: 768px) {
    .claim-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .claim-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .claim-modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .claim-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .claim-item-actions {
        width: 100%;
        justify-content: center;
    }
}/*
 ===== MODERN BUTTON SYSTEM ===== */

/* Base Button Styles */
.btn-modern {
    position: relative;
    padding: 14px 28px;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    user-select: none;
    outline: none;
}

/* Shimmer effect */
.btn-modern::before {
    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.6s ease;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.btn-modern:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.1s;
}

/* Primary Button - Main actions */
.btn-primary-modern {
    background: linear-gradient(135deg, #00F5FF 0%, #1E90FF 50%, #8A2BE2 100%);
    color: white;
    box-shadow: 0 6px 25px rgba(0, 245, 255, 0.4);
}

.btn-primary-modern:hover {
    box-shadow: 0 12px 40px rgba(0, 245, 255, 0.5);
}

/* Success Button - Positive actions */
.btn-success-modern {
    background: linear-gradient(135deg, #00FF87 0%, #32CD32 50%, #228B22 100%);
    color: white;
    box-shadow: 0 6px 25px rgba(50, 205, 50, 0.4);
}

.btn-success-modern:hover {
    box-shadow: 0 12px 40px rgba(50, 205, 50, 0.5);
}

/* Warning Button - Caution actions */
.btn-warning-modern {
    background: linear-gradient(135deg, #FFD700 0%, #FF8C00 50%, #FF6347 100%);
    color: #000;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
    font-weight: 700;
}

.btn-warning-modern:hover {
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.5);
}

/* Danger Button - Destructive actions */
.btn-danger-modern {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 50%, #DC143C 100%);
    color: white;
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.4);
}

.btn-danger-modern:hover {
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.5);
}

/* Secondary Button - Less important actions */
.btn-secondary-modern {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
}

.btn-secondary-modern:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Ghost Button - Minimal style */
.btn-ghost-modern {
    background: transparent;
    color: #00F5FF;
    border: 2px solid #00F5FF;
    backdrop-filter: blur(10px);
}

.btn-ghost-modern:hover {
    background: rgba(0, 245, 255, 0.15);
    color: #fff;
    border-color: #fff;
}

/* Button Sizes */
.btn-sm-modern {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 40px;
    border-radius: 12px;
}

.btn-lg-modern {
    padding: 18px 36px;
    font-size: 18px;
    min-height: 60px;
    border-radius: 20px;
}

.btn-xl-modern {
    padding: 22px 44px;
    font-size: 20px;
    min-height: 68px;
    border-radius: 24px;
    font-weight: 700;
}

/* Button States */
.btn-modern:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    filter: grayscale(0.5);
}

.btn-modern.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.btn-modern.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top: 3px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

/* Icon buttons */
.btn-icon-modern {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.btn-icon-modern.btn-sm-modern {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.btn-icon-modern.btn-lg-modern {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

/* Floating Action Button */
.btn-fab-modern {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 24px;
}

/* Button Groups */
.btn-group-modern {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-group-modern.vertical {
    flex-direction: column;
}

.btn-group-modern.center {
    justify-content: center;
}

.btn-group-modern.full-width {
    width: 100%;
}

.btn-group-modern.full-width .btn-modern {
    flex: 1;
}

/* Special Effects */
.btn-glow {
    position: relative;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, #00F5FF, #8A2BE2, #FFD700, #32CD32);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse effect */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 245, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 245, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 245, 255, 0);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .btn-modern {
        padding: 12px 24px;
        min-height: 48px;
        font-size: 15px;
    }
    
    .btn-lg-modern {
        padding: 16px 32px;
        min-height: 56px;
        font-size: 17px;
    }
    
    .btn-xl-modern {
        padding: 20px 40px;
        min-height: 64px;
        font-size: 18px;
    }
    
    .btn-group-modern {
        gap: 12px;
    }
    
    .btn-group-modern.mobile-stack {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group-modern.mobile-stack .btn-modern {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-modern {
        min-height: 48px;
        padding: 14px 28px;
    }
    
    .btn-modern:hover {
        transform: none;
    }
    
    .btn-modern:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-modern {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn-modern {
        transition: none;
    }
    
    .btn-modern::before {
        display: none;
    }
    
    .btn-modern.loading::after {
        animation: none;
    }
}/* 
Risk Button Specific Styles */
.risk-btn {
    flex: 1;
    min-height: 80px;
    padding: 16px 12px;
    text-align: center;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.risk-btn.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.risk-btn .risk-label {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.risk-btn .risk-multiplier {
    font-size: 12px;
    opacity: 0.8;
    display: block;
}

/* Bet Preset Button Styles */
.bet-preset {
    min-width: 60px;
    transition: all 0.3s ease;
}

.bet-preset.active {
    background: linear-gradient(135deg, #00F5FF 0%, #8A2BE2 100%);
    color: white;
    border-color: #00F5FF;
}

.bet-preset:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mobile optimizations for game controls */
@media (max-width: 768px) {
    .risk-btn {
        min-height: 70px;
        padding: 12px 8px;
    }
    
    .risk-btn .risk-label {
        font-size: 14px;
    }
    
    .risk-btn .risk-multiplier {
        font-size: 11px;
    }
    
    .bet-preset {
        min-width: 50px;
        padding: 10px 16px;
    }
}/* Gem Sel
ection Improvements */
.gem.same-type-highlight {
    animation: sameTypeGlow 1s ease-in-out;
    border: 2px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

@keyframes sameTypeGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
        transform: scale(1.05);
    }
}

/* Better selected gem styling */
.gem.selected {
    border: 3px solid #00F5FF;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.8);
    transform: scale(1.1);
    z-index: 10;
    position: relative;
}

/* Gem hover improvements */
.gem.gem-hover {
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Selection counter */
.selection-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 245, 255, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.selection-counter.hidden {
    display: none;
}
/* ===
== OVERRIDE MODERN BUTTONS WITH COMPACT DESIGN ===== */
/* The compact design system takes precedence over the modern button system */

/* Hide any conflicting styles */
.btn-modern,
.btn-primary-modern,
.btn-secondary-modern,
.btn-success-modern,
.btn-warning-modern,
.btn-danger-modern,
.btn-ghost-modern {
    display: none !important;
}

/* Ensure compact styles take precedence */
.btn-compact,
.btn-preset,
.risk-btn,
.btn-start {
    display: inline-flex !important;
}
