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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
    color: #333;
}

.container {
    max-width: 700px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

.game-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.8s ease;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.score-item {
    text-align: center;
}

.score-item .label {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.score-item .value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.score-item.high-score .value {
    color: #f59e0b;
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    border: 3px solid #667eea;
    border-radius: 8px;
    background: #1e293b;
    cursor: crosshair;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.instructions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

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

.instructions li {
    padding: 0.5rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    color: #ef4444;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.3rem;
    color: #4b5563;
    margin-bottom: 2rem;
}

.modal-content.congrats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 3rem;
}

.modal-content.congrats h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-content.congrats p {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0;
}

footer {
    text-align: center;
    color: white;
    padding: 2rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

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

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

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    .score-board {
        flex-direction: column;
        gap: 1rem;
    }

    .controls {
        flex-direction: column;
    }
}
