/* BACHICO『Drowned in my blue』プレーヤー
   霧のライト：ジャケットの霧の白に深い紺。1カラム、最大480px。ライト固定（docs/design.md） */
:root {
  --mist: #e8e1e1;
  --mist-deep: #ded9da;
  --glow: #f3edec;
  --ink: #08273b;
  --slate: #1a3e52;
  --ink-faint: rgba(8, 39, 59, .35);
  --ink-line: rgba(8, 39, 59, .12);
  --latin: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --jp: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --dur: 240ms;
  --dur-sheet: 320ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; --dur-sheet: 0ms; } }

html, body { margin: 0; background: var(--mist); color: var(--ink); }
[hidden] { display: none !important; }
body { font-family: var(--jp); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
svg { display: block; }
.num { font-family: var(--latin); font-variant-numeric: tabular-nums; }
.latin { font-family: var(--latin); }

.wrap { max-width: 480px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* ① アルバム画面 */
.album { padding-block: 24px 140px; display: grid; gap: 28px; }
.jacket { width: 100%; height: auto; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; display: block; }
.head { display: grid; gap: 14px; }
.head h1 { margin: 0; font-family: var(--latin); font-weight: 500; font-size: 28px; line-height: 1.2; letter-spacing: .04em; text-wrap: balance; }
.byline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.artist { font-family: var(--latin); font-size: 15px; font-weight: 500; letter-spacing: .24em; }
.meta { font-size: 12px; color: var(--slate); letter-spacing: .08em; }
.play-main { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 999px; background: var(--ink); color: var(--mist); font-size: 16px; letter-spacing: .12em; transition: transform var(--dur) var(--ease), opacity var(--dur); }
.play-main:active { transform: scale(.98); }
.play-main svg { width: 18px; height: 18px; }

.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink-line); }
.tracks li { border-bottom: 1px solid var(--ink-line); }
.track { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 60px; text-align: left; padding-block: 8px; }
.track .no { font-size: 13px; color: var(--slate); }
.track .ttl { font-size: 17px; min-width: 0; }
.track .ttl.latin { letter-spacing: .03em; }
.track .len { font-size: 13px; color: var(--slate); }
.track[aria-current="true"] .ttl { font-weight: 500; }
.track[aria-current="true"] .no { color: var(--ink); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 2px; background: var(--ink); height: 4px; animation: eq 900ms ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -300ms; } .eq i:nth-child(3) { animation-delay: -600ms; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 50% { height: 12px; } }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 8px; } }

.foot { display: grid; gap: 16px; justify-items: center; padding-top: 8px; }
.hint { font-size: 13px; color: var(--slate); text-decoration: underline; text-underline-offset: 4px; min-height: 44px; }
.copy { font-size: 11px; color: var(--slate); letter-spacing: .1em; }

