@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');


:root {
    --body-bg: #17191d;
    --receiver: #303238;
    --receiver-light: #45474e;
    --receiver-dark: #22242a;
    --line: #111216;
    --display: #07191b;
    --cyan: #42f4e6;
    --cyan-dim: #1caaa6;
    --button: #3c3e45;
}


* {
    box-sizing: border-box;
}


/* ==================================================
   GRUNDLAYOUT
   ================================================== */

body {
    min-height: 100vh;
    margin: 0;
    padding: 28px 16px;

    display: grid;
    place-items: center;

    background: radial-gradient(
        circle at top,
        #383b42 0,
        var(--body-bg) 55%
    );

    color: #e8e9eb;
    font-family: Arial, sans-serif;
}


.receiver {
    width: min(760px, 100%);
    padding: 25px;

    border: 2px solid #565960;
    border-radius: 8px;

    background: linear-gradient(
        145deg,
        var(--receiver-light),
        var(--receiver-dark)
    );

    box-shadow:
        0 18px 55px #000b,
        inset 0 1px #ffffff20;
}


.receiver-header,
.display-topline,
.display-bottomline,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ==================================================
   HEADER
   ================================================== */

.brand {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .18em;
}


.brand span {
    color: var(--cyan);
}


.model,
.power-indicator,
.section-heading p,
.hint {
    color: #aeb1b8;
    font-size: .7rem;
    letter-spacing: .13em;
}


.model {
    margin: 6px 0 0;
}


.power-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}


.power-indicator span {
    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: #e20074;
    box-shadow: 0 0 9px #e20074;
}


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

.display-panel {
    margin: 26px 0 20px;
    padding: 16px 20px;

    border: 5px solid #1b1c20;
    border-radius: 3px;

    background: var(--display);
    color: var(--cyan);

    font-family: 'Share Tech Mono', 'Courier New', monospace;
    text-shadow: 0 0 7px var(--cyan);

    box-shadow:
        inset 0 0 22px #000,
        0 1px #777;

    transition: filter .2s ease;
}


.display-panel.light-on {
    filter: brightness(1.5);
}


.display-topline,
.display-bottomline {
    color: var(--cyan-dim);
    font-size: .8rem;
    letter-spacing: .1em;
}


.display-bottomline {
    font-size: .7rem;
}


.station-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 30px;

    width: 100%;
}


.display-station {
    min-height: 58px;
    padding: 10px 0;

    overflow: hidden;

    font-size: clamp(1.6rem, 5vw, 2.5rem);
    white-space: nowrap;
    text-overflow: ellipsis;
}


#display-station {
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


#display-frequency {
    flex-shrink: 0;

    white-space: nowrap;
    text-align: right;
}


/* ==================================================
   BUTTONS: GEMEINSAME BASIS
   ================================================== */

.control-button,
.preset-button {
    color: #f2f2f2;

    border: 1px solid #15161a;
    background: linear-gradient(#555860, #2a2c31);

    box-shadow:
        inset 0 1px #ffffff20,
        0 2px 3px #0008;

    cursor: pointer;
}


.control-button {
    min-width: 54px;
    height: 40px;

    border-radius: 4px;
    font-weight: bold;
}


.control-button:hover,
.preset-button:hover {
    border-color: var(--cyan-dim);
    color: var(--cyan);
}


.control-button.play {
    color: var(--cyan);
    font-size: 1.2rem;
}


/* ==================================================
   TRANSPORTSTEUERUNG
   ================================================== */

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;

    padding-bottom: 22px;
    border-bottom: 1px solid #1115;
}


.controls > .control-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    flex-shrink: 0;
}


.transport-icon {
    display: block;

    width: 24px;
    height: 24px;

    fill: currentColor;
    pointer-events: none;
}


/* ==================================================
   VOLUME + LIGHT
   ================================================== */

.volume-light-group {
    display: flex;
    align-items: center;
    gap: 16px;

    margin-left: auto;
    min-width: 0;
}


.volume-control {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-left: auto;

    color: #bbb;
    font-size: .7rem;
    letter-spacing: .12em;
}


.volume-light-group .volume-control {
    width: auto;
    margin: 0;
    min-width: 0;
}


.volume-light-group .volume-control input {
    width: 110px;
    min-width: 0;
    margin: 0;
}


.light-control {
    display: flex;
    align-items: center;
    gap: 5px;

    flex-shrink: 0;
}


.light-label {
    color: #aeb1b8;
    font-size: .7rem;
    letter-spacing: .13em;
}


/* Kleiner runder Light-Button */

.light-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
    padding: 0;

    border: 1px solid #15161a;
    border-radius: 50%;

    background: linear-gradient(#555860, #2a2c31);

    box-shadow:
        inset 0 1px #ffffff20,
        0 2px 3px #0008;

    cursor: pointer;
    flex-shrink: 0;
}


