/* ===========================================
   UNO Card Game - Complete Stylesheet
   =========================================== */

/* CSS Variables for consistent theming */
:root {
    --color-red: #f44336;
    --color-blue: #2196f3;
    --color-green: #4caf50;
    --color-yellow: #ffeb3b;
    --color-wild: #1a1a2e;
    --color-background: #ffc0cb;
    --color-table: #ffb6c1;
    --color-text-light: #ffffff;
    --color-text-dark: #333333;
    --color-shadow: rgba(0, 0, 0, 0.3);
    
    /* Fluid card sizing using clamp for smooth scaling */
    --card-width: clamp(42px, 8vw, 80px);
    --card-height: clamp(63px, 12vw, 120px);
    --card-radius: clamp(4px, 1vw, 8px);
    
    /* Opponent card sizing */
    --opponent-card-width: clamp(30px, 5vw, 50px);
    --opponent-card-height: clamp(45px, 7.5vw, 75px);
    
    /* Side player card sizing */
    --side-card-width: clamp(28px, 4.5vw, 45px);
    --side-card-height: clamp(42px, 6.8vw, 68px);
    
    /* Fluid spacing */
    --spacing-xs: clamp(2px, 0.5vw, 5px);
    --spacing-sm: clamp(5px, 1vw, 10px);
    --spacing-md: clamp(10px, 2vw, 20px);
    --spacing-lg: clamp(15px, 3vw, 30px);
    
    /* Fluid typography */
    --font-size-sm: clamp(0.65rem, 1.5vw, 0.85rem);
    --font-size-base: clamp(0.75rem, 2vw, 1rem);
    --font-size-lg: clamp(1rem, 2.5vw, 1.3rem);
    --font-size-xl: clamp(1.5rem, 4vw, 2.5rem);
    --font-size-title: clamp(2rem, 6vw, 4rem);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Safe area insets for notched devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffe4ec 0%, #ffb6c1 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--color-text-light);
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    touch-action: manipulation; /* Disable double-tap zoom */
    padding: var(--safe-area-top) var(--safe-area-right) var(--safe-area-bottom) var(--safe-area-left);
}

body::before {
    content: '🎀 ✨ 🌸 💕 🎀 ✨ 🌸 💕 🎀 ✨ 🌸 💕';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatDecorations 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    letter-spacing: 30px;
}

body::after {
    content: '💕 🌸 ✨ 🎀 💕 🌸 ✨ 🎀 💕 🌸 ✨ 🎀';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatDecorations 25s linear infinite reverse;
    pointer-events: none;
    z-index: 0;
    letter-spacing: 30px;
}

@keyframes floatDecorations {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===========================================
   Special Decorations (The Rock & Dancing Cat)
   =========================================== */

#dancing-cat {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: clamp(150px, 20vw, 250px);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: katyFloat 3s ease-in-out infinite;
}

#dancing-cat img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    border: 4px solid #ff69b4;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.5),
                0 0 0 4px #fff,
                0 0 0 8px #ffb6c1;
}

.cat-label {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: -15px;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* ===========================================
   Game Container & Layout
   =========================================== */

#game-container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height */
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#game-container::before {
    content: '';
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: clamp(150px, 20vw, 250px);
    height: clamp(150px, 20vw, 250px);
    background-image: url('images/rock.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 4px solid #ff69b4;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.5),
                0 0 0 4px #fff,
                0 0 0 8px #ffb6c1;
    z-index: 1000;
    animation: katyFloat 3s ease-in-out infinite;
}

#game-container::after {
    content: '🎀 The Rock 🎀';
    position: fixed;
    bottom: 5px;
    right: 20px;
    width: clamp(150px, 20vw, 250px);
    text-align: center;
    font-size: 1rem;
    color: #ff69b4;
    font-weight: 700;
    z-index: 1001;
    text-shadow: 1px 1px 0 #fff;
}

@keyframes katyFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

/* Header Styles */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 182, 193, 0.5);
    z-index: 100;
}

.game-title {
    font-family: 'Bangers', cursive;
    font-size: var(--font-size-xl);
    color: #ff69b4;
    text-shadow: 3px 3px 0 #fff,
                 -1px -1px 0 #ffb6c1,
                 1px -1px 0 #ffb6c1,
                 -1px 1px 0 #ffb6c1,
                 1px 1px 0 #ffb6c1;
    letter-spacing: clamp(2px, 0.5vw, 4px);
}

