@font-face {
    font-family: "Noto Sans JP";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("NotoSansJP-119.woff2") format("woff2");
}


@font-face {
    font-family: "PT Mono";
    src: url("PTMono-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "GermaniaOne";
    src: url("GermaniaOne-Regular.ttf") format("truetype");
    font-style: normal;
}

@font-face {
    font-family: "Chicago_12";
    src: url("Chicago_12.woff2") format("woff2");
}

*:focus-visible {
    outline: 1px dashed #7e7e7e;
    outline-offset: 2px;
    border-radius: 0;
}

:root {
    --inside-bg-color: #e2e5e2;
}

html {
    background-color: transparent;
}

body {
    font-family: "PT Mono", "Noto Sans JP", monospace;
    font-size: 12px;
    color: #2b2b2b;
    background-color: transparent;
    max-width: 54em;
    width: 100%;
    margin: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0);
}

body::-webkit-scrollbar-thumb {
    background-color: #333;
    border: 2px solid var(--inside-bg-color);
}

#box {
    background: black;
    box-shadow: none !important;
    border: 3px solid #000;
    border-top: 5px outset #3d3d3d;
    padding: 2em;
    margin: 2em;
    overflow: hidden;
    overflow-wrap: break-word;
    vertical-align: middle;
    padding-top: 26px;
}

.sc,
sc,
small-cap {
    font-variant: all-small-caps;
    font-weight: bold;
    font-size: 120%;
}

#sphereCanvas {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    z-index: -1;
    /* ^TODO HOW is this not in main css */
}

a {
    text-decoration: none;
    color: inherit;
    box-shadow: none;
}

a:hover {
    background: none;
}

button {
    color: #d4d4d4;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
    padding: 0;
}

button {
    background-color: #090909 !important;
    border-radius: 0;
    /* TODO bring to main^ */

    border: 2px outset #3a3a3a;
    border-bottom-color: #111;
    border-right-color: #111;

    transition-timing-function: cubic-bezier(0, 1.68, 0.08, 0.57);
    transition-duration: 300ms;
}

button:hover {
    filter: brightness(1.2);
    transition-timing-function: ease-in-out;
    transition-duration: 300ms;
}

button:active,
button.key-active {
    transform: translateY(1px) !important;
    border-style: outset !important;
}


/* ── title bar ── */
.b {
    margin: -17px -15px 0;
    padding: 2px 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.b::before {
    content: '';
    position: absolute;
    inset: 0.5rem .3rem;
    background: repeating-linear-gradient(to bottom,
            #fff 0px, #fff 1px,
            #000 1px, #000 6px);
}

.b h1 {
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    background: #000;
    color: #fff;
    font-family: "GermaniaOne", Chicago_12;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    margin: 0;
    padding: 0 21px;
    text-align: center;
    position: relative;
}

.b h1::before {
    display: none;
}

/* ── player ── */
#player-wrap {
    display: flex;
    position: relative;
    overflow: hidden;
    border-top: solid #0d0d0d 11px;
    border-left: 8px black solid;
    border-right: 11px black solid;
    border-bottom: inset 8px #3b3b3b;

    margin: 0 -2em;
    /* TODO why? pain */
    padding: 32px 18px 0;
    background:
        /* top shadow — smooth */
        linear-gradient(to bottom, rgba(0, 0, 0, .35) 0%, transparent 40%),
        /* top highlight — stepped */
        radial-gradient(ellipse 140% 90% at 50% -20%, rgba(255, 255, 255, .25) 0%, rgba(255, 255, 255, .25) 15%, transparent 28%),
        radial-gradient(ellipse 140% 90% at 50% -20%, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .12) 28%, transparent 42%),
        radial-gradient(ellipse 140% 90% at 50% -20%, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .05) 42%, transparent 55%),
        /* corner shadows — stepped */
        radial-gradient(ellipse 130% 60% at 0% 0%, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .18) 10%, transparent 28%),
        radial-gradient(ellipse 130% 60% at 0% 0%, rgba(0, 0, 0, .09) 0%, rgba(0, 0, 0, .09) 32%, transparent 45%),
        radial-gradient(ellipse 130% 60% at 0% 0%, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .04) 52%, transparent 62%),
        radial-gradient(ellipse 130% 60% at 100% 0%, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .18) 10%, transparent 28%),
        radial-gradient(ellipse 130% 60% at 100% 0%, rgba(0, 0, 0, .09) 0%, rgba(0, 0, 0, .09) 32%, transparent 45%),
        radial-gradient(ellipse 130% 60% at 100% 0%, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .04) 52%, transparent 62%),
        /* horizontal rule at ~2/3 — sharp top, fades down */
        linear-gradient(to bottom, transparent 74%, rgba(255, 255, 255, .45) 65%, transparent 90%),
        #d8d8d8;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, .2), inset 0 -4px 8px rgba(0, 0, 0, .2);
    outline: 1px solid black;
    background-clip: padding-box;
    /* fixes white bleed/gap between border and edge on mobile */
}

#player {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

#stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    height: 190px;
    margin-left: 20px;
}

#cover-container {
    position: relative;
    transition: transform 0.15s ease-out;
    transform-origin: 80px 80px;
}

#cover {
    display: block;
    width: 160px;
    height: 160px;
    object-fit: cover;
    background: #555;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
}

#reflection {
    position: absolute;
    top: 159px;
    left: -40px;
    height: 50px;
    display: flex;
    pointer-events: none;
    filter: blur(1px);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

#reflection-inner {
    display: flex;
    transition: transform 0.15s ease-out;
}

#reflection img {
    display: none;
}

#reflection-canvas,
#reflection-canvas-l,
#reflection-canvas-r {
    display: block;
    height: 50px;
}

