:root {
    --background: #050705;
    --case: #2c2c24;
    --case-light: #444034;
    --panel: #121510;
    --line: #514c3d;
    --amber: #ffae27;
    --green: #79ff9d;
    --red: #ff5546;
    --cream: #eee5c7;
    --muted: #aaa58f;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--cream);
    background:
        radial-gradient(circle at top, #34362d 0, transparent 35%),
        linear-gradient(#0c0f0b, #020302);
    font-family: Arial, Helvetica, sans-serif;
}

button,
select,
input {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.topbar,
main,
footer {
    width: min(1450px, calc(100% - 28px));
    margin-right: auto;
    margin-left: auto;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 0 18px;
}

.eyebrow {
    color: var(--amber);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.2em;
}

h1,
h2 {
    margin: 5px 0;
    font-family: Georgia, serif;
    font-weight: 500;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: 1.7rem;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.utc {
    min-width: 165px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: #080b08;
    text-align: right;
}

.utc span,
.utc strong {
    display: block;
}

.utc span {
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
}

.utc strong {
    color: var(--amber);
    font-family: monospace;
    font-size: 1.3rem;
}

.radio {
    overflow: hidden;
    padding: 27px;
    border: 3px solid #615d4f;
    border-radius: 17px;
    background:
        linear-gradient(145deg, var(--case-light), var(--case) 50%, #1b1d17);
    box-shadow:
        0 30px 80px #000,
        inset 0 0 35px #000;
}

.radio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 19px;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.brand strong {
    font-family: Georgia, serif;
    font-size: 2rem;
}

.brand span {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.22em;
}

.power {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.65rem;
    font-weight: 900;
}

.power-light,
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.power-light.on,
.status-dot.live {
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

.status-dot.error {
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.status-dot.loading {
    background: var(--amber);
    box-shadow: 0 0 12px var(--amber);
}

.radio-body {
    display: grid;
    grid-template-columns: 270px minmax(400px, 1fr) 315px;
    min-height: 570px;
    border: 2px solid #090a08;
    border-radius: 9px;
    background: var(--panel);
    box-shadow:
        inset 0 0 0 1px var(--line),
        inset 0 0 40px #000;
}

.speaker,
.display-section,
.station-console {
    padding: 24px;
}

.speaker,
.display-section {
    border-right: 2px solid #080a07;
}

.speaker-grille {
    height: 370px;
    border-radius: 7px;
    background-color: #0b0d0a;
    background-image:
        radial-gradient(circle, #020302 3px, transparent 3.5px);
    background-size: 13px 13px;
    box-shadow:
        inset 0 0 32px #000,
        0 1px #514d3e;
}

.meter {
    margin-top: 20px;
    text-align: center;
}

.meter > span {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.meter-face {
    position: relative;
    height: 100px;
    margin-top: 8px;
    overflow: hidden;
    border: 6px solid #343127;
    border-radius: 5px;
    background:
        radial-gradient(circle at 50% 115%, #fff4c5, #c8b573 70%, #655c42);
    box-shadow: inset 0 0 15px #000;
}

.needle {
    position: absolute;
    bottom: -42px;
    left: 50%;
    width: 2px;
    height: 105px;
    background: #df2d24;
    transform: rotate(-45deg);
    transform-origin: bottom;
    transition: transform 0.25s ease;
}

.digital-display {
    padding: 18px 22px;
    border: 2px solid #020302;
    border-radius: 6px;
    background:
        radial-gradient(circle at center, #17331f, #061009 70%);
    box-shadow: inset 0 0 32px #000;
}

.digital-display > span {
    color: #63ce7d;
    font-family: monospace;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
}

.digital-display > strong {
    display: block;
    min-height: 76px;
    padding: 15px 0;
    color: var(--green);
    font-family: monospace;
    font-size: clamp(1.5rem, 3.8vw, 3rem);
    line-height: 1.05;
    text-shadow: 0 0 12px var(--green);
}

.station-details {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: #66d680;
    font-family: monospace;
    font-size: 0.68rem;
}

#spectrum {
    width: 100%;
    height: 180px;
    display: block;
    margin-top: 18px;
    border: 2px solid #020302;
    background: #020805;
    box-shadow: inset 0 0 20px #000;
}

.audio-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 18px;
}

.play-button,
.stop-button,
.metal-button {
    min-height: 48px;
    border-radius: 5px;
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.07em;
}

.play-button {
    border: 1px solid #6d350e;
    color: #1d1305;
    background: linear-gradient(#ffc75e, #df841f);
    box-shadow: 0 4px 0 #5d2a0d;
}

.stop-button {
    min-width: 100px;
    border: 1px solid #30110d;
    color: #f4dfd8;
    background: linear-gradient(#9b3026, #5e1712);
    box-shadow: 0 4px 0 #260907;
}

.play-button:disabled,
.stop-button:disabled {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.45;
}

.volume-control {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 900;
}

.volume-control input {
    width: 100%;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-top: 15px;
    padding: 11px 13px;
    border: 1px solid #34362d;
    background: #090c08;
    font-size: 0.72rem;
}

.status-dot {
    flex: 0 0 auto;
    background: #777467;
}

.station-console label {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.station-console select {
    width: 100%;
    min-height: 46px;
    margin-bottom: 20px;
    padding: 8px 10px;
    border: 1px solid #070807;
    border-radius: 4px;
    color: var(--cream);
    background: #0a100b;
}

.metal-button {
    width: 100%;
    border: 1px solid #25251f;
    color: #171812;
    background: linear-gradient(#dbd4bd, #918a76);
    box-shadow: 0 3px 0 #0a0b08;
}

.station-information {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #403e33;
    background: #0c0f0b;
}

.station-information span {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
}

.station-information strong {
    color: var(--amber);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.region-bank {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid #12130f;
    border-radius: 7px;
    background: rgba(7, 9, 6, 0.65);
}

.section-title {
    margin-bottom: 16px;
}

.region-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.region-button {
    min-height: 85px;
    padding: 12px;
    border: 1px solid #4b493b;
    border-radius: 5px;
    color: var(--cream);
    background: linear-gradient(145deg, #292a22, #171914);
    text-align: left;
}

.region-button:hover,
.region-button.active {
    border-color: var(--amber);
    box-shadow: inset 0 0 15px rgba(255, 174, 39, 0.13);
}

.region-button .icon {
    display: block;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.region-button strong,
.region-button small {
    display: block;
}

.region-button strong {
    font-size: 0.78rem;
}

.region-button small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.6rem;
}

.information-panel {
    display: flex;
    gap: 15px;
    margin-top: 18px;
    padding: 15px;
    border-left: 4px solid var(--amber);
    background: #0d100c;
    font-size: 0.7rem;
    line-height: 1.45;
}

.information-panel strong {
    flex: 0 0 auto;
    color: var(--amber);
}

.information-panel span {
    color: var(--muted);
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 30px;
    color: #716e60;
    font-size: 0.65rem;
}

@media (max-width: 1100px) {
    .radio-body {
        grid-template-columns: 220px 1fr;
    }

    .station-console {
        grid-column: 1 / -1;
        border-top: 2px solid #080a07;
    }

    .display-section {
        border-right: 0;
    }

    .region-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 720px) {
    .topbar {
        display: block;
    }

    .utc {
        margin-top: 14px;
        text-align: left;
    }

    .radio {
        padding: 15px 9px;
    }

    .radio-body {
        display: block;
    }

    .speaker {
        display: none;
    }

    .display-section,
    .station-console {
        padding: 15px;
    }

    .digital-display > strong {
        font-size: 1.8rem;
    }

    .region-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .information-panel,
    footer {
        display: block;
    }

    .information-panel span,
    footer span {
        display: block;
        margin-top: 7px;
    }
}

/* ==========================================================
   LA911 LIVE AI CAPTIONS
   ========================================================== */

.caption-console {
    margin-top: 18px;
    padding: 17px;
    border: 1px solid #4d4939;
    border-radius: 6px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 174, 39, 0.05),
            transparent 45%
        ),
        #080c08;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.7),
        0 1px rgba(255, 255, 255, 0.04);
}

.caption-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px;
}

.caption-heading strong,
.caption-kicker {
    display: block;
}

.caption-heading strong {
    margin-top: 4px;
    color: var(--cream);
    font-size: 0.82rem;
}

.caption-kicker {
    color: var(--amber);
    font-size: 0.59rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.caption-ai-warning {
    flex: 0 0 auto;
    padding: 5px 7px;
    border: 1px solid #724021;
    border-radius: 3px;
    color: #ffb35f;
    background: #241209;
    font-size: 0.51rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.caption-settings {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto auto;
    align-items: center;
    gap: 9px;
}

.caption-settings label {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.11em;
}

.caption-settings select {
    min-height: 39px;
    padding: 7px 9px;
    border: 1px solid #3c4035;
    border-radius: 4px;
    color: var(--cream);
    background: #09100a;
}

#startCaptionsButton,
#stopCaptionsButton {
    min-height: 39px;
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

#startCaptionsButton {
    border: 1px solid #87500f;
    color: #171006;
    background: linear-gradient(#ffc35b, #dc801e);
}

#stopCaptionsButton {
    border: 1px solid #541914;
    color: #f8dfd9;
    background: linear-gradient(#9e3026, #5a1510);
}

#startCaptionsButton:disabled,
#stopCaptionsButton:disabled {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.42;
}

.caption-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin-top: 11px;
    color: #bdb8a5;
    font-size: 0.64rem;
}

.caption-status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #68665b;
}

.caption-status-dot.loading,
.caption-status-dot.starting,
.caption-status-dot.reconnecting {
    background: var(--amber);
    box-shadow: 0 0 9px var(--amber);
}

.caption-status-dot.listening,
.caption-status-dot.active,
.caption-status-dot.model-ready {
    background: var(--green);
    box-shadow: 0 0 9px var(--green);
}

.caption-status-dot.error,
.caption-status-dot.warning {
    background: var(--red);
    box-shadow: 0 0 9px var(--red);
}

.live-caption-display {
    min-height: 145px;
    max-height: 330px;
    overflow-y: auto;
    padding: 15px;
    border: 2px solid #020402;
    border-radius: 5px;
    color: #e9f9eb;
    background:
        linear-gradient(
            rgba(77, 255, 119, 0.025),
            rgba(77, 255, 119, 0.008)
        ),
        #030704;
    box-shadow: inset 0 0 22px #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.08rem;
    line-height: 1.48;
}

.caption-placeholder {
    padding: 28px 10px;
    color: #667069;
    text-align: center;
    font-size: 0.72rem;
}

.caption-entry {
    padding: 10px 0;
    border-bottom: 1px solid rgba(107, 255, 141, 0.12);
}

.caption-entry:last-child {
    border-bottom: 0;
}

.caption-entry-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: #65c87d;
    font-family: monospace;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
}

.caption-entry-text {
    overflow-wrap: anywhere;
}

@media (max-width: 850px) {
    .caption-settings {
        grid-template-columns: 1fr 1fr;
    }

    .caption-settings label {
        grid-column: 1 / -1;
    }

    .caption-settings select {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .caption-settings {
        grid-template-columns: 1fr;
    }

    .caption-settings label,
    .caption-settings select {
        grid-column: auto;
    }

    #startCaptionsButton,
    #stopCaptionsButton {
        width: 100%;
    }

    .caption-heading {
        display: block;
    }

    .caption-ai-warning {
        display: inline-block;
        margin-top: 9px;
    }

    .live-caption-display {
        font-size: 0.96rem;
    }
}