.game-title::before {
    content: '🎀 ';
}

.game-title::after {
    content: ' 🎀';
}

.header-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    background: linear-gradient(135deg, #ff69b4, #ff85c1);
    color: white;
}

.control-btn::before {
    content: '✿ ';
}

.control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

#sound-toggle {
    background: rgba(255, 105, 180, 0.3);
    font-size: 1.2rem;
    padding: 8px 12px;
}

#sound-toggle::before {
    content: '';
}

#music-toggle {
    background: rgba(255, 105, 180, 0.3);
    font-size: 1.2rem;
    padding: 8px 12px;
}

#music-toggle::before {
    content: '';
}

#fullscreen-toggle {
    background: rgba(255, 105, 180, 0.3);
    font-size: 1.2rem;
    padding: 8px 12px;
}

#fullscreen-toggle::before {
    content: '';
}

.fullscreen-exit {
    transform: rotate(45deg);
    display: inline-block;
}

/* Fullscreen mode styles */
:fullscreen #game-container,
:-webkit-full-screen #game-container,
:-moz-full-screen #game-container,
:-ms-fullscreen #game-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
}

#music-toggle.music-off {
    opacity: 0.5;
}

/* ===========================================
   Game Table - 4 Player Grid Layout
   =========================================== */

#game-table {
    flex: 1;
    display: grid;
    grid-template-areas:
        ". top ."
        "left center right"
        ". bottom .";
    grid-template-columns: clamp(120px, 18vw, 220px) 1fr clamp(120px, 18vw, 220px);
    grid-template-rows: clamp(100px, 15vh, 160px) 1fr clamp(140px, 22vh, 200px);
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* ===========================================
   Player Areas
   =========================================== */

.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm);
    border-radius: clamp(10px, 2vw, 15px);
    background: rgba(255, 255, 255, 0.4);
    transition: var(--transition-normal);
    overflow: hidden;
    min-width: 0; /* Allow flex shrinking */
}

.player-area.active {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.8),
                0 0 60px rgba(255, 105, 180, 0.4),
                inset 0 0 20px rgba(255, 105, 180, 0.2);
    animation: activePulse 1.5s ease-in-out infinite;
    border: 3px solid #ff69b4;
}

@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 105, 180, 0.8),
                    0 0 60px rgba(255, 105, 180, 0.4),
                    inset 0 0 20px rgba(255, 105, 180, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 105, 180, 1),
                    0 0 80px rgba(255, 105, 180, 0.6),
                    inset 0 0 30px rgba(255, 105, 180, 0.3);
    }
}

.player-area.active .player-name {
    font-size: calc(var(--font-size-base) * 1.1);
}

.player-area.active .player-info::before {
    content: '👉 ';
}

.player-area.uno-alert {
    animation: unoGlow 0.5s ease infinite alternate;
}

@keyframes unoGlow {
    from {
        box-shadow: 0 0 20px var(--color-red);
    }
    to {
        box-shadow: 0 0 40px var(--color-yellow);
    }
}

.player-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.player-name {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: #ff69b4;
}

.player-name::before {
    content: '♡ ';
}

.player-name::after {
    content: ' ♡';
}

.card-count {
    background: linear-gradient(135deg, #ff69b4, #ff85c1);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.4);
}

.card-count::before {
    content: '✿ ';
}

.card-count::after {
    content: ' ✿';
}

/* Player positions */
#player-top {
    grid-area: top;
}

#player-left {
    grid-area: left;
    position: relative;
    padding: 10px 15px;
}

#player-left .player-info {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

#player-left .player-hand.vertical {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

#player-right {
    grid-area: right;
    position: relative;
    padding: 10px 15px;
}

#player-right .player-info {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

#player-right .player-hand.vertical {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

#player-bottom {
    grid-area: bottom;
}

/* Player hands */
.player-hand {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    overflow: visible;
    max-width: 100%;
}

.player-hand.horizontal {
    flex-direction: row;
    /* Allow scrolling if too many cards */
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 10px 0; /* Space for hover effect */
}

.player-hand.horizontal::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.player-hand.vertical {
    flex-direction: row;
    align-items: center;
}

/* Side player cards - horizontal stack with overlap (rotated by parent) */
.player-hand.vertical .card {
    width: var(--side-card-width);
    height: var(--side-card-height);
    margin-left: calc(var(--side-card-width) * -0.65);
    margin-top: 0 !important;
    flex-shrink: 0;
}

