:root {
    --bg: #111111;
    --panel: linear-gradient(180deg, rgba(46, 46, 46, 0.95), rgba(18, 18, 18, 0.98));
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f3efe6;
    --muted: #b9b2a3;
    --accent: #f97316;
    --accent-2: #facc15;
    --shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
    --metal: linear-gradient(180deg, #4a4a4a 0%, #2d2d2d 48%, #161616 100%);
    --screen: #b7ff72;
    --screen-dim: rgba(183, 255, 114, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at top, rgba(249, 115, 22, 0.1), transparent 30%),
        linear-gradient(180deg, #1b1b1b 0%, #101010 100%);
}

.page-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.hero-card {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    padding: 32px;
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: #f5c66b;
}

h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 0.95;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.badge {
    padding: 10px 16px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.badge::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.live-on {
    color: #fff1d6;
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.1));
    border-color: rgba(249, 115, 22, 0.35);
    animation: pulse 1.7s infinite;
}

.live-off {
    color: #e7ddd1;
    background: linear-gradient(180deg, rgba(120, 120, 120, 0.2), rgba(90, 90, 90, 0.12));
    border-color: rgba(255, 255, 255, 0.12);
}

.console-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.meta-pill {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #eadfca;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-card {
    padding: 22px;
    border-radius: 22px;
    background: var(--metal);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -14px 24px rgba(0, 0, 0, 0.22);
}

.scanner-screen {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(11, 18, 7, 0.98), rgba(18, 28, 11, 0.98));
    border: 1px solid rgba(183, 255, 114, 0.22);
    box-shadow:
        inset 0 0 0 2px rgba(9, 13, 7, 0.96),
        inset 0 0 20px rgba(183, 255, 114, 0.07),
        0 10px 20px rgba(0, 0, 0, 0.18);
    color: var(--screen);
    font-family: "Courier New", monospace;
    position: relative;
    overflow: hidden;
}

.direct-display-frame {
    display: none;
    position: relative;
    z-index: 3;
    margin: 24px 0 8px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(183, 255, 114, 0.12);
    background: rgba(4, 9, 4, 0.8);
    box-shadow: inset 0 0 16px rgba(183, 255, 114, 0.05);
}

.direct-display-label {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(183, 255, 114, 0.62);
}

.direct-display-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.direct-display-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(183, 255, 114, 0.78);
    border: 1px solid rgba(183, 255, 114, 0.18);
    background: rgba(183, 255, 114, 0.08);
}

.direct-display-badge.live {
    color: #eaffbf;
    border-color: rgba(183, 255, 114, 0.28);
    background: rgba(183, 255, 114, 0.12);
    box-shadow: 0 0 10px rgba(183, 255, 114, 0.12);
}

.scanner-screen.has-real-display.hold .direct-display-badge,
.scanner-screen.has-real-display.hold .direct-display-badge.live {
    color: #fff0bf;
    border-color: rgba(255, 189, 89, 0.32);
    background: rgba(255, 189, 89, 0.1);
    box-shadow: 0 0 10px rgba(255, 189, 89, 0.12);
}

.direct-display-stack {
    display: grid;
    gap: 8px;
}

.direct-display-stack img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter:
        drop-shadow(0 0 8px rgba(183, 255, 114, 0.16))
        saturate(1.05);
}

.direct-display-stack img:last-child {
    width: auto;
    min-width: 116px;
}

.scanner-screen.has-real-display .direct-display-frame {
    display: block;
}

.scanner-screen.has-real-display .screen-topline,
.scanner-screen.has-real-display .screen-main,
.scanner-screen.has-real-display .screen-bottom {
    display: none;
}

.scanner-screen .screen-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, transparent 95%, rgba(183, 255, 114, 0.05) 100%),
        repeating-linear-gradient(
            180deg,
            transparent 0,
            transparent 23px,
            rgba(183, 255, 114, 0.045) 24px
        );
    opacity: 0.55;
    pointer-events: none;
}