#reflection-canvas {
    width: 160px;
}

#reflection-canvas-l {
    width: 40px;
}

#reflection-canvas-r {
    width: 40px;
}

/* track info */
#meta {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    justify-content: flex-end;
    min-width: 0;
    padding-bottom: 62px;
    /* align to bottom of cover art, not reflection */
    pointer-events: none;
}

#track-title {
    /* font-weight: bold; */
    font-size: 1.1em;
}

#track-artist {
    opacity: .8;
}

#track-album {
    opacity: .6;
    font-style: italic;
    font-size: .9em;
}

#track-info {
    opacity: .5;
    font-size: .85em;
    white-space: nowrap;
    margin-right: 1.5ch;
}

#lag {
    opacity: .5;
    font-size: .85em;
}


/* ── bottom bar ── */
#bottombar {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 -2em -2em;
    padding: 6px 3px 6px;

    background: #000;
    color: #fff;
    position: relative;
    border-bottom-style: inset;
    border-bottom-color: #474747;
}

#bottombar-left {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-right: auto;
}

#bottombar>a {
    color: #fff;
    box-shadow: none;
}

#bottombar a button,
#lag {
    margin: 0;
    padding: 0 .8ch;
    height: 32px;
    width: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    align-content: normal;
    font-weight: bold;
    overflow: hidden;
}

#lag {
    min-width: 6em;
    width: auto;
    height: 32px;
}

#bottombar>a:hover,
#bottombar-left a:hover {
    background: none;
    /* opacity: .7; */
}

/* controls row */
#controls {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}

#controls button {
    margin: 0;
    padding: .4ch .8ch;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls button svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

#icon-vol line {
    stroke: #c0392b;
}

#vol {
    width: 140px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    align-items: center;
    justify-content: center;
    z-index: 999;
    cursor: pointer;
}

#lightbox.open {
    display: flex;
}

#lightbox img {
    max-width: 90vmin;
    max-height: 90vmin;
    min-width: 300px;
    min-height: 300px;
    object-fit: contain;
    box-shadow: 0 0 60px rgba(0, 0, 0, .9);
    width: unset;
}

#mp3-label {
    font-size: 10px;
    margin-top: 4px;
}

#home-label {
    font-size: 24px;
    margin-top: 5px;
}

#vol {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    --thumb: 15px;
    --track: 4px;
    --thumb-rot: 0deg;
    cursor: col-resize;
}

#vol::-webkit-slider-runnable-track {
    height: 6px;
    background: #212121;
    border-radius: 999px;
    /* box-shadow: inset 0 1px 2px rgba(0,0,0,0.6); */
    border: 1.5px outset #555;
    margin: 0 calc(var(--thumb) / 2);
}

#vol::-moz-range-track {
    height: 3px;
    background: #212121;
    border-radius: 999px;
    box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.8);
    border: 1.5px outset #555;
}

#vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: var(--thumb);
    height: var(--thumb);
    margin-top: calc((var(--track) - var(--thumb)) / 2);
    background: url('button-small.png') center/contain no-repeat;
    transform: rotate(var(--thumb-rot));
}

#vol::-moz-range-thumb {
    width: var(--thumb);
    height: var(--thumb);
    background: url('button-small.png') center/contain no-repeat;
    border: none;
    transform: rotate(var(--thumb-rot));
}

/* ── history ── */
#btn-history {
    position: absolute;
    right: 25px;
    top: 9px;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 1rem;
    padding: 2px 6px;
    line-height: 1;
}

#btn-history:active {}

/* #player-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0px;
    height: 100%;
    background: black;
    z-index: 20;
    pointer-events: none;
} */

#history-dropdown {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 220px;
    background: #111;
    border-left: 4px double #5c5c5c4f;
    /* border-right: 2px ridge #5c5c5c4f; */
    z-index: 19;
    /* overflow: hidden; */
    transform: translateX(100%);
    transition: transform 0.2s ease;

    /* border-top: inset 7px #3b3b3b;
    border-bottom: inset 2px #3b3b3b;
    border-left: double 16px #a7a7a7;
    border-right: double 16px #898989; */
}

#history-dropdown.open {
    transform: translateX(0);
}

#history-tab {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 36px;
    line-height: 36px;
    background: #1f1f1f;
    color: #8f8f8f;
    font-size: 0.6rem;
    cursor: pointer;
    text-align: center;
    border-radius: 6px 0 0 6px;
    z-index: 25;
    transition: right 0.2s ease;
}

#history-tab.open {
    right: 220px;
}

#history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    height: 100%;
    scrollbar-width: none;
}

#history-list::-webkit-scrollbar { display: none; }

#history-list li {
    padding: 5px 10px;
    /* border-bottom: 1px solid #1e1e1e; */
    font-size: 0.54rem;
    color: #ccc;
    display: flex;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
}

#history-list li.h-artist {
    padding: 6px 1.5ch 3px;
    color: #fff;
    font-weight: bold;
    background: #090909;
    border-top: 1.5px groove #18181880;
}
#history-list li.h-artist:first-of-type {
    border-top: none !important;
}

#history-list li.h-track {
    padding-left: 2.5ch;
    padding-right: 0;
    overflow-x: visible;
    background: #0d0d0d;
}

#history-list li.h-track .h-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}
#history-list li.h-track .h-scroll::-webkit-scrollbar { display: none; }

.h-play { cursor: pointer; }
.h-play:hover { color: #fff; }

.h-thumb {
    display: block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    image-rendering: pixelated;
    object-fit: cover;
    margin-right: 1ch;
}

#history-list li .h-time {
    color: #777;
    flex-shrink: 0;
}