.player-hand.vertical .card:first-child {
    margin-left: 0;
}

/* ===========================================
   Card Styles
   =========================================== */

.card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--card-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 2px 2px 8px var(--color-shadow);
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

/* Card back design - buttery pastel yellow */
.card-back {
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 30%, #fff59d 70%, #fff176 100%);
    border: 3px solid #ffcc80;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 8px rgba(255, 183, 77, 0.3),
                inset 0 0 20px rgba(255, 245, 157, 0.5);
}


/* Card in player's hand - stacked effect */
.player-hand.horizontal .card:not(:first-child) {
    margin-left: calc(var(--card-width) * -0.35);
}

/* Human player card interactions */
.human .player-hand .card:hover {
    transform: translateY(-20px);
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.human .player-hand .card.playable {
    border: 3px solid #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.human .player-hand .card.playable:hover {
    transform: translateY(-25px) scale(1.05);
}

.human .player-hand .card:not(.playable) {
    opacity: 0.6;
    cursor: not-allowed;
}

/* AI opponent cards - smaller and face down */
.opponent .player-hand .card {
    width: var(--opponent-card-width);
    height: var(--opponent-card-height);
    cursor: default;
}

.opponent .player-hand.horizontal .card:not(:first-child) {
    margin-left: calc(var(--opponent-card-width) * -0.4);
}

.opponent .player-hand.vertical .card:not(:first-child) {
    margin-top: calc(var(--opponent-card-height) * -0.6);
}

/* ===========================================
   Center Play Area
   =========================================== */

#play-area {
    grid-area: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(15px, 4vw, 40px);
    position: relative;
    background: radial-gradient(ellipse at center, rgba(255, 182, 193, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    padding: var(--spacing-lg);
    min-height: 0; /* Allow flex shrinking */
}

/* Card piles */
.card-pile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.pile-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.3vw, 2px);
    color: #ff69b4;
    background: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 15px;
    border: 2px dashed #ffb6c1;
    white-space: nowrap;
}

.pile-label::before {
    content: '🎀 ';
}

.pile-label::after {
    content: ' 🎀';
}

#draw-pile .card {
    cursor: pointer;
    transition: var(--transition-fast);
}

#draw-pile .card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

#draw-pile::before {
    content: '';
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 30%, #fff59d 70%, #fff176 100%);
    border: 3px solid #ffcc80;
    border-radius: var(--card-radius);
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
}

#draw-pile::after {
    content: '';
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 30%, #fff59d 70%, #fff176 100%);
    border: 3px solid #ffcc80;
    border-radius: var(--card-radius);
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -2;
}

.discard-top {
    background-color: #ccc;
}

/* Direction indicator */
#direction-indicator {
    position: absolute;
    top: var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #ff69b4;
    background: rgba(255, 255, 255, 0.7);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    border: 2px solid #ffb6c1;
    white-space: nowrap;
}

#direction-indicator::before {
    content: '✨';
    margin-right: 5px;
}

#direction-indicator::after {
    content: '✨';
    margin-left: 5px;
}

.direction-arrow {
    display: inline-block;
    transition: var(--transition-normal);
}

.direction-arrow.counterclockwise {
    transform: scaleX(-1);
}

/* Current color indicator */
#current-color-indicator {
    position: absolute;
    bottom: clamp(50px, 10vh, 80px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.7);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    white-space: nowrap;
}

.color-label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
    color: #333;
}

.color-display {
    width: clamp(18px, 3vw, 25px);
    height: clamp(18px, 3vw, 25px);
    border-radius: 50%;
    border: 2px solid white;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.color-display.red { background-color: var(--color-red); }
.color-display.blue { background-color: var(--color-blue); }
.color-display.green { background-color: var(--color-green); }
.color-display.yellow { background-color: var(--color-yellow); }

/* Turn indicator */
#turn-indicator {
    position: absolute;
    bottom: clamp(0px, 1vh, 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 25px;
    font-size: var(--font-size-base);
    font-weight: 700;
    white-space: nowrap;
    color: white;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.5);
    animation: turnBounce 1s ease-in-out infinite;
    z-index: 100;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

#turn-indicator::before {
    content: '🎀 ';
}

#turn-indicator::after {
    content: ' 🎀';
}

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

/* ===========================================
   UNO Alert Banner
   =========================================== */

#uno-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 1000;
    transition: var(--transition-fast);
}

