:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent-primary: #00ffff;
    --accent-secondary: #ff00ff;
    --accent-tertiary: #ffff00;
    --border-color: #444444;
    --success-color: #00ff88;
    --error-color: #ff4444;
    
    /* Shape colors - improved for better distinction */
    --color-red: #dc3545;
    --color-blue: #007bff;
    --color-yellow: #ffc107;
    --color-green: #28a745;
    --color-purple: #6f42c1;
    --color-orange: #fd7e14;
}

[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --accent-primary: #3498db;
    --accent-secondary: #e74c3c;
    --accent-tertiary: #f39c12;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    
    /* Light mode shape colors for better visibility */
    --color-red: #dc3545;
    --color-blue: #007bff;
    --color-yellow: #ffc107;
    --color-green: #28a745;
    --color-purple: #6f42c1;
    --color-orange: #fd7e14;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 0, 0.1) 0%, transparent 40%),
        conic-gradient(from 45deg at 25% 75%, transparent 0deg, rgba(0, 255, 255, 0.05) 90deg, transparent 180deg),
        conic-gradient(from 225deg at 75% 25%, transparent 0deg, rgba(255, 0, 255, 0.05) 90deg, transparent 180deg),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    background-attachment: fixed;
    background-size: 100% 100%, 100% 100%, 100% 100%, 200% 200%, 200% 200%, 100% 100%;
    position: relative;
}

/* Light theme adjustments for background */
[data-theme="light"] body {
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(231, 76, 60, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(243, 156, 18, 0.08) 0%, transparent 40%),
        conic-gradient(from 45deg at 25% 75%, transparent 0deg, rgba(52, 152, 219, 0.03) 90deg, transparent 180deg),
        conic-gradient(from 225deg at 75% 25%, transparent 0deg, rgba(231, 76, 60, 0.03) 90deg, transparent 180deg),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.03) 2px,
            rgba(0, 255, 255, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 0, 255, 0.03) 2px,
            rgba(255, 0, 255, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* Light theme grid pattern */
[data-theme="light"] body::before {
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(52, 152, 219, 0.02) 2px,
            rgba(52, 152, 219, 0.02) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(231, 76, 60, 0.02) 2px,
            rgba(231, 76, 60, 0.02) 4px
        );
}

.game-container {
    position: relative;
    min-height: 100vh;
    padding: 20px 20px 80px 20px;
    z-index: 2;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .theme-toggle {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px var(--accent-primary);
}

.quit-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid var(--error-color);
    border-radius: 15px;
    background: linear-gradient(145deg, transparent, rgba(255, 68, 68, 0.1));
    color: var(--error-color);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
}

.quit-btn:hover {
    background: linear-gradient(145deg, var(--error-color), rgba(255, 68, 68, 0.8));
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

.screen {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Menu Styles */
.logo {
    text-align: center;
    margin-bottom: 3rem;
}

.logo h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary), var(--accent-primary));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    animation: logoGlow 4s ease-in-out infinite, gradientShift 6s ease-in-out infinite;
    position: relative;
}

.logo h1::before {
    content: 'PERCEPTION';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

/* Light theme logo shimmer */
[data-theme="light"] .logo h1::before {
    background: linear-gradient(135deg, transparent, rgba(52, 152, 219, 0.3), transparent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    font-weight: 300;
    position: relative;
}

.instructions {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    padding: 2rem;
    background: linear-gradient(145deg, rgba(42, 42, 42, 0.6), rgba(26, 26, 26, 0.6));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Light theme instructions */
[data-theme="light"] .instructions {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.9));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.mode-btn {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 2.5rem 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

/* Light theme mode buttons */
[data-theme="light"] .mode-btn {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

/* Light theme mode button hover effect */
[data-theme="light"] .mode-btn::before {
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), rgba(231, 76, 60, 0.1), transparent);
}

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

.mode-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 255, 255, 0.3);
}

/* Light theme mode button hover */
[data-theme="light"] .mode-btn:hover {
    box-shadow: 0 20px 50px rgba(52, 152, 219, 0.2);
}

.mode-btn:active {
    transform: translateY(-5px) scale(0.98);
}

.mode-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mode-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Game Screen Styles */
.game-header {
    background: linear-gradient(145deg, rgba(42, 42, 42, 0.8), rgba(26, 26, 26, 0.8));
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
}

/* Light theme game header */
[data-theme="light"] .game-header {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lives, .score, .timer {
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#lives-count { 
    color: var(--error-color);
    text-shadow: 0 0 15px var(--error-color);
}
#score { 
    color: var(--success-color);
    text-shadow: 0 0 15px var(--success-color);
}
#time { 
    color: var(--accent-primary);
    text-shadow: 0 0 15px var(--accent-primary);
}

.shapes-container {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    min-height: 250px;
    align-items: center;
}

