html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #02050d;
    color: #f5f8ff;
}

* {
    box-sizing: border-box;
}

.lab-viewer {
    position: relative;
    width: 100%;
    height: 100%;
    background: #02050d;
}

#meteor-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hud {
    position: absolute;
    left: 20px;
    top: 20px;
    width: min(360px, calc(100vw - 40px));
    padding: 16px;
    border: 1px solid rgba(156, 190, 255, 0.2);
    border-radius: 8px;
    background: rgba(4, 8, 18, 0.78);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    z-index: 4;
}

.camera-panel {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: min(360px, calc(100vw - 40px));
    padding: 14px;
    border: 1px solid rgba(156, 190, 255, 0.2);
    border-radius: 8px;
    background: rgba(4, 8, 18, 0.78);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    z-index: 4;
}

.camera-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.camera-panel h2 {
    margin: 0;
    font-size: 16px;
}

#camera-time {
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #d8e8ff;
    font-size: 12px;
}

.camera-grid {
    display: grid;
    grid-template-columns: 42px repeat(3, 1fr);
    gap: 7px;
    align-items: center;
    margin-bottom: 10px;
}

.camera-grid span {
    color: #c9d8ee;
    font-size: 13px;
}

.camera-grid input {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(3, 8, 18, 0.92);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
}

.camera-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.camera-actions button {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
}

#camera-readout {
    width: 100%;
    resize: none;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(3, 8, 18, 0.92);
    color: #cfe2ff;
    font: 12px/1.35 monospace;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.eyebrow {
    margin: 0 0 5px;
    color: #86d8ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

h1 {
    margin: 0;
    font-size: 23px;
    line-height: 1.12;
}

#phase-time {
    min-width: 50px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #d8e8ff;
    font-size: 13px;
    text-align: center;
}

.phase-title {
    margin: 15px 0 6px;
    color: #ffffff;
    font-weight: 700;
}

.phase-copy,
.look-hint {
    margin: 0;
    color: #c9d8ee;
    line-height: 1.45;
    font-size: 14px;
}

.progress-shell {
    height: 7px;
    margin: 14px 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

#progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #62d8ff, #ffcc73, #ffffff);
}

.controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

button,
select {
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(36, 84, 151, 0.82);
    font: inherit;
}

button {
    cursor: pointer;
}

button:hover,
select:hover {
    filter: brightness(1.08);
}

.speed-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: #dce8ff;
    font-size: 14px;
}

.speed-control select {
    width: 92px;
    padding: 0 10px;
    background: rgba(8, 15, 31, 0.88);
}

#fade-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: #02050d;
    opacity: 0;
    transition: opacity 0.2s linear;
    z-index: 3;
}

@media (max-width: 680px) {
    .hud {
        left: 12px;
        top: 12px;
        width: calc(100vw - 24px);
        padding: 13px;
    }

    h1 {
        font-size: 20px;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .camera-panel {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }
}
