:root {
  --bg: #03040b;
  --fg: #e8ecff;
  --dim: #8a93b8;
  --cyan: #7ce7ff;
  --pink: #ff7ab8;
  --gold: #ffe066;
  --panel: rgba(10, 14, 32, 0.62);
  --line: rgba(124, 231, 255, 0.28);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.6, 0, 0.8, 0.2);
  --f-en: 'Orbitron', 'Segoe UI', sans-serif;
  --f-ja: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-ja);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}
body.playing #game { cursor: none; }

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* ---------------- 画面（シームレスなクロスフェード） ---------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-t)) calc(20px + var(--safe-r)) calc(24px + var(--safe-b)) calc(20px + var(--safe-l));
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.985);
  filter: blur(8px);
  transition:
    opacity 0.45s var(--ease),
    transform 0.6s var(--ease),
    filter 0.45s var(--ease),
    visibility 0s linear 0.6s;
  overflow-y: auto;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  pointer-events: auto;
  transition:
    opacity 0.55s var(--ease) 0.12s,
    transform 0.7s var(--ease) 0.12s,
    filter 0.55s var(--ease) 0.12s,
    visibility 0s linear 0s;
}
.screen > .stagger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(100%, 860px);
  margin: auto;
}
.screen.active .stagger > * { animation: rise 0.7s var(--ease) both; }
.screen.active .stagger > *:nth-child(2) { animation-delay: 0.08s; }
.screen.active .stagger > *:nth-child(3) { animation-delay: 0.16s; }
.screen.active .stagger > *:nth-child(4) { animation-delay: 0.24s; }
.screen.active .stagger > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

#screen-pause { background: rgba(3, 4, 11, 0.55); backdrop-filter: blur(3px); }
#screen-result { background: radial-gradient(ellipse at center, rgba(3, 4, 11, 0.35), rgba(3, 4, 11, 0.8)); }

/* ---------------- タイトル ---------------- */
.logo { text-align: center; }
.logo-ja {
  margin: 0;
  font-family: var(--f-ja);
  font-weight: 900;
  font-size: clamp(48px, 12vw, 112px);
  letter-spacing: 0.08em;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: 0 0 22px rgba(124, 231, 255, 0.45);
}
.logo-ja span {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 10%, #bfefff 55%, #ff9fd0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.screen.active .logo-ja span { animation: letterIn 0.9s var(--ease) both, float 4s ease-in-out infinite; }
.screen.active .logo-ja span:nth-child(1) { animation-delay: 0.05s, 1s; }
.screen.active .logo-ja span:nth-child(2) { animation-delay: 0.12s, 1.3s; }
.screen.active .logo-ja span:nth-child(3) { animation-delay: 0.19s, 1.6s; }
.screen.active .logo-ja span:nth-child(4) { animation-delay: 0.26s, 1.9s; }
.screen.active .logo-ja span:nth-child(5) { animation-delay: 0.33s, 2.2s; }
@keyframes letterIn {
  from { opacity: 0; transform: translateY(-30px) scale(1.3); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.logo-en {
  margin: 6px 0 0;
  font-family: var(--f-en);
  font-weight: 700;
  font-size: clamp(13px, 2.6vw, 20px);
  letter-spacing: 0.6em;
  padding-left: 0.6em;
  color: var(--cyan);
  opacity: 0.85;
}

.howto {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--dim);
}
kbd {
  display: inline-block;
  font-family: var(--f-en);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid rgba(138, 147, 184, 0.45);
  border-radius: 4px;
  color: var(--fg);
}
.press {
  margin: 0;
  font-family: var(--f-en);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--dim);
  animation: blink 2.4s ease-in-out infinite;
}
.screen.active .stagger > .press { animation: rise 0.7s var(--ease) 0.32s both, blink 2.4s ease-in-out 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }

/* ---------------- ボタン ---------------- */
.btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 200px;
  padding: 14px 32px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 22, 48, 0.55);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  outline: none;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(124, 231, 255, 0.25);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateX(120%); }
.btn:active { transform: scale(0.97); }
.btn-ja { font-weight: 700; font-size: 17px; letter-spacing: 0.12em; }
.btn-en { font-family: var(--f-en); font-size: 10px; letter-spacing: 0.3em; color: var(--dim); }
.btn.primary {
  background: linear-gradient(135deg, rgba(124, 231, 255, 0.22), rgba(255, 122, 184, 0.22));
  border-color: rgba(124, 231, 255, 0.6);
}
.btn.primary .btn-ja { font-size: 20px; }
.btn.ghost { background: transparent; border-color: rgba(138, 147, 184, 0.3); min-width: 160px; }

