/* Sound.Lab. サウンドカード — Figma「v2 引き算案」に合わせた実装
   配色・余白・書体は Figma の変数とテキストスタイルをそのまま使っている。 */

:root {
  --navy-900: #090940;
  --navy-800: #10105a;
  --blue: #217eff;
  --pink: #f285fe;
  --mint: #dcffe8;
  --text: #f6f5ff;
  --muted: #b9b8f0;
  --muted-dim: #7c7bc4;
  --on-light: #10105a;
  --hair: rgba(255, 255, 255, 0.18);
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--navy-900);
}
html.is-loading { overflow: hidden; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
  background: var(--navy-900);
  -webkit-font-smoothing: antialiased;
  line-break: strict;
}

[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
ol, ul { list-style: none; padding: 0; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.app {
  max-width: 480px;
  min-height: 100svh;
  margin-inline: auto;
  background: var(--navy-800);
  /* 画面下の固定バー（高さ64px）に、フッターが隠れないように */
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* ---------- 絵 / MV ---------- */
.stage__art,
.stage__mv { display: block; width: 100%; }
.stage__art { height: auto; aspect-ratio: 1086 / 1536; }
.stage__mv { aspect-ratio: 16 / 9; background: #000; }
.stage[data-mode="mv"] .stage__art { display: none; }

/* ---------- タイトル ---------- */
.title { padding: 24px 16px 0; }
.title__event { font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--muted); }
/* ロゴは、イベント名の行と下のタブの、ちょうど真ん中（上下とも24px）に置く */
.title__name { margin-top: 24px; line-height: 0; }
.title__name img { display: block; width: 210px; max-width: 100%; height: auto; }

/* ---------- プレイヤー ---------- */
.player { display: grid; gap: 16px; padding: 24px 16px 0; }

.player__top { display: flex; align-items: flex-end; justify-content: space-between; }

.tabs { display: flex; gap: 8px; margin-left: -8px; }
.tab {
  position: relative;
  padding: 12px 8px 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--muted);
}
.tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: transparent;
}
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { background: var(--pink); }
.tab:hover:not([aria-selected="true"]):not(:disabled) { color: var(--text); }
.tab:disabled { color: var(--muted-dim); cursor: not-allowed; }

.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pink);
  text-decoration: none;
}
.dl:hover { text-decoration: underline; text-underline-offset: 4px; }
.dl[hidden] { display: none; }

.now__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  word-break: auto-phrase;
  text-wrap: balance;
}
.now__by { margin-top: 4px; font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--muted); }

.seek__range {
  --p: 0%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.seek__range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(to right, var(--pink) var(--p), var(--hair) var(--p));
}
.seek__range::-moz-range-track { height: 2px; border-radius: 1px; background: var(--hair); }
.seek__range::-moz-range-progress { height: 2px; border-radius: 1px; background: var(--pink); }
.seek__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
}
.seek__range::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--text); }
.seek__range:focus-visible { outline-offset: 4px; }

