:root {
  --bg: #02030a;
  --panel: rgba(8, 12, 30, 0.78);
  --panel-line: rgba(110, 140, 255, 0.22);
  --text: #e6f0ff;
  --muted: #8a97c0;
  --cyan: #5ef2ff;
  --pink: #ff4fd8;
  --lime: #9dff4f;
  --accent: #5ef2ff;
  --font-d: 'Orbitron', 'Noto Sans JP', sans-serif;
  --font-b: 'Noto Sans JP', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-b); overflow: hidden; }
body { -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input[type=text] { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font-family: var(--font-d); }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }

.screen { position: fixed; inset: 0; display: none; z-index: 2; }
.screen.active { display: flex; }

/* ---------- タイトル ---------- */
#title { align-items: center; justify-content: center; text-align: center; }
.title-inner { padding: 16px; }
.logo-big { font-family: var(--font-d); font-weight: 900; line-height: 0.95; letter-spacing: 0.06em; }
.logo-big span { display: block; font-size: clamp(22px, 5vw, 44px); color: var(--muted); letter-spacing: 0.5em; margin-right: -0.5em; }
.logo-big b { display: block; font-size: clamp(56px, 14vw, 150px); color: #fff; text-shadow: 0 0 18px var(--cyan), 0 0 50px rgba(94, 242, 255, 0.5), 4px 0 0 rgba(255, 79, 216, 0.6); }
.tagline { font-family: var(--font-d); letter-spacing: 0.6em; color: var(--cyan); font-size: 12px; margin: 18px 0 40px; opacity: 0.8; }
.keys-hint { margin-top: 28px; display: flex; gap: 10px; justify-content: center; }
.keys-hint kbd, .foot-hint kbd { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--panel-line); border-radius: 8px; background: rgba(10, 16, 40, 0.7); color: var(--cyan); font-weight: 700; }