.menu { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.menu.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.menu.row .btn { min-width: 160px; }

.screen-head { margin: 0; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.screen-head .ja { font-size: clamp(24px, 5vw, 34px); font-weight: 900; letter-spacing: 0.12em; }
.screen-head .en { font-family: var(--f-en); font-size: 11px; letter-spacing: 0.45em; color: var(--cyan); }

.icon-btn {
  position: absolute;
  top: calc(12px + var(--safe-t));
  right: calc(12px + var(--safe-r));
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(138, 147, 184, 0.3);
  background: rgba(10, 14, 32, 0.4);
  color: var(--fg);
  cursor: pointer;
  pointer-events: auto;
  display: grid;
  place-items: center;
  z-index: 5;
  transition: border-color 0.2s, transform 0.2s var(--ease), opacity 0.4s;
}
.icon-btn:hover { border-color: var(--cyan); transform: scale(1.08); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .spk { fill: currentColor; stroke: none; }
.icon-btn .cross { display: none; }
.icon-btn.muted .wave { display: none; }
.icon-btn.muted .cross { display: block; }
body.playing #btn-mute { opacity: 0.35; }
body.playing #btn-mute:hover { opacity: 1; }
.icon-btn.small { position: static; width: 34px; height: 34px; }
.icon-btn.small svg { width: 16px; height: 16px; }

/* ---------------- 難易度 ---------------- */
.diff-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}
.diff-card {
  --c: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 20px 18px;
  border-radius: 18px;
  border: 1px solid rgba(138, 147, 184, 0.25);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.diff-card[data-diff='easy'] { --c: #7dffcf; }
.diff-card[data-diff='normal'] { --c: #7ce7ff; }
.diff-card[data-diff='hard'] { --c: #ff7ab8; }
.diff-card::after {
  content: '';
  position: absolute;
  inset: auto -30% -60% -30%;
  height: 120%;
  background: radial-gradient(ellipse at center, var(--c), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.diff-card:hover, .diff-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--c);
  box-shadow: 0 10px 40px -12px var(--c);
}
.diff-card:hover::after, .diff-card:focus-visible::after { opacity: 0.16; }
.diff-card:active { transform: translateY(-2px) scale(0.98); }
.diff-ja { font-size: 28px; font-weight: 900; letter-spacing: 0.1em; color: var(--c); }
.diff-en { font-family: var(--f-en); font-size: 11px; letter-spacing: 0.4em; color: var(--dim); margin-top: -6px; }
.diff-desc { font-size: 13px; line-height: 1.6; color: #c8cfee; min-height: 3.2em; }
.diff-meta { font-family: var(--f-en); font-size: 10px; letter-spacing: 0.15em; color: var(--dim); }
.diff-best {
  margin-top: 4px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(138, 147, 184, 0.18);
  font-family: var(--f-en);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
}
.diff-best b { color: var(--fg); font-weight: 700; }
.diff-best .r { color: var(--c); }
.diff-card.chosen { animation: chosen 0.6s var(--ease); border-color: var(--c); }
@keyframes chosen {
  0% { transform: scale(1); }
  30% { transform: scale(1.06); box-shadow: 0 0 60px -8px var(--c); }
  100% { transform: scale(1); }
}

/* ---------------- HUD（控えめで邪魔にならない） ---------------- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: calc(10px + var(--safe-t)) calc(64px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  font-family: var(--f-en);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
#hud.show { opacity: 1; transform: none; }
#hud.dim { opacity: 0.35; }
.hud-label { font-size: 9px; letter-spacing: 0.35em; color: var(--dim); }
.hud-score {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(124, 231, 255, 0.35);
  transition: color 0.3s;
}
.hud-score.bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.12); color: var(--gold); } 100% { transform: scale(1); } }
.hud-score { transform-origin: left center; }
.hud-sub { font-size: 10px; letter-spacing: 0.15em; color: var(--dim); margin-top: 2px; }
.hud-center { text-align: center; padding-top: 2px; }
.hud-stage { font-size: 11px; letter-spacing: 0.35em; color: var(--dim); }
.hud-stage b { color: var(--fg); font-size: 15px; letter-spacing: 0.1em; }
.hud-bar {
  margin: 6px auto 0;
  width: clamp(90px, 22vw, 200px);
  height: 3px;
  border-radius: 3px;
  background: rgba(138, 147, 184, 0.2);
  overflow: hidden;
}
.hud-bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--cyan), var(--pink));
}
.hud-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; pointer-events: auto; }
.hud-rank {
  --rc: #7a7f99;
  font-size: 22px;
  font-weight: 900;
  color: var(--rc);
  text-shadow: 0 0 12px var(--rc);
  min-width: 1em;
  text-align: center;
}
.hud-rank.pop { animation: rankPop 0.7s var(--ease); }
@keyframes rankPop { 0% { transform: scale(1); } 35% { transform: scale(1.6) rotate(-8deg); } 100% { transform: scale(1); } }
.hud-lives { display: flex; gap: 4px; }
.hud-lives i {
  width: 10px;
  height: 12px;
  background: var(--cyan);
  clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%);
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.hud-lives i.lost { opacity: 0.15; transform: scale(0.7); }

/* ---------------- カウントダウン / バナー ---------------- */
#countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-en);
  font-weight: 900;
  font-size: clamp(64px, 16vw, 140px);
  color: #fff;
  text-shadow: 0 0 30px rgba(124, 231, 255, 0.6);
  pointer-events: none;
}
#countdown span { animation: cd 0.9s var(--ease) both; }
#countdown span.go { color: var(--gold); text-shadow: 0 0 40px rgba(255, 224, 102, 0.6); animation: go 0.9s var(--ease) both; }
@keyframes cd {
  0% { opacity: 0; transform: scale(1.8); filter: blur(10px); }
  25% { opacity: 1; transform: scale(1); filter: none; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.7); }
}
@keyframes go {
  0% { opacity: 0; transform: scale(0.6); letter-spacing: -0.2em; }
  25% { opacity: 1; transform: scale(1); letter-spacing: 0.1em; }
  100% { opacity: 0; transform: scale(1.4); letter-spacing: 0.4em; filter: blur(6px); }
}

#stage-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  text-align: center;
  pointer-events: none;
  font-family: var(--f-en);
}
#stage-banner .b {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  animation: banner 2.4s var(--ease) both;
}
#stage-banner .b1 { font-size: 12px; letter-spacing: 0.6em; color: var(--cyan); }
#stage-banner .b2 { font-size: clamp(22px, 5vw, 36px); font-weight: 700; letter-spacing: 0.25em; }
@keyframes banner {
  0% { opacity: 0; transform: translateY(10px); filter: blur(6px); letter-spacing: 0.1em; }
  20% { opacity: 0.85; transform: none; filter: none; }
  70% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-10px); filter: blur(4px); }
}

/* ---------------- ステージ移動演出 ---------------- */
#stage-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
}
#stage-overlay.show { visibility: visible; }
.so-lines i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  transform: scaleX(0);
  opacity: 0;
}
.so-lines i:first-child { top: calc(50% - 118px); }
.so-lines i:last-child { top: calc(50% + 118px); }
#stage-overlay.show .so-lines i { animation: lineIn 0.7s var(--ease) both; }
#stage-overlay.hide .so-lines i { animation: lineOut 0.5s var(--ease-in) both; }
@keyframes lineIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 0.8; } }
@keyframes lineOut { from { transform: scaleX(1); opacity: 0.8; } to { transform: scaleX(0); opacity: 0; } }

