/**
 * snake.css - Snake game styles
 */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    touch-action: none;
    overflow: hidden;
}

.header {
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
}

h1 {
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.back-btn:hover, .back-btn:active {
    color: #667eea;
}

.stats-row {
    margin-bottom: 10px;
}

.stat-box .label {
    font-size: 0.7rem;
}

.stat-box .value {
    color: #ffd700;
}

.stat-box.level .value {
    color: #4ade80;
}

.game-container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#gameCanvas {
    display: block;
    border-radius: 10px;
    background: #1a1a2e;
}

.final-score {
    color: #ffd700;
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.final-level {
    color: #4ade80;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.high-score {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    margin-bottom: 25px;
}

.instructions {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 10px;
    max-width: 320px;
}

.level-up {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: #4ade80;
    text-shadow: 3px 3px 0 #1a1a2e;
    pointer-events: none;
    animation: levelUpPop 1.5s ease forwards;
    z-index: 50;
}

@keyframes levelUpPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    20% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.challenge-intro {
    color: #ffd700;
    font-size: 1rem;
    margin-top: -10px;
    animation: fadeIn 0.5s ease;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    max-width: 320px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
}

.legend-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-icon.apple { background: #ff6b6b; border-radius: 50%; }
.legend-icon.golden { background: #ffd700; border-radius: 50%; }
.legend-icon.poison { background: #8b5cf6; border-radius: 50%; }
.legend-icon.wall { background: #64748b; }
.legend-icon.moving { background: #f97316; }

.mode-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.mode-card {
    width: 140px;
    height: 160px;
    border-radius: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.mode-card:active {
    transform: scale(0.95);
}

.mode-card .mode-emoji {
    font-size: 2.5rem;
}

.mode-card .mode-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
}

.mode-card .mode-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

.mode-card.easy {
    border-color: #4ade80;
}

.mode-card.easy:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: #86efac;
}

.mode-card.hard {
    border-color: #ef4444;
}

.mode-card.hard:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #fca5a5;
}

.mode-badge {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.change-mode-link {
    display: block;
    margin-top: 10px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.change-mode-link:hover {
    color: rgba(255,255,255,0.8);
    text-decoration: underline;
}

@media (max-width: 340px) {
    .mode-selector {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .stat-box {
        padding: 6px 12px;
    }

    .stat-box .value {
        font-size: 1.1rem;
    }
}
