/* 灯台ビート — 夜の港・ネオンの灯台 */
:root {
  --night: #0a1033;
  --deep: #060a22;
  --navy2: #0e1642;
  --navy3: #141d52;
  --line: #27326f;
  --magenta: #ff3d9a;
  --magenta-d: #c8106c;
  --cyan: #39e6f5;
  --lamp: #ffc857;
  --ink: #f2f5ff;
  --mist: #b4bfef;
  --song: #39e6f5;
  --f-neon: "Tilt Neon", "Chakra Petch", sans-serif;
  --f-num: "Chakra Petch", "M PLUS 1p", sans-serif;
  --f-head: "Dela Gothic One", "M PLUS 1p", sans-serif;
  --f-body: "M PLUS 1p", "Hiragino Sans", sans-serif;
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;
  --glow-c: 0 0 0 1px rgba(57, 230, 245, .55), 0 0 18px rgba(57, 230, 245, .35);
  --glow-m: 0 0 0 1px rgba(255, 61, 154, .6), 0 0 22px rgba(255, 61, 154, .4);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --t-fast: 90ms;
  --t-mid: 260ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--deep);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; flex: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
wbr { display: inline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--night);
}
@media (min-width: 600px) {
  body {
    background:
      radial-gradient(ellipse at 50% 20%, rgba(255, 61, 154, .18), transparent 55%),
      radial-gradient(ellipse at 50% 90%, rgba(57, 230, 245, .14), transparent 60%),
      repeating-linear-gradient(0deg, rgba(57, 230, 245, .05) 0 1px, transparent 1px 32px),
      var(--deep);
  }
  .app { left: 50%; right: auto; width: 430px; transform: translateX(-50%); box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .6); }
}

