/**
 * BetHub Games Shared CSS Foundation
 * ==================================
 * Comprehensive styling for all game pages in the BetHub betting platform.
 * Includes CSS variables, loader, lobby grid, game UI components, and animations.
 * 
 * @version 1.0.0
 * @author BetHub Team
 */

/* ============================================
   CSS VARIABLES - Extended Game Palette
   ============================================ */
:root {
    /* Existing palette from style.css */
    --primary-green: #0e7d58;
    --dark-green: #075a3e;
    --light-grey: #f0f0f0;
    --bg-grey: #e9ecef;
    --yellow: #ffc107;
    --text-dark: #333;
    --text-light: #fff;
    --border-color: #ddd;
    --red: #dc3545;
    
    /* Game-specific extended palette */
    --game-gold: #FFD700;
    --game-purple: #9B59B6;
    --game-neon-blue: #00D4FF;
    --game-neon-pink: #FF006E;
    --game-dark-bg: #0a0e17;
    --game-card-bg: #1a1f2e;
    --game-accent: #00E676;
    
    /* Additional game colors */
    --game-orange: #FF6B35;
    --game-teal: #00BFA5;
    --game-royal-blue: #4169E1;
    --game-crimson: #DC143C;
    --game-emerald: #50C878;
    
    /* Shadows and glows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.3);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.5);
    --glow-green: 0 0 20px rgba(0, 230, 118, 0.5);
    --glow-blue: 0 0 20px rgba(0, 212, 255, 0.5);
    --glow-pink: 0 0 20px rgba(255, 0, 110, 0.5);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;
    
    /* Z-index layers */
    --z-loader: 9999;
    --z-overlay: 9990;
    --z-modal: 9980;
    --z-tooltip: 9970;
    --z-header: 100;
}

/* ============================================
   GAME LOADER - Full Screen Overlay
   ============================================ */
.game-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: var(--z-loader);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.game-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Casino-themed loader animation container */
.loader-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

/* Spinning coin animation */
.loader-coin {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, var(--game-gold), #FFA500);
    border-radius: var(--radius-full);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: coin-spin 2s linear infinite;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.loader-coin::before {
    content: '$';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: var(--game-dark-bg);
}

/* Card flip animation */
.loader-card {
    position: absolute;
    width: 40px;
    height: 56px;
    background: linear-gradient(145deg, var(--game-card-bg), #2a3040);
    border-radius: var(--radius-sm);
    top: 10px;
    right: 0;
    border: 2px solid var(--game-gold);
    animation: card-flip 2s ease-in-out infinite;
    transform-style: preserve-3d;
}

.loader-card::after {
    content: '♠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: var(--game-gold);
}

/* Dice roll animation */
.loader-dice {
    position: absolute;
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, #fff, #e0e0e0);
    border-radius: var(--radius-sm);
    bottom: 10px;
    left: 10px;
    animation: dice-roll 2s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}

.loader-dice::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-dark);
    border-radius: var(--radius-full);
    top: 8px;
    left: 8px;
    box-shadow: 
        10px 0 0 var(--text-dark),
        0 10px 0 var(--text-dark),
        10px 10px 0 var(--text-dark);
}

/* Loading text with shimmer */
.loader-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 2px;
    background: linear-gradient(
        90deg,
        var(--text-light) 0%,
        var(--game-gold) 50%,
        var(--text-light) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
}

/* Progress bar */
.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin-top: 20px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--game-gold), var(--game-orange));
    border-radius: var(--radius-full);
    animation: progress-fill 2.5s ease-out forwards;
}

/* ============================================
   GAMES LOBBY GRID
   ============================================ */
.games-lobby {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Game card styling */
.game-card {
    position: relative;
    background: linear-gradient(145deg, var(--game-card-bg), #252b3d);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: transform var(--transition-bounce), box-shadow var(--transition-normal);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.game-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl), var(--glow-blue);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:hover .game-card-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--game-neon-blue));
}

/* Game card icon container */
.game-card-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-bounce), filter var(--transition-normal);
}

.game-card-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--game-neon-blue);
}

/* Game card title */
.game-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
    z-index: 1;
    margin-top: auto;
}

/* Game card badges */
.game-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.game-card-badge.hot {
    background: linear-gradient(135deg, var(--red), #ff4757);
    color: var(--text-light);
    animation: pulse-glow 2s ease-in-out infinite;
}

.game-card-badge.new {
    background: linear-gradient(135deg, var(--game-accent), #00c853);
    color: var(--text-dark);
}

.game-card-badge.popular {
    background: linear-gradient(135deg, var(--game-gold), #FFA500);
    color: var(--text-dark);
}

/* ============================================
   COMMON GAME UI COMPONENTS
   ============================================ */

/* Main game container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--game-dark-bg) 0%, #0f1520 100%);
    position: relative;
}

/* Game header */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(26, 31, 46, 0.8);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.game-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-light);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.game-header-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.game-header-back svg {
    width: 24px;
    height: 24px;
}

.game-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    flex: 1;
    margin: 0 20px;
}

/* Game balance display */
.game-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--game-gold);
    border-radius: var(--radius-full);
    color: var(--game-gold);
    font-weight: 600;
    font-size: 1rem;
}