.seek__time {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ctrl { display: flex; align-items: center; justify-content: center; gap: 32px; padding-top: 8px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: color 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { color: var(--mint); }
.icon-btn:active { transform: translateY(1px); }

.play {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--on-light);
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.play:hover { background: #fff; }
.play:active { transform: translateY(1px); }
.play:focus-visible { outline-color: var(--pink); outline-offset: 3px; }
.play__i--pause { display: none; }
.play[data-state="playing"] .play__i--play { display: none; }
.play[data-state="playing"] .play__i--pause { display: block; }

/* ---------- セクション共通 ---------- */
.sec { padding: 48px 16px 0; }
.sec[hidden] { display: none; }
.sec__label {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* 曲リスト */
.tracklist li { border-bottom: 1px solid var(--hair); }
.track {
  display: grid;
  grid-template-columns: 20px 1fr auto 36px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 0;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.track__no,
.track__mv,
.track__dur { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.track__dur { text-align: right; }
.track:hover .track__title { color: var(--mint); }
.track[aria-current="true"] .track__title,
.track[aria-current="true"] .track__no { color: var(--pink); }

/* 歌詞（コピー抑止：選択・長押しメニューを無効化。完全には防げない） */
.lyrics {
  max-width: 40em;
  padding-top: 16px;
  white-space: pre-wrap;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.note { margin-top: 16px; font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--muted); }

/* クレジット */
.credit {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
}
.credit dt { font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--muted); }
.credit dd a { text-underline-offset: 4px; }

/* リンク */
.links li { border-bottom: 1px solid var(--hair); }
.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 14px 0;
  text-decoration: none;
}
a.link:hover { color: var(--mint); }
.link svg { flex: none; color: var(--muted); }
.link--off { color: var(--muted-dim); }
.link__soon { font-size: 13px; font-weight: 500; }

/* フッター */
.foot { padding: 48px 16px; font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--muted); }
.foot p + p { margin-top: 4px; }

/* ---------- 画面下の固定バー（本体の再生ボタンが画面外にあるときだけ出る） ---------- */
.mini {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 0.18s ease, visibility 0s linear 0.18s;
}
.mini.is-shown {
  visibility: visible;
  transform: none;
  transition: transform 0.18s ease, visibility 0s;
}
.mini__in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  min-height: 64px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--navy-900);
  border-top: 1px solid var(--hair);
}
.mini__line { position: absolute; top: -1px; left: 0; width: 0; height: 2px; background: var(--pink); }
.mini__play {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--on-light);
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.mini__play:hover { background: #fff; }
.mini__play:active { transform: translateY(1px); }
.mini__play:focus-visible { outline-color: var(--pink); }
.mini__play .play__i--pause { display: none; }
.mini__play[data-state="playing"] .play__i--play { display: none; }
.mini__play[data-state="playing"] .play__i--pause { display: block; }
.mini__title {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.mini__title:hover { color: var(--mint); }

/* ---------- ローディング ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: var(--navy-800);
}
.loader__center {
  position: absolute;
  left: 50%;
  top: 42%;
  display: grid;
  justify-items: center;
  gap: 24px;
  width: min(300px, calc(100vw - 48px));
  transform: translate(-50%, -50%);
}
/* ロゴの脈拍の線がそのまま進捗バー：薄いロゴの上に、明るいロゴを左から見せていく */
.loader__logo { position: relative; width: 100%; }
.loader__logo img { display: block; width: 100%; height: auto; }
.loader__dim { opacity: 0.16; }
.loader__lit { position: absolute; inset: 0; clip-path: inset(0 100% 0 0); }
.loader__num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.loader__event {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(32px + env(safe-area-inset-bottom));
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}

.strip { position: absolute; left: 0; width: 100%; height: 25%; transform: translateX(-101%); }
.strip--1 { top: 0; background: var(--blue); }
.strip--2 { top: 25%; background: var(--pink); }
.strip--3 { top: 50%; background: var(--blue); }
.strip--4 { top: 75%; background: var(--pink); }

.loader.is-leaving .strip { animation: strip 0.75s both; }
.loader.is-leaving .strip--2 { animation-delay: 0.04s; }
.loader.is-leaving .strip--3 { animation-delay: 0.08s; }
.loader.is-leaving .strip--4 { animation-delay: 0.12s; }
/* 帯が全面を覆った瞬間に背景と文字を消し、帯が抜けるとページが現れる */
.loader.is-open { background: transparent; }
.loader.is-open > :not(.strip) { visibility: hidden; }

@keyframes strip {
  0%   { transform: translateX(-101%); animation-timing-function: cubic-bezier(0.7, 0, 0.2, 1); }
  45%  { transform: translateX(0); }
  55%  { transform: translateX(0); animation-timing-function: cubic-bezier(0.8, 0, 0.3, 1); }
  100% { transform: translateX(101%); }
}

@media (prefers-reduced-motion: reduce) {
  .loader.is-leaving { transition: opacity 0.25s ease; opacity: 0; }
  .loader.is-leaving .strip { animation: none; display: none; }
  .icon-btn, .play, .mini, .mini.is-shown, .mini__play { transition: none; }
}

@media print {
  .lyrics, .note { display: none; }
}
