:root {
    /* Color Palette - Rich Casino Theme */
    --bg-primary: #0d0d0f;
    --bg-secondary: #151518;
    --bg-card: #1a1a1f;
    --bg-elevated: #222228;
    
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent-gold: #f5c542;
    --accent-gold-dim: #c9a227;
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.4);
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(245, 197, 66, 0.15);
    
    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --space-xs: 0.2rem;
    --space-sm: 0.35rem;
    --space-md: 0.65rem;
    --space-lg: 1rem;
    --space-xl: 1.25rem;
    --space-2xl: 1.75rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Effects */
.background-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(245, 197, 66, 0.08) 0%, transparent 60%);
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

.particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 10s infinite;
}

@keyframes floatParticle {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* Main App Container */
#app {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(95vw, 1600px);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(0.5rem, 2vh, 1.5rem);
    gap: clamp(0.4rem, 1.5vh, 1rem);
}

/* Header */
header {
    display: flex;
    justify-content: center;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.header-top {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(245, 197, 66, 0.5);
    animation: cardFlip 3s ease-in-out infinite;
}

@keyframes cardFlip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.logo h1 {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 50%, var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.table-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: clamp(0.2rem, 0.5vw, 0.4rem) clamp(0.75rem, 2vw, 1.5rem);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: var(--transition-normal);
}

.table-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(245, 197, 66, 0.2);
}

.badge-label {
    font-size: clamp(0.55rem, 0.8vw, 0.7rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.badge-value {
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 1.25vw, 1.1rem);
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(245, 197, 66, 0.3);
}

/* How to Play Button */
.how-to-play-btn {
    padding: clamp(0.4rem, 0.8vw, 0.6rem) clamp(0.8rem, 1.5vw, 1.2rem);
    font-family: var(--font-body);
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.how-to-play-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--accent-gold);
}

.how-to-play-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Game Board */
#game-board {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(0.5rem, 1.5vw, 1.5rem);
    padding: clamp(0.5rem, 1.5vw, 1.5rem);
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

#game-board::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(245, 197, 66, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(245, 197, 66, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Player Slot */
.player-slot {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: clamp(0.5rem, 1.5vw, 1.25rem) clamp(0.75rem, 2vw, 1.5rem);
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.1) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-slow);
    overflow: visible;
}

.player-slot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(245, 197, 66, 0.05) 100%);
    opacity: 0;
    transition: var(--transition-normal);
}

.player-slot:hover:not(.eliminated)::before {
    opacity: 1;
}

.player-slot:hover:not(.eliminated) {
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.player-slot.eliminated {
    opacity: 0.4;
    filter: grayscale(80%) brightness(0.7);
}

.player-slot.eliminated::after {
    content: '☠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(3rem, 8vw, 5rem);
    opacity: 0.5;
    z-index: 10;
    pointer-events: none;
}

/* Player Info */
.player-info {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(0.25rem, 0.75vw, 0.5rem);
    z-index: 1;
}

.player-name-input {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.5vw, 1.25rem);
    font-weight: 600;
    text-align: left;
    width: 100%;
    max-width: 100%;
    padding: clamp(0.25rem, 0.5vw, 0.5rem) clamp(0.4rem, 0.75vw, 0.75rem);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.player-name-input:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-medium);
}

.player-name-input:focus {
    outline: none;
    background: rgba(245, 197, 66, 0.1);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.15);
}

.player-name-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.player-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: clamp(2px, 0.3vw, 4px) clamp(0.35rem, 0.75vw, 0.75rem);
    font-size: clamp(0.6rem, 0.9vw, 0.75rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--radius-full);
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.player-status.eliminated {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

.player-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: statusPulse 2s infinite;
}

.player-status.eliminated::before {
    animation: none;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.player-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chamber-info {
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    font-weight: 500;
    color: var(--text-secondary);
}

.chamber-info strong {
    color: var(--accent-gold);
    font-weight: 700;
}

/* Revolver */
.revolver-container {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    width: clamp(80px, 12vw, 140px);
    height: clamp(80px, 12vw, 140px);
    z-index: 1;
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
}

.revolver {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: clamp(4px, 0.5vw, 6px) solid var(--bg-elevated);
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.3);
}