.game-balance-icon {
    width: 20px;
    height: 20px;
    fill: var(--game-gold);
}

.game-balance-amount {
    font-variant-numeric: tabular-nums;
}

/* Bet controls container */
.bet-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(26, 31, 46, 0.6);
    border-radius: var(--radius-lg);
    margin-top: 20px;
}

/* Bet amount input group */
.bet-amount-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.bet-btn-adjust {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, var(--game-card-bg), #2a3040);
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bet-btn-adjust:hover {
    background: linear-gradient(145deg, #2a3040, var(--game-card-bg));
    transform: scale(1.05);
}

.bet-btn-adjust:active {
    transform: scale(0.95);
}

.bet-amount-input {
    flex: 1;
    min-width: 100px;
    height: 44px;
    padding: 0 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: border-color var(--transition-fast);
}

.bet-amount-input:focus {
    outline: none;
    border-color: var(--game-accent);
}

/* Place bet button */
.bet-btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(14, 125, 88, 0.4);
    min-width: 140px;
}

.bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 125, 88, 0.6), var(--glow-green);
}

.bet-btn:active {
    transform: translateY(0);
}

.bet-btn:disabled {
    background: linear-gradient(135deg, #555, #444);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

/* Result overlay */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.result-overlay.active {
    opacity: 1;
    visibility: visible;
}

.result-content {
    text-align: center;
    padding: 40px 60px;
    background: linear-gradient(145deg, var(--game-card-bg), #252b3d);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.8);
    transition: transform var(--transition-bounce);
}

.result-overlay.active .result-content {
    transform: scale(1);
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.result-icon.win {
    fill: var(--game-accent);
    filter: drop-shadow(0 0 20px var(--game-accent));
}

.result-icon.lose {
    fill: var(--red);
    filter: drop-shadow(0 0 20px var(--red));
}

.result-text {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-text.win {
    color: var(--game-accent);
}

.result-text.lose {
    color: var(--red);
}

.result-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Multiplier display */
.multiplier-display {
    font-size: 3rem;
    font-weight: 800;
    color: var(--game-gold);
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.2);
    animation: golden-glow 2s ease-in-out infinite;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   WIN CELEBRATION STYLES
   ============================================ */

/* Win overlay */
.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(255, 215, 0, 0.3) 0%,
        rgba(255, 140, 0, 0.2) 40%,
        rgba(0, 0, 0, 0.9) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.win-overlay.active {
    opacity: 1;
    visibility: visible;
}

.win-overlay-content {
    text-align: center;
    transform: scale(0);
    animation: scale-bounce 0.6s var(--transition-bounce) forwards;
}

.win-text {
    font-size: 3rem;
    font-weight: 800;
    color: var(--game-gold);
    text-transform: uppercase;
    letter-spacing: 8px;
    margin-bottom: 20px;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.5);
    animation: shimmer 2s linear infinite;
}

.win-amount {
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-light);
    text-shadow: 
        0 0 20px var(--game-gold),
        0 0 40px var(--game-gold),
        0 0 60px rgba(255, 215, 0, 0.5);
    animation: pulse-glow 1.5s ease-in-out infinite;
    font-variant-numeric: tabular-nums;
}

.win-multiplier {
    font-size: 1.5rem;
    color: var(--game-accent);
    margin-top: 10px;
    font-weight: 600;
}

/* Confetti pieces (CSS fallback) */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s linear forwards;
}

.confetti-piece:nth-child(odd) {
    background: var(--game-gold);
}

.confetti-piece:nth-child(even) {
    background: var(--game-neon-pink);
}

.confetti-piece:nth-child(3n) {
    background: var(--game-neon-blue);
}

.confetti-piece:nth-child(4n) {
    background: var(--game-purple);
}

.confetti-piece:nth-child(5n) {
    background: var(--game-accent);
}

/* Golden glow effect for game container */
.golden-glow {
    animation: golden-glow-border 2s ease-in-out infinite;
}

/* Score popup animation */
.score-popup {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--game-accent);
    pointer-events: none;
    animation: float-up 1s ease-out forwards;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

/* Lose animation overlay */
.lose-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(220, 53, 69, 0.3);
    z-index: var(--z-overlay);
    opacity: 0;
    pointer-events: none;
    animation: flash-red 0.5s ease-out;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Coin spin animation */
@keyframes coin-spin {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateY(360deg);
    }
}

/* Card flip animation */
@keyframes card-flip {
    0%, 100% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(180deg);
    }
}

/* Dice roll animation */
@keyframes dice-roll {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    25% {
        transform: rotate(90deg) translateY(-10px);
    }
    50% {
        transform: rotate(180deg) translateY(0);
    }
    75% {
        transform: rotate(270deg) translateY(-5px);
    }
}

