/* ========================================
   SNAKE GAME - MODERN STYLES
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 600px;
    width: 100%;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.game-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Game Info Cards */
.game-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    animation: fadeInUp 0.6s ease;
}

.info-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.info-card .label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-card .value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Game Wrapper */
.game-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    animation: fadeIn 0.8s ease;
}

/* Canvas */
#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: #1a1a2e;
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Overlay Screens */
.game-over,
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-over.active,
.start-screen.active {
    opacity: 1;
    visibility: visible;
}

.game-over-content,
.start-content {
    text-align: center;
    padding: 30px;
    animation: scaleIn 0.5s ease;
}

.game-over-content h2,
.start-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.final-score {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.final-score span {
    color: #ffd700;
    font-weight: bold;
    font-size: 2rem;
}

.high-score-msg {
    font-size: 1.2rem;
    color: #4ade80;
    margin-bottom: 25px;
    font-weight: bold;
}

/* Controls Info */
.controls-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
}

.key {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
}

.btn-link {
    background: transparent;
    color: #fff;
    text-decoration: underline;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.control-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    line-height: 1.6;
}

.instructions li:last-child {
    border-bottom: none;
}

/* Footer */
.game-footer {
    text-align: center;
    padding: 20px 0;
    opacity: 0.8;
}

.game-footer p {
    margin-bottom: 10px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2rem;
    }

    .game-info {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .info-card {
        padding: 15px 10px;
    }

    .info-card .value {
        font-size: 1.5rem;
    }

    .mobile-controls {
        display: block;
    }

    .controls-info {
        grid-template-columns: 1fr;
    }

    .game-over-content h2,
    .start-content h2 {
        font-size: 1.8rem;
    }

    .instructions {
        padding: 20px;
    }

    .instructions li {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .info-card .label {
        font-size: 0.7rem;
    }

    .info-card .value {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}