.revolver::before {
    content: '';
    position: absolute;
    width: 16%;
    height: 16%;
    background: var(--bg-elevated);
    border-radius: 50%;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.chamber {
    width: 13%;
    height: 13%;
    background: linear-gradient(145deg, #2a2a30 0%, #1a1a1f 100%);
    border-radius: 50%;
    position: absolute;
    transition: var(--transition-normal);
    border: 2px solid #3a3a40;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.chamber.used {
    background: #0d0d0f;
    border-color: #1a1a1f;
    opacity: 0.3;
    transform: scale(0.85);
}

.chamber.current {
    background: linear-gradient(145deg, var(--accent-gold) 0%, var(--accent-gold-dim) 100%);
    border-color: var(--accent-gold);
    box-shadow: 
        0 0 15px rgba(245, 197, 66, 0.5),
        0 0 30px rgba(245, 197, 66, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: chamberGlow 1.5s ease-in-out infinite;
}

@keyframes chamberGlow {
    0%, 100% { 
        box-shadow: 
            0 0 15px rgba(245, 197, 66, 0.5),
            0 0 30px rgba(245, 197, 66, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 20px rgba(245, 197, 66, 0.7),
            0 0 40px rgba(245, 197, 66, 0.4);
    }
}

/* Chamber positions - using percentage for fluid sizing */
.chamber:nth-child(1) { transform: translate(0, -165%); }
.chamber:nth-child(2) { transform: translate(143%, -82%); }
.chamber:nth-child(3) { transform: translate(143%, 82%); }
.chamber:nth-child(4) { transform: translate(0, 165%); }
.chamber:nth-child(5) { transform: translate(-143%, 82%); }
.chamber:nth-child(6) { transform: translate(-143%, -82%); }

.chamber.current:nth-child(1) { transform: translate(0, -165%) scale(1.25); }
.chamber.current:nth-child(2) { transform: translate(143%, -82%) scale(1.25); }
.chamber.current:nth-child(3) { transform: translate(143%, 82%) scale(1.25); }
.chamber.current:nth-child(4) { transform: translate(0, 165%) scale(1.25); }
.chamber.current:nth-child(5) { transform: translate(-143%, 82%) scale(1.25); }
.chamber.current:nth-child(6) { transform: translate(-143%, -82%) scale(1.25); }

/* Trigger Button */
.trigger-btn {
    grid-column: 1 / 3;
    grid-row: 2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: clamp(0.5rem, 1.25vw, 0.9rem) clamp(1rem, 2vw, 2rem);
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 1.1vw, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 
        0 4px 15px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
    z-index: 1;
}

.trigger-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition-fast);
}

.trigger-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.trigger-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 25px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.trigger-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: 
        0 2px 10px rgba(239, 68, 68, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.trigger-btn:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Footer Controls */
footer#controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    padding-top: clamp(0.35rem, 1vw, 0.75rem);
    border-top: 1px solid var(--border-subtle);
}

.message-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: clamp(0.35rem, 1vw, 0.75rem) clamp(0.5rem, 1.5vw, 1rem);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    flex: 1;
}

.message-icon {
    font-size: clamp(0.9rem, 1.25vw, 1.1rem);
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

#message-log {
    font-size: clamp(0.75rem, 1.1vw, 0.95rem);
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
}

.stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
}

.stat-label {
    font-size: clamp(0.55rem, 0.85vw, 0.7rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 1.25vw, 1.15rem);
    font-weight: 700;
    color: var(--accent-gold);
}

/* Game Over Overlay */
#game-over-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: overlayFadeIn 0.5s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.overlay-content {
    position: relative;
    text-align: center;
    padding: var(--space-2xl);
    animation: contentSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes contentSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.trophy-icon {
    font-size: 5rem;
    margin-bottom: var(--space-lg);
    animation: trophyBounce 1s ease infinite;
}

@keyframes trophyBounce {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

#winner-name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #fde68a 50%, var(--accent-gold) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    margin-bottom: var(--space-sm);
}

.victory-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#restart-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-2xl);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dim) 100%);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 
        0 4px 20px rgba(245, 197, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#restart-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 30px rgba(245, 197, 66, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#restart-btn:active {
    transform: translateY(0) scale(0.98);
}

#restart-btn .btn-icon {
    font-size: 1.2rem;
}

/* How to Play Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: overlayFadeIn 0.3s ease;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(245, 197, 66, 0.1);
    animation: contentSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(245, 197, 66, 0.3);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.modal-body {
    padding: var(--space-xl);
}

.rules-section {
    display: grid;
    gap: var(--space-lg);
}

.rule-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: var(--transition-normal);
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--accent-gold);
}

.rule-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: var(--space-md);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rule-card p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.rule-card ul {
    color: var(--text-secondary);
    padding-left: var(--space-lg);
}

.rule-card li {
    margin-bottom: var(--space-xs);
    line-height: 1.5;
}

.rule-card strong {
    color: var(--accent-gold);
    font-weight: 600;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-secondary);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold-dim);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-2px, -1px) rotate(-1deg); }
    20% { transform: translate(2px, 1px) rotate(1deg); }
    30% { transform: translate(-2px, 1px) rotate(0deg); }
    40% { transform: translate(2px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 1px) rotate(-1deg); }
    60% { transform: translate(1px, -1px) rotate(0deg); }
    70% { transform: translate(-1px, -1px) rotate(-1deg); }
    80% { transform: translate(1px, 1px) rotate(1deg); }
    90% { transform: translate(-1px, 1px) rotate(0deg); }
}

.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.flash-red {
    animation: flashRed 0.6s ease;
}

@keyframes flashRed {
    0%, 100% { 
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.1) 100%);
        box-shadow: none;
    }
    25%, 75% { 
        background: linear-gradient(145deg, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0.1) 100%);
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .header-top {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    footer#controls {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

@media (max-width: 600px) {
    #game-board {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
    }
    
    .player-slot {
        grid-template-columns: auto 1fr;
        grid-template-rows: 1fr auto;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: var(--space-lg);
    }
    
    .modal-body {
        padding: var(--space-lg);
    }
    
    .rule-card {
        padding: var(--space-md);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-subtle: rgba(255, 255, 255, 0.3);
        --border-medium: rgba(255, 255, 255, 0.5);
    }
    
    .player-slot {
        border-width: 2px;
    }
    
    .trigger-btn {
        border: 2px solid white;
    }