.light-dot {
    display: block;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #536260;
    box-shadow: inset 0 1px 2px #0008;

    pointer-events: none;
}


.light-button:hover {
    border-color: var(--cyan-dim);
}


.light-button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}


.light-button[aria-pressed="true"] .light-dot {
    background: var(--cyan);
    box-shadow: 0 0 9px var(--cyan);
}


/* ==================================================
   PRESET MEMORY
   ================================================== */

.preset-section {
    padding-top: 20px;
}


.section-heading {
    align-items: baseline;
    gap: 15px;
}


.section-heading h1 {
    margin: 0;
    font-size: .85rem;
    letter-spacing: .18em;
}


.section-heading p {
    margin: 0;
    letter-spacing: 0;
}


.preset-bank-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;

    margin-top: 15px;
}


.preset-bank-button {
    min-height: 36px;
    padding: 0 12px;

    font-size: .7rem;
    letter-spacing: .04em;
}


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

    margin-top: 15px;
}


.preset-button {
    min-height: 54px;

    border-radius: 4px;

    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
}


.preset-button.is-active {
    color: var(--cyan);
    border-color: var(--cyan-dim);

    box-shadow:
        0 0 10px #42f4e622,
        inset 0 1px #ffffff20;
}


.preset-button.has-stream::after {
    content: ' •';
    color: var(--cyan);
}


.hint {
    margin: 20px 0 0;

    font-size: .65rem;
    letter-spacing: .04em;
}


/* ==================================================
   PRESET-DIALOG
   ================================================== */

.preset-dialog {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, .65);

    z-index: 1000;
}


.preset-dialog.hidden {
    display: none;
}


.preset-dialog-box {
    width: 420px;
    max-width: calc(100vw - 40px);

    padding: 24px;

    background: #171b1d;
    border: 1px solid #555;

    box-shadow: 0 20px 50px rgba(0, 0, 0, .7);
}


.preset-dialog-title {
    margin-bottom: 24px;

    font-weight: bold;
    letter-spacing: 2px;
}


.preset-dialog-box label {
    display: block;

    margin-top: 16px;
    margin-bottom: 6px;

    font-size: 12px;
    letter-spacing: 1px;
}


.preset-dialog-box input {
    box-sizing: border-box;

    width: 100%;
    padding: 10px;

    background: #080c0d;
    border: 1px solid #444;

    color: #9ffff6;
    font-family: inherit;
}


.frequency-input {
    display: flex;
    align-items: center;
    gap: 10px;
}


.frequency-input span {
    color: #9ffff6;
}


.reception-input {
    display: flex;
    align-items: center;
    gap: 10px;
}


.reception-input select {
    width: 110px;
    padding: 10px;

    background: #080c0d;
    border: 1px solid #444;

    color: #9ffff6;
    font-family: inherit;
}


.reception-input input {
    flex: 1;
}


.preset-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 24px;
}


.preset-dialog-buttons button {
    padding: 8px 16px;
    cursor: pointer;
}


/* ==================================================
   KLEINE BILDSCHIRME
   ================================================== */

@media (max-width: 560px) {
    .receiver {
        padding: 17px;
    }

    .receiver-header {
        align-items: flex-start;
        gap: 15px;
    }

    .brand {
        font-size: 1.45rem;
    }

    .section-heading {
        display: block;
    }

    .section-heading p {
        margin-top: 7px;
    }

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

    .volume-control {
        width: 100%;
        margin: 5px 0 0;
    }

    .volume-control input {
        flex: 1;
    }

    .volume-light-group {
        width: 100%;
        margin: 5px 0 0;
        gap: 12px;
    }

    .volume-light-group .volume-control {
        flex: 1;
        width: auto;
        margin: 0;
    }

    .volume-light-group .volume-control input {
        flex: 1;
        width: 0;
        min-width: 0;
    }
}

/* ==================================================
   PRESET EDIT MODE
   ================================================== */

/* Edit-Schalter mit LED links neben der Beschriftung */

.edit-presets-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.edit-presets-led {
    display: block;
    flex-shrink: 0;

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: #50283c;

    box-shadow: inset 0 1px 2px #0008;

    pointer-events: none;
}

/* Gleiche rosane Leuchtfarbe wie die Power-LED */

.edit-presets-button[aria-pressed="true"] .edit-presets-led {
    background: #e20074;
    box-shadow: 0 0 9px #e20074;
}

/* Im Edit-Modus bekommen auch leere Presets einen Punkt */

.preset-grid.is-editing .preset-button::after {
    content: ' •';
    color: var(--cyan);

    animation: preset-edit-blink 1s steps(1, end) infinite;
}

/* Eine halbe Sekunde an, eine halbe Sekunde aus */

@keyframes preset-edit-blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}