.shape-card {
    background: linear-gradient(145deg, rgba(42, 42, 42, 0.9), rgba(26, 26, 26, 0.9));
    border: 3px solid var(--border-color);
    border-radius: 30px;
    padding: 2rem;
    min-width: 180px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

/* Light theme shape cards */
[data-theme="light"] .shape-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(0, 0, 0, 0.05);
}

.shape-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.shape-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 30px var(--accent-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: var(--accent-primary);
}

/* Light theme shape card hover */
[data-theme="light"] .shape-card:hover {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 30px var(--accent-primary),
        inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.shape {
    width: 80px;
    height: 80px;
    transition: all 0.4s ease;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    margin-bottom: 1rem;
}

/* Light theme shape shadow */
[data-theme="light"] .shape {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.shape.circle {
    border-radius: 50%;
}

.shape.triangle {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid;
}

.shape.diamond {
    transform: rotate(45deg);
    border-radius: 5px; /* Less rounded corners */
}

.shape.rectangle {
    width: 100px;
    height: 60px; /* Clearly different proportions from square */
    border-radius: 8px;
}

.shape-word {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
    margin-top: 0.5rem;
}

/* Light theme shape word */
[data-theme="light"] .shape-word {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Question Section */
.question-section {
    text-align: center;
    background: linear-gradient(145deg, rgba(42, 42, 42, 0.9), rgba(26, 26, 26, 0.9));
    border: 2px solid var(--border-color);
    border-radius: 30px;
    padding: 3rem 2rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

/* Light theme question section */
[data-theme="light"] .question-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.question {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 2.5rem;
    color: var(--accent-primary);
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 20px var(--accent-primary);
    animation: questionPulse 3s ease-in-out infinite;
}

.input-container {
    display: flex;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto 3rem auto;
    flex-wrap: wrap;
    justify-content: center;
}

#answer-input {
    flex: 1;
    min-width: 280px;
    padding: 1.5rem;
    font-size: 1.4rem;
    border: 3px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.4s ease;
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Light theme input */
[data-theme="light"] #answer-input {
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.1);
}

#answer-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 25px rgba(0, 255, 255, 0.5), 
        inset 0 3px 10px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

/* Light theme input focus */
[data-theme="light"] #answer-input:focus {
    box-shadow: 
        0 0 25px var(--accent-primary), 
        inset 0 3px 10px rgba(0, 0, 0, 0.1);
}

.submit-btn {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: 3px solid var(--accent-primary);
    border-radius: 20px;
    background: linear-gradient(145deg, transparent, rgba(0, 255, 255, 0.1));
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.4s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Light theme submit button */
[data-theme="light"] .submit-btn {
    background: linear-gradient(145deg, transparent, rgba(52, 152, 219, 0.1));
}

.submit-btn:hover {
    background: linear-gradient(145deg, var(--accent-primary), rgba(0, 255, 255, 0.8));
    color: var(--bg-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.4);
}

/* Legend Styles - Compact Version */
.legend {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.legend-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.legend-content {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.legend-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 280px;
}

.legend-label {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    max-width: 280px;
}

.legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    min-width: 60px;
}

/* Light theme legend items */
[data-theme="light"] .legend-item {
    background: rgba(0, 0, 0, 0.05);
}

.legend-item span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.legend-shape, .color-sample {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

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

/* Light theme legend item hover */
[data-theme="light"] .legend-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.legend-shape.circle {
    border-radius: 50%;
    background: var(--text-primary);
}

.legend-shape.square {
    background: var(--text-primary);
}

.legend-shape.triangle {
    width: 0;
    height: 0;
    border: none;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid var(--text-primary);
}

.legend-shape.diamond {
    background: var(--text-primary);
    transform: rotate(45deg);
    border-radius: 2px;
}

.legend-shape.rectangle {
    background: var(--text-primary);
    width: 30px;
    height: 18px;
    border-radius: 2px;
}

.color-sample {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Light theme color sample */
[data-theme="light"] .color-sample {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.color-sample.red { background: var(--color-red); }
.color-sample.blue { background: var(--color-blue); }
.color-sample.yellow { background: var(--color-yellow); }
.color-sample.green { background: var(--color-green); }
.color-sample.purple { background: var(--color-purple); }
.color-sample.orange { background: var(--color-orange); }

/* Game Over Screen */
.game-over-content {
    text-align: center;
    background: linear-gradient(145deg, rgba(42, 42, 42, 0.9), rgba(26, 26, 26, 0.9));
    border: 3px solid var(--border-color);
    border-radius: 30px;
    padding: 4rem 3rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

/* Light theme game over */
[data-theme="light"] .game-over-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.game-over-content h2 {
    font-size: 3.5rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--accent-primary);
    animation: gameOverGlow 2s ease-in-out infinite alternate;
}

.final-stats {
    margin-bottom: 3rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#final-score { 
    color: var(--success-color);
    font-weight: bold;
    text-shadow: 0 0 15px var(--success-color);
}
#final-time { 
    color: var(--accent-primary);
    font-weight: bold;
    text-shadow: 0 0 15px var(--accent-primary);
}
#accuracy { 
    color: var(--accent-secondary);
    font-weight: bold;
    text-shadow: 0 0 15px var(--accent-secondary);
}

.game-over-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.restart-btn {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: 3px solid var(--accent-primary);
    border-radius: 20px;
    background: linear-gradient(145deg, transparent, rgba(0, 255, 255, 0.1));
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.4s ease;
    min-width: 150px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Light theme restart button */
[data-theme="light"] .restart-btn {
    background: linear-gradient(145deg, transparent, rgba(52, 152, 219, 0.1));
}

.restart-btn:hover {
    background: linear-gradient(145deg, var(--accent-primary), rgba(0, 255, 255, 0.8));
    color: var(--bg-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.4);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, rgba(42, 42, 42, 0.95), rgba(26, 26, 26, 0.95));
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(15px);
    padding: 1rem;
    z-index: 100;
}

/* Light theme footer */
[data-theme="light"] .footer {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.footer-links a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-secondary);
    transform: translateY(-1px);
}

.footer-info {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Color classes for shapes */
.red { 
    background-color: var(--color-red);
    border-color: var(--color-red);
}

.blue { 
    background-color: var(--color-blue);
    border-color: var(--color-blue);
}

.yellow { 
    background-color: var(--color-yellow);
    border-color: var(--color-yellow);
}

.green { 
    background-color: var(--color-green);
    border-color: var(--color-green);
}

.purple { 
    background-color: var(--color-purple);
    border-color: var(--color-purple);
}

.orange { 
    background-color: var(--color-orange);
    border-color: var(--color-orange);
}

/* Triangle color handling */
.shape.triangle.red { border-bottom-color: var(--color-red); background: transparent; }
.shape.triangle.blue { border-bottom-color: var(--color-blue); background: transparent; }
.shape.triangle.yellow { border-bottom-color: var(--color-yellow); background: transparent; }
.shape.triangle.green { border-bottom-color: var(--color-green); background: transparent; }
.shape.triangle.purple { border-bottom-color: var(--color-purple); background: transparent; }
.shape.triangle.orange { border-bottom-color: var(--color-orange); background: transparent; }

/* Feedback animations */
.correct {
    animation: correctFeedback 1s ease;
    border-color: var(--success-color) !important;
    box-shadow: 0 0 40px var(--success-color) !important;
}

.incorrect {
    animation: incorrectFeedback 1s ease;
    border-color: var(--error-color) !important;
    box-shadow: 0 0 40px var(--error-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px 15px 100px 15px;
    }
    
    .logo h1 {
        font-size: 3rem;
    }
    
    .mode-selection {
        grid-template-columns: 1fr;
    }
    
    .legend-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .legend-section {
        min-width: auto;
    }
    
    .legend-items {
        max-width: none;
    }
    
    .shapes-container {
        gap: 2rem;
    }
    
    .shape-card {
        min-width: 160px;
        min-height: 160px;
        padding: 1.5rem;
    }
    
    .shape {
        width: 60px;
        height: 60px;
    }
    
    .shape.triangle {
        border-left-width: 30px;
        border-right-width: 30px;
        border-bottom-width: 52px;
    }
    
    .shape.rectangle {
        width: 75px;
        height: 45px;
    }
    
    .input-container {
        flex-direction: column;
        align-items: center;
    }
    
    #answer-input {
        min-width: unset;
        width: 100%;
    }
    
    .game-info {
        justify-content: center;
        text-align: center;
        gap: 1.5rem;
    }
    
    .question {
        font-size: 2.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .quit-btn {
        top: 75px;
        right: 15px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .question {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .shapes-container {
        gap: 1.5rem;
    }
    
    .shape-card {
        min-width: 140px;
        min-height: 140px;
        padding: 1.2rem;
    }
    
    .legend-items {
        gap: 0.6rem;
    }
    
    .legend-item {
        min-width: 50px;
        padding: 0.5rem 0.6rem;
    }
    
    .legend-item span {
        font-size: 0.7rem;
    }
    
    .legend-shape, .color-sample {
        width: 20px;
        height: 20px;
    }
    
    .legend-shape.triangle {
        border-left-width: 10px;
        border-right-width: 10px;
        border-bottom-width: 16px;
    }
    
    .legend-shape.rectangle {
        width: 24px;
        height: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoGlow {
    from {
        text-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    }
    to {
        text-shadow: 0 0 60px rgba(0, 255, 255, 0.8), 0 0 100px rgba(255, 0, 255, 0.4);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

@keyframes questionPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

@keyframes gameOverGlow {
    from {
        text-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    }
    to {
        text-shadow: 0 0 50px rgba(0, 255, 255, 0.8), 0 0 80px rgba(255, 0, 255, 0.6);
    }
}

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

@keyframes correctFeedback {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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