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

body {
    background-color: #07090e;
    color: #f8fafc;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 10px;
}

.wrapper {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 10px 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.instructions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #94a3b8;
}

.instructions div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.instructions b {
    color: #f1f5f9;
    background: #1e293b;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #334155;
    font-family: monospace;
}

.red {
    color: #38bdf8;
    font-weight: 600;
}

.score {
    font-size: 16px;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
    white-space: nowrap;
}

canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    border: 2px solid #1e293b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.1);
}

#game-over-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 40;
    display: none;
}

#game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 360px;
    background: linear-gradient(135deg, #0f172a 0%, #172554 100%);
    border: 2px solid #1e3a8a;
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(30, 58, 138, 0.4);
    z-index: 50;
    display: none;
}

.game-over-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

#game-over h1 {
    font-size: 24px;
    font-weight: 900;
    color: #ef4444;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.final-score-text {
    font-size: 14px;
    color: #93c5fd;
    font-weight: 700;
    margin-bottom: 20px;
}

.final-score-text span {
    color: #fbbf24;
    font-size: 18px;
    font-weight: 900;
}

#game-over button {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid #3b82f6;
    outline: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

#game-over button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}