:root {
    --hue: 120;
    --primary-color: hsl(var(--hue), 100%, 50%);
    --bg-color: #000;
    --dim-color: hsl(var(--hue), 100%, 10%);
    --text-shadow: 0 0 10px var(--primary-color);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5vh;
    padding-bottom: 5vh;
    box-sizing: border-box;
}

body.screensaver-mode .container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

body.screensaver-mode #matrix-bg {
    z-index: 10;
}

#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

.container {
    text-align: center;
    z-index: 1;
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px var(--dim-color);
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    margin: 0 auto;
}

@media (max-width: 768px) {
    body {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    .container {
        padding: 1rem 0.5rem;
        width: 85%;
    }

    header h1 {
        font-size: 2rem;
    }

    #countdown-display {
        font-size: 12vw;
    }

    .audit-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .control-btn {
        flex: 1 1 40%;
        margin: 2px;
        padding: 8px;
    }

    #audit-visuals {
        height: 60px;
    }

    .modal-content {
        width: 85%;
        max-height: 80vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .container {
        width: 90%;
    }

    header h1 {
        font-size: 1.8rem;
    }

    #countdown-display {
        font-size: 15vw;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    blockquote {
        font-size: 1.1rem;
    }
}

header h1 {
    font-size: 4rem;
    margin: 0;
    text-shadow: 2px 2px 0px #000, 0 0 20px var(--primary-color);
    letter-spacing: 5px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

header h1:hover {
    text-shadow: 0 0 40px var(--primary-color);
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 3px;
    opacity: 0.8;
}

.glitch-text {
    position: relative;
    display: inline-block;
}

section {
    margin: 3rem 0;
}

#countdown-display {
    font-size: 6rem;
    font-weight: bold;
    text-shadow: 0 0 30px var(--primary-color);
    line-height: 1;
}

.label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #4f4;
}

#countdown-progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--dim-color);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

#countdown-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 100%;
    box-shadow: 0 0 10px var(--primary-color);
}

blockquote {
    font-size: 2rem;
    font-style: italic;
    margin: 0;
    text-shadow: 0 0 5px var(--primary-color);
}

.sub-quote {
    margin-top: 1rem;
    font-size: 1.2rem;
    opacity: 0.7;
}

#time-audit-section {
    border-top: 1px dashed var(--dim-color);
    padding-top: 2rem;
}

.audit-controls {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.control-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-family: inherit;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    min-width: 30px;
}

.control-btn:hover {
    background: var(--primary-color);
    color: #000;
}

#audit-visuals {
    display: flex;
    height: 50px;
    width: 100%;
    border: 1px solid var(--primary-color);
    margin-top: 1rem;
    box-sizing: border-box;
}

.audit-block {
    height: 100%;
    border-right: 1px solid rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
}

.audit-block:hover {
    background: var(--primary-color) !important;
    box-shadow: 0 0 15px var(--primary-color);
    z-index: 2;
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #000;
    border: 1px solid var(--primary-color);
    padding: 2rem;
    width: 300px;
    box-shadow: 0 0 30px var(--primary-color);
    text-align: center;
}

.modal-content input {
    width: 90%;
    background: #111;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px;
    margin: 1rem 0;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.tag-selection {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.tag-btn {
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #fff;
    opacity: 0.7;
    transition: all 0.2s;
}

.tag-btn:hover,
.tag-btn.selected {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 10px #fff;
}

.tag-work {
    background: repeating-linear-gradient(45deg, #004d00, #004d00 10px, #006600 10px, #006600 20px);
    box-shadow: inset 0 0 5px #0f0;
}

.tag-deep {
    background: repeating-linear-gradient(45deg, #300030, #300030 10px, #4d004d 10px, #4d004d 20px);
    border: 1px solid #d0f;
    box-shadow: inset 0 0 5px #d0f;
}

.tag-health {
    background: repeating-linear-gradient(135deg, #003333, #003333 5px, #004d4d 5px, #004d4d 10px);
    border: 1px solid #0ff;
}

.tag-waste {
    background: repeating-radial-gradient(circle, #330000, #330000 5px, #4d0000 5px, #4d0000 10px);
    border: 1px solid #f00;
}

.tag-sleep {
    background: #111;
    border: 1px dotted #555;
}

.tag-learn {
    background: repeating-linear-gradient(90deg, #333300, #333300 10px, #4d4d00 10px, #4d4d00 20px);
    border: 1px solid #ff0;
}

.audit-block.tag-work {
    background: #004d00 !important;
}

.stat-box {
    border: 1px solid var(--primary-color);
    padding: 1rem;
    display: inline-block;
    border-radius: 5px;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}