/* RESET & CORE */
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    background: #000;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    touch-action: none; 
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
}

canvas { display: block; width: 100%; height: 100%; }

/* UI LAYOUT */
.ui-layer {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none; /* Touches pass through */
}

/* NEW SCORE BOARD STYLES */
.score-board {
    display: flex;
    gap: 20px;
}

.score-box {
    display: flex;
    flex-direction: column;
}

.score-box .label {
    font-size: 10px;
    letter-spacing: 1px;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 2px;
}

.score-box .value {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.score-box.best .label { color: #fbbf24; } /* Gold label for High Score */
.score-box.best .value { color: #fbbf24; }

.close-btn {
    pointer-events: auto;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-weight: 700;
    border: 1px solid rgba(255,255,255,0.15);
    transition: 0.2s;
}
.close-btn:hover { background: #ef4444; border-color: #ef4444; color: #fff; }

/* MODALS */
.modal {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s; z-index: 10;
}
.modal.visible { opacity: 1; pointer-events: auto; }

.modal-content {
    background: #111; border: 1px solid #333;
    padding: 40px; border-radius: 20px; text-align: center;
    width: 360px; max-width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

h1 { font-family: 'Playfair Display', serif; color: #fbbf24; font-size: 2rem; margin-bottom: 10px; }
p { color: #888; margin-bottom: 30px; font-size: 0.9rem; }
.danger-text { font-family: 'Playfair Display', serif; color: #ef4444; font-size: 2rem; margin-bottom: 20px; }

/* Stats in Game Over */
.final-stats {
    background: rgba(255,255,255,0.05);
    padding: 15px; border-radius: 12px; margin-bottom: 25px;
}
.stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; color: #ccc; }
.stat-row strong { color: #fff; font-size: 1.1rem; }
.stat-row.highlight span { color: #fbbf24; }
.stat-row.highlight strong { color: #fbbf24; }

.primary-btn {
    width: 100%; background: #fbbf24; color: #000; border: none;
    padding: 14px; border-radius: 50px; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: 0.1s;
}
.primary-btn:active { transform: scale(0.96); }

.secondary-link { display: block; margin-top: 20px; color: #666; text-decoration: none; font-size: 0.85rem; }