#uno-alert.show {
    transform: translate(-50%, -50%) scale(1);
    animation: unoPulse 0.5s ease;
}

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

.uno-text {
    font-family: 'Bangers', cursive;
    font-size: clamp(3rem, 12vw, 6rem);
    color: #ff69b4;
    text-shadow: 
        4px 4px 0 #fff,
        8px 8px 0 rgba(255, 105, 180, 0.3);
    animation: unoShake 0.5s ease infinite;
}

.uno-text::before {
    content: '🎀✨';
    font-size: 3rem;
}

.uno-text::after {
    content: '✨🎀';
    font-size: 3rem;
}

@keyframes unoShake {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* ===========================================
   Modal Styles
   =========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: var(--transition-normal);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 100%);
    padding: clamp(15px, 4vw, 40px);
    border-radius: clamp(12px, 2vw, 20px);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(1);
    transition: var(--transition-normal);
    max-width: min(90%, 450px);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.hidden .modal-content {
    transform: scale(0.8);
}

/* Color Picker Modal */
.color-picker-content h2 {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    margin-bottom: 25px;
    letter-spacing: 2px;
    color: #ff69b4;
}

.color-picker-content h2::before {
    content: '🎀 ';
}

.color-picker-content h2::after {
    content: ' 🎀';
}

.color-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.color-btn {
    width: clamp(70px, 15vw, 100px);
    height: clamp(70px, 15vw, 100px);
    min-width: 60px;
    min-height: 60px;
    border: none;
    border-radius: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    touch-action: manipulation;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Winner Modal */
.winner-content {
    position: relative;
    overflow: hidden;
}

.winner-title {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: #ff69b4;
    margin-bottom: 20px;
    animation: winnerBounce 0.5s ease infinite alternate;
}

.winner-title::before {
    content: '🎀✨ ';
}

.winner-title::after {
    content: ' ✨🎀';
}

@keyframes winnerBounce {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.winner-name {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.play-again-btn {
    padding: 15px 40px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.play-again-btn::before {
    content: '🎀 ';
}

.play-again-btn::after {
    content: ' 🎀';
}

.play-again-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
}

/* Confetti effect */
.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti::before {
    content: '🎀 💖 ✨ 🌸 💕 🎀 💖 ✨ 🌸 💕 🎀';
    position: absolute;
    font-size: 2rem;
    animation: confettiFall 2s linear infinite;
    top: -50px;
    left: 0;
    width: 200%;
}

.confetti::after {
    content: '✨ 🎀 💕 🌸 💖 ✨ 🎀 💕 🌸 💖 ✨';
    position: absolute;
    font-size: 1.5rem;
    animation: confettiFall 2.5s linear infinite;
    animation-delay: 0.5s;
    top: -30px;
    left: 10%;
    width: 200%;
}

@keyframes confettiFall {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(400px) translateX(-50px); }
}

/* Start Modal */
.start-content {
    max-width: 450px;
}

.start-title {
    font-family: 'Bangers', cursive;
    font-size: var(--font-size-title);
    color: #ff69b4;
    text-shadow: 
        3px 3px 0 #fff,
        6px 6px 0 rgba(255, 105, 180, 0.2);
    margin-bottom: var(--spacing-sm);
}

.start-title::before {
    content: '🎀 ';
}

.start-title::after {
    content: ' 🎀';
}

.start-subtitle {
    font-size: 1.2rem;
    color: #ff69b4;
    margin-bottom: 30px;
}

.start-subtitle::before {
    content: '♡ ';
}

.start-subtitle::after {
    content: ' ♡';
}

.start-btn {
    padding: var(--spacing-sm) clamp(30px, 8vw, 50px);
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-lg);
    font-weight: 700;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: var(--spacing-lg);
    min-height: 48px;
    touch-action: manipulation;
}

.start-btn::before {
    content: '🎀 ';
}

.start-btn::after {
    content: ' 🎀';
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 105, 180, 0.5);
}

.game-rules {
    text-align: left;
    background: rgba(255, 255, 255, 0.5);
    padding: var(--spacing-md);
    border-radius: 15px;
}

.game-rules h3 {
    margin-bottom: var(--spacing-sm);
    color: #ff69b4;
    font-size: var(--font-size-base);
}

.game-rules ul {
    list-style: none;
}

.game-rules li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-md);
    position: relative;
    font-size: var(--font-size-sm);
    color: #555;
}

