/* ============================= */
/* ROOT VARIABLES – DISPLAY SYSTEM */
/* ============================= */

:root {
    --display-green: #00ff88;
    --glow-soft:   0 0 4px rgba(0,255,120,0.45);
    --glow-medium: 0 0 8px rgba(0,255,120,0.35);
    --glow-strong: 0 0 14px rgba(0,255,120,0.25);
    --display-brightness: 0.95;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* ============================= */
/* GLOBAL */
/* ============================= */

body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
    overflow: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* ============================= */
/* BACKGROUND */
/* ============================= */

#background {
    position: fixed;
    inset: 0;
    background: url('../images/background-lab.png') center / cover no-repeat;
    filter: blur(8px) brightness(0.7);
    z-index: 0;
}

/* ============================= */
/* DEVICE */
/* ============================= */

#deviceContainer {
    position: relative;
    width: 1200px;
    max-width: 1200px;
}

#deviceImage {
    width: 100%;
    height: auto;
    display: block;
}

#deviceWrapper {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}

/* ============================= */
/* DISPLAY OVERLAY */
/* ============================= */

#displayOverlay {
    white-space: nowrap;
    position: absolute;
    left: 55%;
    top: 21%;
    width: 32.5%;
    height: 8%;
    z-index: 20;

    color: var(--display-green);

    text-shadow:
        var(--glow-soft),
        var(--glow-medium),
        var(--glow-strong);

    font-size: clamp(10px, 1.2vw, 18px);
    padding: clamp(6px, 0.8vw, 10px);

    opacity: 1;
    filter: brightness(var(--display-brightness));
}

#trackLine {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

#trackNumber {
    font-size: 1.2em;
    font-weight: 700;
    margin-right: 0.5em;
}

#trackTitle {
    font-size: 1.2em;
    font-weight: bold;
}

#trackMeta {
    font-size: 1em;
    margin-top: 4px;
}

#modeIndicator {
    font-size: 1em;
    letter-spacing: 0.15em;
    min-width: 4em;
    text-align: right;
    margin-right: 25px;
}

#displayOverlay::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        120deg,
        rgba(255,255,255,0.08) 0%,
        rgba(255,255,255,0.02) 35%,
        transparent 60%
    );

    border-radius: 4px;
    pointer-events: none;
}

/* ============================= */
/* WAVEFORM */
/* ============================= */

#waveCanvas {
    position: absolute;
    left: 55%;
    top: 32%;
    width: 31.5%;
    height: 4%;
    z-index: 5;
    background: transparent;
    filter: brightness(var(--display-brightness));
}

/* ============================= */
/* PROGRESS BAR */
/* ============================= */

#progressContainer {
    position: absolute;
    left: 55%;
    top: 38.5%;
    width: 31.5%;
    height: 6px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--display-green);
    filter: brightness(var(--display-brightness));
}

#progressBar {
    height: 100%;
    width: 0%;
    background: var(--display-green);

    box-shadow:
        inset 0 0 6px rgba(255,255,255,0.3),
        var(--glow-soft),
        var(--glow-medium);
}

/* ============================= */
/* CONTROLS */
/* ============================= */

.controls {
    position: absolute;
    left: 53.6%;
    top: 17%;
    width: 34%;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6%;
}

button {
    flex: 1;
    padding: clamp(2px, 0.3cqw, 4px)
             clamp(5px, 0.6cqw, 10px);
    font-size: clamp(9px, 0.9cqw, 12px);
    font-weight: 600;
    letter-spacing: 0.08em;
    border-radius: clamp(2px, 0.3cqw, 4px);
    border: 1px solid #777;
    background: linear-gradient(to bottom, #dcd9de, #b8b2ba);
    color: #222;
    line-height: 1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.1s ease;
}

button:hover {
    background: linear-gradient(to bottom, #e4e1e6, #c6c1c9);
}

button:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================= */
/* SECONDARY DISPLAY */
/* ============================= */

#secondaryDisplay {
    position: absolute;
    left: 76.7%;
    top: 48.5%;
    width: 9.75%;
    height: 15%;
    z-index: 9999;
    background: rgba(120, 120, 120, 0.35);
    pointer-events: none;
}

#secondaryDisplay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 255, 120, 0.6);
    mix-blend-mode: screen;
    animation: violentFlicker 4s infinite;
}

@keyframes violentFlicker {
    0%   { opacity: 0.18; }
    4%   { opacity: 0.35; }
    6%   { opacity: 0.12; }
    10%  { opacity: 0.22; }
    40%  { opacity: 0.18; }
    42%  { opacity: 0.32; }
    44%  { opacity: 0.14; }
    70%  { opacity: 0.20; }
    100% { opacity: 0.18; }
}

/* ============================= */
/* FIREWORKS */
/* ============================= */

#fireworksCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
}

/* ============================= */
/* WARNING BLOCK */
/* ============================= */

.warningBlock {
    position: relative;
    top: -6px;
    line-height: 1.3;
    font-size: 1.25em;
}

/* ============================= */
/* PASSWORD – CLINICAL */
/* ============================= */

#authModal {
    position: fixed;
    inset: 0;
    background: rgba(240, 244, 246, 0.92);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.authBox {
    width: 360px;
    padding: 40px 35px;
    background: #ffffff;
    border: 1px solid #d6e3e8;
    border-radius: 8px;
    color: #1f2f36;
    font-family: "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.05);
}

.authBox::before {
    content: "Toxicology Audio Unit";
    display: block;
    font-size: 0.8em;
    letter-spacing: 0.2em;
    color: #7aa5b3;
    margin-bottom: 12px;
}

.authBox form {
    margin-top: 25px;
}

.authBox input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8d9df;
    border-radius: 4px;
    background: #f7fbfc;
    color: #1f2f36;
    font-size: 1.1em;
    letter-spacing: 4px;
    text-align: center;
}

.authBox input:focus {
    outline: none;
    border-color: #58c3b3;
    box-shadow: 0 0 0 3px rgba(88,195,179,0.15);
}

.authBox button {
    margin-top: 18px;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: none;
    background: #58c3b3;
    color: white;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: 0.2s ease;
}

.authBox button:hover {
    background: #46b3a4;
}

.denied {
    margin-top: 15px;
    color: #d84f4f;
    font-size: 0.9em;
    font-weight: 500;
}

/* ============================= */
/* AUDIO HIDDEN */
/* ============================= */

#audioPlayer {
    display: none;
}
