*, *::before, *::after { box-sizing: border-box; }
body { 
    background: #020617; 
    color: #fff; 
    font-family: 'Inter', sans-serif; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
    margin: 0; 
    text-align: center; 
    overflow: hidden; 
    user-select: none; 
}

#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-glow { position: fixed; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 40%, #1e3a8a44 0%, transparent 70%); z-index: 0; pointer-events: none; }
.back-home { position: fixed; top: 20px; left: 24px; font-size: 0.85rem; color: #475569; text-decoration: none; transition: color 0.2s; z-index: 10; }
.back-home:hover { color: #fff; }

.container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 32px 24px; max-width: 540px; width: 100%; }
h1 { font-family: 'Syne', sans-serif; font-size: clamp(1.8rem,7vw,2.8rem); font-weight: 900; margin: 0 0 4px; letter-spacing: -2px; }
.subtitle { font-size: 0.9rem; color: #64748b; margin-bottom: 20px; }

.hud { display: flex; gap: 20px; margin-bottom: 16px; }
.hud-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud-val { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 900; color: #f8fafc; }
.hud-label { font-size: 0.65rem; color: #475569; text-transform: uppercase; letter-spacing: 1.5px; }

/* timer bar */
.timer-wrap { width: 100%; height: 7px; background: rgba(30,58,138,0.25); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.timer-bar { height: 100%; border-radius: 999px; background: #3b82f6; transition: width 0.1s linear, background 0.3s; }
.timer-bar.warn { background: #fbbf24; }
.timer-bar.danger { background: #ef4444; }

/* roast display */
.roast-display { font-size: 0.9rem; color: #f87171; min-height: 20px; margin-bottom: 14px; font-style: italic; transition: opacity 0.2s; }

/* mole grid */
.mole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 360px; margin-bottom: 20px; }
.hole {
    aspect-ratio: 1; border-radius: 16px;
    background: rgba(15,23,42,0.8); border: 1.5px solid rgba(51,65,85,0.6);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8rem; cursor: pointer; position: relative; overflow: hidden;
    transition: background 0.15s, border-color 0.15s;
}
.hole .mole {
    position: absolute; bottom: -100%; transition: bottom 0.15s cubic-bezier(0.34,1.2,0.64,1);
    font-size: 2.8rem; line-height: 1;
}
.hole.active .mole { bottom: 10%; }
.hole.whacked .mole { bottom: -100%; transition: bottom 0.1s ease-in; }
.hole.active { background: rgba(30,58,138,0.35); border-color: rgba(96,165,250,0.3); }
.hole:hover.active { background: rgba(37,99,235,0.4); }

/* hit flash */
.hit-flash { position: absolute; inset: 0; background: rgba(96,165,250,0.3); border-radius: 14px; opacity: 0; pointer-events: none; }
.hole.hit .hit-flash { animation: flashAnim 0.3s ease; }
@keyframes flashAnim { 0%{opacity:1} 100%{opacity:0} }

/* score pop */
.score-pop { position: fixed; font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 900; color: #60a5fa; pointer-events: none; animation: popUp 0.7s ease forwards; z-index: 20; }
@keyframes popUp { 0%{opacity:1;transform:translateY(0) scale(1)} 100%{opacity:0;transform:translateY(-50px) scale(0.8)} }

.gameover { position: fixed; inset: 0; background: rgba(2,6,23,0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.4s; backdrop-filter: blur(8px); }
.gameover.show { opacity: 1; pointer-events: all; }
.go-emoji { font-size: 4rem; margin-bottom: 12px; }
.go-title { font-family: 'Syne', sans-serif; font-size: clamp(1.6rem,6vw,2.4rem); font-weight: 900; margin: 0 0 8px; }
.go-sub { color: #64748b; font-size: 1rem; margin-bottom: 24px; }
.go-sub span { color: #60a5fa; font-weight: 700; }
.go-btn { padding: 13px 36px; background: rgba(37,99,235,0.3); border: 1.5px solid rgba(96,165,250,0.45); border-radius: 999px; color: #fff; font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; cursor: pointer; }
.go-btn:hover { background: rgba(37,99,235,0.5); }

.start-overlay { position: fixed; inset: 0; background: rgba(2,6,23,0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(8px); }
.start-overlay h2 { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 900; margin: 0 0 8px; }
.start-overlay p { color: #64748b; margin-bottom: 24px; }
.start-btn { padding: 13px 36px; background: rgba(37,99,235,0.3); border: 1.5px solid rgba(96,165,250,0.45); border-radius: 999px; color: #fff; font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; cursor: pointer; }
.start-btn:hover { background: rgba(37,99,235,0.5); }