.game-rules li::before {
    content: '♥';
    position: absolute;
    left: 0;
    color: #ff69b4;
}

/* ===========================================
   Rules Modal
   =========================================== */

.rules-content {
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(255, 105, 180, 0.15);
    border: 2px solid rgba(255, 105, 180, 0.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    color: #ff69b4;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(255, 105, 180, 0.3);
    transform: scale(1.1);
}

.rules-title {
    font-family: 'Bangers', cursive;
    font-size: var(--font-size-xl);
    color: #ff69b4;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.rules-scrollable {
    overflow-y: auto;
    flex: 1;
    padding-right: var(--spacing-xs);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 105, 180, 0.4) transparent;
}

.rules-scrollable::-webkit-scrollbar {
    width: 6px;
}

.rules-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.4);
    border-radius: 3px;
}

.rules-section {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.rules-section.rules-pink {
    background: rgba(255, 105, 180, 0.12);
    border: 2px solid rgba(255, 105, 180, 0.3);
}

.rules-section h3 {
    font-family: 'Bangers', cursive;
    font-size: var(--font-size-lg);
    color: #ff69b4;
    margin-bottom: var(--spacing-xs);
    letter-spacing: 1px;
}

.rules-section p {
    font-size: var(--font-size-sm);
    color: #555;
    line-height: 1.5;
}

.rules-section ul {
    list-style: none;
    padding: 0;
}

.rules-section li {
    font-size: var(--font-size-sm);
    color: #555;
    padding: 4px 0 4px var(--spacing-md);
    position: relative;
    line-height: 1.5;
}

.rules-section li::before {
    content: '♥';
    position: absolute;
    left: 0;
    color: #ff69b4;
}

.rules-pink li::before {
    content: '🩷';
}

/* ===========================================
   Pink Cards
   =========================================== */

/* Pink card CSS fallback (used when image not found) */
.card.pink-card {
    background: linear-gradient(135deg, #ff69b4, #ff1493, #c71585) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    border: 3px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.card.pink-card .pink-icon {
    font-size: clamp(1.2rem, 3vw, 2rem);
    line-height: 1;
}

.card.pink-card .pink-label {
    font-size: clamp(0.4rem, 1vw, 0.65rem);
    text-align: center;
    padding: 2px;
    line-height: 1.2;
    font-family: 'Poppins', sans-serif;
}

/* Pink card in discard pile */
.card.discard-top.pink-card {
    width: var(--card-width);
    height: var(--card-height);
}

/* Pink Effect Banner */
.pink-effect-banner {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 25px;
    font-size: var(--font-size-lg);
    font-weight: 700;
    z-index: 800;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.6);
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pink-effect-banner.show {
    opacity: 1;
}

/* Peek & Steal Modal */
.peek-steal-modal .modal-content {
    max-width: 600px;
}

.peek-steal-content {
    text-align: center;
    padding: var(--spacing-lg);
}

.peek-steal-title {
    font-family: 'Bangers', cursive;
    font-size: var(--font-size-xl);
    color: #ff69b4;
    margin-bottom: var(--spacing-sm);
}

.peek-steal-sub {
    font-size: var(--font-size-base);
    color: #666;
    margin-bottom: var(--spacing-md);
}

.peek-steal-targets {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.peek-target-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 48px;
}

.peek-target-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.peek-hand {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.peek-card {
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition-fast);
}

.peek-card:hover {
    border-color: #ff69b4;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
}

/* Shield indicator */
.player-area.shielded .player-name::after {
    content: ' 🛡️';
}

/* ===========================================
   Card Play Animation
   =========================================== */

.card.playing {
    animation: playCard 0.4s ease forwards;
}

@keyframes playCard {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2) translateY(-30px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 0;
    }
}

.card.drawing {
    animation: drawCard 0.4s ease forwards;
}

@keyframes drawCard {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===========================================
   Utility Classes
   =========================================== */

.hidden {
    display: none !important;
}

/* ===========================================
   Responsive Design
   =========================================== */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    /* Grid adapts automatically via clamp(), but we can fine-tune */
    #game-table {
        grid-template-columns: clamp(100px, 15vw, 150px) 1fr clamp(100px, 15vw, 150px);
    }
    
    /* Scale down The Rock image */
    #game-container::before {
        width: clamp(60px, 10vw, 100px);
        height: clamp(60px, 10vw, 100px);
    }
    
    #game-container::after {
        width: clamp(60px, 10vw, 100px);
        font-size: clamp(0.5rem, 1vw, 0.6rem);
    }
}