.scanner-indicators {
    position: absolute;
    left: 14px;
    top: 8px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.indicator-pill {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    color: rgba(183, 255, 114, 0.38);
    border: 1px solid rgba(183, 255, 114, 0.12);
    background: rgba(183, 255, 114, 0.03);
}

.indicator-pill.on {
    color: #eaffbf;
    border-color: rgba(183, 255, 114, 0.28);
    background: rgba(183, 255, 114, 0.12);
    box-shadow: 0 0 10px rgba(183, 255, 114, 0.16);
}

.scanner-screen.hold .indicator-pill.on {
    color: #fff0bf;
    border-color: rgba(255, 189, 89, 0.35);
    background: rgba(255, 189, 89, 0.12);
    box-shadow: 0 0 10px rgba(255, 189, 89, 0.16);
}

.scanner-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(183, 255, 114, 0.1) 48%, transparent 100%);
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.scanner-screen.scan::after {
    opacity: 1;
    animation: scanSweep 2.2s linear infinite;
}

.scanner-screen.hold {
    color: #ffd28a;
    border-color: rgba(255, 189, 89, 0.28);
    box-shadow:
        inset 0 0 0 2px rgba(24, 16, 8, 0.92),
        inset 0 0 20px rgba(255, 189, 89, 0.08),
        0 10px 20px rgba(0, 0, 0, 0.18);
}

.scanner-screen.has-real-display.hold .direct-display-frame {
    border-color: rgba(255, 189, 89, 0.24);
    background: rgba(18, 12, 4, 0.78);
    box-shadow: inset 0 0 16px rgba(255, 189, 89, 0.06);
}

.screen-topline,
.screen-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.88;
}

.screen-brand {
    position: absolute;
    top: 8px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    color: rgba(183, 255, 114, 0.38);
    pointer-events: none;
}

.screen-brand span {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    line-height: 1;
    text-shadow: 0 0 8px rgba(183, 255, 114, 0.08);
}

.screen-main {
    position: relative;
    padding: 14px 0 12px;
    z-index: 1;
}

.hold-banner {
    display: none;
    width: fit-content;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff0bf;
    border: 1px solid rgba(255, 189, 89, 0.35);
    background: rgba(255, 189, 89, 0.12);
    box-shadow: 0 0 10px rgba(255, 189, 89, 0.12);
}

.scanner-screen.hold .hold-banner {
    display: inline-flex;
}

.screen-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.screen-corner {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.82;
}

#scanner-protocol-badge {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(183, 255, 114, 0.18);
    background: rgba(183, 255, 114, 0.06);
}

.screen-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 10px rgba(183, 255, 114, 0.12);
}

.screen-line + .screen-line {
    margin-top: 8px;
}

.screen-line-strong {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.screen-frequency {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-shadow:
        0 0 8px rgba(183, 255, 114, 0.18),
        0 0 18px rgba(183, 255, 114, 0.08);
}

.screen-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(183, 255, 114, 0.16);
}

.screen-data-item {
    min-width: 0;
}

.screen-data-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.72;
}

.screen-data-item strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.scanner-screen.offline {
    color: rgba(183, 255, 114, 0.62);
    opacity: 0.72;
}

.scanner-screen.offline #scanner-protocol-badge,
.scanner-screen.offline .screen-data-item strong,
.scanner-screen.offline .screen-frequency {
    text-shadow: none;
}

.console-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.strip-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.strip-value {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--screen);
    font-family: "Courier New", monospace;
    background: rgba(183, 255, 114, 0.08);
    border: 1px solid rgba(183, 255, 114, 0.14);
}