/* Shimmer text animation */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Progress bar fill */
@keyframes progress-fill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Confetti fall animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Golden glow pulse */
@keyframes golden-glow {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.5),
            0 0 20px rgba(255, 215, 0, 0.3),
            0 0 30px rgba(255, 215, 0, 0.2);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.5),
            0 0 60px rgba(255, 215, 0, 0.3);
    }
}

/* Golden glow border animation */
@keyframes golden-glow-border {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.3),
            inset 0 0 20px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 0.6),
            inset 0 0 30px rgba(255, 215, 0, 0.2);
    }
}

/* Scale bounce animation */
@keyframes scale-bounce {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Float up animation for score popup */
@keyframes float-up {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

/* Pulse glow animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

/* Red flash animation for lose */
@keyframes flash-red {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet breakpoint (768px) */
@media (max-width: 768px) {
    .games-lobby {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .game-card {
        min-height: 150px;
        padding: 15px;
    }
    
    .game-card-icon {
        width: 60px;
        height: 60px;
    }
    
    .game-card-title {
        font-size: 1rem;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .game-header {
        padding: 12px 15px;
    }
    
    .game-header-title {
        font-size: 1.2rem;
        margin: 0 15px;
    }
    
    .game-balance {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .bet-controls {
        flex-wrap: wrap;
        gap: 12px;
        padding: 15px;
    }
    
    .bet-amount-group {
        width: 100%;
        justify-content: center;
    }
    
    .bet-btn {
        width: 100%;
        padding: 12px 24px;
    }
    
    .win-text {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .win-amount {
        font-size: 3rem;
    }
    
    .loader-text {
        font-size: 1.2rem;
    }
}

/* Mobile breakpoint (576px) */
@media (max-width: 576px) {
    .games-lobby {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 12px;
    }
    
    .game-card {
        min-height: 130px;
        padding: 12px;
    }
    
    .game-card-icon {
        width: 50px;
        height: 50px;
    }
    
    .game-card-title {
        font-size: 0.9rem;
    }
    
    .game-card-badge {
        padding: 3px 8px;
        font-size: 0.6rem;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .game-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .game-header-title {
        font-size: 1.1rem;
        order: 3;
        width: 100%;
        margin: 0;
        text-align: left;
    }
    
    .game-header-back {
        width: 40px;
        height: 40px;
    }
    
    .game-balance {
        padding: 6px 12px;
        font-size: 0.85rem;
        margin-left: auto;
    }
    
    .bet-controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .bet-amount-group {
        width: 100%;
    }
    
    .bet-btn-adjust {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
    
    .bet-amount-input {
        height: 48px;
        font-size: 1.1rem;
    }
    
    .bet-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .result-content {
        padding: 30px 40px;
        margin: 20px;
    }
    
    .result-text {
        font-size: 1.5rem;
    }
    
    .result-amount {
        font-size: 1.2rem;
    }
    
    .multiplier-display {
        font-size: 2.5rem;
    }
    
    .win-text {
        font-size: 2rem;
        letter-spacing: 3px;
    }
    
    .win-amount {
        font-size: 2.5rem;
    }
    
    .loader-animation {
        width: 100px;
        height: 100px;
    }
    
    .loader-coin {
        width: 50px;
        height: 50px;
    }
    
    .loader-coin::before {
        font-size: 22px;
    }
    
    .loader-text {
        font-size: 1.1rem;
    }
    
    .loader-progress {
        width: 160px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .games-lobby {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-card {
        min-height: 120px;
    }
    
    .game-header-title {
        font-size: 1rem;
    }
    
    .game-balance {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .game-card:hover {
        transform: none;
    }
    
    .game-card:active {
        transform: scale(0.98);
    }
    
    .bet-btn:hover {
        transform: none;
    }
    
    .bet-btn:active {
        transform: scale(0.95);
    }
    
    .bet-btn-adjust:hover {
        transform: none;
    }
    
    .bet-btn-adjust:active {
        transform: scale(0.9);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .game-card {
        border: 2px solid var(--text-light);
    }
    
    .bet-btn {
        border: 2px solid var(--text-light);
    }
    
    .game-balance {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loader-coin,
    .loader-card,
    .loader-dice {
        animation: none;
    }
    
    .loader-text {
        animation: none;
        background: var(--text-light);
        -webkit-text-fill-color: var(--text-light);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gold { color: var(--game-gold); }
.text-green { color: var(--game-accent); }
.text-red { color: var(--red); }
.text-blue { color: var(--game-neon-blue); }
.text-purple { color: var(--game-purple); }

.bg-gold { background-color: var(--game-gold); }
.bg-green { background-color: var(--game-accent); }
.bg-dark { background-color: var(--game-dark-bg); }
.bg-card { background-color: var(--game-card-bg); }

.glow-gold { box-shadow: var(--glow-gold); }
.glow-green { box-shadow: var(--glow-green); }
.glow-blue { box-shadow: var(--glow-blue); }

.hidden { display: none !important; }
.invisible { visibility: hidden !important; }
.no-scroll { overflow: hidden !important; }
