/* Smash & Clash! - Modern Game Styles */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    min-height: 100vh;
    color: #fff;
    user-select: none;
    overflow-x: hidden;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px;
    position: relative;
    height: 100vh;
    max-height: 100vh;
    display: grid;
    grid-template-rows: 1fr 140px;
    gap: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Animated particles background */
.game-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.3), transparent);
    background-repeat: repeat;
    background-size: 200px 150px;
    animation: sparkle 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

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

/* Header Styles - Hidden */
.game-header {
    display: none;
}

/* Deck Section - Perfectly Integrated within Scoreboard */
.deck-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.deck-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.deck-stack {
    position: relative;
    width: 60px;
    height: 85px;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.deck-card {
    position: absolute;
    width: 60px;
    height: 85px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #2c3e50 100%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background-image: url('assets/Card_Back_v2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.deck-card-1 {
    transform: translateZ(-6px) rotate(-2deg);
    opacity: 0.6;
}

.deck-card-2 {
    transform: translateZ(-3px) rotate(1deg);
    opacity: 0.8;
}

.deck-card-3 {
    transform: translateZ(-1px) rotate(-1deg);
    opacity: 0.9;
}

.deck-card-top {
    transform: translateZ(0px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.deck-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.deck-count {
    background: rgba(0,0,0,0.6);
    padding: 6px 10px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9em;
    backdrop-filter: blur(5px);
}

/* Deck Shuffle Animation */
@keyframes deckShuffle {
    0%, 100% { transform: translateZ(0px) rotate(0deg); }
    25% { transform: translateZ(10px) rotate(5deg); }
    50% { transform: translateZ(5px) rotate(-3deg); }
    75% { transform: translateZ(15px) rotate(2deg); }
}

.deck-shuffling .deck-card {
    animation: deckShuffle 0.8s ease-in-out infinite;
}

.deck-shuffling .deck-card-1 { animation-delay: 0.1s; }
.deck-shuffling .deck-card-2 { animation-delay: 0.2s; }
.deck-shuffling .deck-card-3 { animation-delay: 0.3s; }
.deck-shuffling .deck-card-top { animation-delay: 0.4s; }

/* Card Deal Animation */
@keyframes cardDeal {
    0% { 
        transform: translateZ(0px) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateZ(50px) scale(1.2) rotate(10deg);
        opacity: 0.7;
    }
    100% { 
        transform: translateZ(200px) scale(0.8) rotate(0deg);
        opacity: 0;
    }
}

.deck-dealing .deck-card-top {
    animation: cardDeal 0.6s ease-out forwards;
}

/* Revamped Score Display with Perfect Deck Integration */
.score-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 20px 15px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 100%);
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    backdrop-filter: blur(25px);
    height: 500px;
    width: 200px;
    position: relative;
}

/* Add premium glow effect to scoreboard */


.new-game-btn {
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #7c8cea 0%, #8a5db2 100%);
}



.score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 15px 12px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    width: 100%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.score-section:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.1);
}





.score-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-size: 2.8em;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 15px currentColor,
        0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    min-width: 80px;
    line-height: 1;
}



.human-score .score-value {
    color: #48dbfb;
    border-color: rgba(72, 219, 251, 0.6);
    background: linear-gradient(135deg, rgba(72, 219, 251, 0.3) 0%, rgba(72, 219, 251, 0.15) 100%);
    box-shadow: 
        0 0 20px rgba(72, 219, 251, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.2);
}

.computer-score .score-value {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0.15) 100%);
    box-shadow: 
        0 0 20px rgba(255, 107, 107, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.2);
}