.history-panel {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.history-list {
    display: grid;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
}

.history-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-time {
    color: #f5c66b;
    font-family: "Courier New", monospace;
    font-size: 0.78rem;
}

.history-main {
    min-width: 0;
}

.history-title,
.history-sub {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-title {
    color: var(--screen);
    font-family: "Courier New", monospace;
}

.history-sub {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.84rem;
}

.telemetry-rack {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(36, 36, 36, 0.95), rgba(18, 18, 18, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -8px 12px rgba(0, 0, 0, 0.18);
}

.rack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #cbbfae;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rack-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rack-slot {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(8, 8, 8, 0.28), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.rack-slot-wide {
    grid-column: 1 / -1;
}

.rack-label {
    display: block;
    margin-bottom: 4px;
    color: #aa9f91;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rack-slot strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--screen);
    font-family: "Courier New", monospace;
    font-size: 0.96rem;
}

#telemetry-source {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.audio-helper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.14), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(249, 115, 22, 0.24);
}

.audio-helper.is-hidden {
    display: none;
}

.audio-helper-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.audio-helper-copy strong {
    color: #fff1d6;
    font-size: 0.92rem;
}

.audio-helper-copy span {
    color: #e7ddd1;
    font-size: 0.78rem;
    line-height: 1.35;
}

.audio-helper-button {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #f97316, #d95e0b);
    color: #fff8ef;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

audio {
    width: 100%;
    margin-top: 18px;
    border-radius: 14px;
    filter: sepia(0.2) contrast(1.05);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.stat-card {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong {
    font-size: 1.4rem;
    color: var(--screen);
    font-family: "Courier New", monospace;
    letter-spacing: 0.04em;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.25); }
    70% { box-shadow: 0 0 0 14px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

@keyframes scanSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 760px) {
    .page-shell {
        padding: 12px;
    }

    .hero-card {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 16px;
        border-radius: 22px;
    }

    .hero-card::before {
        inset: 6px;
        border-radius: 18px;
    }

    .hero-copy {
        align-items: stretch;
        padding: 2px 2px 8px;
    }

    .eyebrow {
        margin-bottom: 8px;
        font-size: 0.72rem;
        letter-spacing: 0.18em;
    }

    h1 {
        font-size: 2.2rem;
        line-height: 0.98;
        max-width: 8ch;
    }

    .badge {
        width: fit-content;
        margin-bottom: 14px;
        padding: 8px 12px;
        font-size: 0.84rem;
    }

    .console-meta {
        margin-top: 14px;
        gap: 8px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .meta-pill {
        padding: 7px 10px;
        font-size: 0.72rem;
        text-align: center;
    }

    .player-card {
        padding: 14px;
        border-radius: 18px;
    }

    .audio-helper {
        align-items: stretch;
        flex-direction: column;
    }

    .audio-helper-button {
        width: 100%;
    }

    .scanner-screen {
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 14px;
    }

    .screen-brand {
        top: 7px;
        right: 9px;
    }

    .scanner-indicators {
        left: 10px;
        top: 7px;
        gap: 4px;
        flex-wrap: wrap;
        max-width: 62%;
    }

    .indicator-pill {
        font-size: 0.5rem;
        padding: 2px 5px;
    }

    .screen-brand span {
        font-size: 0.52rem;
        letter-spacing: 0.12em;
    }

    .screen-topline,
    .screen-bottom,
    .screen-row {
        gap: 8px;
        font-size: 0.68rem;
    }

    .screen-main {
        padding: 10px 0 10px;
    }

    .hold-banner {
        margin-bottom: 6px;
        font-size: 0.62rem;
        padding: 2px 7px;
    }

    .screen-line-strong {
        font-size: 1rem;
    }

    .screen-frequency {
        font-size: 2rem;
        letter-spacing: 0.04em;
    }

    .screen-data-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 10px;
        padding-top: 8px;
    }

    .screen-data-item strong {
        font-size: 0.92rem;
    }

    .console-strip {
        margin-top: 0;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .strip-label,
    .strip-value {
        font-size: 0.72rem;
    }

    .history-panel {
        margin-top: 10px;
        padding: 10px;
    }

    .telemetry-rack {
        margin-top: 10px;
        padding: 10px;
    }

    .rack-header {
        margin-bottom: 8px;
        font-size: 0.72rem;
    }

    .rack-grid {
        gap: 8px;
    }

    .rack-slot {
        padding: 8px 10px;
    }

    .history-header {
        margin-bottom: 8px;
        font-size: 0.72rem;
    }

    .history-list {
        max-height: 130px;
    }

    .history-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .history-time {
        font-size: 0.72rem;
    }

    .history-title,
    .history-sub {
        font-size: 0.78rem;
    }

    audio {
        margin-top: 12px;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 12px;
    }

    .stat-card {
        padding: 12px 14px;
        border-radius: 14px;
    }

    .stat-label {
        margin-bottom: 6px;
        font-size: 0.74rem;
    }

    .stat-card strong {
        font-size: 1.2rem;
    }
}

@media (max-width: 420px) {
    .page-shell {
        padding: 8px;
    }

    .hero-card {
        padding: 12px;
    }

    .hero-copy {
        padding-bottom: 4px;
    }

    .eyebrow {
        margin-bottom: 6px;
    }

    .badge {
        margin-bottom: 10px;
    }

    h1 {
        font-size: 1.9rem;
        max-width: none;
    }

    .screen-frequency {
        font-size: 1.7rem;
    }

    .console-meta {
        grid-template-columns: 1fr;
    }

    .meta-pill {
        text-align: left;
    }

    .screen-data-grid {
        grid-template-columns: 1fr;
    }

    .console-strip {
        align-items: flex-start;
    }

    .screen-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

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