/* 見た目: 漆黒と点灯＋押すキーの立体感（11-15 ユーザーが見本「B＋A」を選択。好みは「視覚的負荷が低い・
   触って気持ちいい・認知的負荷が低い・文字でなく見た目と動きで誘導」）。
   普段はほぼ黒一色で、どの欄かは左下の短い色の線だけ。鳴っているものだけが、その欄の色で光る。
   タイルは上の縁のわずかな光と下の影で「押せる板」に見せ、押すと物理キーのように下がる。
   意味の無い飾りは置かない。板は角丸。面の色は --face、縁は内側の線 --edge、立体感の影は --key */
:root {
  --bg: #000;
  --bg2: #000;
  --panel: #111114;
  --line: #1a1a1d;
  --line2: #2a2a30;
  --text: #d2d2d7;
  --muted: #6c6c72;
  --bgm: #4fd6ff;
  --scene: #ff5277;
  --se: #ffc23d;
  --stop: #c9c9ce;
  --ok: #59f0b4;
  /* 押すキーの立体感（上の縁の光・下の影）。押している間は浅くする */
  --key-up: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 0 #000, 0 3px 8px rgba(0, 0, 0, .7);
  --key-down: inset 0 1px 0 rgba(255, 255, 255, .03), 0 0 0 #000, 0 1px 2px rgba(0, 0, 0, .7);
  --ng: #ff5d5d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  padding: 0 16px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 角丸の板。ボタン類はすべてこの形 */
.startBtn, .chip, .dockBtn, .tile, .sub {
  position: relative; isolation: isolate; border: 0; color: var(--text);
  border-radius: var(--r, 10px);
  background: var(--face, var(--panel));
  box-shadow: var(--key, 0 0 transparent), inset 0 0 0 var(--edge-w, 1.5px) var(--edge, transparent);
  transition: transform 60ms, opacity 120ms;
}
/* 見出しの文字: 画面には出さず、読み上げには残す（欄の違いは色と形で伝える） */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.roomNow { margin: 8px 0 4px; font-size: 14px; color: var(--muted); }

.start { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 12px; }
/* 始めるボタン: タイルと同じキーの形。再生の印をその欄の色で光らせ、ゆっくり呼吸する光で「ここを押す」を見せる */
.startBtn {
  --r: 28px; --face: linear-gradient(180deg, #19191c, #0e0e10); --key: var(--key-up);
  --edge: color-mix(in srgb, var(--bgm) 45%, transparent);
  justify-self: center; width: 168px; height: 168px;
  display: grid; place-items: center; align-content: center; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: .12em;
  animation: invite 2.4s ease-in-out infinite;
  transition: transform 60ms, opacity 300ms;
}
.startBtn .ico { font-size: 46px; color: var(--bgm); fill: currentColor; stroke-width: 1.5; }
@keyframes invite {
  0%, 100% { box-shadow: var(--key), inset 0 0 0 1.5px var(--edge), 0 0 0 transparent; }
  50% { box-shadow: var(--key), inset 0 0 0 1.5px var(--edge), 0 0 32px color-mix(in srgb, var(--bgm) 30%, transparent); }
}
.startBtn:active { transform: translateY(2px) scale(.97); --key: var(--key-down); animation: none; }
.startBtn:disabled { opacity: .6; animation: none; }
/* 準備中は暗く、光らせない（光り始めたら押せる） */
.startBtn.waiting { opacity: .45; animation: none; }
.note:empty { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .startBtn { animation: none; } }
.note { color: var(--muted); font-size: 14px; margin: 0; }

.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.toggle input { width: 22px; height: 22px; accent-color: var(--bgm); }
.chip { --face: color-mix(in srgb, var(--text) 8%, var(--panel)); min-height: 40px; padding: 0 16px; font-size: 14px; }
.chip:active { transform: scale(.95); }

h2 { font-size: 14px; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 対戦画面 ----------
   スクロールせずに1画面に収める。下の帯（.dock）は固定で、その分だけ下を空ける。
   メインBGM・カットインは1行で横に送る。いちばん押す効果音は親指の届く下側に大きく置き、増えたらページで切り替える */
#pad {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  height: calc(100dvh - var(--dock-h, 72px));
  padding-top: calc(10px + env(safe-area-inset-top));
}
#pad[hidden] { display: none; }
.cat { --c: var(--bgm); display: flex; flex-direction: column; min-height: 0; flex: none; }
.cat[data-cat="scene"] { --c: var(--scene); }
.cat[data-cat="se"] { --c: var(--se); flex: 1; }
.catHead {
  display: flex; align-items: center; gap: 6px; margin: 8px 0 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--c);
}
.catHead::after { content: ""; order: 1; flex: 1; height: 1px; background: color-mix(in srgb, var(--c) 25%, transparent); }
/* 見出しの右端の「＋」: タイルの場所を使わずに、足す場所をいつも見せる */
.addBtn {
  order: 2; flex: none; min-width: 44px; height: 32px; margin: -6px -4px -6px 0;
  border: 0; background: transparent; color: var(--c);
  font-size: 22px; font-weight: 400; line-height: 1;
  transition: transform 60ms;
}
.addBtn:active { transform: scale(.9); }
.catHead .ico { font-size: 14px; }

/* メインBGM・カットイン: 1画面に3列、4曲以上は2段。それ以上は横に送る */
.row {
  display: grid; grid-auto-flow: column; gap: 8px;
  grid-template-rows: repeat(var(--rows, 1), 64px);
  grid-auto-columns: calc((100vw - 32px - 16px) / 3);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none;
  margin: 0 -16px; padding: 0 16px 2px;
}
.cat { position: relative; }
/* 右に続きがあるときだけ、右端をうっすら暗くして矢印を出す */
.cat.more::after {
  content: "›"; position: absolute; right: -16px; top: 34px; bottom: 2px; width: 34px;
  display: grid; place-items: center; pointer-events: none;
  font-size: 22px; font-weight: 700; color: var(--c);
  background: linear-gradient(90deg, transparent, var(--bg) 70%);
}
.row::-webkit-scrollbar { display: none; }
.grid {
  flex: 1; display: grid; gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(var(--se-rows, 3), minmax(56px, 1fr));
}
.pager { display: flex; justify-content: center; gap: 6px; padding: 6px 0 2px; }
.pageBtn {
  min-width: 40px; height: 32px; border: 0; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; border-bottom: 2px solid var(--line2);
}
.pageBtn[aria-current="true"] { color: var(--se); border-bottom-color: var(--se); }

.editBar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px; margin-top: 4px; border-radius: 10px;
  background: color-mix(in srgb, var(--ng) 16%, var(--panel));
  color: var(--text); font-size: 13px;
}

