/* Language switcher + Japanese-supermarket jukebox (js/site-ui.js). */
.navbar .nav-tools {
    --jb-teal: #8debdc;
    --jb-pink: #f6a4ff;
    --jb-gold: #ffd166;
    --jb-red: #e63946;
    --jb-ink: #e4f4ef;
    position: relative;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    min-width: 0;
    color: var(--jb-ink);
}
@media (max-width: 1200px) {
    .navbar .nav-tools {
        grid-row: 1;
        grid-column: 2;
    }
}

/* ---- language switcher ---- */
.lang-switch {
    display: inline-flex;
    border: 1px solid #2f4a47;
    border-radius: 999px;
    background: #0b1214cc;
    overflow: hidden;
}
.lang-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    padding: 7px 10px;
    min-width: 34px;
    text-align: center;
    font: 600 11px/1 'Orbitron', 'DM Sans', sans-serif;
    letter-spacing: 1px;
    color: #9fc9c1;
    transition:
        color 0.2s,
        background 0.2s;
}
.lang-btn:hover {
    color: #fff;
}
.lang-btn.is-active {
    color: #06201c;
    background: linear-gradient(135deg, var(--jb-teal), #63d7df);
}
.lang-btn:focus-visible,
.jb-toggle:focus-visible,
.jb-mini:focus-visible,
.jb-btn:focus-visible,
.jb-track:focus-visible {
    outline: 2px solid var(--jb-pink);
    outline-offset: 2px;
}

/* ---- jukebox bar (always visible) ---- */
.jukebox {
    position: relative;
}
.jb-bar {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #2f4a47;
    border-radius: 999px;
    background: #0b1214cc;
    box-shadow: 0 0 16px #63d7df22;
}
.jb-toggle,
.jb-mini {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--jb-teal);
}
.jb-toggle {
    padding: 7px 8px 7px 14px;
    font: 500 12px/1 'Orbitron', monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 12px #63d7df55;
    white-space: nowrap;
}
.jb-toggle:hover {
    color: #fff;
}
.jb-mini {
    justify-content: center;
    width: 36px;
    border-radius: 0 999px 999px 0;
    border-left: 1px solid #2f4a47;
    background: #8debdc14;
    transition: background 0.2s;
}
.jb-mini:hover {
    background: #8debdc33;
}
.jb-mini svg,
.jb-btn svg {
    width: 16px;
    height: 16px;
}

/* ---- equalizer ---- */
.jb-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}
.jb-eq i {
    display: block;
    width: 3px;
    height: 30%;
    border-radius: 1px;
    background: linear-gradient(to top, var(--jb-teal), var(--jb-pink));
    transform-origin: bottom;
}
.jb-eq-big {
    height: 44px;
    gap: 3px;
}
.jb-eq-big i {
    width: 5px;
}
.jukebox.is-playing .jb-eq i {
    animation: jb-bounce 0.9s ease-in-out infinite;
}
.jb-eq i:nth-child(2) {
    animation-delay: -0.35s;
}
.jb-eq i:nth-child(3) {
    animation-delay: -0.6s;
}
.jb-eq i:nth-child(4) {
    animation-delay: -0.15s;
}
.jb-eq i:nth-child(5) {
    animation-delay: -0.5s;
}
.jb-eq i:nth-child(6) {
    animation-delay: -0.8s;
}
@keyframes jb-bounce {
    0%,
    100% {
        height: 25%;
    }
    50% {
        height: 100%;
    }
}