/* Game Logo - Integrated with Hand Area at Bottom Left */
.game-logo {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 5;
    width: 80px;
    height: auto;
    opacity: 0.7;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.game-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.game-logo img:hover {
    transform: scale(1.05);
}

.game-logo:hover {
    opacity: 1;
}

/* Turn Indicator - Optimized for Scoreboard */
.turn-indicator {
    background: linear-gradient(135deg, rgba(72, 219, 251, 0.2) 0%, rgba(102, 126, 234, 0.2) 100%);
    border: 2px solid rgba(72, 219, 251, 0.4);
    padding: 10px 12px;
    border-radius: 15px;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #48dbfb;
    text-shadow: 0 0 8px rgba(72, 219, 251, 0.6);
    backdrop-filter: blur(10px);
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 12px rgba(72, 219, 251, 0.3);
    flex-shrink: 0;
}

/* Main Game Layout - Two Column: Board | Scores+Deck */
.main-game {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 15px;
    padding: 10px;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Computer Section - Above the board */
.computer-section {
    background: linear-gradient(135deg, rgba(116, 75, 162, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(116, 75, 162, 0.3);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-height: 80px;
    flex-shrink: 0;
}

.computer-info {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.computer-info h3 {
    color: #764ba2;
    font-size: 1em;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

.computer-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: rgba(255,255,255,0.9);
    flex-wrap: wrap;
}

.computer-stats div {
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: 600;
}

.computer-hand {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-height: 120px;
    overflow: hidden;
    max-width: 100%;
}

.computer-card {
    width: 60px;
    height: 85px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    border: 3px solid rgba(116, 75, 162, 0.6);
    position: relative;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: float 6s ease-in-out infinite;
    transform: rotate(180deg); /* Upside down for computer */
}

.computer-card::before {
    content: '🎴';
    color: rgba(255,255,255,0.8);
}

.computer-card-back {
    background-image: url('assets/Card_Back_v2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.computer-card-back::before {
    content: '';
}

.human-card {
    transform: rotate(0deg); /* Normal orientation for human player */
}

.human-card:hover {
    transform: translateY(-15px) scale(1.08) rotate(0deg);
}

/* Player Hand Section - Compact for Viewport */
.player-hand-section {
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 12px;
    position: relative;
    overflow: visible;
    height: 140px;
    max-height: 140px;
    box-sizing: border-box;
}

.player-hand {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow: visible;
    padding: 5px;
    position: relative;
    height: 100px;
}

/* Card overlapping effect - each card overlaps the previous one */
.player-hand .card {
    position: relative;
    z-index: 1;
}

.player-hand .card:not(:first-child) {
    margin-left: -18px; /* Overlap by 18px */
}

.player-hand .card:hover {
    z-index: 15; /* Bring hovered card to front */
    transform: translateY(-12px) scale(1.1);
}

.player-hand .card.selected {
    z-index: 25; /* Selected card always on top */
}



/* Card Styles - Optimized for Viewport Fit */
.card {
    width: 85px;
    height: 120px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(72, 219, 251, 0.6);
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform-origin: bottom center;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-12px) scale(1.05);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 8px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(72, 219, 251, 0.3);
    z-index: 10;
}

.card.selected {
    border-color: #feca57;
    box-shadow: 
        0 15px 30px rgba(254, 202, 87, 0.4),
        0 8px 15px rgba(254, 202, 87, 0.3),
        inset 0 0 0 2px rgba(254, 202, 87, 0.5),
        0 0 25px rgba(254, 202, 87, 0.6);
    transform: translateY(-10px) scale(1.05);
    z-index: 20;
}

/* Premium UNO-style card arrangement with sophisticated left-to-right stacking */
.player-hand .card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: bottom center;
}

.player-hand .card:nth-child(1) { 
    transform: rotate(-15deg) translateX(-5px); 
    z-index: 1;
}
.player-hand .card:nth-child(2) { 
    transform: rotate(-8deg) translateX(-3px); 
    z-index: 2;
}
.player-hand .card:nth-child(3) { 
    transform: rotate(0deg) translateX(0px); 
    z-index: 3;
}
.player-hand .card:nth-child(4) { 
    transform: rotate(8deg) translateX(3px); 
    z-index: 4;
}
.player-hand .card:nth-child(5) { 
    transform: rotate(15deg) translateX(5px); 
    z-index: 5;
}

/* Handle more than 5 cards with increased overlap */
.player-hand .card:nth-child(n+6) {
    margin-left: -35px; /* More overlap for additional cards */
    z-index: 2;
}

/* Extended support for 6+ cards with enhanced UNO-style positioning */
.player-hand .card:nth-child(6) { 
    transform: rotate(22deg) translateX(8px); 
    z-index: 6;
}
.player-hand .card:nth-child(7) { 
    transform: rotate(-22deg) translateX(-8px); 
    z-index: 6;
}
.player-hand .card:nth-child(8) { 
    transform: rotate(28deg) translateX(10px); 
    z-index: 7;
}

.player-hand .card:nth-child(6):hover { 
    transform: rotate(12deg) translateY(-25px) translateX(-12px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 25px 50px rgba(72, 219, 251, 0.4),
        0 10px 25px rgba(72, 219, 251, 0.3),
        0 0 30px rgba(72, 219, 251, 0.5);
}
.player-hand .card:nth-child(7):hover { 
    transform: rotate(-12deg) translateY(-25px) translateX(12px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 25px 50px rgba(72, 219, 251, 0.4),
        0 10px 25px rgba(72, 219, 251, 0.3),
        0 0 30px rgba(72, 219, 251, 0.5);
}
.player-hand .card:nth-child(8):hover { 
    transform: rotate(15deg) translateY(-25px) translateX(-15px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 25px 50px rgba(72, 219, 251, 0.4),
        0 10px 25px rgba(72, 219, 251, 0.3),
        0 0 30px rgba(72, 219, 251, 0.5);
}

/* Premium UNO-style hover effects with sophisticated animations */
.player-hand .card:nth-child(1):hover { 
    transform: rotate(-8deg) translateY(-15px) translateX(8px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 15px 30px rgba(72, 219, 251, 0.4),
        0 6px 15px rgba(72, 219, 251, 0.3),
        0 0 20px rgba(72, 219, 251, 0.5);
}
.player-hand .card:nth-child(2):hover { 
    transform: rotate(-4deg) translateY(-15px) translateX(4px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 15px 30px rgba(72, 219, 251, 0.4),
        0 6px 15px rgba(72, 219, 251, 0.3),
        0 0 20px rgba(72, 219, 251, 0.5);
}
.player-hand .card:nth-child(3):hover { 
    transform: rotate(0deg) translateY(-15px) translateX(0px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 15px 30px rgba(72, 219, 251, 0.4),
        0 6px 15px rgba(72, 219, 251, 0.3),
        0 0 20px rgba(72, 219, 251, 0.5);
}
.player-hand .card:nth-child(4):hover { 
    transform: rotate(4deg) translateY(-15px) translateX(-4px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 15px 30px rgba(72, 219, 251, 0.4),
        0 6px 15px rgba(72, 219, 251, 0.3),
        0 0 20px rgba(72, 219, 251, 0.5);
}
.player-hand .card:nth-child(5):hover { 
    transform: rotate(8deg) translateY(-15px) translateX(-8px) scale(1.1); 
    z-index: 20;
    box-shadow: 
        0 15px 30px rgba(72, 219, 251, 0.4),
        0 6px 15px rgba(72, 219, 251, 0.3),
        0 0 20px rgba(72, 219, 251, 0.5);
}

/* Premium UNO-style selected card effects */
.player-hand .card.selected:nth-child(1) { 
    transform: rotate(-8deg) translateY(-12px) translateX(8px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 12px 25px rgba(254, 202, 87, 0.5),
        0 6px 12px rgba(254, 202, 87, 0.4),
        inset 0 0 0 2px rgba(254, 202, 87, 0.6),
        0 0 25px rgba(254, 202, 87, 0.7);
}
.player-hand .card.selected:nth-child(2) { 
    transform: rotate(-4deg) translateY(-12px) translateX(4px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 12px 25px rgba(254, 202, 87, 0.5),
        0 6px 12px rgba(254, 202, 87, 0.4),
        inset 0 0 0 2px rgba(254, 202, 87, 0.6),
        0 0 25px rgba(254, 202, 87, 0.7);
}
.player-hand .card.selected:nth-child(3) { 
    transform: rotate(0deg) translateY(-12px) translateX(0px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 12px 25px rgba(254, 202, 87, 0.5),
        0 6px 12px rgba(254, 202, 87, 0.4),
        inset 0 0 0 2px rgba(254, 202, 87, 0.6),
        0 0 25px rgba(254, 202, 87, 0.7);
}
.player-hand .card.selected:nth-child(4) { 
    transform: rotate(4deg) translateY(-12px) translateX(-4px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 12px 25px rgba(254, 202, 87, 0.5),
        0 6px 12px rgba(254, 202, 87, 0.4),
        inset 0 0 0 2px rgba(254, 202, 87, 0.6),
        0 0 25px rgba(254, 202, 87, 0.7);
}
.player-hand .card.selected:nth-child(5) { 
    transform: rotate(8deg) translateY(-12px) translateX(-8px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 12px 25px rgba(254, 202, 87, 0.5),
        0 6px 12px rgba(254, 202, 87, 0.4),
        inset 0 0 0 2px rgba(254, 202, 87, 0.6),
        0 0 25px rgba(254, 202, 87, 0.7);
}
/* Extended selected card effects for 6+ cards */
.player-hand .card.selected:nth-child(6) { 
    transform: rotate(12deg) translateY(-20px) translateX(-12px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 20px 40px rgba(254, 202, 87, 0.5),
        0 10px 20px rgba(254, 202, 87, 0.4),
        inset 0 0 0 3px rgba(254, 202, 87, 0.6),
        0 0 40px rgba(254, 202, 87, 0.7);
}
.player-hand .card.selected:nth-child(7) { 
    transform: rotate(-12deg) translateY(-20px) translateX(12px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 20px 40px rgba(254, 202, 87, 0.5),
        0 10px 20px rgba(254, 202, 87, 0.4),
        inset 0 0 0 3px rgba(254, 202, 87, 0.6),
        0 0 40px rgba(254, 202, 87, 0.7);
}
.player-hand .card.selected:nth-child(8) { 
    transform: rotate(15deg) translateY(-20px) translateX(-15px) scale(1.08); 
    z-index: 25;
    border-color: #feca57;
    box-shadow: 
        0 20px 40px rgba(254, 202, 87, 0.5),
        0 10px 20px rgba(254, 202, 87, 0.4),
        inset 0 0 0 3px rgba(254, 202, 87, 0.6),
        0 0 40px rgba(254, 202, 87, 0.7);
}

.card-stats {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    pointer-events: none;
    z-index: 2;
}

.card-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: white;
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.9),
        1px 1px 3px rgba(0, 0, 0, 0.7);
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    margin: auto;
    font-family: 'Orbitron', monospace;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.stat-top {
    grid-column: 2;
    grid-row: 1;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.stat-right {
    grid-column: 3;
    grid-row: 2;
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

.stat-bottom {
    grid-column: 2;
    grid-row: 3;
    background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
}

.stat-left {
    grid-column: 1;
    grid-row: 2;
    background: linear-gradient(135deg, #1dd1a1 0%, #10ac84 100%);
}

/* Game Board Container - Optimized for Viewport */
.game-board-container {
    position: relative;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #2c3e50 100%);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 
        0 15px 30px rgba(0,0,0,0.4),
        inset 0 2px 10px rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

#game-board {
    border-radius: 15px;
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.3),
        inset 0 2px 5px rgba(255,255,255,0.1);
    cursor: pointer;
    max-width: 100%;
    max-height: 100%;
}

/* Enhanced board interactions */
.board-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
    pointer-events: none;
}

.board-cell {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.board-cell.highlight {
    border-color: #feca57;
    background: radial-gradient(circle, rgba(254, 202, 87, 0.3) 0%, rgba(254, 202, 87, 0.1) 70%, transparent 100%);
    box-shadow: 
        inset 0 0 20px rgba(254, 202, 87, 0.3),
        0 0 20px rgba(254, 202, 87, 0.4);
}

.board-cell.highlight::before {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    animation: sparkle 1s ease-in-out infinite alternate;
}

@keyframes sparkle {
    from { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* Premium visual polish for UNO-style card interactions */
.card-hovered {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    filter: drop-shadow(0 0 25px rgba(72, 219, 251, 0.8)) !important;
}

.card-neighbor-left,
.card-neighbor-right {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    opacity: 0.9;
}

/* Enhanced deck shuffle with more premium feel */
@keyframes deckShufflePremium {
    0%, 100% { transform: translateZ(0px) rotate(0deg) scale(1); }
    25% { transform: translateZ(15px) rotate(8deg) scale(1.02); }
    50% { transform: translateZ(8px) rotate(-5deg) scale(0.98); }
    75% { transform: translateZ(20px) rotate(3deg) scale(1.01); }
}

.deck-shuffling .deck-card {
    animation: deckShufflePremium 1s ease-in-out infinite;
}

/* Card placement effects */
.card-placing {
    animation: cardPlace 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardPlace {
    0% { 
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-10deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Turn transition effects */
.turn-transition {
    animation: turnChange 0.8s ease-in-out;
}

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





.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 4px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(-1px) scale(1.01);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}



/* Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    max-width: 500px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 25px;
    font-family: 'Orbitron', monospace;
    font-size: 2.5em;
    font-weight: 900;
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 2s ease-in-out infinite;
}

#final-scores {
    margin-bottom: 30px;
    font-size: 1.4em;
    line-height: 1.8;
    font-weight: 600;
    color: #fff;
}

/* Turn Announcement Overlay */
.turn-announcement {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.turn-announcement.show {
    opacity: 1;
    animation: turnAnnounceAbove 2.5s ease-in-out forwards;
}

.turn-text {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    color: #2c3e50;
    padding: 15px 30px;
    border-radius: 12px;
    font-family: 'Orbitron', monospace;
    font-size: 1.4em;
    font-weight: 900;
    text-align: center;
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.4),
        inset 0 2px 8px rgba(255,255,255,0.3);
    border: 2px solid rgba(254, 202, 87, 0.8);
    text-shadow: 0 0 8px rgba(254, 202, 87, 0.6);
    backdrop-filter: blur(10px);
}

@keyframes turnAnnounceAbove {
    0% { 
        transform: translateX(-50%) translateY(-20px) scale(0.5);
        opacity: 0;
    }
    20% { 
        transform: translateX(-50%) translateY(0px) scale(1.1);
        opacity: 1;
    }
    80% { 
        transform: translateX(-50%) translateY(0px) scale(1);
        opacity: 1;
    }
    100% { 
        transform: translateX(-50%) translateY(-10px) scale(0.8);
        opacity: 0;
    }
}

/* Card Hover Tooltip - Positioned Above */
.card-tooltip {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.85) 100%);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.card:hover .card-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0px);
}

/* Hide tooltips when card is selected */
.card.selected .card-tooltip {
    opacity: 0 !important;
    pointer-events: none;
}

.card-tooltip::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(0,0,0,0.95);
}

.tooltip-name {
    color: #feca57;
    font-weight: 700;
    margin-bottom: 2px;
}

.tooltip-stats {
    display: flex;
    gap: 6px;
    font-size: 10px;
}

.tooltip-stat {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tooltip-stat-value {
    font-weight: 700;
    color: #48dbfb;
}

/* Responsive Design */
@media (max-height: 900px) {
    .desktop-device .game-container {
        padding: 6px;
    }
    
    .desktop-device .score-display {
        margin: 6px 0;
        padding: 6px;
    }
    
    .desktop-device .score-value {
        font-size: 1.6em;
        padding: 3px 8px;
    }
    
    .desktop-device .player-hand-section {
        max-height: 90px;
        padding: 8px;
        min-height: 80px;
    }
    
    .desktop-device .card {
        width: 110px;
        height: 154px;
    }
    
    .desktop-device .game-board-container {
        height: 500px;
        max-height: 500px;
    }
    
    .desktop-device .score-sidebar {
        height: 400px;
        gap: 10px;
        padding: 15px 12px;
    }
}

@media (max-width: 1400px) and (min-width: 1025px) {
    .desktop-device #game-board {
        max-width: 650px;
        max-height: 400px;
    }
    
    .desktop-device .card {
        width: 115px;
        height: 161px;
    }
    
    .desktop-device .game-board-container {
        max-width: 750px;
        height: 450px;
    }
    
    .desktop-device .main-game {
        grid-template-columns: 1fr 160px;
        gap: 15px;
    }
}

@media (max-width: 1100px) {
    .computer-section {
        max-width: 500px;
        margin: 0 auto;
        max-height: 120px;
    }
    
    .player-hand {
        gap: 12px;
    }
    
    .card {
        width: 54px;
        height: 78px;
    }
    

      .main-game {
        grid-template-columns: 1fr 120px;
        gap: 10px;
    }
    
    .game-board-container {
        height: 350px;
    }
}

/* Mobile Landscape Optimizations - Keep Desktop-like Layout */
@media (max-width: 812px) and (orientation: landscape) and (max-height: 500px) {
    .mobile-device .main-game {
        grid-template-columns: 1fr 140px !important;
        grid-template-rows: 1fr !important;
        gap: 15px !important;
        padding: 8px !important;
    }
    

    
    .mobile-device .score-sidebar {
        order: 3 !important;
        flex-direction: column !important;
        width: 140px !important;
        height: 320px !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
        padding: 12px 8px !important;
    }
    
    .mobile-device .game-board-container {
        order: 2 !important;
        height: 300px !important;
        padding: 8px !important;
    }
    
    .mobile-device .card {
        width: 70px !important;
        height: 98px !important;
    }
    
    .mobile-device .player-hand-section {
        min-height: 80px !important;
        padding: 8px !important;
    }
    
    .mobile-device .player-hand {
        height: 70px !important;
    }
    
    .mobile-device .score-section {
        flex: none !important;
        padding: 8px !important;
    }
    
    .mobile-device .turn-indicator {
        padding: 4px 8px !important;
        font-size: 9px !important;
        margin-bottom: 5px !important;
    }
}

/* Fallback mobile styles for devices not caught by device detection */
@media (max-width: 768px) and (orientation: portrait) {
    .game-container {
        padding: 5px;
        height: 100vh;
        grid-template-rows: 1fr 130px;
        gap: 5px;
    }
    
    .main-game {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 5px;
        min-height: 0;
        overflow: hidden;
    }
    
    .game-board-container {
        min-height: 0;
        padding: 5px;
        flex: 1;
    }
    
    .player-hand-section {
        height: 130px;
        max-height: 130px;
        padding: 8px;
    }
    
    .card {
        width: 65px;
        height: 91px;
    }
    
    /* Hide deck on mobile portrait to save space */
    .deck-section {
        display: none !important;
    }
    
    /* Optimize score layout without deck */
    .score-content {
        gap: 8px;
    }
    
    .score-section {
        padding: 8px 6px;
    }
    
    /* Adjust card overlapping for bigger cards */
    .player-hand .card:not(:first-child) {
        margin-left: -15px;
    }
    
    .player-hand {
        height: 105px;
    }
    
    /* Adjust card stats for bigger cards */
    .card-stat {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
        .score-sidebar {
        flex-direction: column;
        height: auto;
        width: 100%;
        padding: 8px;
        gap: 8px;
        background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 100%);
        backdrop-filter: blur(20px);
    }

    .score-content {
        flex-direction: row;
        gap: 10px;
    }

    .score-section {
        flex: 1;
        padding: 10px 6px;
        border-radius: 8px;
    }

    .score-value {
        font-size: 1.6em;
        line-height: 1;
    }
    
    .modal-content {
        margin: 10px;
        padding: 15px;
    }
}

/* Enhanced Mobile Landscape Optimizations */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    .game-container {
        padding: 2px;
        height: 100vh;
        grid-template-rows: 40px 1fr 70px;
        gap: 2px;
        overflow: hidden;
    }
    
    .main-game {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 0;
        overflow: hidden;
        padding: 0;
        position: relative;
    }
    
    .game-board-container {
        min-height: 0;
        padding: 2px;
        flex: 1;
        border-radius: 8px;
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: calc(100vh * 1.67);
    }
    
    /* Optimize game board for landscape */
    #game-board {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    
    /* Position scorecard at top of screen in landscape */
    .score-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 40px;
        padding: 2px 8px;
        gap: 8px;
        width: 100%;
        border-radius: 0 0 8px 8px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(44, 62, 80, 0.95);
        backdrop-filter: blur(10px);
        z-index: 10;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Compact player hand for landscape */
    .player-hand-section {
        height: 70px;
        max-height: 70px;
        padding: 2px 4px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* Hide game logo on landscape to save space */
    .game-logo {
        display: none !important;
    }
    
    .player-hand {
        height: 60px;
        padding: 2px;
        gap: 2px;
        justify-content: center;
        flex: 1;
    }
    
    .card {
        width: 42px;
        height: 58px;
        border-radius: 6px;
        border-width: 2px;
    }
    
    /* Reduce card overlap in landscape */
    .player-hand .card:not(:first-child) {
        margin-left: -8px;
    }
    
    /* Compact sidebar for landscape */
    .score-sidebar {
        padding: 4px 2px;
        gap: 4px;
        width: 100px;
        border-radius: 8px;
        flex-direction: column;
        justify-content: space-between;
    }
    
    /* Minimize turn indicator for top bar */
    .turn-indicator {
        font-size: 10px;
        padding: 4px 8px;
        border-radius: 6px;
        text-align: center;
        margin: 0;
        line-height: 1;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        order: 1;
    }
    
    /* Compact deck section for top bar */
    .deck-section {
        margin: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        order: 2;
    }
    
    .deck-stack {
        width: 25px;
        height: 32px;
        margin: 0;
    }
    
    .deck-card {
        width: 25px;
        height: 32px;
        border-radius: 3px;
    }
    
    .deck-info {
        gap: 0;
        margin: 0;
    }
    
    .deck-count {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Horizontal score display for top bar */
    .score-content {
        gap: 12px;
        flex-direction: row;
        flex: 1;
        justify-content: center;
        order: 3;
    }
    
    .score-section {
        min-width: auto;
        padding: 4px 8px;
        border-radius: 6px;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .score-label {
        font-size: 10px;
        margin: 0;
        line-height: 1;
        opacity: 0.8;
    }
    
    .score-value {
        font-size: 16px;
        line-height: 1;
        font-weight: 700;
    }
    
    /* Compact new game button for top bar */
    .new-game-btn {
        font-size: 9px;
        padding: 4px 8px;
        border-radius: 6px;
        margin: 0;
        white-space: nowrap;
        order: 4;
        background: rgba(52, 152, 219, 0.8);
        border: 1px solid rgba(52, 152, 219, 1);
    }
    
    /* Turn announcement adjustments */
    .turn-announcement {
        border-radius: 8px;
    }
    
    .turn-text {
        font-size: 16px;
        padding: 8px 12px;
    }
    
    /* Optimize modals for landscape */
    .modal-content {
        margin: 5px;
        padding: 12px;
        border-radius: 12px;
        max-width: 90vw;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.8em;
        margin-bottom: 12px;
    }
    
    #final-scores {
        font-size: 1.1em;
        margin-bottom: 12px;
        line-height: 1.4;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Fallback for wider landscape phones */
@media (max-width: 768px) and (orientation: landscape) and (min-height: 500px) {
    .game-container {
        padding: 4px;
        height: 100vh;
        grid-template-rows: 50px 1fr 90px;
        gap: 4px;
    }
    
    .main-game {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 0;
        overflow: hidden;
        position: relative;
    }
    
    .game-board-container {
        min-height: 0;
        padding: 6px;
        flex: 1;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: calc(100vh * 1.4);
    }
    
    /* Position scorecard at top for wider landscape phones */
    .score-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        padding: 4px 12px;
        gap: 12px;
        width: 100%;
        border-radius: 0 0 12px 12px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(44, 62, 80, 0.95);
        backdrop-filter: blur(10px);
        z-index: 10;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .turn-indicator {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        order: 1;
    }
    
    .deck-section {
        display: flex;
        align-items: center;
        gap: 8px;
        order: 2;
    }
    
    .deck-stack {
        width: 30px;
        height: 40px;
    }
    
    .deck-card {
        width: 30px;
        height: 40px;
        border-radius: 4px;
    }
    
    .deck-count {
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .score-content {
        gap: 16px;
        flex-direction: row;
        justify-content: center;
        order: 3;
    }
    
    .score-section {
        padding: 6px 12px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .score-label {
        font-size: 12px;
        opacity: 0.8;
    }
    
    .score-value {
        font-size: 18px;
        font-weight: 700;
    }
    
    .new-game-btn {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 8px;
        order: 4;
        background: rgba(52, 152, 219, 0.8);
        border: 1px solid rgba(52, 152, 219, 1);
    }
    
    .player-hand-section {
        height: 90px;
        max-height: 90px;
        padding: 6px;
        border-radius: 12px;
    }
    
    .game-logo {
        max-width: 120px;
        max-height: 25px;
    }
    
    .game-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    
    .player-hand {
        height: 70px;
    }
    
    .card {
        width: 50px;
        height: 70px;
    }
    
    .score-sidebar {
        padding: 6px;
        gap: 6px;
        width: 120px;
    }
    
    .score-section {
        padding: 6px 4px;
    }
    
    .score-value {
        font-size: 1.4em;
    }
    
    .new-game-btn {
        font-size: 10px;
        padding: 6px 12px;
    }
}

/* iPhone Landscape Specific (iPhone X and similar) */
@media (max-width: 812px) and (orientation: landscape) and (max-height: 375px) {
    .game-container {
        padding: 1px;
        grid-template-rows: 35px 1fr 60px;
        gap: 1px;
    }
    
    .main-game {
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .game-board-container {
        max-width: calc(100vh * 1.67);
        height: 100%;
        padding: 1px;
        border-radius: 4px;
    }
    
    .player-hand-section {
        height: 60px;
        max-height: 60px;
        padding: 2px;
    }
    
    .player-hand {
        height: 50px;
    }
    
    .card {
        width: 35px;
        height: 48px;
        border-radius: 4px;
    }
    
    .score-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 35px;
        padding: 2px 4px;
        gap: 4px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(44, 62, 80, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 0;
        z-index: 1000;
    }
    
    .turn-indicator {
        order: 1;
        font-size: 7px;
        padding: 1px 4px;
        flex-shrink: 0;
    }
    
    .deck-section {
        order: 2;
        flex-shrink: 0;
    }
    
    .deck-stack, .deck-card {
        width: 20px;
        height: 28px;
    }
    
    .deck-count {
        font-size: 6px;
        padding: 1px 2px;
    }
    
    .score-content {
        order: 3;
        flex-direction: row;
        gap: 4px;
        flex: 1;
        justify-content: center;
    }
    
    .score-section {
        padding: 2px 4px;
        min-width: 35px;
    }
    
    .score-value {
        font-size: 12px;
        line-height: 1;
    }
    
    .score-label {
        font-size: 6px;
    }
    
    .score-divider {
        font-size: 10px;
        padding: 0 2px;
    }
    
    .new-game-btn {
        order: 4;
        font-size: 6px;
        padding: 2px 4px;
        flex-shrink: 0;
    }
}

/* Android Landscape Specific (common Android phone resolutions) */
@media (max-width: 640px) and (orientation: landscape) and (max-height: 360px) {
    .game-container {
        padding: 1px;
        grid-template-rows: 32px 1fr 55px;
        gap: 1px;
    }
    
    .main-game {
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .game-board-container {
        max-width: calc(100vh * 1.67);
        height: 100%;
        padding: 1px;
        border-radius: 3px;
    }
    
    .player-hand-section {
        height: 55px;
        max-height: 55px;
        padding: 1px 2px;
    }
    
    .game-logo {
        display: none !important;
    }
    
    .player-hand {
        height: 45px;
        gap: 1px;
    }
    
    .card {
        width: 32px;
        height: 44px;
        border-radius: 3px;
        border-width: 1px;
    }
    
    .player-hand .card:not(:first-child) {
        margin-left: -6px;
    }
    
    .score-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 32px;
        padding: 1px 3px;
        gap: 3px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(44, 62, 80, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 0;
        z-index: 1000;
    }
    
    .turn-indicator {
        order: 1;
        font-size: 6px;
        padding: 1px 3px;
        flex-shrink: 0;
    }
    
    .deck-section {
        order: 2;
        flex-shrink: 0;
    }
    
    .deck-stack, .deck-card {
        width: 18px;
        height: 25px;
    }
    
    .deck-count {
        font-size: 5px;
        padding: 1px 2px;
    }
    
    .score-content {
        order: 3;
        flex-direction: row;
        gap: 3px;
        flex: 1;
        justify-content: center;
    }
    
    .score-section {
        padding: 1px 3px;
        min-width: 30px;
    }
    
    .score-value {
        font-size: 10px;
        line-height: 1;
    }
    
    .score-label {
        font-size: 5px;
    }
    
    .score-divider {
        font-size: 8px;
        padding: 0 1px;
    }
    
    .new-game-btn {
        order: 4;
        font-size: 5px;
        padding: 1px 3px;
        flex-shrink: 0;
    }
}

/* Ultra-wide Screen Optimizations (2560px+) */
@media (min-width: 2560px) {
    .game-container {
        max-width: 1800px;
        margin-top: 80px;
    }
    
    .main-game {
        grid-template-columns: 1fr 220px;
        gap: 25px;
    }
    
    .game-board-container {
        max-width: 1400px;
        height: 700px;
        padding: 20px;
    }
    
    .card {
        width: 102px;
        height: 138px;
    }
    
    .computer-card {
        width: 70px;
        height: 95px;
    }
    
    .deck-stack, .deck-card {
        width: 85px;
        height: 115px;
    }
    
        .score-sidebar {
        height: 650px;
        width: 240px;
        gap: 20px;
        padding: 25px 20px;
    }

    .score-section {
        min-width: 100px;
        padding: 18px 15px;
    }
    
    .score-icon {
        font-size: 3em;
    }
    
    .score-value {
        font-size: 3em;
    }
    
    .score-divider {
        font-size: 2.2em;
        padding: 20px;
        min-width: 80px;
    }
}

/* 4K Display Optimizations */
@media (min-width: 3840px) {
    .game-container {
        max-width: 2400px;
        margin-top: 100px;
        padding: 20px;
    }
    
    .main-game {
        grid-template-columns: 1fr 300px;
        gap: 35px;
    }
    
    .game-board-container {
        max-width: 1800px;
        height: 900px;
        padding: 30px;
    }
    
    .card {
        width: 126px;
        height: 174px;
    }
    
    .computer-card {
        width: 85px;
        height: 115px;
    }
    
    .card-stat {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* Device-Specific Optimizations */
/* Mobile Device Optimizations */
.mobile-device {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Landscape Mobile Specific Optimizations */
.landscape-mobile {
    overflow: hidden;
}

.landscape-mobile .game-container {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}

.landscape-mobile .main-game {
    overflow: hidden !important;
}

.landscape-mobile .game-board-container {
    overflow: hidden !important;
    padding: 1px !important;
    margin: 0 !important;
}

/* Ensure canvas fits properly in landscape mobile */
.landscape-mobile #game-board {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Optimize touch targets for landscape mobile */
.landscape-mobile .card {
    cursor: pointer;
    touch-action: manipulation;
}

.landscape-mobile .new-game-btn {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Hide unnecessary elements in landscape mobile for maximum space */
.landscape-mobile .turn-announcement {
    font-size: 14px !important;
}

.landscape-mobile .turn-text {
    padding: 6px 10px !important;
    font-size: 14px !important;
}

/* Optimize card stats display for landscape mobile */
.landscape-mobile .card-stat {
    width: 14px !important;
    height: 14px !important;
    font-size: 8px !important;
    line-height: 14px !important;
}

/* Ensure proper spacing in landscape mobile */
.landscape-mobile .player-hand .card.selected {
    transform: translateY(-8px) scale(1.05) !important;
}

.landscape-mobile .player-hand .card:hover {
    transform: translateY(-6px) scale(1.02) !important;
}

/* Optimize board overlay for landscape */
.landscape-mobile .board-overlay {
    gap: 1px;
    padding: 1px;
}

.landscape-mobile .board-cell {
    border-width: 1px;
    border-radius: 4px;
}

/* Performance optimizations for landscape mobile */
.landscape-mobile * {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.landscape-mobile .card {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Safe area handling for phones with notches/rounded corners */
@supports (padding: max(0px)) {
    .landscape-mobile .game-container {
        padding-left: max(2px, env(safe-area-inset-left));
        padding-right: max(2px, env(safe-area-inset-right));
        padding-top: max(2px, env(safe-area-inset-top));
        padding-bottom: max(2px, env(safe-area-inset-bottom));
    }
    
    .landscape-mobile .main-game {
        margin-left: env(safe-area-inset-left);
        margin-right: env(safe-area-inset-right);
    }
}

/* Ultra-compact mode for very small landscape phones */
@media (max-width: 568px) and (orientation: landscape) and (max-height: 320px) {
    .game-container {
        padding: 0;
        grid-template-rows: 28px 1fr 50px;
        gap: 1px;
    }
    
    .main-game {
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .game-board-container {
        max-width: calc(100vh * 1.67);
        height: 100%;
        padding: 1px;
        border-radius: 4px;
    }
    
    .player-hand-section {
        height: 50px;
        max-height: 50px;
        padding: 1px;
        display: flex;
        align-items: center;
    }
    
    .game-logo {
        display: none !important;
    }
    
    .player-hand {
        height: 40px;
        gap: 0;
    }
    
    .card {
        width: 28px;
        height: 38px;
        border-radius: 2px;
        border-width: 1px;
    }
    
    .player-hand .card:not(:first-child) {
        margin-left: -5px;
    }
    
    .score-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 28px;
        padding: 1px 2px;
        gap: 2px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(44, 62, 80, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 0;
        z-index: 1000;
    }
    
    .turn-indicator {
        order: 1;
        font-size: 5px;
        padding: 1px 2px;
        flex-shrink: 0;
    }
    
    .deck-section {
        order: 2;
        flex-shrink: 0;
    }
    
    .deck-stack, .deck-card {
        width: 16px;
        height: 22px;
    }
    
    .deck-count {
        font-size: 4px;
        padding: 1px;
    }
    
    .score-content {
        order: 3;
        flex-direction: row;
        gap: 2px;
        flex: 1;
        justify-content: center;
    }
    
    .score-section {
        padding: 1px 2px;
        min-width: 25px;
        border-radius: 3px;
    }
    
    .score-label {
        font-size: 4px;
        margin-bottom: 1px;
    }
    
    .score-value {
        font-size: 8px;
        line-height: 1;
    }
    
    .score-divider {
        font-size: 6px;
        padding: 0 1px;
    }
    
    .new-game-btn {
        order: 4;
        font-size: 4px;
        padding: 1px 2px;
        border-radius: 3px;
        flex-shrink: 0;
    }
    
    /* Ultra-compact modal */
    .modal-content {
        margin: 2px;
        padding: 8px;
        border-radius: 8px;
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .modal-content h2 {
        font-size: 1.4em;
        margin-bottom: 8px;
    }
    
    #final-scores {
        font-size: 0.9em;
        margin-bottom: 8px;
        line-height: 1.2;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

.mobile-device .card {
    width: 75px;
    height: 105px;
    border-radius: 8px;
}

.mobile-device .player-hand {
    height: 110px;
    padding: 5px;
    gap: 0;
}

.mobile-device .player-hand .card:not(:first-child) {
    margin-left: -15px;
}

.mobile-device .player-hand-section {
    height: 140px;
    max-height: 140px;
    padding: 10px;
    border-radius: 15px;
}

.mobile-device .game-board-container {
    order: 3;
    min-height: 0;
    flex: 1;
    padding: 8px;
    border-radius: 15px;
    overflow: hidden;
}

.mobile-device .main-game {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 8px;
    padding: 5px;
    min-height: 0;
    overflow: hidden;
}

/* Update mobile device container for portrait with bigger cards */
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-device .game-container {
        grid-template-rows: 1fr 140px !important;
    }
}



.mobile-device .score-sidebar {
    order: 2;
    flex-direction: column;
    height: auto;
    width: 100%;
    padding: 10px;
    gap: 8px;
    justify-content: flex-start;
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 100%);
    border-radius: 15px;
    margin-bottom: 8px;
    backdrop-filter: blur(20px);
}

/* Score content wrapper optimized for deck integration */
.score-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    flex: 1;
    justify-content: center;
}

.mobile-device .score-content {
    flex-direction: row;
    gap: 12px;
    flex: none;
}

.mobile-device .score-section {
    flex: 1;
    max-width: none;
    padding: 12px 8px;
    border-radius: 10px;
}

.mobile-device .score-value {
    font-size: 2em;
    line-height: 1;
}

.mobile-device .score-label {
    font-size: 0.8em;
}

.mobile-device .new-game-btn {
    padding: 10px 15px;
    font-size: 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.mobile-device .turn-indicator {
    padding: 8px 12px;
    font-size: 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.mobile-device .game-logo {
    bottom: 8px;
    left: 8px;
    width: 60px;
    opacity: 0.6;
}

.mobile-device .deck-section {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Hide deck on mobile portrait devices to save space */
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-device .deck-section {
        display: none !important;
    }
    
    /* Optimize mobile score layout without deck */
    .mobile-device .score-content {
        gap: 6px;
    }
    
    .mobile-device .score-section {
        padding: 8px 6px;
    }
    
    /* Bigger cards for mobile portrait */
    .mobile-device .card {
        width: 75px !important;
        height: 105px !important;
        border-radius: 8px !important;
    }
    
    .mobile-device .player-hand {
        height: 110px !important;
    }
    
    .mobile-device .player-hand-section {
        height: 140px !important;
        max-height: 140px !important;
    }
    
    .mobile-device .player-hand .card:not(:first-child) {
        margin-left: -15px !important;
    }
    
    .mobile-device .card-stat {
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
    }
}

.mobile-device .deck-stack,
.mobile-device .deck-card {
    width: 50px;
    height: 70px;
}

.mobile-device .card-stat {
    width: 16px;
    height: 16px;
    font-size: 9px;
}

/* Disable hover effects on mobile */
.mobile-no-hover .card:hover {
    transform: none !important;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.mobile-no-hover .player-hand .card:hover {
    transform: none !important;
}

.mobile-no-hover .score-section:hover {
    transform: none !important;
    background: rgba(255,255,255,0.05) !important;
}

.mobile-no-hover .new-game-btn:hover {
    transform: none !important;
}

/* Tablet Device Optimizations */
.tablet-device .card {
    width: 115px;
    height: 161px;
}

.tablet-device .main-game {
    grid-template-columns: 1fr 160px;
    gap: 20px;
}

.tablet-device .game-board-container {
    height: 550px;
}

.tablet-device .score-sidebar {
    width: 180px;
    height: 420px;
}

/* Desktop Device Optimizations */
.desktop-device .card {
    width: 130px;
    height: 182px;
}

.desktop-device .main-game {
    grid-template-columns: 1fr 200px;
    gap: 25px;
}

.desktop-device .game-board-container {
    height: 700px;
}

/* Responsive touch targets for mobile */
@media (pointer: coarse) {
    .card {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn, .new-game-btn {
        min-height: 44px;
        padding: 12px 20px;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ====================================== */
/* SERVICE WORKER CACHE STATUS & NOTIFICATIONS */
/* ====================================== */

/* Cache Status Overlay */
.cache-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: cacheStatusFadeIn 0.3s ease-out;
}

.cache-status.hidden {
    display: none;
}

@keyframes cacheStatusFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cache-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    animation: cacheContentSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cacheContentSlideIn {
    from { 
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cache-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: cacheIconPulse 2s ease-in-out infinite;
}

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

.cache-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5em;
    font-weight: 900;
    color: #48dbfb;
    text-shadow: 0 0 20px rgba(72, 219, 251, 0.6);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.cache-progress {
    margin-top: 20px;
}

.cache-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cache-fill {
    height: 100%;
    background: linear-gradient(90deg, #1dd1a1, #48dbfb);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cache-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: cacheShimmer 2s infinite;
}

@keyframes cacheShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.cache-info {
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Update Available Notification */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: updateSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.update-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    max-width: 350px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 15px;
}

.update-icon {
    font-size: 2em;
    animation: updateIconSpin 2s linear infinite;
}

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

.update-text {
    flex: 1;
}

.update-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.update-subtitle {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
}

.update-btn, .update-dismiss {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.update-btn {
    background: linear-gradient(135deg, #1dd1a1 0%, #48dbfb 100%);
}

.update-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(29, 209, 161, 0.4);
}

.update-dismiss {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    font-size: 0.8em;
    padding: 6px 12px;
}

.update-dismiss:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
}

/* Cache Complete Notification */
.cache-complete-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: cacheCompleteIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

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

.cache-complete-content {
    background: linear-gradient(135deg, rgba(29, 209, 161, 0.95) 0%, rgba(72, 219, 251, 0.95) 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 400px;
}

.cache-complete-icon {
    font-size: 3em;
    animation: cacheCompleteIconBounce 0.8s ease-in-out;
}

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

.cache-complete-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3em;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.cache-complete-subtitle {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    font-weight: 500;
}

/* Mobile responsive adjustments for cache notifications */
@media (max-width: 768px) {
    .cache-content {
        margin: 20px;
        padding: 25px;
        border-radius: 15px;
    }
    
    .cache-icon {
        font-size: 3em;
        margin-bottom: 15px;
    }
    
    .cache-title {
        font-size: 1.2em;
        margin-bottom: 20px;
    }
    
    .update-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .update-content {
        padding: 15px;
        border-radius: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .update-btn, .update-dismiss {
        margin: 5px;
        padding: 10px 20px;
    }
    
    .cache-complete-content {
        margin: 20px;
        padding: 20px;
        border-radius: 15px;
        flex-direction: column;
        gap: 15px;
    }
    
    .cache-complete-icon {
        font-size: 2.5em;
    }
    
    .cache-complete-title {
        font-size: 1.1em;
    }
    
    .cache-complete-subtitle {
        font-size: 0.9em;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .cache-content {
        padding: 20px;
        margin: 10px;
    }
    
    .cache-icon {
        font-size: 2.5em;
        margin-bottom: 10px;
    }
    
    .cache-title {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .cache-bar {
        height: 6px;
        margin-bottom: 10px;
    }
    
    .cache-info {
        font-size: 0.9em;
    }
    
    .cache-complete-content {
        padding: 15px;
        margin: 10px;
    }
    
    .cache-complete-icon {
        font-size: 2em;
    }
    
    .cache-complete-title {
        font-size: 1em;
        margin-bottom: 5px;
    }
    
    .cache-complete-subtitle {
        font-size: 0.8em;
    }
}

/* Ultra-compact cache notifications for very small screens */
@media (max-width: 568px) and (orientation: landscape) and (max-height: 320px) {
    .cache-content {
        padding: 15px;
        margin: 5px;
        border-radius: 10px;
    }
    
    .cache-icon {
        font-size: 2em;
        margin-bottom: 8px;
    }
    
    .cache-title {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .cache-bar {
        height: 5px;
        margin-bottom: 8px;
    }
    
    .cache-info {
        font-size: 0.8em;
    }
    
    .update-notification {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .update-content {
        padding: 10px;
        border-radius: 8px;
    }
    
    .update-title {
        font-size: 1em;
    }
    
    .update-subtitle {
        font-size: 0.8em;
    }
    
    .update-btn, .update-dismiss {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .cache-complete-content {
        padding: 12px;
        margin: 5px;
        border-radius: 10px;
    }
    
    .cache-complete-icon {
        font-size: 1.8em;
    }
    
    .cache-complete-title {
        font-size: 0.9em;
    }
    
    .cache-complete-subtitle {
        font-size: 0.7em;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .cache-icon,
    .update-icon,
    .cache-complete-icon,
    .cache-fill::after {
        animation: none;
    }
    
    .cache-status,
    .update-notification,
    .cache-complete-notification {
        animation: none;
        transition: none;
    }
}

/* Dark mode adjustments (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    .cache-content {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(26, 26, 46, 0.95) 100%);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .update-content {
        background: linear-gradient(135deg, rgba(44, 62, 80, 0.95) 0%, rgba(52, 73, 94, 0.95) 100%);
    }
}
