@font-face {
  font-family: 'Broadway';
  src: url('fonts/Broadway-Regular.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --line: #2e2e2e;
  --t1: #e8e8e8;
  --t2: #a8a8a8;
  --t3: #8a8a8a;
  --acc: #5b7fa6;
  --acc-hi: #9db9d8;
  --serif: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Hiragino Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
  --pad: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--t1); overflow: hidden; }
body {
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none;
  overscroll-behavior: none; touch-action: none;
}
[hidden] { display: none !important; }

#tree { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: calc(var(--pad) + env(safe-area-inset-top)) var(--pad) 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand h1 {
  margin: 0; font: 400 clamp(19px, 2.3vw, 27px)/1 'Broadway', var(--serif);
  display: flex; gap: .62em; letter-spacing: .01em; color: var(--t1);
}
.brand p { margin: 9px 0 0; font: 400 clamp(14px, 1.5vw, 17px)/1 var(--serif); color: #c8c8c8; letter-spacing: .02em; }
nav { display: flex; gap: 4px; }
button {
  font: inherit; color: var(--t2); background: none; border: 0; cursor: pointer;
  min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px;
}
nav button, .ctrl .txt { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
button:hover { color: var(--t1); }
button:focus-visible, a:focus-visible { outline: 1px solid var(--acc-hi); outline-offset: 2px; }

.hint {
  position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 2; margin: 0;
  text-align: center; font: 400 clamp(16px, 2vw, 19px)/1.55 var(--serif); color: var(--t1);
  pointer-events: none; transition: opacity .6s;
}
.hint span { color: var(--t2); }
.hint.gone { opacity: 0; }

.tip {
  position: fixed; z-index: 4; pointer-events: none; transform: translate(-50%, calc(-100% - 18px));
  background: rgba(13, 13, 13, .92); border: 1px solid var(--line); border-radius: 3px;
  padding: 8px 12px 9px; white-space: nowrap; text-align: center;
  font: 400 15px/1.25 var(--serif); color: var(--t1);
}
.tip small { display: block; margin-top: 4px; font: 400 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--t2); }

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0 var(--pad) calc(34px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(13,13,13,.96) 62%, rgba(13,13,13,0));
}
#tape {
  display: block; width: 100%; height: 58px; margin-bottom: 14px; cursor: ew-resize;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.row { display: flex; align-items: center; gap: 14px; max-width: 980px; margin: 0 auto; }
#cover { width: 56px; height: 56px; object-fit: cover; background: var(--card); flex: none; }
.meta { min-width: 0; flex: 1; }
.title { margin: 0; font: 400 clamp(17px, 2.1vw, 22px)/1.2 var(--serif); color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 6px 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub a { color: var(--t2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #4a4a4a; }
.sub a:hover { color: var(--t1); }
.ctrl { display: flex; align-items: center; flex: none; }
.ctrl svg { width: 22px; height: 22px; display: block; margin: auto; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
#play { color: var(--t1); }
#play svg { width: 28px; height: 28px; }
.player.loading #play { animation: wait 1s ease-in-out infinite alternate; }
@keyframes wait { from { opacity: 1; } to { opacity: .35; } }

.panel {
  position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: min(400px, 100%);
  background: rgba(16, 16, 16, .97); border-left: 1px solid var(--line);
  padding: calc(var(--pad) + env(safe-area-inset-top)) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain;
}
.panel h2 { margin: 6px 44px 22px 0; font: 400 21px/1.25 var(--serif); color: var(--t1); }
.panel p { margin: 0 0 15px; font: 400 15.5px/1.6 var(--serif); color: var(--t2); }
.panel p b { font-weight: 400; color: var(--t1); }
.panel p.small { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font: 400 13px/1.6 var(--sans); color: var(--t3); }
.panel .close { position: absolute; top: calc(var(--pad) - 6px + env(safe-area-inset-top)); right: calc(var(--pad) - 10px); font-size: 26px; line-height: 1; color: var(--t2); }
#list { list-style: none; margin: 0; padding: 0; }
#list .year { margin: 22px 0 6px; font-size: 11px; letter-spacing: .2em; color: var(--t3); }
#list .year:first-child { margin-top: 0; }
#list button {
  display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; border-radius: 0;
  padding: 0; min-height: 44px; font: 400 16px/1.3 var(--serif); color: var(--t1); border-bottom: 1px solid #1f1f1f;
}
#list button i { font: 400 11px/1 var(--sans); font-style: normal; color: var(--t3); width: 22px; flex: none; text-align: right; }
#list button:hover, #list button.on { color: #fff; }
#list button.on { border-bottom-color: var(--acc); }
#list button.on i { color: var(--acc-hi); }

.legal {
  position: fixed; z-index: 3; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom));
  text-align: center; font-size: 11px; letter-spacing: .06em; color: var(--t3); pointer-events: none;
}
.legal a { color: var(--t3); text-decoration: none; pointer-events: auto; padding: 6px 2px; }
.legal a:hover { color: var(--t1); }

@media (max-width: 640px) {
  nav button { padding: 0 7px; font-size: 10.5px; letter-spacing: .1em; white-space: nowrap; }
  .brand h1 { font-size: 18px; }
  .sub { font-size: 10.5px; letter-spacing: .07em; }
  .row { gap: 10px; flex-wrap: wrap; }
  #cover { width: 44px; height: 44px; }
  .meta { flex: 1 1 60%; }
  .ctrl { flex: 1 1 100%; justify-content: center; margin-top: 2px; }
  #tape { height: 48px; margin-bottom: 10px; }
  .panel { border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .hint { transition: none; } }