/* ② ミニプレーヤー */
.mini { position: fixed; left: 0; right: 0; bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding-top: 10px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); background: var(--glow); border-top: 1px solid var(--ink-line); transform: translateY(110%); transition: transform var(--dur-sheet) var(--ease); z-index: 5; }
.mini.show { transform: none; }
.mini-in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: 44px 1fr 44px; gap: 12px; align-items: center; }
.mini-in img { width: 44px; height: 44px; border-radius: 2px; }
.mini-open { text-align: left; min-width: 0; min-height: 44px; display: grid; align-content: center; }
.mini-open .t { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-open .s { font-size: 12px; color: var(--slate); }
.mini .bar { position: absolute; left: 0; top: -1px; height: 2px; background: var(--ink); width: 0; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; }
.icon-btn svg { width: 24px; height: 24px; }
.mini.error .s { color: var(--ink); }

/* ③ フルプレーヤー */
.player { position: fixed; inset: 0; background: var(--glow); z-index: 10; transform: translateY(100%); transition: transform var(--dur-sheet) var(--ease); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.player.show { transform: none; }
.player .wrap { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; flex: 1; min-height: 0; padding-block: 8px 20px; gap: 16px; }
.p-top { display: flex; align-items: center; justify-content: space-between; }
.p-top .lbl { font-family: var(--latin); font-size: 12px; letter-spacing: .2em; color: var(--slate); }
.stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
.stage .jacket { max-height: 100%; width: auto; max-width: 100%; }
.lyrics { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; mask-image: linear-gradient(transparent, #000 12%, #000 85%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 85%, transparent); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.lyrics::-webkit-scrollbar { display: none; }
.lyrics-mode .lyrics { opacity: 1; pointer-events: auto; }
.lyrics-mode .stage .jacket { opacity: 0; }
.stage .jacket { transition: opacity var(--dur) var(--ease); }
.lyrics ol { list-style: none; margin: 0; padding: 30vh 0 40vh; }
.lyrics li.gap { height: 1.2em; }
.line { display: block; width: 100%; text-align: left; font-size: 20px; line-height: 1.9; margin-left: -8px; padding: 0 8px; border-radius: 8px; color: var(--ink-faint); transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); touch-action: manipulation; }
.line.now { color: var(--ink); }
.line.tapped { background: var(--mist-deep); color: var(--ink); }
@media (hover: hover) { .line:hover { color: var(--slate); } }
.lyrics.unsynced .line { color: var(--ink); }
.lyrics .lcred { margin-top: 32px; font-size: 12px; color: var(--slate); line-height: 1.8; cursor: default; }
.resync { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: var(--ink); color: var(--mist); font-size: 13px; border-radius: 999px; padding: 0 16px; min-height: 36px; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
.resync.show { opacity: 1; pointer-events: auto; }

.p-info { display: grid; gap: 2px; }
.p-info .t { font-size: 22px; font-weight: 500; }
.p-info .s { font-size: 13px; color: var(--slate); letter-spacing: .06em; }
.seek { display: grid; gap: 6px; }
.seek input { width: 100%; margin: 0; height: 28px; background: transparent; -webkit-appearance: none; appearance: none; }
.seek input::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(var(--ink), var(--ink)) 0 / var(--p, 0%) 100% no-repeat, var(--mist-deep); }
.seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); margin-top: -5.5px; }
.seek input::-moz-range-track { height: 3px; background: var(--mist-deep); }
.seek input::-moz-range-progress { height: 3px; background: var(--ink); }
.seek input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--slate); }
.controls { display: grid; grid-template-columns: 44px 1fr 56px 64px 56px 1fr 44px; align-items: center; justify-items: center; }
.controls .big { width: 64px; height: 64px; border-radius: 999px; background: var(--ink); color: var(--glow); display: grid; place-items: center; }
.controls .big svg { width: 26px; height: 26px; }
.controls .icon-btn svg { width: 28px; height: 28px; }
.controls .side svg { width: 22px; height: 22px; }
.side { position: relative; color: var(--ink-faint); }
.side.on { color: var(--ink); }
.lyr { color: var(--ink); }
.lyr.on { background: var(--ink); color: var(--glow); }
.lyr.on .bubble { fill: var(--glow); stroke: var(--glow); }
.lyr.on .quote { fill: var(--ink); }
.side .one { position: absolute; top: 6px; right: 4px; font-family: var(--latin); font-size: 10px; font-weight: 600; }
.spin { width: 22px; height: 22px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border: 0; } .spin::after { content: "…"; } }

/* シート（ダミーページ・ホーム画面に追加） */
.scrim { position: fixed; inset: 0; background: rgba(8, 39, 59, .25); z-index: 20; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--glow); border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform var(--dur-sheet) var(--ease); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet.show { transform: none; }
.sheet .wrap { display: grid; gap: 16px; padding-block: 28px 0; }
.sheet h2 { margin: 0; font-size: 18px; font-weight: 500; }
.sheet p, .sheet ol { margin: 0; font-size: 14px; color: var(--slate); line-height: 1.8; }
.sheet ol { padding-left: 1.4em; }
.sheet .ok { min-height: 48px; border-radius: 999px; border: 1px solid var(--ink); font-size: 15px; }
.check { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; }
.check svg { width: 22px; height: 22px; }

/* ⑥ 存在しないURL */
.void { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.void div { display: grid; gap: 20px; justify-items: center; }
.void img { height: 40px; width: auto; opacity: .85; }
.void p { margin: 0; font-size: 14px; color: var(--slate); letter-spacing: .06em; }
</style>

/* 歌詞：時刻のない行は読むだけ（タップしても何もしない） */
.line.plain { cursor: default; }
.lyrics .empty { font-size: 14px; color: var(--slate); }
