:root {
            --stroke-width: 1.2vw;
            --shadow-blur: 4vw;
            --timer-color: #ffffff;
            --timer-stroke: #000000;
            --timer-shadow: #000000;
            --timer-glow: rgba(0, 0, 0, 0.9);
            --timer-size: 30vw;
        }

        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background-color: #00b300;
            font-family: 'Impact', 'Arial Black', sans-serif;
            user-select: none;
            z-index: 0;
        }

        /* Running state hides everything */
        body.running {
            cursor: none !important;
        }

        body.running .controls,
        body.running .start-overlay {
            display: none !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        /* 50 Backgrounds cross-fade system */
        .bg-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 1;
            opacity: 0;
            transition: opacity 1.5s ease-in-out;
            background-size: cover;
        }

        .bg-layer.active {
            opacity: 1;
        }

        /* Geometric Diamond Lattice Overlay */
        .lattice-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 2;
            background: 
                linear-gradient(135deg, rgba(0,0,0,0.7) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.7) 75%, rgba(0,0,0,0.7)),
                linear-gradient(45deg, rgba(0,0,0,0.7) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.7) 75%, rgba(0,0,0,0.7));
            background-size: 8vw 8vw;
            background-position: 0 0, 4vw 4vw;
            mix-blend-mode: multiply;
            opacity: 0.85;
            pointer-events: none;
        }

        /* Diagonal Light Beams */
        .beams {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 2;
            background: repeating-linear-gradient(
                45deg,
                transparent,
                transparent 5vw,
                rgba(255,255,255,0.05) 5vw,
                rgba(255,255,255,0.05) 10vw
            );
            animation: shift 20s linear infinite;
            pointer-events: none;
        }

        @keyframes shift {
            from { background-position: 0 0; }
            to { background-position: 100vw 100vw; }
        }

        /* Center Timer Container */
        .timer-wrapper {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
            z-index: 10;
        }

        /* Number Styles */
        .timer-text {
            font-size: var(--timer-size);
            line-height: 1;
            color: var(--timer-color);
            -webkit-text-stroke: var(--stroke-width) var(--timer-stroke);
            text-stroke: var(--stroke-width) var(--timer-stroke);
            text-shadow: 0.5vw 0.5vw 2vw var(--timer-shadow), 0px 0px 3vw var(--timer-glow);
            will-change: contents;
            transform: translateZ(0);
            margin: 0;
            cursor: pointer;
            transition: transform 0.1s ease, color 0.5s ease, text-shadow 0.5s ease, -webkit-text-stroke 0.5s ease, font-size 0.2s ease;
            white-space: nowrap;
        }

        body.running .timer-text {
            cursor: none;
        }

        .timer-text:active {
            transform: scale(0.98);
        }

        /* Start Overlay */
        .start-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 20;
            backdrop-filter: blur(15px);
            color: white;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
            transition: opacity 0.5s ease;
        }

        .start-overlay-clickable {
            cursor: pointer;
            padding: 30px;
            text-align: center;
            border-radius: 20px;
        }
        
        .start-overlay-clickable:hover {
            background: rgba(255,255,255,0.05);
        }

        .start-overlay h1 {
            font-size: 4rem;
            margin-bottom: 20px;
            font-weight: 800;
            pointer-events: none;
        }

        .start-overlay p {
            font-size: 1.5rem;
            opacity: 0.8;
            pointer-events: none;
            margin-bottom: 15px;
        }

        /* Time Settings Panel */
        .settings-panel {
            display: flex;
            flex-direction: column;
            gap: 15px;
            justify-content: center;
            align-items: center;
            z-index: 25;
            background: rgba(20,20,20,0.9);
            padding: 25px 30px;
            border-radius: 20px;
            border: 1px solid rgba(255,255,255,0.2);
            box-shadow: 0 15px 40px rgba(0,0,0,0.7);
            margin-top: 20px;
            max-width: 700px;
            width: 90vw;
            max-height: 80vh;
    overflow-y: auto;
}

        .settings-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
            justify-content: center;
            width: 100%;
        }

        .settings-label {
            font-family: 'Segoe UI', sans-serif;
            font-weight: 700;
            font-size: 0.9rem;
            opacity: 0.6;
            text-transform: uppercase;
            letter-spacing: 2px;
            min-width: 40px;
        }

        /* HH:MM:SS Picker */
        .hms-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .hms-unit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .hms-input {
            width: 65px;
            padding: 10px 5px;
            font-size: 1.6rem;
            font-weight: bold;
            border-radius: 10px;
            border: 2px solid rgba(255,255,255,0.4);
            background: rgba(0,0,0,0.6);
            color: white;
            text-align: center;
            outline: none;
            font-family: 'Impact', monospace;
            -moz-appearance: textfield;
        }

        .hms-input::-webkit-inner-spin-button,
        .hms-input::-webkit-outer-spin-button { -webkit-appearance: none; }

        .hms-input:focus {
            border-color: white;
            background: rgba(255,255,255,0.1);
            box-shadow: 0 0 15px rgba(255,255,255,0.3);
        }

        .hms-btn {
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
            padding: 3px 14px;
            font-size: 0.85rem;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s;
            line-height: 1;
        }

        .hms-btn:hover { background: rgba(255,255,255,0.3); }

        .hms-colon {
            font-size: 2rem;
            font-weight: bold;
            color: rgba(255,255,255,0.7);
            margin-bottom: 20px;
        }

        .hms-label {
            font-size: 0.7rem;
            opacity: 0.5;
            letter-spacing: 2px;
            font-family: 'Segoe UI', sans-serif;
        }

        .param-group {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: bold;
            font-family: 'Segoe UI', sans-serif;
        }

        .time-btn {
            background: rgba(0, 0, 0, 0.6);
            border: 2px solid rgba(255, 255, 255, 0.5);
            color: white;
            padding: 10px 20px;
            font-size: 1.1rem;
            border-radius: 10px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.2s;
        }

        .time-btn:hover {
            border-color: white;
            background: rgba(255, 255, 255, 0.2);
        }

        .time-btn.active {
            background: white;
            color: black;
            border-color: white;
            box-shadow: 0 0 15px white;
        }

        .custom-input {
            width: 80px;
            padding: 8px;
            font-size: 1.1rem;
            border-radius: 10px;
            border: 2px solid rgba(255, 255, 255, 0.5);
            background: rgba(0, 0, 0, 0.6);
            color: white;
            text-align: center;
            outline: none;
            font-family: inherit;
        }

        select.custom-input {
            width: auto;
            text-align: left;
            cursor: pointer;
        }

        select.custom-input option {
            background: #222;
            color: white;
        }

        .custom-input:focus {
            border-color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        /* Checkbox styling */
        input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: #555;
        }

        .hidden {
            opacity: 0;
            pointer-events: none;
        }

        .color-picker {
            width: 36px !important;
            height: 36px !important;
            padding: 0;
            cursor: pointer;
            border-radius: 8px;
            overflow: hidden;
            border: 2px solid rgba(255, 255, 255, 0.5);
        }
        .color-picker::-webkit-color-swatch-wrapper {
            padding: 0;
        }
        .color-picker::-webkit-color-swatch {
            border: none;
        }

        /* Controls */
        .controls {
            position: fixed;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            z-index: 15;
            display: flex;
            gap: 1rem;
            opacity: 0;
            transition: opacity 0.3s;
        }

        body:hover .controls {
            opacity: 1;
        }

        button.control-btn {
            background: rgba(0, 0, 0, 0.6);
            border: 2px solid white;
            color: white;
            padding: 10px 20px;
            font-size: 1.2rem;
            border-radius: 50px;
            cursor: pointer;
            font-weight: bold;
            backdrop-filter: blur(5px);
            transition: all 0.2s;
        }

        button.control-btn:hover {
            background: white;
            color: black;
        }

        /* Alarm file row */
        .alarm-file-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(255,255,255,0.08);
            border: 2px solid rgba(255,255,255,0.3);
            color: white;
            padding: 8px 16px;
            font-size: 1rem;
            border-radius: 10px;
            cursor: pointer;
            font-family: 'Segoe UI', sans-serif;
            font-weight: bold;
            transition: all 0.2s;
        }
        .alarm-file-btn:hover { background: rgba(255,255,255,0.2); border-color: white; }
        .alarm-file-name {
            font-family: 'Segoe UI', sans-serif;
            font-size: 0.9rem;
            opacity: 0.7;
            max-width: 160px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        
/* Video Background */
#bgVideo {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    z-index: 0;
    object-fit: cover;
    display: none;
}

/* File Upload Button */
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    transition: all 0.2s;
}

.upload-btn:hover { background: rgba(255,255,255,0.2); border-color: white; }