.so-band {
  position: relative;
  width: min(100% - 32px, 640px);
  padding: 26px 24px 22px;
  text-align: center;
  background: linear-gradient(90deg, transparent, rgba(8, 12, 30, 0.75) 15%, rgba(8, 12, 30, 0.75) 85%, transparent);
  clip-path: inset(50% 0 50% 0);
  opacity: 0;
}
#stage-overlay.show .so-band { animation: bandIn 0.6s var(--ease) 0.1s both; }
#stage-overlay.hide .so-band { animation: bandOut 0.5s var(--ease-in) both; }
@keyframes bandIn { from { clip-path: inset(50% 0 50% 0); opacity: 0; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes bandOut { from { clip-path: inset(0 0 0 0); opacity: 1; transform: none; } to { clip-path: inset(50% 0 50% 0); opacity: 0; transform: scaleX(1.1); } }

.so-band > * { opacity: 0; }
#stage-overlay.show .so-band > * { animation: rise 0.6s var(--ease) both; }
#stage-overlay.show .so-band > *:nth-child(1) { animation-delay: 0.25s; }
#stage-overlay.show .so-band > *:nth-child(2) { animation-delay: 0.4s; }
#stage-overlay.show .so-band > *:nth-child(3) { animation-delay: 0.55s; }
#stage-overlay.show .so-band > *:nth-child(4) { animation-delay: 0.85s; }

.so-title { font-family: var(--f-en); display: flex; justify-content: center; align-items: baseline; gap: 14px; }
.so-stage { font-size: clamp(22px, 5vw, 32px); font-weight: 900; letter-spacing: 0.15em; }
.so-clear { font-size: clamp(16px, 3.6vw, 22px); font-weight: 700; letter-spacing: 0.3em; color: var(--gold); }
.so-row { display: flex; justify-content: center; gap: clamp(18px, 5vw, 44px); margin-top: 16px; font-family: var(--f-en); }
.so-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.so-label { font-size: 9px; letter-spacing: 0.35em; color: var(--dim); }
.so-val { font-size: clamp(16px, 4vw, 22px); font-weight: 700; font-variant-numeric: tabular-nums; }
.so-val.bonus { color: var(--gold); }
.so-rank {
  --rc: #7a7f99;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 0.9;
  font-weight: 900;
  color: var(--rc);
  text-shadow: 0 0 18px var(--rc);
}
.so-rank.up { animation: rankPop 0.8s var(--ease); }
.so-hint { margin-top: 10px; font-family: var(--f-en); font-size: 10px; letter-spacing: 0.2em; color: var(--dim); min-height: 1.2em; }
.so-next { margin-top: 12px; font-family: var(--f-en); font-size: 12px; letter-spacing: 0.35em; color: var(--cyan); }

/* ---------------- リザルト ---------------- */
.result-main {
  display: flex;
  align-items: center;
  gap: clamp(20px, 5vw, 56px);
  padding: 24px clamp(18px, 4vw, 36px);
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid rgba(138, 147, 184, 0.2);
}
.result-rank-wrap { text-align: center; }
.result-rank-label { font-family: var(--f-en); font-size: 11px; letter-spacing: 0.5em; color: var(--dim); }
.result-rank {
  --rc: #7a7f99;
  font-family: var(--f-en);
  font-weight: 900;
  font-size: clamp(96px, 22vw, 160px);
  line-height: 1;
  color: var(--rc);
  text-shadow: 0 0 40px var(--rc);
  opacity: 0;
}
.result-rank.reveal { animation: rankReveal 1s var(--ease) both; }
@keyframes rankReveal {
  0% { opacity: 0; transform: scale(3) rotate(-12deg); filter: blur(16px); }
  55% { opacity: 1; transform: scale(0.92); filter: none; }
  100% { opacity: 1; transform: scale(1); }
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, auto));
  gap: 12px 28px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 11px; color: var(--dim); letter-spacing: 0.15em; }
