/* ===== Base + Theme ===== */

:root {
    --bg-color: #111;
    --text-color: #ffffff;
    --card-bg: #222;
    --accent: #ffcc00;
    --topbar-bg: rgba(0, 0, 0, 0.4);
}

body.light {
    --bg-color: #f3f3f3;
    --text-color: #111111;
    --card-bg: #ffffff;
    --topbar-bg: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle at top, #333, var(--bg-color));
    color: var(--text-color);
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* ===== Layout ===== */

.app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--topbar-bg);
    backdrop-filter: blur(6px);
}

h1 {
    font-size: 2rem;
    margin: 0;
}

.countdown {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.time-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Boxes ===== */

.box {
    font-size: 2rem;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    min-width: 110px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.box span:first-child {
    display: block;
    font-weight: bold;
}

.label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 8px;
}

/* ===== Theme toggle button ===== */

.theme-toggle {
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.theme-toggle:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* ===== Fireworks overlay ===== */

#fireworks {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    display: none;
    z-index: 999;
}

#fireworks.active {
    display: block;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    animation: explode 1.2s ease-out forwards;
    transform: translate(-50%, -50%);
}

/* The movement uses CSS custom properties set from JS */
@keyframes explode {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(-50% + var(--dx)),
            calc(-50% + var(--dy))
        ) scale(0.2);
    }
}

/* ===== Responsive ===== */

@media (max-width: 600px) {
    h1 {
        font-size: 1.6rem;
    }

    .box {
        font-size: 1.4rem;
        min-width: 80px;
        padding: 16px;
    }
}