/* Tablets and large phones (landscape) */
@media (max-width: 900px) {
    #game-table {
        grid-template-areas:
            "top top"
            "left right"
            "center center"
            "bottom bottom";
        grid-template-columns: 1fr 1fr;
        grid-template-rows: clamp(80px, 12vh, 120px) clamp(70px, 10vh, 100px) 1fr clamp(120px, 20vh, 180px);
    }
    
    #player-left,
    #player-right {
        flex-direction: column;
        position: static;
        padding: var(--spacing-sm);
    }
    
    #player-left .player-info,
    #player-right .player-info {
        position: static;
        writing-mode: horizontal-tb;
        transform: none;
    }
    
    #player-left .player-hand.vertical,
    #player-right .player-hand.vertical {
        position: static;
        transform: none;
    }
    
    .player-hand.vertical {
        flex-direction: row;
    }
    
    .player-hand.vertical .card {
        width: clamp(32px, 6vw, 40px);
        height: clamp(48px, 9vw, 60px);
        margin-left: clamp(-16px, -3vw, -20px);
        margin-top: 0 !important;
    }
    
    .player-hand.vertical .card:first-child {
        margin-left: 0;
    }

    #play-area {
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    #turn-indicator {
        position: static;
        transform: none;
        margin-top: var(--spacing-sm);
    }

    /* Scale down The Rock image more */
    #game-container::before {
        width: clamp(50px, 8vw, 80px);
        height: clamp(50px, 8vw, 80px);
        bottom: 15px;
        right: 15px;
    }
    
    #game-container::after {
        width: clamp(50px, 8vw, 80px);
        font-size: 0.55rem;
        bottom: 3px;
        right: 15px;
    }
    
    /* Hide floating decorations for cleaner mobile view */
    body::before,
    body::after {
        font-size: 1rem;
        opacity: 0.2;
    }
    
    /* Better header layout */
    #game-header {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .header-controls {
        gap: var(--spacing-xs);
    }
    
    .control-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-sm);
        min-height: 44px; /* Touch-friendly minimum */
    }
    
    #sound-toggle,
    #music-toggle {
        padding: var(--spacing-xs);
        min-width: 44px;
        min-height: 44px;
    }
}

/* Phones (portrait) - additional refinements */
@media (max-width: 600px) {
    /* Header stacks vertically */
    #game-header {
        flex-direction: column;
        align-items: center;
    }
    
    /* Adjust game table grid for smaller phones */
    #game-table {
        grid-template-rows: clamp(70px, 12vh, 100px) clamp(60px, 10vh, 80px) 1fr clamp(110px, 18vh, 160px);
    }
    
    /* Smaller play area positioning */
    #current-color-indicator {
        bottom: clamp(45px, 8vh, 60px);
    }
}

/* Very small phones */
@media (max-width: 400px) {
    /* Simplify decorations for performance and space */
    .card-count::before,
    .card-count::after,
    #direction-indicator::before,
    #direction-indicator::after,
    .pile-label::before,
    .pile-label::after,
    #turn-indicator::before,
    #turn-indicator::after,
    .player-name::before,
    .player-name::after {
        content: '';
    }
    
    /* Adjust game table for very small phones */
    #game-table {
        grid-template-rows: clamp(60px, 10vh, 85px) clamp(55px, 9vh, 70px) 1fr clamp(95px, 15vh, 130px);
    }
    
    /* The Rock - even smaller */
    #game-container::before {
        width: 38px;
        height: 38px;
        bottom: 8px;
        right: 8px;
    }
    
    #game-container::after {
        width: 38px;
        font-size: 0.35rem;
        right: 8px;
    }
}

/* ===========================================
   Touch-Friendly Styles
   =========================================== */

@media (hover: none) and (pointer: coarse) {
    /* Touch devices - use :active instead of :hover */
    .human .player-hand .card:hover {
        transform: none;
        z-index: auto;
        box-shadow: 2px 2px 8px var(--color-shadow);
    }
    
    .human .player-hand .card:active {
        transform: translateY(-15px) scale(1.05);
        z-index: 10;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }
    
    .human .player-hand .card.playable:active {
        transform: translateY(-20px) scale(1.08);
    }
    
    #draw-pile .card:hover {
        transform: none;
    }
    
    #draw-pile .card:active {
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    }
    
    .control-btn:hover {
        transform: none;
    }
    
    .control-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
    }
    
    .color-btn:hover {
        transform: none;
    }
    
    .color-btn:active {
        transform: scale(0.95);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    .start-btn:hover,
    .play-again-btn:hover {
        transform: none;
    }
    
    .start-btn:active,
    .play-again-btn:active {
        transform: scale(0.95);
    }
    
    /* Larger tap targets */
    .control-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .color-btn {
        min-height: 60px;
        min-width: 60px;
    }
}

