/* ================================================================
   SUBATHON TIMER — OBS Overlay Stylesheet
   All colours/sizes come from CSS custom properties which are
   overwritten at runtime by the values in config.toml.
   ================================================================ */

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

:root {
    --font-family: 'Segoe UI', 'Inter', sans-serif;
    --font-size: 64px;
    --text-color: #ffffff;
    --glow-color: transparent;
    --text-stroke-color: transparent;
    --text-stroke-width: 2px;
    --flash-color: transparent;
    --warning-color: #ffaa00;
    --critical-color: #ff3333;
    --background: transparent;
    --feed-duration: 5s;
}

body {
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-family);
}

/* ── Timer ────────────────────────────────────────────────────── */

#timer-container {
    text-align: center;
    position: relative;
}

.timer {
    font-family: var(--font-family);
    font-size: var(--font-size);
    color: var(--text-color);
    -webkit-text-stroke: var(--text-stroke-width) var(--text-stroke-color);
    paint-order: stroke fill;
    text-shadow:
        0 0 10px var(--glow-color),
        0 0 20px var(--glow-color),
        0 0 40px var(--glow-color);
    transition: color 0.5s ease, text-shadow 0.5s ease, -webkit-text-stroke 0.5s ease;
    letter-spacing: 4px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* Warning — amber glow when time is getting low */
.timer.warning {
    color: var(--warning-color);
    text-shadow:
        0 0 10px var(--warning-color),
        0 0 20px rgba(255, 170, 0, 0.4),
        0 0 40px rgba(255, 170, 0, 0.2);
}

/* Critical — red pulsing when time is almost out */
.timer.critical {
    color: var(--critical-color);
    text-shadow:
        0 0 10px var(--critical-color),
        0 0 20px rgba(255, 51, 51, 0.5),
        0 0 40px rgba(255, 51, 51, 0.3);
    animation: pulse 1s ease-in-out infinite;
}

/* Brief flash when time is added */
.timer.flash {
    animation: flash 0.4s ease-out;
}

/* Paused badge */
.status-badge {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 8px;
    margin-top: 8px;
}

.status-badge.hidden {
    display: none;
}

/* ── Event feed ───────────────────────────────────────────────── */

#event-feed {
    position: fixed;
    bottom: 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-height: 30vh;
    overflow: hidden;
    pointer-events: none;
}

.event-item {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    border-left: 3px solid var(--flash-color);
    font-size: 16px;
    font-family: var(--font-family);
    white-space: nowrap;
    animation: slideUp 0.3s ease-out, fadeOut 0.5s ease-in forwards;
    animation-delay: 0s, var(--feed-duration);
}

/* ── Keyframes ────────────────────────────────────────────────── */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

@keyframes flash {
    0%   { transform: scale(1.08); filter: brightness(2); }
    100% { transform: scale(1);    filter: brightness(1); }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
