*, *::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; 
    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; 
    z-index: 10; 
}

.back-home:hover { 
    color: #fff; 
}

.container { 
    position: relative; 
    z-index: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 16px 24px; 
}

h1 { 
    font-family: 'Syne', sans-serif; 
    font-size: clamp(1.6rem, 6vw, 2.4rem); 
    font-weight: 900; 
    margin: 0 0 3px; 
    letter-spacing: -1px; 
}

.subtitle { 
    font-size: 0.82rem; 
    color: #64748b; 
    margin-bottom: 12px; 
}

.hud { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 10px; 
}

.hud-stat { 
    text-align: center; 
}

.hud-val { 
    font-family: 'Syne', sans-serif; 
    font-size: 1.3rem; 
    font-weight: 900; 
    color: #f8fafc; 
}

.hud-label { 
    font-size: 0.62rem; 
    color: #475569; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
}

.grid { 
    display: grid; 
    gap: 2px; 
    margin-bottom: 12px; 
}

.cell {
    width: 32px; 
    height: 32px; 
    border-radius: 6px;
    background: rgba(30, 58, 138, 0.25);
    border: 1px solid rgba(51, 65, 85, 0.5);
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 0.75rem; 
    font-weight: 700; 
    cursor: pointer;
    transition: background 0.1s;
}

.cell:hover { 
    background: rgba(37, 99, 235, 0.3); 
}

.cell.revealed { 
    background: rgba(15, 23, 42, 0.8); 
    border-color: rgba(51, 65, 85, 0.3); 
    cursor: default; 
}

.cell.flagged { 
    background: rgba(251, 191, 36, 0.15); 
    border-color: rgba(251, 191, 36, 0.3); 
}

.cell.mine { 
    background: rgba(239, 68, 68, 0.3); 
    border-color: #ef4444; 
}

.cell.n1 { color: #60a5fa; } 
.cell.n2 { color: #10b981; } 
.cell.n3 { color: #f87171; }
.cell.n4 { color: #8b5cf6; } 
.cell.n5 { color: #f97316; } 
.cell.n6 { color: #06b6d4; }
.cell.n7 { color: #ec4899; } 
.cell.n8 { color: #94a3b8; }

.action-row { 
    display: flex; 
    gap: 10px; 
}

.action-btn { 
    padding: 9px 22px; 
    background: rgba(15, 23, 42, 0.7); 
    border: 1px solid rgba(51, 65, 85, 0.6); 
    border-radius: 999px; 
    color: #94a3b8; 
    font-size: 0.8rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
}

.action-btn:hover { 
    background: rgba(30, 58, 138, 0.4); 
    color: #fff; 
    border-color: rgba(96, 165, 250, 0.3); 
}

.action-btn.active { 
    background: rgba(251, 191, 36, 0.15); 
    color: #fbbf24; 
    border-color: rgba(251, 191, 36, 0.3); 
}

.msg { 
    font-family: 'Syne', sans-serif; 
    font-size: 1rem; 
    font-weight: 700; 
    min-height: 24px; 
    margin-bottom: 8px; 
}

.msg.win { 
    color: #10b981; 
}

.msg.lose { 
    color: #f87171; 
}

.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); 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s; 
}

.overlay.show { 
    opacity: 1; 
    pointer-events: all; 
}

.ov-emoji { 
    font-size: 3.5rem; 
    margin-bottom: 10px; 
}

.ov-title { 
    font-family: 'Syne', sans-serif; 
    font-size: clamp(1.8rem, 7vw, 2.8rem); 
    font-weight: 900; 
    margin: 0 0 8px; 
}

.ov-sub { 
    color: #64748b; 
    margin-bottom: 24px; 
    font-size: 0.95rem; 
}

.ov-btn { 
    padding: 12px 32px; 
    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; 
}

.ov-btn:hover { 
    background: rgba(37, 99, 235, 0.5); 
}