/* ===========================================
   Landscape Phone Orientation
   =========================================== */

@media (max-height: 500px) and (orientation: landscape) {
    #game-table {
        grid-template-areas:
            "left top right"
            "left center right"
            "left bottom right";
        grid-template-columns: clamp(80px, 15vw, 120px) 1fr clamp(80px, 15vw, 120px);
        grid-template-rows: auto 1fr auto;
    }
    
    #player-top,
    #player-bottom {
        padding: var(--spacing-xs);
    }
    
    #player-left,
    #player-right {
        padding: var(--spacing-xs);
    }
    
    .player-info {
        margin-bottom: var(--spacing-xs);
    }
    
    #game-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .modal-content {
        max-height: 95vh;
        max-height: 95dvh;
        padding: var(--spacing-sm);
    }

    .game-rules {
        padding: var(--spacing-sm);
        max-height: 30vh;
        overflow-y: auto;
    }
    
    .game-rules li {
        padding: 2px 0;
    }
    
    /* Hide The Rock in landscape to save space */
    #game-container::before,
    #game-container::after {
        display: none;
    }
    
    /* Hide decorations in landscape */
    body::before,
    body::after {
        display: none;
    }
}

/* ===========================================
   High DPI / Retina Displays
   =========================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===========================================
   Reduced Motion (Accessibility)
   =========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before,
    body::after {
        animation: none;
    }
    
    #game-container::before {
        animation: none;
    }
    
    .player-area.active {
        animation: none;
    }
    
    #turn-indicator {
        animation: none;
    }
}

/* ===========================================
   Print Styles (hide for print)
   =========================================== */

@media print {
    body {
        display: none;
    }
}

/* ===========================================
   Flying Unicorn Animation
   =========================================== */

.flying-unicorn {
    position: fixed;
    font-size: clamp(3rem, 8vw, 6rem);
    z-index: 9999;
    pointer-events: none;
    animation: unicornFly 2s ease-in-out forwards;
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.8));
}

.flying-unicorn::after {
    content: '✨';
    position: absolute;
    font-size: 0.5em;
    animation: sparkleTrail 0.3s ease-out infinite;
}

@keyframes unicornFly {
    0% {
        left: -100px;
        top: 70%;
        transform: rotate(-15deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: rotate(-10deg) scale(1);
    }
    30% {
        top: 40%;
        transform: rotate(5deg) scale(1.1);
    }
    50% {
        top: 30%;
        transform: rotate(-5deg) scale(1.2);
    }
    70% {
        top: 20%;
        transform: rotate(10deg) scale(1.1);
    }
    90% {
        opacity: 1;
        transform: rotate(-5deg) scale(1);
    }
    100% {
        left: 110%;
        top: 10%;
        transform: rotate(15deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes sparkleTrail {
    0% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-30px) translateY(10px);
    }
}

.unicorn-rainbow {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 0, 0.1) 0%,
        rgba(255, 127, 0, 0.1) 16%,
        rgba(255, 255, 0, 0.1) 33%,
        rgba(0, 255, 0, 0.1) 50%,
        rgba(0, 0, 255, 0.1) 66%,
        rgba(75, 0, 130, 0.1) 83%,
        rgba(148, 0, 211, 0.1) 100%
    );
    opacity: 0;
    animation: rainbowFlash 2s ease-in-out forwards;
}

@keyframes rainbowFlash {
    0% { opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.4; }
    100% { opacity: 0; }
}

/* ===========================================
   Glitter Rain Effect
   =========================================== */

.glitter-particle {
    position: fixed;
    top: -20px;
    pointer-events: none;
    z-index: 10000;
    user-select: none;
    animation: glitterFall linear forwards;
}

@keyframes glitterFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===========================================
   Local Multiplayer — Start screen additions
   =========================================== */

