/* styles.css - Viper Blitz (with mute button in center) */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 20px;
    background: #0f1a2e;
    color: #e0f0e0;
    font-family: system-ui, -apple-system, Arial, sans-serif;
    text-align: center;
    overflow-x: hidden;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
}

h1 {
    margin: 10px 0 15px;
    font-size: 2.5rem;
    color: #aaffaa;
    text-shadow: 0 0 10px #55ff55;
}

canvas {
    background: #7cb77c;
    border: 6px solid #1e3a1e;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    display: block;
    margin: 0 auto 20px;
    width: min(600px, 90vmin);
    height: min(400px, 60vmin);
}

.high-score {
    font-size: 1.4rem;
    font-weight: bold;
    color: #aaffaa;
    margin: 10px 0 15px;
    text-shadow: 0 0 8px #55ff55;
}

.controls {
    display: grid;
    grid-template-columns: 80px 80px 80px;
    grid-template-rows: 80px 80px 80px;
    gap: 6px;
    width: fit-content;
    margin: 0 auto 25px;
}

.controls button {
    font-size: 38px;
    background: linear-gradient(#4a4a4a, #2a2a2a);
    color: #fff;
    border: 4px solid #111;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(0,0,0,0.4);
    transition: all 0.1s ease;
    user-select: none;
    min-height: 80px;
}

.controls button:active {
    transform: scale(0.93) translateY(3px);
    background: #666;
}

#up    { grid-column: 2; grid-row: 1; }
#left  { grid-column: 1; grid-row: 2; }
#right { grid-column: 3; grid-row: 2; }
#down  { grid-column: 2; grid-row: 3; }

.dpad-center {
    grid-column: 2;
    grid-row: 2;
    font-size: 38px;
    background: rgba(30,58,30,0.6);
    border: 3px solid #1e3a1e;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-center.muted {
    background: rgba(60,20,20,0.6);
    color: #ff5252;
}

.start-btn {
    padding: 14px 40px;
    font-size: 1.3rem;
    background: linear-gradient(#388e3c, #1b5e20);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(56,142,60,0.5);
    transition: all 0.2s;
    margin: 0 auto 20px;
    display: block;
    min-width: 160px;
}

.start-btn:hover:not(.disabled) {
    background: linear-gradient(#4caf50, #2e7d32);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(76,175,80,0.6);
}

.start-btn:active:not(.disabled) {
    transform: translateY(1px);
}

.start-btn.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.top10-btn {
    padding: 10px 25px;
    font-size: 1.1rem;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 0 auto 20px;
    display: block;
}

.instructions {
    margin: 20px auto 0;
    max-width: 500px;
    color: #c8e6c9;
    line-height: 1.5;
    font-size: 1rem;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1a2a1a;
    padding: 25px;
    border-radius: 15px;
    border: 4px solid #4caf50;
    max-width: 90%;
    width: 420px;
    color: #eee;
    text-align: center;
}

.modal-content h2 { margin-top: 0; color: #aaffaa; }

#top10-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

#top10-table th, #top10-table td {
    padding: 10px;
    border-bottom: 1px solid #444;
    text-align: center;
}

#top10-table th { background: #2e7d32; }

.modal-content button {
    margin-top: 15px;
    padding: 12px 30px;
    font-size: 1.1rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Mobile optimizations */
@media (max-width: 768px), (pointer: coarse) {
    body { padding: 10px; }
    .container { padding: 0.5rem; max-width: 100%; }
    h1 { font-size: 2rem; margin: 5px 0 10px; }
    canvas { border-width: 4px; border-radius: 10px; margin-bottom: 15px; width: 90vmin; height: 60vmin; }
    .controls { grid-template-columns: 100px 100px 100px; grid-template-rows: 100px 100px 100px; gap: 8px; margin: 0 auto 20px; }
    .controls button { font-size: 50px; min-height: 100px; border-width: 5px; border-radius: 18px; }
    .dpad-center { font-size: 50px; border-width: 4px; }
    .start-btn, .top10-btn { padding: 16px 45px; font-size: 1.45rem; min-width: 180px; margin: 0 auto 15px; }
    .instructions { font-size: 0.95rem; margin-top: 15px; padding: 0 10px; }
}