/* ---- panel ---- */
.jb-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1200;
    width: min(360px, 92vw);
    overflow: hidden;
    border: 1px solid #2f4a47;
    border-radius: 16px;
    background: linear-gradient(180deg, #111a1d 0%, #0a1012 100%);
    box-shadow:
        0 24px 60px #000a,
        0 0 36px #63d7df1f;
    text-align: left;
    font-family: 'DM Sans', system-ui, sans-serif;
}
.jb-panel[hidden] {
    display: none;
}
/* striped supermarket awning */
.jb-awning {
    height: 12px;
    background:
        radial-gradient(circle at 50% 100%, #0a1012 5px, transparent 5.5px) 0 0 / 20px 12px repeat-x,
        repeating-linear-gradient(90deg, var(--jb-red) 0 20px, #fff3e0 20px 40px);
}
.jb-head {
    padding: 14px 18px 6px;
}
.jb-title {
    margin: 0;
    font: 500 13px/1.35 'Orbitron', monospace;
    letter-spacing: 1.5px;
    color: var(--jb-teal);
    text-shadow:
        0 0 8px #43e8cf66,
        0 0 20px #43e8cf33;
}
.jb-tagline {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #b8d4cf;
    font-style: italic;
}
.jb-display {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 18px 6px;
    padding: 12px 14px;
    border: 1px solid #1f3532;
    border-radius: 10px;
    background:
        repeating-linear-gradient(0deg, #ffffff07 0 1px, transparent 1px 3px),
        #050a0b;
    box-shadow: inset 0 0 22px #43e8cf14;
}
.jb-now {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.jb-now-label {
    font: 500 10px/1 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--jb-gold);
}
.jb-now-title {
    font-size: 19px;
    line-height: 1.25;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jb-now-meta {
    font-size: 12px;
    color: #8fb8b1;
}
.jb-now-meta.is-error {
    color: #ff8b94;
}
.jb-seek-row,
.jb-volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
}
.jb-seek-row {
    margin-top: 10px;
}
.jb-time {
    min-width: 34px;
    font: 500 11px/1 'DM Sans', sans-serif;
    font-variant-numeric: tabular-nums;
    color: #8fb8b1;
}
.jb-duration {
    text-align: right;
}
.jb-seek,
.jb-volume {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 0;
    height: 16px;
    margin: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--jb-teal) var(--jb-fill, 60%), #25373a var(--jb-fill, 60%)) center / 100% 4px no-repeat;
    cursor: pointer;
}
.jb-seek::-webkit-slider-runnable-track,
.jb-volume::-webkit-slider-runnable-track {
    background: transparent;
    height: 16px;
}
.jb-seek::-moz-range-track,
.jb-volume::-moz-range-track {
    background: transparent;
}
.jb-seek:disabled {
    cursor: default;
    opacity: 0.55;
}
.jb-seek::-webkit-slider-thumb,
.jb-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    margin-top: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    box-shadow: 0 0 10px var(--jb-teal);
}
.jb-seek::-moz-range-thumb,
.jb-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    box-shadow: 0 0 10px var(--jb-teal);
}
.jb-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px 4px;
}
.jb-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #2f4a47;
    background: #0e1719;
    color: var(--jb-teal);
    transition:
        transform 0.15s,
        background 0.2s,
        color 0.2s;
}
.jb-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #16282a;
    color: #fff;
}
.jb-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.jb-btn-main {
    width: 52px;
    height: 52px;
    color: #06201c;
    border: 0;
    background: linear-gradient(135deg, var(--jb-teal), var(--jb-pink));
    box-shadow: 0 6px 20px #8debdc44;
}
.jb-btn-main:hover:not(:disabled) {
    color: #06201c;
    background: linear-gradient(135deg, #b4fff2, #ffc2ff);
}
.jb-btn-main svg {
    width: 22px;
    height: 22px;
}
.jb-volume-row {
    margin-top: 10px;
    color: #8fb8b1;
}
.jb-volume-row svg {
    flex: none;
    width: 18px;
    height: 18px;
}
.jb-list-title {
    margin: 16px 18px 6px;
    font: 500 10px/1 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #7fa39d;
}
.jb-list {
    list-style: none;
    margin: 0;
    padding: 0 10px 14px;
    max-height: 230px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.jb-track {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    transition: background 0.2s;
}
.jb-track:hover,
.jb-track.is-current {
    background: #8debdc14;
}
.jb-track-no {
    font: 500 12px/1 'Orbitron', monospace;
    color: var(--jb-gold);
}
.jb-track-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.jb-track-name {
    font-size: 15px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jb-track-store {
    font-size: 12px;
    color: #8fb8b1;
}
.jb-track-state {
    color: var(--jb-pink);
    font-size: 11px;
}

/* ---- small screens: panel hangs from the nav as a full-width sheet ---- */
@media (max-width: 760px) {
    .navbar .nav-tools {
        gap: 6px;
        justify-self: center;
    }
    .lang-btn {
        padding: 6px 8px;
        min-width: 28px;
    }
    .jb-toggle-label {
        display: none;
    }
    .jb-toggle {
        padding: 7px 8px 7px 12px;
    }
    .jb-panel {
        position: fixed;
        top: var(--jb-top, 96px);
        left: 8px;
        right: 8px;
        width: auto;
    }
}
/* the existing mobile layout hides the old "Digital Life" label; keep the tools visible */
@media (max-width: 900px) {
    .navbar .nav-tools {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jukebox.is-playing .jb-eq i {
        animation: none;
        height: 70%;
    }
    .jb-btn {
        transition: none;
    }
}