#mode-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.start-btn-secondary {
    background: linear-gradient(135deg, #b24ecf, #7c3aed) !important;
    border-color: rgba(255,255,255,0.4) !important;
}

.start-btn-ghost {
    background: transparent !important;
    border: 2px solid #ff69b4 !important;
    color: #ff69b4 !important;
    font-size: var(--font-size-base) !important;
    padding: var(--spacing-xs) var(--spacing-md) !important;
}

.start-btn-ghost::before,
.start-btn-ghost::after {
    content: '' !important;
}

.setup-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: #ff1493;
    margin-bottom: var(--spacing-md);
    letter-spacing: 2px;
}

.setup-label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.setup-player-count {
    margin-bottom: var(--spacing-md);
}

.count-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: center;
}

.count-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ff69b4;
    background: white;
    color: #ff69b4;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.count-btn:hover {
    background: #ff69b4;
    color: white;
}

#player-count-display {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: #ff1493;
    min-width: 32px;
    text-align: center;
}

.player-name-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--spacing-xs);
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.player-name-input {
    padding: 10px 14px;
    border: 2px solid #ffb3d9;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-base);
    outline: none;
    transition: border-color 0.15s;
}

.player-name-input:focus {
    border-color: #ff69b4;
}

.player-pin-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    color: #888;
    cursor: pointer;
    white-space: nowrap;
}

.player-pin-toggle input[type="checkbox"] {
    accent-color: #ff69b4;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.player-pin-row {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 182, 193, 0.15);
    border-radius: 10px;
}

.player-pin-input {
    width: 100px;
    padding: 8px 12px;
    border: 2px solid #ffb3d9;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-sm);
    letter-spacing: 4px;
    text-align: center;
    outline: none;
}

.player-pin-input:focus {
    border-color: #ff69b4;
}

.player-pin-label {
    font-size: var(--font-size-sm);
    color: #888;
    margin-bottom: 4px;
}

.setup-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

/* ===========================================
   Pass Screen Modal
   =========================================== */

#pass-screen {
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
}

.pass-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-lg);
    text-align: center;
    gap: var(--spacing-md);
}

.pass-screen-icon {
    font-size: clamp(3rem, 10vw, 6rem);
    animation: bobble 1.2s ease-in-out infinite;
}

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

.pass-screen-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    color: #fff;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(255, 105, 180, 0.8);
}

.pass-screen-sub {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.7);
}

.pass-pin-label {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-sm);
}

.pass-pin-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pass-pin-digit {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    background: rgba(255,255,255,0.1);
    border: 3px solid rgba(255, 105, 180, 0.5);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: border-color 0.15s;
}

.pass-pin-digit:focus {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.15);
}

.pass-pin-error {
    color: #ff6b6b;
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

.pass-reveal-btn {
    font-size: var(--font-size-lg) !important;
    padding: var(--spacing-sm) clamp(30px, 8vw, 50px) !important;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 105, 180, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 105, 180, 0.9); }
}

/* ===========================================
   Phase 7 — Visual Polish
   =========================================== */

/* Turn indicator pulse for active player */
.player-area.active .player-name {
    animation: activePulse 1.5s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% { text-shadow: 0 0 6px rgba(255, 105, 180, 0.5); }
    50% { text-shadow: 0 0 18px rgba(255, 105, 180, 1), 0 0 30px rgba(255, 20, 147, 0.6); }
}

/* Discard pile pop animation when new card lands */
#discard-pile.card-landed .card {
    animation: discardPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes discardPop {
    0% { transform: scale(0.7) rotate(-15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Draw pile bounce when clicked */
#draw-pile:active {
    transform: scale(0.95);
}

/* Playable card hover lift — enhance existing */
.card.playable {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.15s ease;
}

.card.playable:hover {
    transform: translateY(-12px) scale(1.06) rotate(-2deg);
    box-shadow: 0 12px 28px rgba(255, 20, 147, 0.45);
}

/* Active player area glow ring */
.player-area.active {
    transition: box-shadow 0.3s ease;
}

/* Smooth color display transition */
.color-display {
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Card draw bounce-in */
@keyframes cardBounceIn {
    0% { opacity: 0; transform: scale(0.5) translateY(-40px); }
    70% { transform: scale(1.1) translateY(4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.card.bounce-in {
    animation: cardBounceIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* UNO alert stagger */
#uno-alert {
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#uno-alert.show {
    transform: scale(1.1);
}
#uno-alert:not(.show) {
    transform: scale(0.9);
}