/* ---------- 下の帯: 音の切り替え／いま流れている曲／止める／メニュー ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg2); border-top: 1px solid var(--line);
}
.dockBtn {
  --r: 12px; --face: linear-gradient(180deg, #19191c, #101012); --key: var(--key-up);
  flex: none; width: 48px; height: 48px;
  display: grid; place-items: center; font-size: 22px;
}
.dockBtn:active { transform: translateY(2px) scale(.97); --key: var(--key-down); }
.menuBtn { --face: transparent; --key: 0 0 transparent; width: 40px; color: var(--muted); }
.stopBtn { width: 60px; }
/* 音あり=色づく、音なし=沈ませる（いまどちらかを一目で見分ける） */
.speakerBtn[aria-pressed="true"] { --edge: color-mix(in srgb, var(--ok) 60%, transparent); --face: linear-gradient(180deg, color-mix(in srgb, var(--ok) 16%, #19191c), color-mix(in srgb, var(--ok) 10%, #101012)); color: var(--ok); }
.speakerBtn[aria-pressed="false"] { color: var(--muted); }
.now {
  flex: 1; min-width: 0; font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--bgm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now.idle { color: var(--muted); font-weight: 500; }
.offline {
  position: fixed; left: 12px; right: 12px; z-index: 2;
  bottom: calc(var(--dock-h, 72px) + 6px);
  padding: 8px 12px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--ng) 28%, var(--panel)); border-radius: 10px; color: var(--text);
}
/* 新しい版の知らせ: 押すと読み直す（鳴らしている最中だけ出す） */
.newVer { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: auto; border: 0; text-align: left; background: color-mix(in srgb, var(--bgm) 22%, var(--panel)); }
.newVer b { flex: none; padding: 6px 12px; border-radius: 8px; background: var(--bgm); color: #000; }
.newVer:active { transform: translateY(2px); }
/* 曲が多くて収まらないときや編集中は、見出しやすき間を指で動かして縦に送る */
#pad.overflow, #pad.editing { height: auto; padding-bottom: calc(var(--dock-h, 72px) + 8px); }
#pad.overflow .cat, #pad.editing .cat { flex: none; }
#pad.overflow .grid, #pad.editing .grid { grid-template-rows: none; grid-auto-rows: 64px; }

/* ---------- タイル ---------- */
.tile {
  --c: var(--bgm);
  --face: linear-gradient(180deg, #19191c, #0e0e10);
  --edge: #1d1d21; --edge-w: 1px;
  --key: var(--key-up);
  --r: 14px;
  overflow: hidden; min-height: 0; padding: 6px 10px;
  font-size: 15px; font-weight: 700; line-height: 1.25;
  /* タイルに触れた指では画面を動かさない（動かそうとして鳴る誤タップを防ぐ）。横に送る行だけは横の送りを許す */
  touch-action: none;
  overflow-wrap: anywhere;
  /* 離すと少し弾んで戻る */
  transition: transform 240ms cubic-bezier(.3, 1.7, .5, 1), opacity 120ms;
}
/* どの欄かを示す、左下の短い色の線（鳴っている・止めている間は面や縁で示すので消す） */
.tile::before {
  content: ""; position: absolute; left: 10px; bottom: 8px; width: 16px; height: 2px; border-radius: 1px;
  background: var(--c); opacity: .75; pointer-events: none;
}
.tile.playing::before, .tile.paused::before { display: none; }
.tile .name { position: relative; z-index: 1; }
.tile .name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile[data-cat="bgm"] { --c: var(--bgm); }
.tile[data-cat="scene"] { --c: var(--scene); }
.tile[data-cat="se"] { --c: var(--se); font-size: 16px; }
.row .tile { height: 64px; padding: 4px 8px; font-size: 14px; scroll-snap-align: start; touch-action: pan-x; }
/* 「読み込み中…」などの印があるときと、‖ と並ぶときは、名前を1行にして切れないようにする */
.row .tile:has(.state) .name, .tile.paused .name { -webkit-line-clamp: 1; min-width: 0; }
.row .tile:has(.state) .name { position: relative; top: -6px; }
#pad.editing .tile { touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* 編集中: メインBGM・カットインも横に送らず全部並べる（並べ替える先が見えるように） */
#pad.editing .row {
  grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-template-rows: none; grid-auto-rows: 64px;
  overflow: visible; margin: 0; padding: 0 0 2px;
}
#pad.editing .cat.more::after { display: none; }
/* 長押しで持ち上げたタイル: 縁を光らせ、指に付いてくる */
.tile.lifted { z-index: 3; pointer-events: none; transition: none; --edge: var(--text); color: var(--text); }
/* 押した瞬間に物理キーのように下がる（離すと弾んで戻る） */
.tile:active, .tile.pressed { transform: translateY(2px) scale(.97); transition: transform 40ms ease-out; --key: var(--key-down); }
/* 鳴っている: その欄の色で光る */
.tile.playing {
  --face: linear-gradient(180deg, color-mix(in srgb, var(--c) 88%, #fff), var(--c)); --edge: transparent; color: #050505;
  --glow: 0 0 22px color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: var(--key), var(--glow);
}
/* メインBGM: 流れている間、右端で音の波が動く */
.eq { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i { width: 3px; height: 100%; background: #050505; transform-origin: bottom; animation: eq 900ms ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -300ms; }
.eq i:nth-child(3) { animation-delay: -600ms; }
.eq i:nth-child(4) { animation-delay: -150ms; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.tile[data-cat="bgm"].playing .name { padding-right: 22px; }
/* カットイン: メインBGM と同じく光り、その面の明るさと周りの光が呼吸する。はじめるボタンと同じ「ここを押す」の合図で、
   もう一度押すとメインBGM に戻ることを見せる。
   11-15: 白い縁の脈打ち→周りの光だけの呼吸、とも気づかれなかった（明るい面に周りの光がかき消される）ので、面そのものを動かす */
.tile[data-cat="scene"].playing { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { filter: brightness(1); box-shadow: var(--key), 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
  50% { filter: brightness(.55); box-shadow: var(--key), 0 0 4px color-mix(in srgb, var(--c) 15%, transparent); }
}
/* カットインで止めているメインBGM: 大きな ‖ と曲名。押すと止めた位置の続きから流れる（音楽アプリの一時停止と同じ） */
.tile.paused {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  --edge: var(--c); --edge-w: 1.5px; --face: #0a0a0b; --key: inset 0 2px 4px rgba(0, 0, 0, .8); color: var(--muted);
}
.tile .pz { flex: none; width: 22px; height: 22px; color: var(--c); stroke-width: 3; position: relative; z-index: 1; }
/* カットインを押した瞬間、止まるメインBGM が一度へこむ（押した結果、止まったと分かる） */
.tile.sink { animation: sink 380ms ease-out; }
@keyframes sink { 0% { transform: scale(1); } 35% { transform: scale(.86); } 100% { transform: scale(1); } }
/* 曲の進み具合: 溝（曲全体）の中を帯が満ちていく。止めている曲は止めた位置で止まる */
.bar { position: absolute; left: 8px; right: 8px; bottom: 6px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--c) 22%, transparent); }
.bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 2px; background: var(--c); }
/* 光っている面の上では、帯を暗い色で描く */
.tile.playing .bar { background: rgba(0, 0, 0, .22); }
.tile.playing .bar i { background: #050505; }
.row .tile:has(.bar) .name, .row .tile:has(.bar) .pz { top: -3px; }
/* 効果音: 鳴らした瞬間に色が満ち、音の長さ（--d）に合わせて左へ引いていく */
.tile[data-cat="se"]::after {
  content: ""; position: absolute; inset: 0; background: var(--c); opacity: 0; transform-origin: left center; pointer-events: none;
}
.tile.hit::after { animation: drain var(--d, .6s) linear forwards; }
@keyframes drain { 0% { opacity: .7; transform: scaleX(1); } 8% { opacity: .55; } 100% { opacity: .15; transform: scaleX(0); } }
/* 効果音が光った瞬間も名前が読めるよう、文字に影を付ける */
.tile[data-cat="se"] .name { text-shadow: 0 1px 3px rgba(0, 0, 0, .85); }
@media (prefers-reduced-motion: reduce) {
  .eq i, .tile[data-cat="scene"].playing, .tile.hit::after, .tile.sink { animation: none; }
  .tile, .tile:active, .tile.pressed { transition: none; }
}
.tile.loading { opacity: .45; }
/* 読み込み失敗の知らせ: 名前を押し下げないよう、下端に重ねる */
.tile .state { position: absolute; left: 6px; right: 6px; bottom: 5px; z-index: 1; font-size: 10px; font-weight: 600; line-height: 1.2; color: var(--ng); }
.editing .tile { --c: var(--muted); }

/* ---------- 重ねて出す画面（メニュー・音を足す・ネットで探す） ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 3; overflow: auto;
  background: var(--bg);
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}
.sheetLow { top: auto; max-height: 70vh; border-top: 1px solid var(--line2); background: var(--bg2); }
.sheetHead { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sheetHead h2 { margin: 0; font-size: 17px; color: var(--text); letter-spacing: .04em; }
h3 { font-size: 12px; color: var(--bgm); margin: 22px 0 6px; font-weight: 700; letter-spacing: .14em; }
.field { display: grid; gap: 4px; margin: 8px 0 12px; }
.field small { color: var(--muted); font-size: 12px; }
input[type=range] { width: 100%; accent-color: var(--bgm); }
.sub { --face: color-mix(in srgb, var(--text) 6%, var(--panel)); width: 100%; padding: 12px; margin: 6px 0; }
.sub:active { transform: scale(.98); }
.sub.armed { --edge: var(--ng); color: var(--ng); }
.bigSub { display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; font-size: 16px; font-weight: 700; }
.bigSub .ico { font-size: 22px; color: var(--bgm); }
.bigSub small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
details { margin-top: 22px; background: var(--panel); border-radius: 10px; padding: 4px 14px 12px; }
summary { padding: 10px 0; font-weight: 600; cursor: pointer; }
.credit { font-size: 13px; color: var(--muted); margin: 6px 0; padding-left: 18px; user-select: text; -webkit-user-select: text; }
p.credit { padding-left: 0; }
.credit li { margin: 4px 0; }
.credit a { color: var(--bgm); }
/* 招待の QR: 相手のカメラで読めるよう大きく、白地に黒（暗い画面でも読み取れる向き） */
.qr { width: min(220px, 62vw); aspect-ratio: 1; margin: 8px auto 4px; border-radius: 12px; overflow: hidden; background: #fff; }
.qr:empty { display: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.mono { font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 6px 0; user-select: text; -webkit-user-select: text; }
.log { max-height: 260px; overflow: auto; color: var(--muted); }

/* ネットで探す */
.searchForm { display: flex; gap: 8px; margin: 8px 0; }
.searchForm input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  user-select: text; -webkit-user-select: text;
}
.searchForm input:focus { outline: none; border-color: var(--bgm); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chips .chip { min-height: 34px; padding: 0 12px; font-size: 13px; }
.searchStatus { margin: 8px 0; }
.results { list-style: none; margin: 0; padding: 0; }
.result { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.resultPlay { width: 44px; height: 44px; font-size: 18px; color: var(--bgm); }
.resultInfo { flex: 1; min-width: 0; display: grid; }
.resultInfo b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultInfo small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultAdd { flex: none; --edge: color-mix(in srgb, var(--bgm) 60%, var(--bg)); }
.resultAdd.done { --edge: var(--ok); color: var(--ok); }
.resultAdd:disabled { opacity: .7; }

.toast {
  position: fixed; left: 16px; right: 16px; z-index: 4;
  bottom: calc(var(--dock-h, 72px) + 8px);
  padding: 12px 14px;
  background: var(--panel); border-radius: 10px;
  color: var(--text); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px #000a;
}

/* 背の低い画面（幅320pxの iPhone など）: BGM の段と見出しを詰めて、効果音に高さを回す */
@media (max-height: 600px) {
  .row { grid-template-rows: repeat(var(--rows, 1), 52px); }
  .row .tile { height: 52px; }
  .catHead { margin: 4px 0 3px; }
  #pad { padding-top: calc(4px + env(safe-area-inset-top)); }
}

/* ---------- YouTube ----------
   プレーヤーは YouTube の決まりで 200×200 以上を見せておく。YouTube の曲が鳴っている間、BGM と効果音の間に
   高さ 200px の枠をすっと開く（固定を選んだスマホは開けたまま。効果音の段数は、残りの高さから決める）。メニューなどを開いている間は画面の上に置き、
   開いた画面をその下から始める */
/* 閉じた枠は高さ 0。#pad の gap（2px）は負の余白で消す。開いた枠の大きさは変数が正本（app.js の slotPending も読む） */
:root { --yt-slot-h: 200px; --yt-slot-mt: 8px; --yt-slot-mb: 2px; --yt-open: 200ms; }
.ytSlot { flex: none; height: 0; margin: 0 0 -2px; overflow: hidden; border-radius: 14px; background: #050505; }
body.yt-room .ytSlot { height: var(--yt-slot-h); margin: var(--yt-slot-mt) 0 var(--yt-slot-mb); }
/* 枠を開け閉めする間だけ（app.js が body.yt-anim を付ける）動かす。開いた画面の上の空きも一緒に動かす */
body.yt-anim .ytSlot { transition: height var(--yt-open) ease-out, margin var(--yt-open) ease-out; }
body.yt-anim .sheet { transition: padding-top var(--yt-open) ease-out, max-height var(--yt-open) ease-out; }
/* 枠が開ききるまで、プレーヤーは見せない・触らせない（app.js の ytShow） */
.ytBox.opening { pointer-events: none; }
/* 空けた場所の印（鳴っていない間）。プレーヤーはこの上に出る */
.ytWell { position: fixed; z-index: 1; display: grid; place-items: center; border-radius: 14px; background: #050505; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); pointer-events: none; }
body.yt-pinned .ytWell { z-index: 5; }
.ytWell .ico { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .45; }
/* 重なり順: ふだんは下の帯（2）より下（編集中に画面を送っても下の帯に被らない）。開いた画面の上に置くときだけ一番上 */
.ytBox { position: fixed; z-index: 1; overflow: hidden; border-radius: 14px; background: #000; }
.ytBox iframe { display: block; width: 100%; height: 100%; border: 0; }
/* 最初のタップで再生の許可をもらうため、曲を鳴らす前から作っておく間（何も流れていない） */
.ytBox.parked { left: 0; top: 0; width: 200px; height: 200px; opacity: 0; pointer-events: none; }
body.yt-pinned .ytBox { z-index: 5; }
body.yt-pinned .sheet:not(.sheetLow) { padding-top: calc(226px + env(safe-area-inset-top)); }
body.yt-pinned .sheetLow { max-height: calc(100dvh - 236px - env(safe-area-inset-top)); }
/* 自動で鳴らせなかったとき: 「ここを押す」の呼吸する光（はじめるボタンと同じ合図） */
.ytTap {
  position: fixed; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 14px;
  border: 0; border-radius: 14px; font-size: 15px; font-weight: 700;
  color: var(--text); background: linear-gradient(180deg, #19191c, #0e0e10);
  --key: var(--key-up); --edge: color-mix(in srgb, var(--bgm) 45%, transparent);
  box-shadow: var(--key), inset 0 0 0 1.5px var(--edge);
  animation: invite 2.4s ease-in-out infinite;
}
.ytTap .ico { font-size: 22px; color: var(--bgm); fill: currentColor; stroke-width: 1.5; }
.ytTap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ytTap:active { transform: translateY(2px); animation: none; }
@media (prefers-reduced-motion: reduce) { .ytTap { animation: none; } }
/* YouTube の曲のタイル: 右上に小さな印（鳴らし方が違う＝読み込みに少しかかる、を見分けられるように） */
.tile .yt { position: absolute; right: 6px; top: 5px; z-index: 1; width: 14px; height: 14px; color: var(--c); opacity: .75; }
.tile.playing .yt { color: #050505; }
.resultThumb { flex: none; width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--panel); }