.btn-glow, .btn-line {
  font-family: var(--font-d); font-weight: 700; letter-spacing: 0.12em; font-size: 15px;
  padding: 14px 28px; border-radius: 10px; transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn-glow { border: 1px solid var(--accent); background: rgba(94, 242, 255, 0.12); color: #fff; box-shadow: 0 0 18px rgba(94, 242, 255, 0.35), inset 0 0 12px rgba(94, 242, 255, 0.2); }
.btn-glow:hover { background: rgba(94, 242, 255, 0.25); transform: translateY(-1px); }
.btn-line { border: 1px solid var(--panel-line); background: rgba(10, 14, 34, 0.7); }
.btn-line:hover { border-color: var(--accent); }
.btn-glow small, .btn-line small { opacity: 0.55; font-size: 10px; margin-left: 6px; }
#btn-start { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 34px rgba(94, 242, 255, 0.7), inset 0 0 18px rgba(94, 242, 255, 0.3); } }

/* ---------- 選曲 ---------- */
#select { flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.logo-small { font-family: var(--font-d); font-weight: 800; letter-spacing: 0.12em; font-size: 16px; color: var(--muted); }
.logo-small b { color: #fff; text-shadow: 0 0 10px var(--cyan); }
.spacer { flex: 1; }
.chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--panel-line); background: var(--panel); border-radius: 999px; padding: 8px 14px; font-size: 13px; backdrop-filter: blur(6px); }
.chip:hover { border-color: var(--accent); }
.chip .ico { color: var(--accent); }

.select-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 440px); gap: 18px; padding: 0 20px 8px; }
.song-list { overflow-y: auto; overflow-x: hidden; padding: 4px 16px 20px 2px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: #2a3570 transparent; }
.song-card {
  position: relative; text-align: left; border: 1px solid var(--panel-line); background: var(--panel); border-radius: 12px;
  padding: 14px 16px 14px 20px; backdrop-filter: blur(6px); transition: transform 0.15s, border-color 0.15s, background 0.15s;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; max-width: 620px;
}
.song-card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--cyan)); box-shadow: 0 0 10px var(--c, var(--cyan)); }
.song-card:hover { border-color: rgba(160, 180, 255, 0.45); }
.song-card.sel { transform: translateX(10px); border-color: var(--c); background: rgba(14, 20, 50, 0.88); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 30%, transparent); }
.song-card .sc-title { font-family: var(--font-d); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-card .sc-sub { font-size: 12px; color: var(--muted); grid-column: 1; }
.song-card .sc-lv { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.lv { font-family: var(--font-d); font-size: 12px; font-weight: 700; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; border: 1px solid currentColor; position: relative; }
.lv.easy { color: #6dffb0; } .lv.normal { color: #ffd25e; } .lv.hard { color: #ff5a8a; }
.lv .mark { position: absolute; top: -7px; right: -7px; font-size: 8px; background: #000; padding: 1px 3px; border-radius: 4px; border: 1px solid currentColor; }
.song-card.upload { grid-template-columns: 1fr; border-style: dashed; color: var(--muted); }
.song-card.upload::before { background: var(--muted); box-shadow: none; }
.song-card.upload .sc-title { font-size: 14px; color: var(--text); }

.detail {
  border: 1px solid var(--panel-line); background: var(--panel); border-radius: 16px; padding: 22px; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
}
.d-genre { font-family: var(--font-d); font-size: 11px; letter-spacing: 0.35em; color: var(--accent); }
.d-title { font-family: var(--font-d); font-size: 30px; margin: 6px 0 4px; line-height: 1.15; word-break: break-word; text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent); }
.d-meta { color: var(--muted); font-size: 13px; }
.diffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 12px; }
.diff-btn { border: 1px solid var(--panel-line); background: rgba(6, 10, 26, 0.8); border-radius: 10px; padding: 10px 4px; font-family: var(--font-d); text-align: center; }
.diff-btn .dn { font-size: 11px; letter-spacing: 0.15em; font-weight: 700; }
.diff-btn .dl { font-size: 24px; font-weight: 800; }
.diff-btn .dc { font-size: 10px; color: var(--muted); font-family: var(--font-b); }
.diff-btn.sel { border-color: currentColor; box-shadow: 0 0 14px color-mix(in srgb, currentColor 40%, transparent), inset 0 0 14px color-mix(in srgb, currentColor 15%, transparent); }
.diff-btn.easy { color: #6dffb0; } .diff-btn.normal { color: #ffd25e; } .diff-btn.hard { color: #ff5a8a; }
.best { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; font-family: var(--font-d); padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); min-height: 56px; }
.best .b-rank { font-size: 28px; font-weight: 900; grid-row: span 2; min-width: 52px; text-align: center; }
.best .b-score { font-size: 20px; font-weight: 700; }
.best .b-sub { font-size: 11px; color: var(--muted); font-family: var(--font-b); }
.best .b-badges { grid-row: span 2; display: flex; gap: 4px; }
.badge { font-family: var(--font-d); font-size: 10px; font-weight: 800; padding: 3px 6px; border-radius: 5px; letter-spacing: 0.08em; }
.badge.fc { background: #ffd25e; color: #1a1200; }
.badge.ap { background: linear-gradient(90deg, #5ef2ff, #ff4fd8); color: #000; }
.best.none { color: var(--muted); font-family: var(--font-b); font-size: 13px; display: flex; }

.btn-play {
  margin: 14px 0 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
  font-family: var(--font-d); font-weight: 900; font-size: 22px; letter-spacing: 0.3em; display: flex; justify-content: center; align-items: baseline; gap: 12px;
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 0.12s;
}
.btn-play:hover { transform: scale(1.015); }
.btn-play small { font-size: 10px; letter-spacing: 0.2em; opacity: 0.6; font-weight: 600; }
.btn-play.wait { opacity: 0.6; }

.ranking { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.rank-head { display: flex; align-items: center; }
.rank-head h3 { font-family: var(--font-d); font-size: 12px; letter-spacing: 0.25em; color: var(--muted); margin: 0; flex: 1; }
.mini { border: 1px solid var(--panel-line); background: transparent; border-radius: 6px; width: 26px; height: 26px; color: var(--muted); }
.rank-list { list-style: none; margin: 8px 0 0; padding: 0; overflow-y: auto; font-size: 13px; }
.rank-list li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(110, 140, 255, 0.1); }
.rank-list li.me { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 6px; }
.rank-list .rk { font-family: var(--font-d); font-weight: 800; color: var(--muted); text-align: center; }
.rank-list li:nth-child(1) .rk { color: #ffd25e; } .rank-list li:nth-child(2) .rk { color: #d6e0ff; } .rank-list li:nth-child(3) .rk { color: #ff9a5c; }
.rank-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .sc { font-family: var(--font-d); font-weight: 700; }
.rank-list .empty { display: block; color: var(--muted); border: 0; padding: 12px 4px; }
.foot-hint { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 12px 12px; }

.drop-veil { position: fixed; inset: 12px; border: 2px dashed var(--accent); border-radius: 20px; display: none; place-items: center; font-size: 20px; background: rgba(2, 3, 10, 0.75); z-index: 20; font-weight: 700; }
.drop-veil.on { display: grid; }

/* ---------- リザルト ---------- */
#result { align-items: center; justify-content: center; padding: 16px; background: rgba(2, 3, 10, 0.45); }
.result-panel { width: min(680px, 100%); max-height: 100%; overflow-y: auto; border: 1px solid var(--panel-line); background: var(--panel); border-radius: 18px; padding: 24px; backdrop-filter: blur(10px); animation: rise 0.5s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.r-song { font-family: var(--font-d); font-weight: 700; font-size: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.r-diff { font-size: 11px; letter-spacing: 0.2em; padding: 3px 8px; border: 1px solid currentColor; border-radius: 6px; }
.r-main { display: flex; gap: 22px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.r-rank { font-family: var(--font-d); font-weight: 900; font-size: 96px; line-height: 1; min-width: 140px; text-align: center; color: #fff; text-shadow: 0 0 24px var(--accent), 0 0 60px var(--accent); animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } }
.r-scorebox { flex: 1; min-width: 220px; }
.r-new { font-family: var(--font-d); font-size: 12px; letter-spacing: 0.3em; color: #ffd25e; text-shadow: 0 0 10px #ffd25e; visibility: hidden; }
.r-new.on { visibility: visible; animation: blink 0.8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.r-score { font-family: var(--font-d); font-weight: 800; font-size: clamp(36px, 8vw, 54px); letter-spacing: 0.04em; }
.r-badges { display: flex; gap: 6px; min-height: 22px; margin: 4px 0; }
.r-badges .badge { font-size: 13px; padding: 4px 10px; }
.r-acc { font-family: var(--font-d); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.r-acc b { color: var(--text); }
.r-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.r-counts div { background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 10px; text-align: center; font-family: var(--font-d); }
.r-counts small { display: block; font-size: 10px; letter-spacing: 0.12em; font-weight: 700; }
.r-counts b { font-size: 22px; }
.r-counts .fs { grid-column: 1 / -1; font-size: 12px; color: var(--muted); background: none; padding: 0; }
.r-online { margin-top: 14px; font-size: 13px; }
.r-online .rank-list { max-height: 170px; }
.r-online .r-msg { color: var(--muted); }
.r-online .r-myrank { font-family: var(--font-d); font-weight: 800; font-size: 16px; color: var(--accent); }
.r-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---------- オーバーレイ ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; background: rgba(2, 3, 10, 0.72); backdrop-filter: blur(4px); padding: 16px; }
.overlay.on { display: flex; }
.pause-box { display: flex; flex-direction: column; gap: 12px; min-width: 240px; text-align: center; }
.pause-box h2, .modal-box h2 { font-family: var(--font-d); letter-spacing: 0.3em; margin: 0 0 10px; }
#loading { flex-direction: column; gap: 14px; font-family: var(--font-d); letter-spacing: 0.3em; color: var(--accent); }
.scanner { width: 220px; height: 4px; background: rgba(94, 242, 255, 0.15); border-radius: 4px; overflow: hidden; }
.scan-bar { width: 40%; height: 100%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: scan 1s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.modal-box { width: min(520px, 100%); max-height: 100%; overflow-y: auto; border: 1px solid var(--panel-line); background: rgba(8, 12, 30, 0.95); border-radius: 16px; padding: 22px; }
.modal-box.narrow { width: min(400px, 100%); }
.row { display: grid; grid-template-columns: 120px 1fr 56px; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; }
.row input[type=text] { grid-column: 2 / span 2; }
.row output { font-family: var(--font-d); font-size: 12px; text-align: right; color: var(--accent); }
input[type=range] { accent-color: var(--cyan); width: 100%; }
input[type=text] { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--panel-line); color: var(--text); border-radius: 8px; padding: 10px 12px; font: inherit; width: 100%; }
input[type=text]:focus { outline: none; border-color: var(--accent); }
.preview-wrap { margin: 8px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--panel-line); }
#s-preview { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.muted { color: var(--muted); font-size: 13px; }
#name-input { margin: 8px 0; font-size: 18px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: rgba(10, 16, 40, 0.95); border: 1px solid var(--panel-line); padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: 0.25s; z-index: 40; pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

body.playing .screen { display: none !important; }
.btn-pause-game {
  display: none; position: fixed; z-index: 10; top: calc(60px + env(safe-area-inset-top)); left: calc(12px + env(safe-area-inset-left));
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--panel-line); background: rgba(8, 12, 30, 0.6);
  color: var(--muted); font-size: 13px; letter-spacing: -2px;
}
body.playing .btn-pause-game { display: block; }
body.touch .foot-hint, body.touch .keys-hint { display: none; }
.screen { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

@media (max-width: 760px) {
  .select-body { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; padding: 0 12px 16px; gap: 12px; align-content: start; }
  .song-list { overflow: visible; flex-direction: row; overflow-x: auto; padding: 4px 2px 8px; gap: 8px; scroll-snap-type: x mandatory; }
  .song-card { min-width: 210px; padding: 10px 12px 10px 16px; scroll-snap-align: start; }
  .song-card .sc-title { font-size: 15px; }
  .song-card .sc-lv { grid-row: auto; grid-column: 1; margin-top: 6px; }
  .song-card .lv { width: 24px; height: 24px; font-size: 11px; }
  .song-card.sel { transform: translateY(-2px); }
  .song-card.upload { min-width: 170px; }
  .detail { padding: 16px; }
  .d-title { font-size: 24px; }
  .diffs { margin: 12px 0 10px; }
  .btn-play { padding: 18px; margin: 12px 0; }
  .rank-list { max-height: none; overflow: visible; }
  .result-panel { padding: 18px; }
  .r-main { gap: 8px; margin: 10px 0; }
  .r-counts b { font-size: 18px; }
  .r-buttons button { flex: 1; }
  .pause-box button { padding: 18px 28px; }
  .detail { overflow: visible; }
  .topbar { padding: 12px 16px; }
  .foot-hint { display: none; }
  .row { grid-template-columns: 96px 1fr 48px; }
  .r-rank { font-size: 72px; min-width: 100px; }
}

/* ---------- ナビ・コイン ---------- */
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-btn { position: relative; }
.coin-ico { color: #ffd25e; font-weight: 700; margin-right: 3px; }
.coin-chip { font-family: var(--font-d); font-weight: 700; }
.badge-dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff4f6e; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--font-d); }
.badge-dot[hidden] { display: none; }
.team-fx-mini { font-size: 12px; color: var(--muted); margin: -6px 0 12px; text-align: center; }
.link-btn { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0; }
.small { font-size: 12px; }

/* ---------- アカウント ---------- */
.acc-tabs, .q-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.acc-tab, .q-tab { position: relative; flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.3); font-weight: 700; }
.acc-tab.sel, .q-tab.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.f-row { display: block; margin-bottom: 10px; font-size: 13px; }
.f-row span { display: block; color: var(--muted); margin-bottom: 4px; }
.f-row input { width: 100%; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--panel-line); color: var(--text); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text; }
.f-row input:focus { outline: none; border-color: var(--accent); }
.f-row[hidden] { display: none; }
.acc-msg { color: #ff8a9a; font-size: 13px; min-height: 1em; margin: 4px 0; }
.acc-who { font-family: var(--font-d); font-size: 24px; font-weight: 800; margin: 8px 0 4px; }
#acc-in[hidden], #acc-out[hidden] { display: none; }
.row.check input { width: 22px; height: 22px; accent-color: var(--cyan); justify-self: start; }

/* ---------- メタ画面共通 ---------- */
.screen.meta { flex-direction: column; background: rgba(2, 3, 10, 0.55); }
.meta-title { font-family: var(--font-d); letter-spacing: 0.3em; margin: 0 0 0 8px; font-size: 18px; }
.meta-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 24px; width: min(900px, 100%); margin: 0 auto; }

/* クエスト */
.quest-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.quest { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel); }
.quest.ready { border-color: #ffd25e; box-shadow: 0 0 14px rgba(255, 210, 94, 0.2); }
.quest.claimed { opacity: 0.5; }
.q-title { font-weight: 700; font-size: 14px; }
.q-bar { height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; margin: 6px 0 3px; overflow: hidden; }
.q-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.quest.ready .q-bar span { background: #ffd25e; }
.q-prog { font-size: 11px; color: var(--muted); font-family: var(--font-d); }
.q-reward { font-family: var(--font-d); font-weight: 700; }
.q-claim { padding: 8px 12px; border-radius: 8px; border: 1px solid #ffd25e; background: rgba(255, 210, 94, 0.15); font-weight: 700; font-size: 13px; min-width: 76px; }
.q-claim[disabled] { border-color: var(--panel-line); background: transparent; color: var(--muted); cursor: default; }

/* ガチャ */
.gacha-banner { text-align: center; padding: 26px 16px; border-radius: 18px; border: 1px solid var(--panel-line); background:
  radial-gradient(circle at 50% 0%, rgba(255, 210, 94, 0.18), transparent 60%), radial-gradient(circle at 50% 120%, rgba(94, 242, 255, 0.15), transparent 60%), var(--panel); }
.gb-title { font-family: var(--font-d); font-weight: 900; font-size: clamp(32px, 7vw, 52px); letter-spacing: 0.1em; color: var(--muted); }
.gb-title b { color: #fff; text-shadow: 0 0 16px #ffd25e; }
.gb-sub { color: var(--muted); margin: 4px 0 12px; font-size: 13px; }
.gb-rates { font-size: 12px; color: var(--text); opacity: 0.85; line-height: 1.7; }
.gb-pity { font-family: var(--font-d); color: #ffd25e; margin: 10px 0 16px; font-size: 13px; letter-spacing: 0.05em; }
.gb-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gb-buttons button { min-width: 150px; }
.gb-buttons button[disabled] { opacity: 0.4; cursor: default; }
.gacha-lineup-head, .team-units-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; }
.gacha-lineup-head h3, .team-units-head h3 { font-family: var(--font-d); font-size: 13px; letter-spacing: 0.2em; color: var(--muted); margin: 0; }
.lineup-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.lineup-row b { width: 56px; font-size: 12px; }
.lineup-u.unowned { filter: grayscale(1) brightness(0.5); }
.gacha-result { position: fixed; inset: 0; z-index: 35; display: none; align-items: center; justify-content: center; background: rgba(2, 3, 10, 0.88); backdrop-filter: blur(6px); padding: 16px; overflow-y: auto; }
.gacha-result.on { display: flex; }
.gr-inner { text-align: center; width: min(760px, 100%); }
.gr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 18px; }
.gr-card { position: relative; padding: 12px 6px 10px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel); animation: grIn 0.45s ease-out both; }
@media (prefers-reduced-motion: reduce) { .gr-card { animation: none !important; } }
.gr-card.r3 { border-color: #ff4fd8; box-shadow: 0 0 16px rgba(255, 79, 216, 0.35); }
.gr-card.r4 { border-color: #ffd25e; box-shadow: 0 0 24px rgba(255, 210, 94, 0.55); animation-name: grIn4; }
@keyframes grIn { from { opacity: 0; transform: translateY(14px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes grIn4 { 0% { opacity: 0; transform: scale(1.5); } 60% { opacity: 1; transform: scale(0.96); } 100% { opacity: 1; transform: none; } }
.gr-new { position: absolute; top: 6px; left: 6px; font-family: var(--font-d); font-size: 10px; font-weight: 800; background: #ff4f6e; color: #fff; padding: 2px 6px; border-radius: 4px; }
.gr-stars { font-size: 12px; margin-top: 4px; }
.gr-name { font-family: var(--font-d); font-size: 12px; font-weight: 700; margin-top: 2px; }
.gr-sub { font-size: 11px; color: var(--muted); }

/* 編成 */
.team-slots { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 8px; }
.slot { position: relative; min-height: 170px; padding: 22px 6px 10px; border-radius: 14px; border: 1px solid var(--panel-line); background: var(--panel); display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.slot.leader { border-color: rgba(255, 210, 94, 0.6); }
.slot.sel { border-color: var(--accent); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent); }
.slot-tag { position: absolute; top: 6px; font-family: var(--font-d); font-size: 9px; letter-spacing: 0.2em; color: var(--muted); }
.slot.leader .slot-tag { color: #ffd25e; }
.slot-name { font-family: var(--font-d); font-size: 11px; font-weight: 700; }
.slot-lv { font-size: 11px; color: var(--muted); }
.slot-skill { font-size: 10.5px; color: var(--text); opacity: 0.85; line-height: 1.35; }
.slot-empty { margin: auto; font-size: 30px; color: var(--muted); }
.team-fx-box { margin: 12px 0 4px; padding: 10px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); font-size: 14px; }
.team-fx-box b { color: var(--accent); }
#team-sort { background: rgba(0, 0, 0, 0.4); color: var(--text); border: 1px solid var(--panel-line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.team-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.unit-card { position: relative; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel); text-align: center; }
.unit-card:hover { border-color: rgba(160, 180, 255, 0.5); }
.unit-card.in-team { border-color: var(--accent); }
.in-tag { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #000; font-family: var(--font-d); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.uc-name { font-family: var(--font-d); font-size: 11px; font-weight: 700; margin-top: 4px; }
.uc-meta { font-size: 11px; color: var(--muted); }
.uc-skill { font-size: 10.5px; opacity: 0.85; margin-top: 2px; line-height: 1.35; }
.unit-icon { display: block; margin: 0 auto; }

/* リザルト追加 */
.r-team { font-size: 13px; margin-bottom: 10px; }
.r-team b { font-family: var(--font-d); color: var(--accent); font-size: 16px; }
.r-reward { margin-top: 12px; font-family: var(--font-d); font-weight: 700; font-size: 16px; min-height: 1em; }
.r-reward .muted { font-family: var(--font-b); font-weight: 400; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .nav { width: 100%; justify-content: flex-start; gap: 6px; }
  .nav .chip { padding: 7px 10px; font-size: 12px; }
  .meta-body { padding: 4px 12px 24px; }
  .team-slots { grid-template-columns: repeat(3, 1fr); }
  .slot.leader { grid-column: span 3; min-height: 150px; }
  .slot { min-height: 150px; }
  .quest { grid-template-columns: 1fr auto; }
  .q-claim { grid-column: span 2; }
}

/* ---------- 編成 v2 ---------- */
.team-guide { font-size: 13px; line-height: 1.6; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; border: 1px dashed var(--panel-line); background: rgba(0, 0, 0, 0.25); }
.team-guide b { color: var(--accent); }
.team-guide .muted { font-size: 12px; }
.slot { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.slot:not(.filled) { border-style: dashed; cursor: pointer; }
.slot-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot-empty small { font-size: 10px; letter-spacing: 0.05em; }
.slot-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.5); color: var(--muted); font-size: 15px; line-height: 1; display: grid; place-items: center; }
.slot-x:hover { color: #fff; border-color: #ff5a6e; background: rgba(255, 90, 110, 0.3); }
.kind-chip { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; color: var(--k); border: 1px solid var(--k); background: color-mix(in srgb, var(--k) 12%, transparent); margin: 3px 0 1px; white-space: nowrap; }
.team-hint { text-align: center; color: var(--accent); font-weight: 700; font-size: 13px; margin: 8px 0 0; }
.team-hint[hidden] { display: none; }

.team-fx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 10px; }
.fx-tile { padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--k) 45%, transparent); background: color-mix(in srgb, var(--k) 8%, rgba(8, 12, 30, 0.8)); }
.fx-tile.off { opacity: 0.45; border-color: var(--panel-line); }
.fx-label { font-size: 12px; font-weight: 700; color: var(--k); }
.fx-val { font-family: var(--font-d); font-weight: 800; font-size: 22px; margin: 2px 0; }
.fx-desc { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.team-actions { display: flex; gap: 8px; justify-content: flex-end; }
.team-actions button { padding: 9px 16px; font-size: 13px; letter-spacing: 0.05em; font-family: var(--font-b); }

.kind-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.kind-tab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.3); font-size: 12px; font-weight: 700; color: var(--text); }
.kind-tab small { color: var(--muted); margin-left: 2px; }
.kind-tab.sel { border-color: var(--k); color: var(--k); background: color-mix(in srgb, var(--k) 14%, transparent); }
.unit-card { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform 0.12s, opacity 0.12s; }
.unit-card.in-team { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

/* ドラッグ中 */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; width: 72px; height: 72px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px var(--accent)); }
.drag-ghost .unit-icon { width: 72px; height: 72px; }
.dragging-src { opacity: 0.35; }
.lift { transform: scale(1.05); box-shadow: 0 0 0 2px var(--accent); }
body.team-dragging, body.team-dragging * { cursor: grabbing !important; }
body.team-dragging .slot { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
body.team-dragging .slot.over { transform: scale(1.04); border-color: var(--accent); border-style: solid; box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 50%, transparent); }
body.drop-remove .drag-ghost { opacity: 0.6; filter: grayscale(1) drop-shadow(0 0 10px #ff5a6e); }

@media (max-width: 760px) {
  .team-fx-grid { grid-template-columns: repeat(2, 1fr); }
  .fx-val { font-size: 18px; }
  .team-actions button { flex: 1; }
}

/* ---------- 検索・並び替え・絞り込み ---------- */
.song-col { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.song-col .song-list { flex: 1; min-height: 0; }
.list-tools { display: flex; gap: 8px; align-items: center; }
.list-tools input[type=search] {
  flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--panel-line); color: var(--text); border-radius: 10px;
  padding: 9px 12px 9px 34px; font: inherit; font-size: 14px; -webkit-user-select: text; user-select: text;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a97c0' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; background-size: 16px;
}
.list-tools input[type=search]:focus { outline: none; border-color: var(--accent); }
.list-tools select { background: rgba(0, 0, 0, 0.45); color: var(--text); border: 1px solid var(--panel-line); border-radius: 10px; padding: 9px 8px; font: inherit; font-size: 13px; max-width: 48%; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.f-chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.3); font-size: 12px; color: var(--text); }
.f-chip:hover { border-color: rgba(160, 180, 255, 0.5); }
.f-chip.sel { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 700; }
.f-label { font-family: var(--font-d); font-size: 10px; letter-spacing: 0.15em; color: var(--muted); margin-right: 2px; }
.f-sep { width: 1px; height: 18px; background: var(--panel-line); margin: 0 2px; }
.list-empty { color: var(--muted); font-size: 13px; padding: 16px 4px; }
#team .list-tools { margin-bottom: 8px; }
#team .filter-chips { margin-bottom: 10px; }

@media (max-width: 760px) {
  .song-col { min-width: 0; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .f-chip { white-space: nowrap; flex-shrink: 0; }
  .list-tools input[type=search] { font-size: 16px; }
}

/* ---------- 譜面メーカー ---------- */
.screen.editor { flex-direction: column; background: rgba(2, 3, 10, 0.92); }
.ed-top { flex-wrap: wrap; row-gap: 8px; }
.ed-top select, .ed-top input[type=text], .ed-toolbar select, .ed-toolbar input[type=number] {
  background: rgba(0, 0, 0, 0.45); color: var(--text); border: 1px solid var(--panel-line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px;
}
.ed-top input[type=text] { width: min(260px, 40vw); -webkit-user-select: text; user-select: text; }
.ed-top #ed-song { max-width: 220px; }
.ed-lv { font-family: var(--font-d); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.ed-lv small { color: var(--muted); font-family: var(--font-b); }
#ed-post[disabled] { opacity: 0.4; }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 20px 8px; }
.tb { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--panel-line); background: rgba(10, 14, 34, 0.8); font-size: 13px; }
button.tb:hover { border-color: var(--accent); }
.tb kbd { font-size: 9px; opacity: 0.55; border: 1px solid var(--panel-line); border-radius: 4px; padding: 1px 4px; }
.tb.rec.on { border-color: #ff4f6e; color: #ff8a9a; background: rgba(255, 79, 110, 0.15); }
.tb.danger:hover { border-color: #ff5a6e; color: #ff8a9a; }
button.tb:disabled { opacity: 0.4; cursor: default; border-color: var(--panel-line); color: inherit; }
.tb input[type=range] { width: 90px; }
.tb input[type=number] { width: 80px; }
.tb-sep { width: 1px; height: 22px; background: var(--panel-line); }
.tb.seg { padding: 2px; gap: 2px; }
.tb.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; font-size: 13px; }
.tb.seg button.sel { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font-weight: 700; }
.ed-main { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 20px; }
#ed-canvas { flex: 1; min-width: 0; height: 100%; border-radius: 12px; border: 1px solid var(--panel-line); touch-action: none; cursor: crosshair; }
.ed-side { width: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ed-info { padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-line); font-size: 13px; line-height: 1.8; }
.ed-info b { font-family: var(--font-d); font-size: 18px; color: var(--accent); }
.ed-help { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-line); font-size: 12px; }
.ed-help summary { cursor: pointer; font-weight: 700; }
.ed-help ul { padding-left: 16px; margin: 8px 0 0; line-height: 1.6; }
.ed-help b { color: var(--accent); }
input[type=range].ed-pos { width: calc(100% - 40px); margin: 8px 20px 12px; accent-color: var(--cyan); }
.ed-gpop { position: fixed; z-index: 45; width: 270px; padding: 14px; border-radius: 12px; border: 1px solid rgba(196, 155, 255, 0.6); background: rgba(10, 12, 32, 0.97); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
.ed-gpop[hidden] { display: none; }
.gp-title { font-weight: 700; margin-bottom: 8px; color: #c49bff; }
.gp-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.gp-row[hidden] { display: none; }
.gp-row select, .gp-row input { width: 110px; background: rgba(0, 0, 0, 0.45); color: var(--text); border: 1px solid var(--panel-line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.gp-actions { display: flex; gap: 6px; justify-content: flex-end; }
.gp-actions button { padding: 8px 12px; font-size: 13px; font-family: var(--font-b); letter-spacing: 0; }
.gp-actions button[hidden] { display: none; }

/* みんなの譜面 */
.chart-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.chart-row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel); border-left: 4px solid var(--c); }
.cr-lv { font-family: var(--font-d); font-weight: 900; font-size: 24px; color: var(--c); text-align: center; min-width: 46px; line-height: 1; }
.cr-lv small { display: block; font-size: 9px; letter-spacing: 0.2em; color: var(--muted); }
.cr-title { font-weight: 700; font-size: 15px; word-break: break-word; }
.cr-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cr-actions .cr-play { padding: 8px 14px; font-size: 13px; letter-spacing: 0.05em; }
.cr-btn { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.3); font-size: 12px; }
.cr-btn.liked { border-color: #ff4f8a; color: #ff6f9d; }
.cr-btn.danger:hover { border-color: #ff5a6e; color: #ff8a9a; }
.cr-rank { grid-column: 1 / -1; max-height: 260px; }
.cr-rank[hidden] { display: none; }

@media (max-width: 760px) {
  .ed-toolbar { padding: 0 12px 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ed-toolbar::-webkit-scrollbar { display: none; }
  .tb { flex-shrink: 0; white-space: nowrap; }
  .tb kbd { display: none; }
  .ed-main { padding: 0 12px; }
  .ed-side { display: none; }
  input[type=range].ed-pos { width: calc(100% - 24px); margin: 8px 12px 10px; }
  .ed-top input[type=text] { width: 100%; order: 10; }
  .chart-row { grid-template-columns: auto 1fr; }
  .cr-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ================= 洗練ネオン v2 ================= */
/* HUDの角ブラケット(どの要素にも .hud で付けられる) */
.hud { --hc: color-mix(in srgb, var(--accent) 80%, transparent); --hl: 16px; position: relative;
  background-image:
    linear-gradient(var(--hc), var(--hc)), linear-gradient(var(--hc), var(--hc)),
    linear-gradient(var(--hc), var(--hc)), linear-gradient(var(--hc), var(--hc)),
    linear-gradient(var(--hc), var(--hc)), linear-gradient(var(--hc), var(--hc)),
    linear-gradient(var(--hc), var(--hc)), linear-gradient(var(--hc), var(--hc));
  background-size: var(--hl) 2px, 2px var(--hl), var(--hl) 2px, 2px var(--hl), var(--hl) 2px, 2px var(--hl), var(--hl) 2px, 2px var(--hl);
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
}
.panel-label { display: flex; justify-content: space-between; font-family: var(--font-d); font-size: 10px; letter-spacing: 0.3em; color: color-mix(in srgb, var(--accent) 70%, var(--muted)); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--panel-line); }
.panel-label span:last-child { letter-spacing: 0.1em; color: var(--muted); }

/* うっすら走査線(UI全体) */
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px); }
body.playing::after { display: none; }

/* ---------- タイトル ---------- */
#title { overflow: hidden; }
.title-frame { position: absolute; inset: 18px; pointer-events: none; --hl: 34px; --hc: rgba(94, 242, 255, 0.55); }
.title-sweep { position: absolute; left: 0; right: 0; height: 2px; top: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(94, 242, 255, 0.9), transparent); box-shadow: 0 0 18px rgba(94, 242, 255, 0.7);
  animation: sweep 4.5s cubic-bezier(0.6, 0, 0.4, 1) infinite; opacity: 0.7; }
@keyframes sweep { 0% { transform: translateY(-10px); } 100% { transform: translateY(100vh); } }
.tele { position: absolute; font-family: var(--font-d); font-size: 10px; letter-spacing: 0.2em; line-height: 1.8; color: rgba(140, 170, 230, 0.6); pointer-events: none; }
.tele.tl { top: 36px; left: 40px; text-align: left; } .tele.tr { top: 36px; right: 40px; text-align: right; }
.tele.bl { bottom: 36px; left: 40px; min-height: 90px; text-align: left; } .tele.br { bottom: 36px; right: 40px; text-align: right; }
.tele b { color: #7ff9ff; font-weight: 600; } .tele b.ok { animation: blink 0.8s steps(2) infinite; }
.logo-big b { position: relative; display: block; animation: logoIn 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.15s; }
.logo-big b::after { content: attr(data-text); position: absolute; inset: 0; color: transparent; -webkit-text-stroke: 1px rgba(255, 79, 216, 0.7);
  transform: translate(4px, 0); animation: glitch 6s steps(1) infinite 1.5s; pointer-events: none; }
@keyframes logoIn { 0% { clip-path: inset(100% -30% -60% -30%); filter: brightness(3); } 100% { clip-path: inset(-60% -30% -60% -30%); filter: none; } }
@keyframes glitch { 0%, 92%, 100% { transform: translate(4px, 0); clip-path: none; } 93% { transform: translate(-6px, 1px); clip-path: inset(20% 0 55% 0); } 95% { transform: translate(8px, -1px); clip-path: inset(60% 0 10% 0); } 97% { transform: translate(-3px, 0); clip-path: inset(40% 0 40% 0); } }
.logo-big span { animation: fadeUp 0.8s ease-out both; }
.logo-rule { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 18px auto 44px; width: min(520px, 86vw); animation: fadeUp 0.8s ease-out both 0.6s; }
.logo-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(94, 242, 255, 0.8)); }
.logo-rule i:last-child { background: linear-gradient(270deg, transparent, rgba(94, 242, 255, 0.8)); }
.logo-rule em { font-style: normal; font-family: var(--font-d); font-size: 11px; letter-spacing: 0.55em; color: var(--cyan); white-space: nowrap; margin-right: -0.55em; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.btn-start { position: relative; font-family: var(--font-d); font-weight: 700; font-size: 14px; letter-spacing: 0.45em; padding: 16px 40px 16px calc(40px + 0.45em);
  color: #fff; background: rgba(94, 242, 255, 0.07); border: 1px solid rgba(94, 242, 255, 0.45);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  animation: fadeUp 0.8s ease-out both 0.9s, breathe2 2.4s ease-in-out infinite 1.7s; transition: background 0.2s; }
.btn-start:hover { background: rgba(94, 242, 255, 0.18); }
@keyframes breathe2 { 50% { background: rgba(94, 242, 255, 0.16); } }
.keys-hint { animation: fadeUp 0.8s ease-out both 1.1s; }
.keys-hint kbd { border-radius: 4px; }

/* ---------- 選曲 ---------- */
.song-card { grid-template-columns: auto 1fr auto; padding: 10px 14px 10px 10px; gap: 12px; border-radius: 6px; }
.song-card::before { display: none; }
.sc-jacket { width: 52px; height: 52px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.sc-text { min-width: 0; }
.song-card .sc-lv { grid-row: auto; grid-column: auto; }
.song-card.sel { transform: translateX(8px); border-color: transparent; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, rgba(8, 12, 30, 0.9)), rgba(8, 12, 30, 0.9) 70%);
  box-shadow: inset 3px 0 0 var(--c), 0 0 24px color-mix(in srgb, var(--c) 22%, transparent); }
.song-card.sel .sc-jacket { box-shadow: 0 0 0 1px var(--c), 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.song-card.upload { grid-template-columns: 1fr; padding-left: 16px; }
.detail { border-radius: 4px; border-color: rgba(110, 140, 255, 0.16); }
.d-head { display: flex; gap: 16px; align-items: flex-end; }
.d-jacket { width: 132px; height: 132px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: jIn 0.35s ease-out; }
@keyframes jIn { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.d-headtext { min-width: 0; }
.d-title { font-size: 26px; }
.diff-btn { border-radius: 4px; }
.btn-play { border-radius: 4px; clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.best { border-radius: 4px; }

/* ---------- リザルト ---------- */
.result-panel { border-radius: 4px; }
.r-banner { font-family: var(--font-d); font-weight: 900; font-size: clamp(20px, 4.5vw, 30px); letter-spacing: 0.35em; text-align: center; padding: 8px 0; margin: 10px -24px 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 18%, transparent), transparent); color: #fff; text-shadow: 0 0 14px var(--accent); }
.r-banner.full-combo { color: #ffe39a; text-shadow: 0 0 16px #ffd25e; background: linear-gradient(90deg, transparent, rgba(255, 210, 94, 0.18), transparent); }
.r-banner.all-perfect { background: linear-gradient(90deg, transparent, rgba(94, 242, 255, 0.2), rgba(255, 79, 216, 0.2), transparent); text-shadow: 0 0 16px #ff4fd8, 0 0 30px #5ef2ff; }
.r-banner.failed { color: #ff8a9a; text-shadow: none; background: none; letter-spacing: 0.5em; }
.r-jacket { width: 108px; height: 108px; border-radius: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.r-score { font-variant-numeric: tabular-nums; }
.result-panel.reveal .r-banner { animation: bannerIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.15s; }
.result-panel.reveal .r-jacket { animation: fadeUp 0.5s ease-out both 0.1s; }
.result-panel.reveal .r-rank { animation: rankIn 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both 0.9s; }
.result-panel.reveal .r-counts > div { animation: fadeUp 0.4s ease-out both; }
.result-panel.reveal .r-counts > div:nth-child(1) { animation-delay: 1.1s; } .result-panel.reveal .r-counts > div:nth-child(2) { animation-delay: 1.18s; }
.result-panel.reveal .r-counts > div:nth-child(3) { animation-delay: 1.26s; } .result-panel.reveal .r-counts > div:nth-child(4) { animation-delay: 1.34s; }
.result-panel.reveal .r-counts > div:nth-child(5) { animation-delay: 1.42s; }
@keyframes bannerIn { 0% { clip-path: inset(0 50% 0 50%); opacity: 0; } 100% { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes rankIn { 0% { opacity: 0; transform: scale(2.4); filter: blur(6px) brightness(3); } 100% { opacity: 1; transform: none; filter: none; } }
.r-counts div { border-radius: 4px; }

/* ---------- ガチャ ---------- */
.gacha-banner { border-radius: 6px; }
.gr-scan { position: absolute; inset: 0; display: none; place-items: center; }
.gacha-result.scanning .gr-scan { display: grid; }
.gacha-result.scanning .gr-inner { display: none; }
.gr-ring { position: absolute; width: min(60vw, 340px); aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--gc, #5ef2ff); border-left-color: color-mix(in srgb, var(--gc, #5ef2ff) 40%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--gc, #5ef2ff) 40%, transparent); animation: spin 0.9s linear infinite; }
.gr-ring.r2 { width: min(44vw, 240px); animation-duration: 1.4s; animation-direction: reverse; border-top-color: transparent; border-bottom-color: var(--gc, #5ef2ff); }
@keyframes spin { to { transform: rotate(360deg); } }
.gr-scantext { position: relative; font-family: var(--font-d); font-weight: 800; letter-spacing: 0.5em; color: #fff; text-align: center; animation: blink 0.5s steps(2) infinite; }
.gr-scantext span { display: block; font-size: 11px; letter-spacing: 0.3em; margin-top: 8px; color: var(--gc, #5ef2ff); }
.gacha-result.best3 { --gc: #ff4fd8; } .gacha-result.best4 { --gc: #ffd25e; }
.gacha-result.scanning.best4 { animation: goldFlash 2.2s ease-in both; }
@keyframes goldFlash { 70% { background: rgba(2, 3, 10, 0.88); } 92% { background: rgba(255, 210, 94, 0.35); } 100% { background: rgba(2, 3, 10, 0.88); } }
.gr-card { border-radius: 6px; overflow: hidden; }
.gr-card.r3::after, .gr-card.r4::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 2.4s ease-in-out infinite 1s; }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

@media (max-width: 760px) {
  .tele { display: none; }
  .title-frame { inset: 10px; --hl: 22px; }
  .sc-jacket { width: 44px; height: 44px; }
  .song-card { grid-template-columns: auto 1fr; }
  .song-card .sc-lv { grid-column: 1 / -1; }
  .d-jacket { width: 92px; height: 92px; }
  .d-title { font-size: 21px; }
  .r-jacket { width: 72px; height: 72px; }
  .r-banner { margin: 8px -18px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .title-sweep, .logo-big b::after { animation: none; }
}

/* ヘッダーを詰める */
.logo-small { white-space: nowrap; }
.nav { gap: 6px; }
.nav .chip { padding: 7px 11px; font-size: 12.5px; border-radius: 4px; }
@media (max-width: 1180px) and (min-width: 761px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .nav { width: 100%; justify-content: flex-start; }
  .topbar > .spacer { display: none; }
}

/* リザルトの横はみ出し対策 */
.result-panel { overflow-x: hidden; }
.r-main { flex-wrap: nowrap; gap: 16px; }
.r-rank { font-size: clamp(54px, 9vw, 84px); min-width: 0; flex-shrink: 0; }
.r-scorebox { min-width: 0; }
.r-score { font-size: clamp(30px, 5.6vw, 46px); white-space: nowrap; }
.r-badges:empty { display: none; }
@media (max-width: 560px) {
  .r-main { flex-wrap: wrap; justify-content: center; }
  .r-scorebox { flex-basis: 100%; text-align: center; }
}

/* ---------- 読み込み中画面 ---------- */
.overlay.loading-screen { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 10%, rgba(2, 3, 10, 0.94)), rgba(2, 3, 10, 0.97) 70%); backdrop-filter: blur(6px); z-index: 40; }
.ld-card { width: min(560px, 100%); padding: 22px 24px; border: 1px solid var(--panel-line); background-color: rgba(8, 12, 30, 0.85); border-radius: 4px; animation: fadeUp 0.35s ease-out; }
.ld-body { display: flex; gap: 18px; align-items: center; }
.ld-jacket { width: 128px; height: 128px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 34px color-mix(in srgb, var(--accent) 30%, transparent); animation: ldFloat 3s ease-in-out infinite; }
.ld-jacket[hidden] { display: none; }
@keyframes ldFloat { 50% { transform: translateY(-4px); } }
.ld-info { min-width: 0; }
.ld-genre { font-family: var(--font-d); font-size: 11px; letter-spacing: 0.35em; color: var(--accent); }
.ld-title { font-family: var(--font-d); font-weight: 800; font-size: clamp(22px, 5vw, 30px); line-height: 1.15; margin: 6px 0; word-break: break-word; text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent); }
.ld-diff { font-family: var(--font-d); font-size: 12px; letter-spacing: 0.15em; color: var(--muted); }
.ld-bar { position: relative; height: 4px; margin: 22px 0 8px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ld-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: width 0.15s linear; }
.ld-bar.indeterminate i { width: 35% !important; animation: scan 1.1s ease-in-out infinite alternate; }
.ld-status { font-family: var(--font-d); font-size: 11px; letter-spacing: 0.2em; color: var(--muted); margin: 0; }
.ld-tips { margin-top: 18px; padding: 12px 14px; border-left: 2px solid var(--accent); background: rgba(0, 0, 0, 0.3); display: flex; gap: 12px; align-items: baseline; min-height: 64px; }
.ld-tips b { font-family: var(--font-d); font-size: 10px; letter-spacing: 0.25em; color: var(--accent); flex-shrink: 0; }
.ld-tips p { margin: 0; font-size: 13.5px; line-height: 1.7; }
.ld-tips p.in { animation: tipIn 0.45s ease-out; }
@keyframes tipIn { from { opacity: 0; transform: translateX(8px); } }
@media (max-width: 560px) {
  .ld-card { padding: 18px; }
  .ld-jacket { width: 88px; height: 88px; }
  .ld-body { gap: 14px; }
}
.ld-card { font-family: var(--font-b); letter-spacing: normal; color: var(--text); }

.d-credit { font-size: 11px; color: var(--muted); margin-top: 4px; }
.d-credit a { color: var(--accent); }
.d-credit:empty { display: none; }
.tele.br { pointer-events: auto; }

/* タイトルの説明文(検索向け・控えめ表示) */
.title-lead { font-family: var(--font-b); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; color: rgba(200,215,255,0.65); margin: 22px 0 6px; animation: fadeUp 0.8s ease-out both 1.2s; }
.title-links { margin: 0; font-size: 12px; animation: fadeUp 0.8s ease-out both 1.3s; }
.title-links a { color: var(--cyan); }
.title-noscript { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--muted); }

.rec-bias { font-family: var(--font-d); font-size: 11px; color: var(--muted); }

/* 曲ページ・共有 */
.share-btn { display: block; width: 100%; margin: -6px 0 12px; padding: 8px; border-radius: 4px; border: 1px dashed var(--panel-line); background: transparent; color: var(--muted); font-size: 12px; }
.share-btn:hover { color: var(--accent); border-color: var(--accent); }
.title-song { font-family: var(--font-d); font-weight: 700; font-size: 18px; color: #fff; margin: -26px 0 30px; text-shadow: 0 0 12px var(--cyan); animation: fadeUp 0.8s ease-out both 0.8s; }
.title-song[hidden] { display: none; }

/* ================= 洗練ネオン v3: メニュー画面・切り替え ================= */
/* 画面切り替えのワイプ */
.wipe { position: fixed; inset: 0; z-index: 46; pointer-events: none; visibility: hidden; }
.wipe.go { visibility: visible; animation: wipeShow 0.5s linear forwards; }
.wipe::before { content: ''; position: absolute; inset: 0; background: rgba(2, 3, 10, 0.92);
  background-image: repeating-linear-gradient(0deg, rgba(94, 242, 255, 0.05) 0 1px, transparent 1px 4px); }
.wipe::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #bff9ff; box-shadow: 0 0 18px #5ef2ff, 0 0 40px #5ef2ff; }
.wipe.go::before { animation: wipeCurtain 0.45s cubic-bezier(0.5, 0, 0.3, 1) forwards; }
.wipe.go::after { animation: wipeLine 0.45s cubic-bezier(0.5, 0, 0.3, 1) forwards; }
@keyframes wipeCurtain { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(100% 0 0 0); } }
@keyframes wipeLine { from { top: 0; opacity: 1; } 90% { opacity: 1; } to { top: 100%; opacity: 0; } }
@keyframes wipeShow { to { visibility: hidden; } }
.screen.active .meta-body > *, .screen.active .select-body > * { animation: screenIn 0.4s ease-out both; }
.screen.active .meta-body > *:nth-child(2), .screen.active .select-body > *:nth-child(2) { animation-delay: 0.05s; }
.screen.active .meta-body > *:nth-child(3) { animation-delay: 0.1s; }
.screen.active .meta-body > *:nth-child(n+4) { animation-delay: 0.14s; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .wipe.go { display: none; } .screen.active .meta-body > *, .screen.active .select-body > * { animation: none; } }

/* メニュー画面のヘッダー */
.screen.meta .topbar { border-bottom: 1px solid var(--panel-line); background: linear-gradient(180deg, rgba(8, 12, 30, 0.85), rgba(8, 12, 30, 0.35)); margin-bottom: 12px; }
.screen.meta .meta-title { position: relative; padding-left: 14px; }
.screen.meta .meta-title::before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform: rotate(45deg); }

/* 角ブラケット(カード類) */
.quest, .chart-row, .slot, .fx-tile, .team-guide, .unit-card {
  --hc: color-mix(in srgb, var(--accent) 55%, transparent); --hl: 10px;
  background-image:
    linear-gradient(var(--hc), var(--hc)), linear-gradient(var(--hc), var(--hc)),
    linear-gradient(var(--hc), var(--hc)), linear-gradient(var(--hc), var(--hc));
  background-size: var(--hl) 1.5px, 1.5px var(--hl), var(--hl) 1.5px, 1.5px var(--hl);
  background-position: 0 0, 0 0, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
}
.fx-tile { --hc: var(--k); }

/* クエスト */
.quest { position: relative; border-radius: 4px; overflow: hidden; transition: transform 0.15s, border-color 0.15s; }
.quest::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0.6; }
.quest.ready { animation: questReady 1.8s ease-in-out infinite; }
.quest.ready::before { background: #ffd25e; opacity: 1; box-shadow: 0 0 10px #ffd25e; }
@keyframes questReady { 50% { box-shadow: 0 0 22px rgba(255, 210, 94, 0.35); } }
.quest:hover { transform: translateX(3px); }
.q-bar { height: 6px; border-radius: 0; background: rgba(255, 255, 255, 0.06); }
.q-bar span { border-radius: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, transparent), var(--accent)); box-shadow: 0 0 8px var(--accent); }
.quest.ready .q-bar span { background: linear-gradient(90deg, #ffb84d, #ffe39a); box-shadow: 0 0 10px #ffd25e; }
.q-claim:not([disabled]) { background: linear-gradient(180deg, rgba(255, 210, 94, 0.35), rgba(255, 210, 94, 0.12)); box-shadow: 0 0 14px rgba(255, 210, 94, 0.35); color: #fff; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); border-radius: 0; }
.q-reward { color: #ffe39a; text-shadow: 0 0 10px rgba(255, 210, 94, 0.5); }
.q-tab { border-radius: 4px; }

/* 編成 */
.slot { border-radius: 6px; }
.slot.leader.filled { box-shadow: 0 0 24px rgba(255, 210, 94, 0.18) inset; }
.slot.leader .slot-tag { text-shadow: 0 0 8px #ffd25e; }
.unit-card { border-radius: 6px; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.unit-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.fx-tile { border-radius: 4px; }
.fx-tile:not(.off) .fx-val { text-shadow: 0 0 12px var(--k); }
.kind-tab, .f-chip { border-radius: 4px; }

/* みんなの譜面 */
.chart-row { grid-template-columns: auto auto 1fr auto; border-radius: 4px; border-left-width: 1px; transition: transform 0.15s, box-shadow 0.15s; }
.chart-row:hover { transform: translateX(3px); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 22%, transparent); }
.cr-jacket { width: 56px; height: 56px; border-radius: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); }
.cr-lv { border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); padding: 6px 4px; border-radius: 3px; background: color-mix(in srgb, var(--c) 10%, transparent); }
.cr-actions .cr-play { clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); border-radius: 0; }
.cr-btn { border-radius: 3px; }
.cr-rank { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .chart-row { grid-template-columns: auto auto 1fr; }
  .cr-jacket { width: 44px; height: 44px; }
}

/* バージョン・更新履歴 */
.ver-chip { position: relative; font-family: var(--font-d); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.ver-new { position: absolute; top: -7px; right: -8px; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 3px; background: #ff4f6e; color: #fff; letter-spacing: 0.05em; animation: blink 1.2s steps(2) infinite; }
.ver-new[hidden] { display: none; }
.title-ver { font-family: var(--font-d); font-size: 10px; color: rgba(160, 180, 230, 0.6); margin-left: 4px; }
.changelog-box { width: min(620px, 100%); }
.changelog-box h2 { margin-top: 4px; }
.cl-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: min(62vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.cl-item { position: relative; padding: 10px 12px 10px 16px; border-left: 2px solid var(--panel-line); background: rgba(0, 0, 0, 0.25); border-radius: 0 4px 4px 0; }
.cl-item.latest { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, rgba(0, 0, 0, 0.25)); }
.cl-item.unseen::after { content: 'NEW'; position: absolute; top: 10px; right: 10px; font-family: var(--font-d); font-size: 9px; font-weight: 800; color: #ff8a9a; }
.cl-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.cl-ver { font-family: var(--font-d); font-weight: 800; font-size: 15px; color: #fff; }
.cl-item.latest .cl-ver { color: var(--accent); text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.cl-date { font-family: var(--font-d); font-size: 11px; color: var(--muted); }
.cl-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--accent); color: var(--accent); }
.cl-item ul { margin: 0; padding-left: 1.2em; font-size: 13px; line-height: 1.7; }

/* みんなでライブ */
.nav-live { border-color: rgba(255, 90, 140, 0.55); }
.nav-live .ico { color: #ff5a8c; animation: blink 1.2s steps(2) infinite; }
#live .meta-body { max-width: 980px; margin: 0 auto; width: 100%; }
.live-intro { border: 1px solid var(--panel-line); background: var(--panel); border-radius: 14px; padding: 18px; }
.live-intro h3 { margin: 6px 0 4px; font-size: 20px; }
.live-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.live-actions small { font-size: 11px; opacity: 0.7; }
.live-join { display: flex; gap: 6px; }
.live-join input { width: 130px; text-transform: uppercase; letter-spacing: 0.2em; font-family: var(--font-d); }
.live-h { margin: 18px 0 8px; font-size: 14px; color: var(--muted); letter-spacing: 0.1em; }
.live-rooms { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.live-rooms .empty { color: var(--muted); font-size: 13px; padding: 10px 4px; }
.live-room { width: 100%; display: grid; grid-template-columns: 48px 1fr auto auto auto; gap: 12px; align-items: center; text-align: left;
  border: 1px solid var(--panel-line); background: var(--panel); border-radius: 10px; padding: 8px 12px; color: inherit; }
.live-room:hover { border-color: var(--accent); }
.live-room img, .live-room > i { width: 48px; height: 48px; border-radius: 6px; display: block; background: #111a33; }
.lr-main { display: flex; flex-direction: column; min-width: 0; }
.lr-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-main small { font-family: var(--font-d); font-size: 11px; }
.lr-host { font-size: 12px; color: var(--muted); }
.lr-n { font-family: var(--font-d); font-size: 13px; }
.lr-st { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid #6dffb0; color: #6dffb0; }
.lr-st.play { border-color: #ff5a8c; color: #ff5a8c; }
.live-roombox { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.live-roombox[hidden], #live-lobby[hidden] { display: none; }
.live-room-main, .live-room-side { border: 1px solid var(--panel-line); background: var(--panel); border-radius: 14px; padding: 18px; }
.live-room-main .panel-label b { font-family: var(--font-d); color: var(--accent); font-size: 15px; letter-spacing: 0.15em; }
.live-room-main .panel-label .mini { width: 22px; height: 22px; margin-left: 4px; }
.lr-song { display: flex; gap: 14px; align-items: center; margin: 10px 0 12px; }
.lr-song img { width: 96px; height: 96px; border-radius: 8px; border: 1px solid var(--panel-line); }
.lr-song > div { min-width: 0; flex: 1; }
.lr-song h3 { margin: 2px 0 8px; font-size: 20px; }
.lr-song select { max-width: 100%; }
.lr-song select:disabled { opacity: 0.55; }
#live-diffs .diff-btn:disabled { cursor: default; }
#live-diffs .diff-btn:not(.sel):disabled { opacity: 0.45; }
#live-start { width: 100%; margin-top: 12px; }
#live-start[hidden] { display: none; }
#live-start small { font-size: 11px; opacity: 0.75; }
#live-start:disabled { opacity: 0.5; filter: grayscale(0.6); }
.live-msg { text-align: center; color: var(--muted); font-size: 13px; min-height: 1.5em; margin: 10px 0 4px; }
.live-leave { display: block; margin: 6px auto 0; font-size: 12px; padding: 6px 14px; }
.live-members { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.live-members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); font-size: 14px; }
.live-members li.me { background: color-mix(in srgb, var(--accent) 14%, rgba(0, 0, 0, 0.25)); }
.lm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-host { font-style: normal; font-family: var(--font-d); font-size: 9px; font-weight: 800; color: #ffd25e; border: 1px solid #ffd25e; border-radius: 3px; padding: 0 4px; margin-right: 6px; vertical-align: 2px; }
.lm-st { font-family: var(--font-d); font-size: 11px; white-space: nowrap; }
.lm-st.ok { color: #6dffb0; } .lm-st.wait { color: var(--muted); } .lm-st.play { color: #ff5a8c; } .lm-st.done { color: #ffd25e; font-weight: 800; }
.r-live { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(255, 90, 140, 0.4); border-radius: 12px; background: rgba(255, 90, 140, 0.06); font-size: 13px; }
.r-live[hidden] { display: none; }
.lv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lv-head b { font-family: var(--font-d); color: #ff7aa2; letter-spacing: 0.12em; }
.lv-head span { font-weight: 700; }
.r-live p { margin: 2px 0 0; }
.lv-list li { grid-template-columns: 34px 1fr auto auto; }
.lv-list li.win .sc { color: #ffd25e; }
.lv-list .cb { font-family: var(--font-d); font-size: 11px; color: var(--muted); }
.lv-mark { font-style: normal; font-family: var(--font-d); font-size: 9px; font-weight: 800; margin-left: 6px; padding: 0 4px; border-radius: 3px; border: 1px solid #7ff9ff; color: #7ff9ff; }
.lv-mark.ap { border-color: #ffd25e; color: #ffd25e; }
body.live #btn-p-retry, body.live #btn-retry { display: none; }
@media (max-width: 760px) {
  .live-roombox { grid-template-columns: 1fr; }
  .live-room { grid-template-columns: 40px 1fr auto; }
  .live-room img, .live-room > i { width: 40px; height: 40px; }
  .lr-host, .lr-n { display: none; }
  .lr-song img { width: 72px; height: 72px; }
}
.lr-song select { background: rgba(0, 0, 0, 0.45); color: var(--text); border: 1px solid var(--panel-line); border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 13px; }
.lr-song select option { background: #0a1024; }

/* ---------- ホーム(モード選択) ---------- */
#home { flex-direction: column; }
.home-body { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.home-body [hidden] { display: none !important; }
.h-player { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; padding: 10px 14px; border: 1px solid var(--panel-line); border-left: 2px solid var(--accent); background: var(--panel); border-radius: 4px; animation: fadeUp 0.4s ease-out both; }
.h-player b { font-size: 16px; }
.hp-hi { font-family: var(--font-d); font-size: 10px; letter-spacing: 0.2em; color: var(--accent); }
.hp-sep { width: 1px; height: 14px; background: var(--panel-line); }
.hp-login { margin-left: auto; padding: 7px 14px; font-size: 13px; }
.home-main { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.h-tile { --tc: #5ef2ff; position: relative; overflow: hidden; text-align: left; color: var(--text); border: 1px solid var(--panel-line); background: var(--panel); border-radius: 6px;
  padding: 16px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; backdrop-filter: blur(6px);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; animation: fadeUp 0.45s ease-out both; }
.h-tile::before { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 16%, transparent), transparent 55%); pointer-events: none; }
.h-tile::after { content: ''; position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border-top: 2px solid var(--tc); border-right: 2px solid var(--tc); opacity: 0.7; }
.h-tile:hover, .h-tile:focus-visible { transform: translateY(-3px); border-color: var(--tc); box-shadow: 0 0 24px color-mix(in srgb, var(--tc) 30%, transparent); outline: none; }
.h-tile:nth-child(2) { --tc: #6dffb0; animation-delay: 0.05s; }
.h-tile:nth-child(3) { --tc: #ffd25e; animation-delay: 0.1s; }
.h-tile:nth-child(4) { --tc: #ff9a5c; animation-delay: 0.15s; }
.h-tile:nth-child(5) { --tc: #c49bff; animation-delay: 0.2s; }
.h-tile:nth-child(6) { --tc: #ff7ce6; animation-delay: 0.25s; }
.h-label { position: relative; display: flex; flex-direction: column; line-height: 1.15; }
.h-label small { font-family: var(--font-d); font-size: 9px; letter-spacing: 0.25em; color: var(--tc); }
.h-label b { font-family: var(--font-d); font-weight: 900; font-size: 24px; letter-spacing: 0.06em; color: #fff; text-shadow: 0 0 14px color-mix(in srgb, var(--tc) 55%, transparent); }
.h-label span { font-size: 13px; font-weight: 700; color: var(--tc); }
.h-tile p { position: relative; margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.h-badge { position: absolute; top: 10px; left: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ff4f6e; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.h-tile.locked, .hl-card.locked { filter: saturate(0.4); }
.h-tile.locked .h-label, .h-tile.locked p, .hl-card.locked > :not(.hl-lock) { opacity: 0.55; }
.h-tile.locked p::before, .hl-card.locked p::before { content: '🔒 ログインで解放 ・ '; color: #ffd25e; }
.h-go { position: absolute; right: 16px; bottom: 14px; font-style: normal; font-family: var(--font-d); font-size: 11px; letter-spacing: 0.15em; color: var(--tc, var(--accent)); opacity: 0.8; }

/* LIVE(大きいタイル) */
.h-tile.h-live { grid-column: 1 / -1; min-height: min(42vh, 340px); padding: 28px; justify-content: center; }
.h-live::before { background: linear-gradient(90deg, rgba(2, 3, 10, 0.92) 25%, rgba(2, 3, 10, 0.35) 70%, rgba(2, 3, 10, 0.7)); z-index: 1; }
.h-live > :not(.h-jackets) { z-index: 2; }
.h-live::after { z-index: 2; }
.h-jackets { position: absolute; top: -40%; right: -10%; width: 85%; height: 180%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; transform: rotate(-12deg); opacity: 0.85; animation: hjScroll 40s linear infinite; }
.h-jackets img { width: 100%; aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.12); }
@keyframes hjScroll { from { transform: rotate(-12deg) translateY(0); } to { transform: rotate(-12deg) translateY(-25%); } }
.h-live .h-label b { font-size: clamp(48px, 9vw, 96px); line-height: 1; letter-spacing: 0.08em; }
.h-live .h-label small { font-size: 11px; }
.h-live .h-label span { font-size: 18px; }
.h-live p { font-size: 14px; color: rgba(220, 235, 255, 0.85); margin-top: 6px; }
.h-live .h-go { font-size: 13px; bottom: 22px; right: 26px; animation: blink 1.4s steps(2) infinite; }

/* ライブの選択 */
.home-live { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.hl-head { display: flex; align-items: center; gap: 12px; }
.hl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: min(60vh, 460px); }
.hl-card { --tc: #5ef2ff; position: relative; overflow: hidden; text-align: left; color: var(--text); border: 1px solid var(--panel-line); background: var(--panel); border-radius: 8px;
  padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; backdrop-filter: blur(6px); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; animation: fadeUp 0.4s ease-out both; }
.hl-card.multi { --tc: #ff5a8c; animation-delay: 0.08s; }
.hl-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 70% 20%, color-mix(in srgb, var(--tc) 22%, transparent), transparent 60%); pointer-events: none; }
.hl-card:hover, .hl-card:focus-visible { transform: translateY(-4px); border-color: var(--tc); box-shadow: 0 0 34px color-mix(in srgb, var(--tc) 35%, transparent); outline: none; }
.hl-card small { position: relative; font-family: var(--font-d); font-size: 11px; letter-spacing: 0.3em; color: var(--tc); }
.hl-card b { position: relative; font-size: clamp(24px, 3.4vw, 36px); font-weight: 900; text-shadow: 0 0 18px color-mix(in srgb, var(--tc) 50%, transparent); }
.hl-card p { position: relative; margin: 0; font-size: 13px; color: rgba(210, 225, 255, 0.8); line-height: 1.6; max-width: 32em; }
.hl-card .h-go { --tc: inherit; color: var(--tc); bottom: 22px; right: 24px; }
.hl-ico { position: absolute; top: 26px; right: 28px; display: flex; gap: 8px; }
.hl-ico i { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--tc); box-shadow: 0 0 16px color-mix(in srgb, var(--tc) 60%, transparent), inset 0 0 12px color-mix(in srgb, var(--tc) 40%, transparent); }
.hl-card.multi .hl-ico i { width: 34px; height: 34px; }
.hl-card.multi .hl-ico i:nth-child(2) { margin-top: 14px; }

/* 選曲画面の見出し */
#select .topbar .meta-title { font-size: 15px; }

@media (max-width: 860px) {
  .home-main { grid-template-columns: 1fr 1fr; }
  .h-tile { min-height: 116px; padding: 14px; }
  .h-label b { font-size: 20px; }
  .h-tile.h-live { min-height: 220px; padding: 20px; }
  .h-jackets { width: 110%; right: -40%; }
  .hl-cards { grid-template-columns: 1fr; min-height: 0; }
  .hl-card { min-height: 190px; padding: 22px; }
  .home-body { padding: 4px 12px 20px; }
  .hp-login { margin-left: 0; }
}
@media (max-width: 860px) { .home-main .h-tile:last-child { grid-column: 1 / -1; min-height: 96px; } }
body.touch .h-go { display: none; }
.lm-diff { font-style: normal; font-family: var(--font-d); font-size: 9px; font-weight: 800; color: var(--dc); border: 1px solid var(--dc); border-radius: 3px; padding: 0 4px; margin-left: auto; margin-right: 8px; white-space: nowrap; }
.lv-list .lm-diff { margin: 0 0 0 6px; vertical-align: 1px; }

/* きくだけ(音楽プレーヤー) */
.home-main { grid-template-columns: repeat(3, 1fr); }
.h-tile.h-music { --tc: #5ef2ff; }
#player .topbar input[type=search] { background: rgba(0, 0, 0, 0.45); color: var(--text); border: 1px solid var(--panel-line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; width: min(260px, 40vw); }
.pl-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 16px; padding: 0 20px 20px; max-width: 1180px; width: 100%; margin: 0 auto; }
.pl-now { border: 1px solid var(--panel-line); background: var(--panel); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.pl-art { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.pl-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-art img { width: 62%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent); animation: plSpin 24s linear infinite; animation-play-state: paused; }
.pl-now.playing .pl-art img { animation-play-state: running; }
@keyframes plSpin { to { transform: rotate(360deg); } }
.pl-info { text-align: center; }
.pl-info h1 { margin: 2px 0; font-size: 22px; }
.pl-artist { font-size: 12px; color: var(--muted); }
.pl-seekrow { display: flex; align-items: center; gap: 10px; font-family: var(--font-d); font-size: 12px; color: var(--muted); }
.pl-seekrow input { flex: 1; accent-color: var(--accent); }
.pl-ctrl { display: flex; justify-content: center; align-items: center; gap: 14px; }
.pl-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.35); font-size: 18px; display: grid; place-items: center; }
.pl-btn:hover { border-color: var(--accent); }
.pl-btn.big { width: 66px; height: 66px; font-size: 22px; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, rgba(0, 0, 0, 0.35)); box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.pl-btn.small { width: 38px; height: 38px; font-size: 15px; opacity: 0.45; }
.pl-btn.small.on { opacity: 1; border-color: var(--accent); }
.pl-hint { text-align: center; margin: 0; }
.pl-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.pl-list .empty { color: var(--muted); padding: 12px; }
.pl-list button { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-align: left; color: inherit; border: 1px solid var(--panel-line); background: var(--panel); border-radius: 8px; padding: 6px 12px 6px 6px; }
.pl-list button:hover { border-color: var(--c); }
.pl-list button.cur { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel)); }
.pl-list button.cur .pl-tt b::before { content: '♪ '; color: var(--c); }
.pl-list img { width: 44px; height: 44px; border-radius: 4px; }
.pl-tt { display: flex; flex-direction: column; min-width: 0; }
.pl-tt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-tt small { font-size: 11px; color: var(--muted); }
.pl-len { font-family: var(--font-d); font-size: 12px; color: var(--muted); }
@media (max-width: 860px) {
  .home-main { grid-template-columns: 1fr 1fr; }
  .pl-body { grid-template-columns: 1fr; overflow-y: auto; padding: 0 12px 16px; }
  .pl-list { overflow: visible; }
  .pl-art { width: min(100%, 320px); margin: 0 auto; }
  #player .topbar input[type=search] { width: 100%; order: 10; }
}
.pl-art { width: min(100%, 46vh); margin: 0 auto; }
@media (max-width: 860px) {
  .pl-body { display: flex; flex-direction: column; }
  .pl-now { overflow: visible; flex: none; }
  .pl-art { width: min(100%, 34vh); }
  .pl-hint { display: none; }
}

/* チュートリアル */
.tut-box h2 { margin: 6px 0 8px; }
.tut-box p { line-height: 1.7; }
.tut-steps { margin: 4px 0 14px; padding-left: 1.4em; line-height: 1.9; }
.tut-steps li::marker { color: var(--accent); font-family: var(--font-d); font-weight: 800; }
.tut-result { font-size: 15px; }
.tut-result b { font-family: var(--font-d); font-size: 22px; color: var(--accent); }
.tut-fc { color: #7ff9ff; font-weight: 800; }
.tut-box .modal-actions { flex-wrap: wrap; }

/* ガチャの切り替え・イベントガチャ */
.gacha-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.g-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--panel-line); background: var(--panel); color: var(--text); font-weight: 700; font-size: 14px; }
.g-tab small { font-weight: 400; font-size: 11px; color: var(--muted); }
.g-tab.sel { border-color: #ffd25e; box-shadow: 0 0 16px rgba(255, 210, 94, 0.3); }
.g-tab.theme-halloween { border-color: rgba(255, 138, 31, 0.5); }
.g-tab.theme-halloween small { color: #ffb36b; }
.g-tab.theme-halloween.sel { border-color: #ff8a1f; background: linear-gradient(135deg, rgba(255, 138, 31, 0.22), rgba(120, 40, 200, 0.22)), var(--panel); box-shadow: 0 0 18px rgba(255, 138, 31, 0.4); }
.gacha-banner { position: relative; overflow: hidden; }
.gacha-banner > * { position: relative; }
.gb-deco { display: none; }
.gb-period { display: inline-block; font-size: 12px; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; border: 1px solid currentColor; }
.gb-period b { margin-left: 6px; }
.gb-pickup { margin: 14px 0 12px; }
.gp-label { font-family: var(--font-d); font-size: 11px; letter-spacing: 0.3em; margin-bottom: 8px; }
.gp-units { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gp-u { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; font-size: 12px; }
.gp-u b { font-size: 12px; line-height: 1.3; }
.gp-u small { font-size: 10px; color: var(--muted); }
.gp-u.r4 { width: 120px; }
.gacha-banner.theme-halloween { border-color: rgba(255, 138, 31, 0.6); background:
  radial-gradient(circle at 80% -10%, rgba(255, 231, 168, 0.25), transparent 30%),
  radial-gradient(circle at 50% 0%, rgba(255, 138, 31, 0.3), transparent 60%),
  radial-gradient(circle at 50% 120%, rgba(140, 50, 220, 0.35), transparent 60%), #0c0614; }
.gacha-banner.theme-halloween .gb-deco { display: block; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 12% 30%, rgba(255, 138, 31, 0.5) 0 2px, transparent 3px), radial-gradient(circle at 88% 60%, rgba(180, 90, 255, 0.5) 0 2px, transparent 3px), radial-gradient(circle at 30% 80%, rgba(255, 138, 31, 0.4) 0 1.5px, transparent 2.5px), radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.4) 0 1px, transparent 2px);
  animation: hwFloat 6s ease-in-out infinite alternate; }
@keyframes hwFloat { to { transform: translateY(-8px); } }
.gacha-banner.theme-halloween .gb-title { color: #c08bff; }
.gacha-banner.theme-halloween .gb-title b { text-shadow: 0 0 18px #ff8a1f, 0 0 32px rgba(255, 138, 31, 0.6); }
.gacha-banner.theme-halloween .gb-period, .gacha-banner.theme-halloween .gp-label { color: #ffb36b; }
.gacha-banner.theme-halloween .gb-pity { color: #ff8a1f; }
.gacha-banner.theme-halloween .gb-sub { color: #e9d7ff; }
.gacha-banner.theme-halloween #btn-gacha-10 { border-color: #ff8a1f; background: rgba(255, 138, 31, 0.18); box-shadow: 0 0 18px rgba(255, 138, 31, 0.4); }
.lineup-row b { white-space: nowrap; }
.gr-lim, .uc-lim { font-size: 10px; font-weight: 800; color: #1c0830; background: #ff8a1f; border-radius: 3px; padding: 0 5px; }
.gr-lim { position: absolute; top: 6px; left: 6px; }
.uc-lim { margin-right: 4px; vertical-align: 1px; }
.h-event { color: #ff8a1f; font-weight: 800; }
.h-tile.h-event-on { border-color: rgba(255, 138, 31, 0.6); }
.gp-units + .gp-units { margin-top: 10px; }
.gp-u.r2 { width: 88px; }
.gp-u.r2 b { font-size: 11px; }

/* 管理者ページ */
.adm-chip { border-color: rgba(255, 210, 94, 0.6); color: #ffd25e; }
.adm-chip[hidden] { display: none; }
.adm-body { max-width: 1100px; margin: 0 auto; width: 100%; }
.adm-deny { padding: 40px; text-align: center; color: #ff8a9a; font-weight: 700; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.adm-card { border: 1px solid var(--panel-line); background: var(--panel); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.adm-card small { font-size: 11px; color: var(--muted); }
.adm-card b { font-family: var(--font-d); font-size: 26px; color: #fff; }
.adm-card span { font-size: 11px; color: var(--muted); }
.adm-h { margin: 22px 0 8px; font-size: 14px; letter-spacing: 0.08em; color: var(--muted); }
.adm-online { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.adm-online li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--panel-line); background: var(--panel); border-radius: 6px; font-size: 14px; flex-wrap: wrap; }
.adm-online li span { color: var(--accent); }
.adm-online li small { color: var(--muted); margin-left: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6dffb0; box-shadow: 0 0 8px #6dffb0; margin-right: 6px; font-style: normal; }
.adm-table-wrap { overflow-x: auto; border: 1px solid var(--panel-line); border-radius: 8px; background: var(--panel); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.adm-table th, .adm-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(110, 140, 255, 0.12); }
.adm-table th { font-size: 11px; color: var(--muted); font-weight: 700; }
.adm-table th[data-sort] { cursor: pointer; }
.adm-table th.on { color: var(--accent); }
.adm-table td small { display: block; font-size: 10px; color: var(--muted); }
.adm-table td.n { text-align: right; font-family: var(--font-d); }
.adm-table tr.on td:first-child { font-weight: 700; }
.adm-badge { font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 3px; background: #ffd25e; color: #1a1300; }
.adm-badge.fc { background: #7ff9ff; } .adm-badge.ap { background: #ffd25e; }

/* 段位道場 */
.hl-cards { grid-template-columns: repeat(3, 1fr); }
.hl-card.dan { --tc: #ffd25e; animation-delay: 0.16s; }
.hl-card.dan .hl-ico i { border-radius: 4px; transform: rotate(45deg); }
.dan-best { font-weight: 800; color: #ffd25e; margin-left: 10px; }
.hp-dan { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 3px; background: #ffd25e; color: #1a1300; }
.dan-help { margin: 0 0 12px; line-height: 1.7; }
.dan-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dan-card { --dc: hsl(calc(200 - var(--dn) * 18), 90%, 65%); border: 1px solid var(--panel-line); border-top: 3px solid var(--dc); background: var(--panel); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dan-card.kaiden { --dc: #ffd25e; background: linear-gradient(160deg, rgba(255, 210, 94, 0.12), transparent 60%), var(--panel); box-shadow: 0 0 22px rgba(255, 210, 94, 0.2); }
.dan-card.cleared { border-color: color-mix(in srgb, var(--dc) 60%, transparent); }
.dan-name { display: flex; align-items: center; gap: 10px; }
.dan-name b { font-size: 26px; font-weight: 900; color: var(--dc); text-shadow: 0 0 14px color-mix(in srgb, var(--dc) 50%, transparent); }
.dan-pass { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 3px; background: var(--dc); color: #05060f; }
.dan-songs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.dan-songs li { display: flex; align-items: center; gap: 10px; }
.dan-songs img { width: 34px; height: 34px; border-radius: 4px; }
.dan-songs span { display: flex; flex-direction: column; min-width: 0; }
.dan-songs b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dan-songs small { font-size: 10px; color: var(--muted); }
.dan-rule { font-size: 11px; color: var(--muted); }
.dan-go { margin-top: auto; }
body.live #btn-p-retry { display: none; }
.dan-result-box { width: min(560px, 100%); text-align: center; }
.dan-verdict { font-size: 64px; font-weight: 900; letter-spacing: 0.2em; margin: 6px 0; animation: rankIn 0.6s ease-out both; }
.dan-result-box.pass .dan-verdict { color: #ffd25e; text-shadow: 0 0 30px rgba(255, 210, 94, 0.7); }
.dan-result-box.fail .dan-verdict { color: #ff4f6e; text-shadow: 0 0 24px rgba(255, 79, 110, 0.5); }
.dan-sub { color: var(--muted); margin: 0 0 12px; }
.dan-res { list-style: none; padding: 0; margin: 0 0 10px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.dan-res li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); }
.dan-res li span { font-family: var(--font-d); font-weight: 800; }
.dan-res li small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.dan-res li.failed span { color: #ff4f6e; }
.dan-reward { color: #ffd25e; font-weight: 700; min-height: 1.2em; }
@media (max-width: 860px) { .hl-cards { grid-template-columns: 1fr; } }

/* お気に入り(☆) */
.sc-fav { float: left; margin: 1px 6px 0 0; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; transition: color 0.15s, transform 0.15s; }
.sc-fav:hover { color: #ffd25e; transform: scale(1.2); }
.sc-fav.on { color: #ffd25e; text-shadow: 0 0 8px rgba(255, 210, 94, 0.7); }
.d-fav { margin-top: 8px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(0, 0, 0, 0.3); color: var(--muted); font-size: 12px; }
.d-fav:hover { border-color: #ffd25e; color: #ffd25e; }
.d-fav.on { border-color: #ffd25e; color: #ffd25e; background: rgba(255, 210, 94, 0.12); font-weight: 700; }

/* みんなでライブ: ホストは左に曲リスト(ひとりでライブの選曲画面と同じ見た目) */
#live .meta-body:has(.live-roombox.host:not([hidden])) { max-width: 1320px; }
.live-pick { display: none; min-width: 0; }
.live-roombox.host { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.75fr); align-items: start; }
.live-roombox.host .live-pick { display: flex; flex-direction: column; gap: 8px; }
.live-pick .song-list { max-height: calc(100vh - 230px); overflow-y: auto; display: grid; gap: 6px; padding: 2px 12px 8px 2px; }
.live-pick .song-card { max-width: none; width: 100%; }
.live-pick .song-card.sel { transform: none; }
.live-pick .song-list.locked .song-card:not(.sel) { opacity: 0.5; }
.live-pick > * { flex-shrink: 0; }
.live-pick .song-col .song-list, .live-pick .song-list { flex: none; }
.live-pick .filter-chips { flex-wrap: wrap; }
.lr-pickmsg { margin: 0; font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) {
  .live-roombox.host { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .live-roombox.host .live-pick { grid-row: span 2; }
}
@media (max-width: 760px) {
  .live-roombox.host { grid-template-columns: 1fr; }
  .live-roombox.host .live-pick { order: 2; grid-row: auto; }
  .live-roombox.host .live-room-side { order: 3; }
  .live-pick .song-list { display: grid; max-height: 55vh; overflow-x: hidden; }
  .live-pick .song-card { min-width: 0; }
}