/* ---------- 共通部品 ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.is-active { display: flex; }
/* JS が読めなかったときもタイトルは見せる */
html:not([data-ready]) .screen--title { display: flex; }
.screen.is-enter { animation: enter var(--t-mid) var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--navy2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.icon-btn:active { transform: scale(.9); background: var(--navy3); }
.icon-btn--spacer { visibility: hidden; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--r-s);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .04em;
  word-break: keep-all;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-mid), filter var(--t-fast);
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn--l { min-height: 54px; width: 100%; font-size: 17px; }
.btn--xl { min-height: 62px; width: 100%; font-size: 20px; }
.btn--neon {
  background: var(--cyan);
  color: var(--deep);
  box-shadow: 0 0 0 2px rgba(255, 61, 154, .9), 0 0 28px rgba(57, 230, 245, .55), 0 8px 24px rgba(0, 0, 0, .4);
}
.btn--neon::after {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 8px;
  border: 1px dashed rgba(6, 10, 34, .35);
  pointer-events: none;
}
.btn--neon:active { filter: brightness(1.15); box-shadow: 0 0 0 3px var(--magenta), 0 0 40px rgba(57, 230, 245, .9); }
.btn--ghost { background: var(--navy2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:active { background: var(--navy3); }
.btn--text { min-height: 44px; padding: 0 12px; font-weight: 700; font-size: 15px; color: var(--mist); }
.btn--danger { background: #ff6b8f; color: #1a0410; }
.btn--sq { width: 54px; min-height: 54px; padding: 0; }

.bar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 14px 8px;
  background: var(--deep);
  border-bottom: 1px solid var(--line);
  flex: none;
  z-index: 3;
}
.bar--clear { background: transparent; border-bottom: 0; position: absolute; left: 0; right: 0; top: 0; }
.bar__title { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.2; font-weight: 800; font-size: 17px; }
.bar__en { font-family: var(--f-neon); font-size: 12px; letter-spacing: .14em; color: var(--cyan); font-weight: 400; }

.sec-h {
  display: flex; align-items: baseline; gap: 10px;
  margin: 28px 4px 12px;
  font-size: 17px; font-weight: 800;
  font-feature-settings: "palt";
}
.sec-h__en { font-family: var(--f-neon); font-weight: 400; font-size: 13px; letter-spacing: .12em; color: var(--magenta); text-transform: uppercase; }

/* ---------- タイトル ---------- */
.screen--title {
  background:
    linear-gradient(180deg, rgba(6, 10, 34, .55) 0%, rgba(6, 10, 34, 0) 26%, rgba(6, 10, 34, 0) 52%, rgba(6, 10, 34, .9) 76%, #060a22 100%),
    url("/app-development/apps/a004/img/title.webp") center 30% / cover no-repeat,
    var(--deep);
}
.title__top { display: flex; justify-content: flex-end; padding: calc(10px + var(--safe-t)) 14px 0; }
.title__logo { padding: 2vh 24px 0; text-align: center; }
.title__en {
  font-family: var(--f-neon);
  font-size: 15px; letter-spacing: .32em;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(57, 230, 245, .8);
  display: flex; justify-content: center; gap: .6em;
  text-transform: uppercase;
}
.title__en-b { color: #ff8cc6; text-shadow: 0 0 10px rgba(255, 61, 154, .9); }
.logo {
  font-family: var(--f-head);
  font-weight: 400;
  line-height: 1;
  margin-top: 6px;
  display: flex; flex-direction: column; align-items: center;
  font-feature-settings: "palt";
}
.logo__a {
  font-size: 76px;
  color: #fffaf0;
  letter-spacing: .04em;
  text-shadow: 0 0 2px #fff, 0 0 18px rgba(255, 200, 87, .9), 0 0 42px rgba(255, 61, 154, .55);
}
.logo__b {
  font-size: 50px;
  letter-spacing: .14em;
  margin-top: 4px;
  color: #eafcff;
  text-shadow: 0 0 2px #fff, 0 0 14px rgba(57, 230, 245, 1), 0 0 34px rgba(57, 230, 245, .6);
}
@media (prefers-reduced-motion: no-preference) {
  .logo__b { animation: neon 5.5s steps(1) infinite; }
}
@keyframes neon { 0%, 100% { opacity: 1; } 91% { opacity: 1; } 92% { opacity: .55; } 93% { opacity: 1; } 95% { opacity: .7; } 96% { opacity: 1; } }
.title__lead {
  margin: 14px auto 0;
  display: inline-flex; flex-direction: column;
  font-size: 15px; font-weight: 700;
  word-break: keep-all;
  color: var(--ink);
  background: rgba(6, 10, 34, .92);
  padding: 8px 14px;
  border-radius: 10px;
}
.title__menu {
  margin-top: auto;
  padding: 0 22px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; gap: 12px;
}
.title__best {
  align-self: center;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: #0b1236;
  box-shadow: inset 0 0 0 1px var(--line);
}
.title__best-k { font-size: 12px; color: var(--mist); font-weight: 700; }
.title__best b { font-size: 20px; font-weight: 700; color: var(--lamp); }
.title__best-s { font-size: 12px; color: var(--mist); font-weight: 700; }
.title__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.title__row .btn { font-size: 15px; padding: 0 10px; }
.title__about {
  align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 12px;
  font-size: 14px; font-weight: 700; color: var(--mist);
}
.title__about svg { width: 18px; height: 18px; }

/* ---------- 選曲 ---------- */
.screen--select {
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--song) 22%, transparent), transparent 60%),
    var(--night);
  transition: background var(--t-mid);
}
.select__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.deck {
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 18px calc(50% - min(34vw, 136px)) 8px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.deck::-webkit-scrollbar { display: none; }
.card {
  position: relative;
  flex: none;
  width: min(68vw, 272px);
  aspect-ratio: 1 / 1.12;
  border-radius: var(--r-l);
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--navy2);
  transform: scale(.88);
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid);
  text-align: left;
}
.card img { width: 100%; height: 82%; object-fit: cover; }
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 82%;
  background: rgba(6, 10, 34, .45);
  transition: opacity var(--t-mid);
  pointer-events: none;
}
.card[aria-selected="true"] { transform: none; box-shadow: 0 0 0 2px var(--c), 0 0 34px color-mix(in srgb, var(--c) 55%, transparent), 0 18px 40px rgba(0, 0, 0, .5); }
.card[aria-selected="true"]::after { opacity: 0; }
.card:active { transform: scale(.95); }
.card__no {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  padding: 3px 9px; border-radius: 999px;
  background: #060a22; color: var(--ink);
}
.card__t {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 18%;
  min-height: 46px;
  padding: 6px 14px;
  display: flex; flex-direction: column; justify-content: center;
  background: #0b1236;
  border-top: 2px solid var(--c);
  line-height: 1.25;
}
.card__en { font-family: var(--f-neon); font-size: 11px; letter-spacing: .12em; color: var(--mist); }
.card__title { font-weight: 800; font-size: 15px; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__eq { position: absolute; right: 14px; bottom: calc(18% + 12px); display: flex; gap: 3px; align-items: flex-end; height: 22px; opacity: 0; z-index: 1; }
.card__eq i { width: 4px; background: var(--c); border-radius: 2px; height: 30%; box-shadow: 0 0 8px var(--c); }
.deck.is-playing .card[aria-selected="true"] .card__eq { opacity: 1; }
.deck.is-playing .card[aria-selected="true"] .card__eq i { animation: eq .7s ease-in-out infinite alternate; }
.card__eq i:nth-child(2) { animation-delay: -.3s !important; }
.card__eq i:nth-child(3) { animation-delay: -.5s !important; }
.card__eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
.dots { display: flex; justify-content: center; gap: 8px; padding: 6px 0 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: width var(--t-mid) var(--ease), background var(--t-mid); }
.dots i.is-on { width: 22px; border-radius: 4px; background: var(--song); }

.songinfo { padding: 8px 20px 0; }
.songinfo__head { display: flex; gap: 14px; align-items: center; }
.songinfo__no {
  font-size: 44px; font-weight: 700; line-height: 1;
  color: var(--song);
  text-shadow: 0 0 16px color-mix(in srgb, var(--song) 60%, transparent);
}
.songinfo__title { font-family: var(--f-head); font-weight: 400; font-size: 23px; line-height: 1.25; font-feature-settings: "palt"; word-break: keep-all; }
.songinfo__mood { font-size: 14px; color: var(--mist); font-weight: 700; word-break: keep-all; }
.specs {
  margin: 14px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-radius: var(--r-m);
  background: var(--navy2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.specs div { padding: 8px 4px; text-align: center; }
.specs div + div { border-left: 1px solid var(--line); }
.specs dt { font-size: 11px; color: var(--mist); font-weight: 700; letter-spacing: .06em; }
.specs dd { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.specs dd[data-rank]:not([data-rank=""])::after { content: attr(data-rank); font-family: var(--f-neon); font-size: 12px; margin-left: 3px; color: var(--lamp); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.diff button {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px 14px;
  border-radius: var(--r-m);
  background: var(--navy2);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-mid), background var(--t-mid);
}
.diff button:active { transform: scale(.96); }
.diff__k { grid-row: 1 / 3; font-family: var(--f-head); font-size: 28px; line-height: 1; }
.diff__y { font-size: 12px; color: var(--mist); font-weight: 700; }
.diff__lv { font-size: 16px; font-weight: 700; }
.diff button[data-d="easy"][aria-checked="true"] { background: #0c2a4a; box-shadow: inset 0 0 0 2px var(--cyan), 0 0 22px rgba(57, 230, 245, .3); }
.diff button[data-d="hard"][aria-checked="true"] { background: #3a0f37; box-shadow: inset 0 0 0 2px var(--magenta), 0 0 22px rgba(255, 61, 154, .35); }
.diff button[aria-checked="true"]::after {
  content: ""; position: absolute; top: 10px; right: 12px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lamp); box-shadow: 0 0 10px var(--lamp);
}
.select__foot {
  flex: none;
  padding: 10px 20px calc(12px + var(--safe-b));
  background: var(--deep);
  border-top: 1px solid var(--line);
  text-align: center;
}
.select__hint { margin-top: 6px; font-size: 13px; color: var(--mist); font-weight: 700; word-break: keep-all; }

/* ---------- プレイ ---------- */
.screen--play { background: var(--deep); }
.stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.hud {
  position: relative; z-index: 2;
  padding: calc(8px + var(--safe-t)) 12px 0;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.hud__row { display: flex; align-items: center; gap: 8px; }
.hud__row .icon-btn { pointer-events: auto; }
.hud__song {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 4px;
  border-radius: 999px;
  background: #0b1236;
  box-shadow: inset 0 0 0 1px var(--line);
}
.hud__diff {
  display: grid; place-items: center;
  min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 999px;
  font-family: var(--f-head); font-size: 15px;
  background: var(--cyan); color: var(--deep);
}
.hud__diff[data-d="hard"] { background: var(--magenta); color: #1a0410; }
.hud__name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn--hud { background: #0b1236; }
.hud__row--2 { gap: 10px; }
.hud__life {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  border-radius: 10px;
  background: #0b1236;
  box-shadow: inset 0 0 0 1px var(--line);
}
.hud__k { font-size: 11px; font-weight: 800; color: var(--mist); letter-spacing: .08em; white-space: nowrap; }
.life { flex: 1; height: 8px; border-radius: 4px; background: #1b2560; overflow: hidden; }
.life i { display: block; height: 100%; background: linear-gradient(90deg, var(--magenta), var(--lamp)); transform-origin: left; transform: scaleX(.7); transition: transform 160ms var(--ease); box-shadow: 0 0 10px rgba(255, 200, 87, .8); }
.life.is-low i { background: #ff6b8f; animation: low .5s steps(2) infinite; }
@keyframes low { 50% { opacity: .45; } }
.hud__score {
  display: flex; align-items: baseline; gap: 8px;
  height: 34px; padding: 0 12px;
  border-radius: 10px;
  background: #0b1236;
  box-shadow: inset 0 0 0 1px var(--line);
  align-items: center;
}
.hud__score b { font-size: 20px; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
.hud__prog { display: block; height: 3px; border-radius: 2px; background: rgba(39, 50, 111, .9); overflow: hidden; }
.hud__prog i { display: block; height: 100%; background: var(--cyan); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 8px var(--cyan); }

.lanes-hint {
  position: absolute; left: 0; right: 0; bottom: calc(10% - 34px); z-index: 2;
  display: none; justify-content: space-around;
  pointer-events: none;
  opacity: 0;
}
.lanes-hint span {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 8px; background: #0b1236; box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--f-num); font-weight: 700; font-size: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .lanes-hint { display: flex; }
  .lanes-hint.is-on { animation: hint 3.2s var(--ease) forwards; }
}
@keyframes hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

.demo, .coach {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 0 16px calc(16px + var(--safe-b));
  display: none;
}
.screen--play.is-demo .demo { display: block; }
.screen--play.is-coach .coach { display: grid; place-items: center; top: 0; background: rgba(6, 10, 34, .55); }
.demo__panel, .coach__panel {
  padding: 16px;
  border-radius: var(--r-l);
  background: #0b1236;
  box-shadow: var(--glow-m), 0 18px 40px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.demo__panel { flex-direction: row; gap: 12px; padding: 10px 10px 10px 10px; text-align: left; }
.demo__t { flex: 1; min-width: 0; line-height: 1.35; }
.demo__panel .btn { min-height: 52px; padding: 0 18px; }
.demo__tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-neon); font-size: 14px; color: #ff8cc6; letter-spacing: .08em; }
.demo__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }
@media (prefers-reduced-motion: no-preference) { .demo__dot { animation: low 1s steps(2) infinite; } }
.demo__song { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach__panel { width: min(100%, 360px); }
.coach__fig { width: 100%; height: auto; max-width: 240px; }
@media (prefers-reduced-motion: no-preference) {
  .coach__orb { animation: orb 1.4s cubic-bezier(.5, 0, .8, .6) infinite; }
}
@keyframes orb { from { transform: translateY(-28px); opacity: .2; } 80% { opacity: 1; } to { transform: translateY(64px); opacity: 0; } }
.coach__h { font-family: var(--f-head); font-size: 22px; line-height: 1.35; word-break: keep-all; font-feature-settings: "palt"; }
.coach__p { font-size: 15px; color: var(--ink); word-break: keep-all; margin-bottom: 6px; }

.pause {
  position: absolute; inset: 0; z-index: 6;
  display: none; place-items: center;
  padding: 20px;
  background: rgba(6, 10, 34, .78);
  backdrop-filter: blur(6px);
}
.pause.is-on { display: grid; animation: enter var(--t-mid) var(--ease); }
.pause__card {
  width: min(100%, 340px);
  padding: 22px 18px 12px;
  border-radius: var(--r-l);
  background: var(--navy2);
  box-shadow: var(--glow-c);
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  text-align: center;
}
.pause__en { font-family: var(--f-neon); color: var(--cyan); letter-spacing: .3em; font-size: 14px; text-transform: uppercase; }
.pause__title { font-family: var(--f-head); font-weight: 400; font-size: 30px; }
.pause__stat { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin-bottom: 6px; color: var(--mist); font-weight: 700; font-size: 14px; }
.pause__stat b { color: var(--ink); font-size: 22px; }
.pause__row { display: flex; justify-content: center; gap: 6px; }
.countdown {
  position: absolute; inset: 0; z-index: 7;
  display: none; place-items: center;
  font-family: var(--f-num); font-weight: 700; font-size: 92px;
  color: var(--ink);
  pointer-events: none;
}
.countdown.is-on { display: grid; background: rgba(6, 10, 34, .55); }

/* ---------- リザルト ---------- */
.screen--result { background: var(--deep); }
.result__scroll { padding-bottom: 100px; }
.rhero {
  position: relative;
  padding: calc(64px + var(--safe-t)) 16px 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 34, 0) 40%, var(--deep) 100%),
    url("/app-development/apps/a004/img/result.webp") center top / cover no-repeat;
  min-height: 250px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.rhero__eyebrow {
  align-self: flex-start;
  font-size: 13px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
  background: #060a22; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 10px;
}
.rhero__main {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: var(--r-l);
  background: var(--navy2);
  box-shadow: var(--glow-c);
}
.screen--result[data-status="fail"] .rhero__main { box-shadow: 0 0 0 1px #8d97c9; }
.screen--result[data-status="full"] .rhero__main { box-shadow: 0 0 0 2px var(--lamp), 0 0 30px rgba(255, 200, 87, .45); }
.rhero__jk { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex: none; }
.rhero__t { flex: 1; min-width: 0; }
.rhero__title { font-family: var(--f-head); font-weight: 400; font-size: 32px; line-height: 1.15; font-feature-settings: "palt"; }
.screen--result[data-status="full"] .rhero__title { color: var(--lamp); text-shadow: 0 0 16px rgba(255, 200, 87, .6); }
.screen--result[data-status="fail"] .rhero__title { color: var(--mist); }
.rhero__song { font-size: 14px; font-weight: 700; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank {
  flex: none;
  width: 70px; height: 70px;
  border-radius: 50%;
  display: grid; place-items: center; align-content: center;
  background: var(--deep);
  box-shadow: 0 0 0 2px var(--magenta), 0 0 20px rgba(255, 61, 154, .5);
  line-height: 1;
}
.rank__k { font-family: var(--f-num); font-size: 11px; color: var(--mist); letter-spacing: .14em; font-weight: 700; }
.rank b { font-family: var(--f-neon); font-weight: 400; font-size: 38px; color: #ff8cc6; text-shadow: 0 0 12px rgba(255, 61, 154, .9); }
.rank[data-rank="S"] { box-shadow: 0 0 0 2px var(--lamp), 0 0 26px rgba(255, 200, 87, .6); }
.rank[data-rank="S"] b { color: var(--lamp); text-shadow: 0 0 14px rgba(255, 200, 87, .9); }
.rank[data-rank="A"] b { color: #9ff6ff; text-shadow: 0 0 12px rgba(57, 230, 245, .9); }
.rank[data-rank="A"] { box-shadow: 0 0 0 2px var(--cyan), 0 0 20px rgba(57, 230, 245, .5); }
.rank[data-rank="D"] b { color: var(--mist); text-shadow: none; }
.rank[data-rank="D"] { box-shadow: 0 0 0 2px #5d6699; }
@media (prefers-reduced-motion: no-preference) {
  .screen--result.is-enter .rank { animation: stamp 520ms var(--spring) 260ms both; }
}
@keyframes stamp { from { transform: scale(2.2) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
.rpanel { padding: 4px 16px 0; }
.rscore {
  position: relative;
  margin-top: 14px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.rscore > div { display: flex; flex-direction: column; line-height: 1.1; }
.rscore__k { font-family: var(--f-neon); font-size: 13px; letter-spacing: .2em; color: var(--cyan); }
.rscore__v { font-size: 44px; font-weight: 700; letter-spacing: .02em; }
.rscore__best { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--mist); font-weight: 700; padding-bottom: 6px; }
.rscore__best b { font-size: 17px; color: var(--ink); }
.newrec {
  position: absolute; right: 0; top: -6px;
  font-family: var(--f-neon); font-size: 13px; letter-spacing: .14em;
  color: var(--deep); background: var(--lamp);
  padding: 2px 10px; border-radius: 6px;
  display: none;
}
.newrec.is-on { display: block; }
@media (prefers-reduced-motion: no-preference) { .newrec.is-on { animation: stamp 480ms var(--spring) 900ms both; } }
.judges { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.judge { display: grid; grid-template-columns: 82px 1fr 52px; align-items: center; gap: 10px; }
.judge__k { font-family: var(--f-neon); font-size: 15px; letter-spacing: .06em; }
.judge--p .judge__k { color: var(--lamp); }
.judge--g .judge__k { color: #7ff3ff; }
.judge--m .judge__k { color: var(--mist); }
.judge__bar { height: 12px; border-radius: 6px; background: var(--navy2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.judge__bar i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); transition: transform 700ms var(--ease); border-radius: 6px; }
.judge--p i { background: var(--lamp); box-shadow: 0 0 10px rgba(255, 200, 87, .7); }
.judge--g i { background: var(--cyan); transition-delay: 120ms; }
.judge--m i { background: #8d97c9; transition-delay: 240ms; }
.judge b { text-align: right; font-size: 20px; font-weight: 700; }
.rstats {
  margin: 16px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-radius: var(--r-m);
  background: var(--navy2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.rstats div { padding: 10px 6px; text-align: center; }
.rstats div + div { border-left: 1px solid var(--line); }
.rstats dt { font-size: 12px; color: var(--mist); font-weight: 700; white-space: nowrap; }
.rstats dd { margin: 0; white-space: nowrap; }
.rstats b { font-size: 20px; font-weight: 700; }
.rstats .u { font-size: 12px; color: var(--mist); margin-left: 3px; font-weight: 700; }
.hist { border-radius: var(--r-m); background: var(--navy2); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 12px 8px; }
.hist svg { width: 100%; height: 96px; display: block; }
.hist__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--mist); font-weight: 700; margin-top: 2px; }
.hist__cap { margin-top: 8px; font-size: 14px; color: var(--ink); }
.logs { list-style: none; margin: 0; padding: 0 0 0 14px; position: relative; display: flex; flex-direction: column; gap: 10px; }
.logs::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 11px); }
.log {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--r-m);
  background: var(--navy2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.log::before { content: ""; position: absolute; left: -14px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--deep); box-shadow: 0 0 0 2px var(--cyan); }
.log[data-status="fail"]::before { box-shadow: 0 0 0 2px #8d97c9; }
.log[data-status="full"]::before { background: var(--lamp); box-shadow: 0 0 0 2px var(--lamp), 0 0 10px var(--lamp); }
.log.is-cur { box-shadow: inset 0 0 0 2px var(--magenta); }
.log img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.log__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.log__when { font-size: 12px; color: var(--mist); font-weight: 600; }
.log__name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log__d { font-family: var(--f-head); font-size: 12px; font-weight: 400; margin-left: 6px; color: var(--mist); }
.log__st { font-size: 12px; font-weight: 800; color: var(--cyan); }
.log[data-status="fail"] .log__st { color: var(--mist); }
.log[data-status="full"] .log__st { color: var(--lamp); }
.log__s { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.log__s b { font-size: 16px; font-weight: 700; }
.log__rank { font-family: var(--f-neon); font-size: 18px; color: #ff8cc6; }
.log__rank[data-rank="S"] { color: var(--lamp); }
.log__rank[data-rank="A"] { color: #7ff3ff; }
.log__rank[data-rank="D"] { color: var(--mist); }
.result__foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--deep);
  border-top: 1px solid var(--line);
}
.result__foot .btn--l { flex: 1; width: auto; }

/* ---------- 設定・アプリについて ---------- */
.screen--settings, .screen--about { background: var(--night); }
.settings__scroll, .about__scroll { padding: 0 16px calc(28px + var(--safe-b)); }
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.howto__c {
  display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center;
  padding: 12px;
  border-radius: var(--r-m);
  background: var(--navy2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.howto__c svg { width: 104px; height: 78px; border-radius: 12px; background: var(--deep); }
.howto__c h3 { font-size: 16px; font-weight: 800; line-height: 1.4; word-break: keep-all; font-feature-settings: "palt"; display: flex; align-items: center; gap: 8px; }
.howto__n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--magenta); color: #1a0410; font-size: 13px; font-weight: 700; flex: none; }
.howto__c p { font-size: 14px; color: var(--ink); margin-top: 4px; }
.keys { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--mist); font-weight: 700; }
kbd { font-family: var(--f-num); font-weight: 700; min-width: 28px; height: 28px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--navy3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--line); }
.group { border-radius: var(--r-m); background: var(--navy2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 16px; }
.row + .row { border-top: 1px solid var(--line); }
.row--stack { flex-direction: column; align-items: stretch; gap: 8px; }
.row__label { font-weight: 800; font-size: 15px; display: flex; flex-direction: column; }
.row--stack .row__label { flex-direction: row; justify-content: space-between; }
.row__label small { font-size: 12px; color: var(--mist); font-weight: 700; }
.row__label b { color: var(--cyan); font-size: 16px; }
.row--btn { width: 100%; justify-content: flex-start; gap: 12px; font-weight: 800; text-align: left; }
.row--btn:active { background: var(--navy3); }
.js-reset { color: #ff9ab4; }
.row--link span { flex: 1; }
.row__chev { width: 18px; height: 18px; color: var(--mist); }
.range { width: 100%; height: 32px; accent-color: var(--magenta); background: transparent; }
.range__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--mist); font-weight: 700; margin-top: -4px; }
.switch {
  position: relative; flex: none;
  width: 56px; height: 34px; border-radius: 999px;
  background: #2a3470;
  transition: background var(--t-mid);
}
.switch i { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: transform var(--t-mid) var(--spring); }
.switch[aria-checked="true"] { background: var(--magenta); }
.switch[aria-checked="true"] i { transform: translateX(22px); }
.about__head { display: flex; align-items: center; gap: 16px; margin: 22px 0 16px; }
.about__head img { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--glow-c); }
.about__name { font-family: var(--f-head); font-size: 24px; }
.about__ver { font-size: 14px; color: var(--mist); font-weight: 700; }
.about__note { padding: 14px; border-radius: var(--r-m); background: var(--navy2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.about__k { margin: 18px 0 8px; font-weight: 800; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 4px 12px; border-radius: 999px; background: var(--navy3); font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.about__p { margin: 16px 0 20px; font-size: 14px; }
.about__cta { word-break: keep-all; }

/* ---------- シート・トースト・スプラッシュ ---------- */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(2, 4, 16, .6); opacity: 0; pointer-events: none; transition: opacity var(--t-mid); }
.scrim.is-on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21;
  padding: 10px 18px calc(18px + var(--safe-b));
  border-radius: var(--r-l) var(--r-l) 0 0;
  background: var(--navy2);
  box-shadow: 0 -1px 0 var(--line), 0 -20px 50px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 10px;
  transform: translateY(105%);
  transition: transform 320ms var(--ease);
  visibility: hidden;
}
.sheet.is-on { transform: none; visibility: visible; }
.sheet__grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.sheet h2 { font-family: var(--f-head); font-weight: 400; font-size: 21px; line-height: 1.4; word-break: keep-all; }
.sheet p { font-size: 15px; }
.calib-pad {
  position: relative;
  align-self: center;
  width: 132px; height: 132px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--deep);
  box-shadow: 0 0 0 3px var(--cyan), 0 0 26px rgba(57, 230, 245, .4);
  margin: 6px 0;
  touch-action: manipulation;
}
.calib-pad b { font-size: 20px; font-weight: 700; }
.calib-pad__ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 3px var(--magenta); opacity: 0; }
.calib-pad.is-hit .calib-pad__ring { animation: ring 380ms var(--ease); }
@keyframes ring { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
.toast {
  position: absolute; left: 50%; top: calc(14px + var(--safe-t)); z-index: 30;
  transform: translate(-50%, -140%);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #0b1236;
  box-shadow: var(--glow-m);
  font-weight: 800; font-size: 14px;
  transition: transform 300ms var(--spring), opacity 200ms, visibility 0s 300ms;
  pointer-events: none;
  word-break: keep-all;
  opacity: 0;
  visibility: hidden;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 300ms var(--spring), opacity 200ms; }
.splash {
  position: absolute; inset: 0; z-index: 40;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--deep);
}
.splash.is-on { display: flex; }
.splash img { width: 120px; height: 120px; border-radius: 28px; box-shadow: 0 0 0 1px var(--line), 0 0 50px rgba(57, 230, 245, .35); }
.splash p { font-family: var(--f-head); font-size: 24px; letter-spacing: .1em; }
.splash.is-out { opacity: 0; transition: opacity 320ms; }
.noscript, .jsfail { position: absolute; left: 16px; right: 16px; top: 40%; z-index: 50; padding: 16px; border-radius: 16px; background: var(--navy2); text-align: center; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
@media (max-height: 700px) {
  .logo__a { font-size: 60px; }
  .logo__b { font-size: 40px; }
  .card { width: min(56vw, 230px); }
  .deck { padding-left: calc(50% - min(28vw, 115px)); padding-right: calc(50% - min(28vw, 115px)); }
}