.stat b { font-family: var(--f-en); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.big { grid-column: 1 / -1; }
.stat.big b { font-size: clamp(28px, 6vw, 40px); text-shadow: 0 0 14px rgba(124, 231, 255, 0.3); }
.new-record {
  font-family: var(--f-en);
  font-weight: 900;
  letter-spacing: 0.4em;
  font-size: 14px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 224, 102, 0.6);
  visibility: hidden;
}
.screen.active .stagger > .new-record { animation: none; }
.new-record.show { visibility: visible; animation: recordIn 0.8s var(--ease) both, blink 1.6s ease-in-out 0.8s infinite !important; }
@keyframes recordIn { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: none; } }

/* ---------------- 幕（画面転換の補助） ---------------- */
#curtain {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(124, 231, 255, 0.12), transparent 60%);
  opacity: 0;
  pointer-events: none;
}
#curtain.pulse { animation: pulse 0.9s var(--ease); }
@keyframes pulse { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

/* ---------------- レスポンシブ ---------------- */
@media (max-width: 720px) {
  .diff-list { grid-template-columns: 1fr; gap: 10px; }
  .diff-card { padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 4px; align-items: baseline; }
  .diff-ja { font-size: 22px; }
  .diff-en { margin: 0; }
  .diff-desc, .diff-meta, .diff-best { grid-column: 1 / -1; min-height: 0; }
  .diff-best { padding-top: 6px; }
  .result-main { flex-direction: column; gap: 12px; padding: 18px; }
  .result-stats { gap: 10px 20px; }
  .menu.row .btn { min-width: 0; flex: 1 1 30%; padding: 12px 10px; }
  .btn { min-width: 180px; }
  #hud { padding-right: calc(58px + var(--safe-r)); }
  .hud-score { font-size: 18px; }
  .hud-stage { letter-spacing: 0.12em; }
  .hud-bar { width: clamp(64px, 20vw, 120px); }
  .hud-right { gap: 8px; }
  .hud-rank { font-size: 18px; }
  .screen > .stagger { gap: 16px; }
}
@media (max-height: 560px) {
  .screen > .stagger { gap: 12px; }
  .logo-ja { font-size: clamp(40px, 10vh, 80px); }
  .result-rank { font-size: clamp(72px, 20vh, 120px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.12s !important; }
}
