/* =========================================================
   RETROBASS R-26
   Phase 8: Mechanik und haptische Details
   ========================================================= */

/* ---------------------------------------------------------
   Statusleuchte
   --------------------------------------------------------- */

.receiver-status-light {
    position: absolute;
    z-index: 8;

    top: clamp(5px, 0.7vw, 8px);
    right: clamp(8px, 1vw, 13px);

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

    width: 12px;
    height: 7px;

    border: 1px solid rgba(43, 28, 15, 0.76);
    border-radius: 4px;

    background:
        linear-gradient(
            180deg,
            rgba(37, 29, 22, 0.88),
            rgba(14, 11, 8, 0.94)
        );

    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.76),
        0 1px 1px rgba(255, 255, 255, 0.09);
}

.receiver-status-light span {
    display: block;

    width: 5px;
    height: 2px;

    border-radius: 2px;

    background: rgba(79, 55, 32, 0.38);

    transition:
        background 320ms ease,
        box-shadow 320ms ease,
        opacity 320ms ease;
}

.receiver.is-powered .receiver-status-light span {
    background: #d58b35;

    box-shadow:
        0 0 4px rgba(223, 142, 48, 0.78),
        0 0 9px rgba(223, 142, 48, 0.34);
}

.receiver.is-booting .receiver-status-light span {
    animation: status-light-boot 850ms ease-in-out infinite;
}

.receiver.is-ready .receiver-status-light span {
    background: #e39a43;

    opacity: 0.92;
}

/* ---------------------------------------------------------
   Physischer Tastendruck
   --------------------------------------------------------- */

.control-button {
    position: relative;

    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-button__knob {
    transition:
        transform 90ms ease,
        filter 140ms ease,
        box-shadow 140ms ease;
}

.control-button.is-pressed .control-button__knob,
.control-button:active .control-button__knob {
    transform: translateY(2px) scale(0.965);

    filter: brightness(0.94);

    box-shadow:
        inset 2px 3px 5px rgba(0, 0, 0, 0.48),
        inset -1px -1px 2px rgba(255, 255, 255, 0.18),
        0 1px 1px rgba(0, 0, 0, 0.24);
}

.control-button.is-pressed::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: -4px;

    width: 24px;
    height: 4px;

    border-radius: 50%;

    pointer-events: none;

    background: rgba(78, 43, 15, 0.22);

    filter: blur(2px);
    transform: translateX(-50%);
}

/* ---------------------------------------------------------
   sanfter Metallreflex
   --------------------------------------------------------- */

.receiver__controls-area::after {
    content: "";

    position: absolute;
    z-index: 1;

    top: 0;
    bottom: 0;
    left: -25%;

    width: 20%;

    pointer-events: none;

    opacity: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 244, 219, 0.14),
            transparent
        );

    transform: skewX(-17deg);
}

.receiver.has-control-reflection
.receiver__controls-area::after {
    animation: control-reflection 680ms ease;
}

/* ---------------------------------------------------------
   Lautstärkeregler
   --------------------------------------------------------- */

.volume-control__knob {
    touch-action: none;
    user-select: none;

    transition:
        transform 95ms linear,
        filter 150ms ease,
        box-shadow 150ms ease;
}

.volume-control__knob.is-dragging {
    filter: brightness(1.06);

    box-shadow:
        inset 2px 2px 3px rgba(255, 255, 255, 0.46),
        inset -4px -5px 8px rgba(0, 0, 0, 0.42),
        0 6px 10px rgba(0, 0, 0, 0.48),
        0 0 0 2px rgba(176, 104, 30, 0.17);
}

.volume-control__knob.is-dragging::after {
    content: "";

    position: absolute;
    z-index: 5;
    inset: -7px;

    border: 1px solid rgba(191, 115, 38, 0.20);
    border-radius: 50%;

    pointer-events: none;
}

/* feine Rändelung */

.volume-control__knob {
    background:
        repeating-conic-gradient(
            from 0deg,
            rgba(255, 255, 255, 0.12) 0deg 1deg,
            rgba(36, 29, 22, 0.08) 1deg 3deg
        ),
        conic-gradient(
            from 215deg,
            #6e6153,
            #d8c6ae,
            #8f7d68,
            #f0e1ca,
            #776656,
            #c8b59e,
            #6e6153
        );
}

/* ---------------------------------------------------------
   Displaymeldung bei Lautstärke
   --------------------------------------------------------- */

.radio-interface__volume {
    position: absolute;
    z-index: 9;

    top: 50%;
    left: 50%;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: 72%;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform: translate(-50%, -45%);
}

.radio-interface__volume.is-visible {
    visibility: visible;

    animation: volume-display 1150ms ease both;
}

.radio-interface__volume-label {
    color: rgba(229, 143, 51, 0.72);

    font-size: clamp(0.34rem, 0.58vw, 0.48rem);
    letter-spacing: 0.17em;
}

.radio-interface__volume-value {
    margin-top: 5px;

    color: #eba04c;

    font-size: clamp(0.75rem, 1.5vw, 1.12rem);
    font-weight: 500;
    letter-spacing: 0.10em;

    text-shadow:
        0 0 7px rgba(221, 126, 31, 0.34);
}

.radio-interface__volume-track {
    position: relative;

    width: 100%;
    height: 4px;
    margin-top: 8px;

    overflow: hidden;

    border: 1px solid rgba(205, 112, 24, 0.17);
    border-radius: 3px;

    background: rgba(29, 14, 5, 0.62);
}

.radio-interface__volume-fill {
    display: block;

    width: var(--volume-level, 46%);
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #9e4d0d,
            #e99b43
        );

    box-shadow:
        0 0 6px rgba(224, 128, 31, 0.32);

    transition: width 90ms linear;
}

/* ---------------------------------------------------------
   dezente Gerätebewegung
   --------------------------------------------------------- */

.receiver.is-switching-on .receiver__body {
    animation: receiver-power-touch 480ms ease;
}

/* ---------------------------------------------------------
   Animationen
   --------------------------------------------------------- */

@keyframes status-light-boot {
    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 1;
    }
}

@keyframes control-reflection {
    0% {
        left: -25%;
        opacity: 0;
    }

    18% {
        opacity: 0.72;
    }

    100% {
        left: 112%;
        opacity: 0;
    }
}

@keyframes receiver-power-touch {
    0%,
    100% {
        transform: translateY(0);
    }

    42% {
        transform: translateY(1px);
    }
}

@keyframes volume-display {
    0% {
        opacity: 0;
        transform: translate(-50%, -43%);
    }

    14%,
    72% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -53%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .receiver.is-booting .receiver-status-light span,
    .receiver.has-control-reflection .receiver__controls-area::after,
    .receiver.is-switching-on .receiver__body,
    .radio-interface__volume.is-visible {
        animation-duration: 1ms;
    }
}