﻿:root {
  --bg-sky: #37a5ff;
  --panel: #fff8e4;
  --blue: #0f4fa6;
  --red: #e53c20;
  --yellow: #ffd54d;
  --line: #272727;
}
* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  color: #1a1a1a;
  background:
    radial-gradient(circle at 10% 20%, #8fdaff 0, transparent 40%),
    radial-gradient(circle at 90% 15%, #bee9ff 0, transparent 30%),
    linear-gradient(180deg, #2ba5ff 0%, #6ec8ff 35%, #f8df9a 100%);
  min-height: 100dvh;
  min-height: 100vh;
}
.game-shell { width: 100%; max-width: 1060px; margin: 0 auto; padding: clamp(10px, 2.4vw, 16px); }
.panel {
  background: color-mix(in srgb, var(--panel) 88%, white);
  border: 4px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 0 #00000044;
  padding: 16px;
}
.game-shell,
.panel,
.card,
.difficulty-btn,
.flight-zone,
.timing-stage,
.result-card,
.title-item,
.stats-grid span { max-width: 100%; }
.logo {
  font-size: clamp(2rem, 5.4vw, 4rem);
  margin: 0;
  line-height: 1;
  color: #0f59be;
  text-shadow: -3px -3px #fff, 3px -3px #fff, -3px 3px #fff, 3px 3px #fff, 0 6px #472401;
}
.copy { font-weight: 700; font-size: clamp(1rem, 2.8vw, 1.8rem); margin-top: 8px; }
.top-grid { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(230px, 0.9fr) minmax(290px, 1fr); gap: 14px; align-items: center; }
.card { background: #fffdf5; border: 3px solid #294b72; border-radius: 14px; padding: 12px; }
.bubble { background: #fff; border: 2px solid #222; border-radius: 20px; padding: 8px 10px; display: inline-block; }
.launcher-wrap { text-align: center; }
.principal { display: inline-block; background: #f4e5bf; border: 3px solid #333; border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.mascot-frame { margin: 6px auto; width: min(100%, 320px); animation: float 2.8s ease-in-out infinite; }
.mascot-svg { width: 100%; height: auto; filter: drop-shadow(0 10px 0 #13395f66); }
.launcher { font-size: 1.5rem; font-weight: 900; background: #d9dde0; border: 3px solid #333; border-radius: 10px; padding: 8px; display: inline-block; }
.action-box { display: grid; gap: 12px; }
.btn {
  border: 3px solid #2a2a2a;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8df, #ead9aa);
  box-shadow: 0 5px 0 #00000036;
  color: #231100;
  padding: 12px 16px;
  min-height: 48px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:active { transform: translateY(2px); box-shadow: 0 3px 0 #00000036; }
.btn-main { background: linear-gradient(180deg, #ff6946, #dd2416); color: #fff; font-size: 1.5rem; min-height: 56px; }
.sub-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.footer-bar { margin-top: 14px; display: flex; justify-content: space-between; font-weight: 700; flex-wrap: wrap; gap: 8px; }

.difficulty-box { margin: 12px 0 14px; }
.difficulty-box.subtle {
  background: linear-gradient(180deg, #fffef9, #f2f8ff);
  border-color: #4a6788;
  box-shadow: 0 4px 0 #00000024;
}
.difficulty-box h2 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: #25496e;
}
.difficulty-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.difficulty-btn {
  border: 2px solid #4b6d91;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #e8f2ff);
  min-height: 104px;
  padding: 12px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.difficulty-btn strong { font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.difficulty-btn span {
  font-size: .86rem;
  line-height: 1.35;
  color: #23425f;
  word-break: normal;
  overflow-wrap: anywhere;
}
.rec-badge {
  font-size: .7rem;
  font-style: normal;
  color: #814f00;
  background: #ffe9a8;
  border: 1px solid #d6a64c;
  border-radius: 999px;
  padding: 2px 8px;
}
.difficulty-btn.on {
  background: linear-gradient(180deg, #ffe9b8, #ffd684);
  border-color: #c48321;
  box-shadow: inset 0 0 0 1px #fff2cf;
}

.hud-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-weight: 700; }
.hud-extended { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.timer { font-size: clamp(1.6rem, 6vw, 3rem); color: var(--red); background: #fff; border: 3px solid #333; border-radius: 12px; text-align: center; }
.difficulty-chip,
.combo-chip,
.awaken-chip,
.cond-mini,
.judge {
  background: #fff;
  border: 2px solid #2d4f72;
  border-radius: 12px;
  padding: 8px;
}
.combo-chip.combo-glow { box-shadow: 0 0 14px #ffd864; }
.combo-chip.combo-awaken { box-shadow: 0 0 22px #ffdd88; background: #fff7cf; }
.awaken-chip.on { background: linear-gradient(180deg, #fff6bf, #ffe072); color: #7c4300; font-weight: 900; }

.power-wrap { margin: 10px 0 6px; }
.power-label { font-weight: 900; margin-bottom: 4px; }
.power-gauge {
  height: 22px;
  border-radius: 999px;
  border: 3px solid #234b7a;
  background: #f2f8ff;
  overflow: hidden;
}
.power-gauge span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5fb5ff 0%, #64e0f6 40%, #ffe66e 72%, #ff8f46 100%);
  transition: width .12s linear;
}
.tap-panel.power-stage-1 .timing-stage { filter: saturate(1); }
.tap-panel.power-stage-2 .timing-stage { filter: saturate(1.05); }
.tap-panel.power-stage-3 .timing-stage { filter: saturate(1.12); }
.tap-panel.power-stage-4 .timing-stage { filter: saturate(1.2); }
.tap-panel.power-stage-5 .timing-stage { filter: saturate(1.26); }
.tap-panel.power-stage-6 .timing-stage { filter: saturate(1.34) brightness(1.04); }
.tap-panel.power-stage-7 .timing-stage { filter: saturate(1.42) brightness(1.08); }

.tap-main { text-align: center; padding: 10px 0; }
.rhythm-main {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.timing-stage,
.tap-trigger,
.btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tap-trigger {
  width: min(100%, 420px);
  margin: 2px auto 8px;
  display: block;
  font-size: clamp(1.2rem, 4.8vw, 1.6rem);
  letter-spacing: 0.02em;
}
.timing-stage {
  position: relative;
  width: min(100%, clamp(270px, 80vw, 420px));
  aspect-ratio: 1 / 1;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #e9f6ff 0%, #bddcf6 60%, #9abde8 100%);
  border: 4px solid #1f4f86;
  overflow: hidden;
}
.aura-layer {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, #d8f0ff00 30%, #89bfff4a 66%, #4b82d36c 100%);
  opacity: calc(var(--power-heat, .1) * .9);
  transform: scale(calc(1 + var(--power-heat, .1) * .16));
  animation: aura-pulse .7s ease-in-out infinite;
}
.speed-lines {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: repeating-linear-gradient(-25deg, #ffffffaa 0 6px, transparent 6px 18px);
  pointer-events: none;
}
.timing-stage.mood-serious .speed-lines,
.timing-stage.mood-awaken .speed-lines { opacity: .45; }
.judge-ring {
  position: absolute;
  width: 42%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 7px solid #ffffff;
  box-shadow: 0 0 0 4px #1660ad;
}
.timing-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 9px solid #ffef68;
  box-shadow: 0 0 18px #ffdc3a;
  will-change: transform;
}
.mascot-core { width: 52%; z-index: 2; }
.mascot-core.combo-glow,
.mascot-core.combo-awaken { filter: drop-shadow(0 0 16px #ffe27f); }
.mascot-core.mood-motivated { animation: mood-wobble .52s ease-in-out infinite; }
.mascot-core.mood-excited { animation: mood-sway .26s linear infinite; }
.mascot-core.mood-serious { animation: mood-shake .11s linear infinite; }
.mascot-core.mood-awaken { animation: mood-awaken .1s linear infinite; filter: drop-shadow(0 0 18px #fff38b); }
.tap-panel.power-stage-3 .mascot-core { animation: mood-wobble .42s ease-in-out infinite; }
.tap-panel.power-stage-4 .mascot-core { animation: mood-sway .22s linear infinite; }
.tap-panel.power-stage-5 .mascot-core { animation: mood-shake .1s linear infinite; }
.tap-panel.power-stage-6 .mascot-core { animation: mood-awaken .09s linear infinite; filter: drop-shadow(0 0 24px #ffd35f); }
.tap-panel.power-stage-7 .mascot-core { animation: mood-awaken .07s linear infinite; filter: drop-shadow(0 0 30px #ffea88); }
.impact-wave {
  position: absolute;
  width: 34%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 5px solid #fff8a3;
  opacity: 0;
  transform: scale(.8);
  pointer-events: none;
}
.impact-wave.on {
  animation: impact .45s ease-out;
}
.countdown-pop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2.4rem, 13vw, 5rem);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 0 #1b3f6e, 0 0 18px #63d5ff;
  background: #15416c73;
  z-index: 3;
}
.judge-pop {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffffeb;
  border: 3px solid #2b2b2b;
  border-radius: 12px;
  padding: 4px 10px;
  font-weight: 900;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.judge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2.4rem, 12vw, 5rem);
  font-weight: 900;
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
}
.judge-center.perfect,
.judge-center.great,
.judge-center.good,
.judge-center.miss {
  opacity: 1;
  animation: judge-burst .35s ease-out;
}
.judge-center.perfect { color: #fff7bb; text-shadow: 0 0 16px #ffd73c, 0 4px 0 #8f6500; }
.judge-center.great { color: #ebf8ff; text-shadow: 0 0 14px #61c2ff, 0 4px 0 #004f8c; }
.judge-center.good { color: #fff; text-shadow: 0 0 12px #ffffff, 0 4px 0 #3b3b3b; }
.judge-center.miss { color: #ffd6d6; text-shadow: 0 4px 0 #961a1a; }
.judge-pop span { font-size: 0.85rem; opacity: .8; }
.judge-pop.perfect { color: #b37e00; background: linear-gradient(180deg, #fff8ba, #ffd966); }
.judge-pop.great { color: #0059a8; background: linear-gradient(180deg, #dff2ff, #8dd4ff); }
.judge-pop.good { color: #404040; background: linear-gradient(180deg, #ffffff, #ececec); }
.judge-pop.miss { color: #ac2121; background: linear-gradient(180deg, #ffdede, #ffc0c0); }
.miss-mark {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 2rem;
  color: #d42f24;
  opacity: 0;
  transform: scale(.7);
}
.timing-stage.miss .miss-mark { opacity: 1; transform: scale(1); transition: transform .12s ease-out; }
.timing-stage.perfect {
  box-shadow: 0 0 0 4px #86c8ff, 0 0 28px #66b9ff;
  background: radial-gradient(circle at center, #ebf7ff 0%, #bbddff 60%, #8ebaf0 100%);
}
.timing-stage.great {
  box-shadow: 0 0 0 4px #6cc2ff, 0 0 30px #59bcff;
}
.timing-stage.good {
  box-shadow: 0 0 0 4px #e8e8e8, 0 0 16px #ffffff;
}
.timing-stage.miss {
  box-shadow: 0 0 0 4px #ff9d9d;
  filter: grayscale(.2);
}
.timing-stage.awaken-mode {
  background: radial-gradient(circle at center, #edf4ff 0%, #c7d8ff 52%, #8ea7ee 100%);
  box-shadow: 0 0 0 4px #9dbfff, 0 0 30px #7ca8ff;
}
.timing-stage.extreme-mode {
  box-shadow: 0 0 0 4px #ffb7b7, 0 0 30px #ff836d;
}
.timing-stage.extreme-mode .timing-ring {
  border-color: #ffe066;
  box-shadow: 0 0 22px #ff8f47;
}
.tap-note { margin: 4px 0 0; font-weight: 700; opacity: .85; }
.timing-stats { display: grid; gap: 8px; }
.stats-line {
  font-weight: 900;
  font-size: clamp(1rem, 3.8vw, 1.35rem);
  background: #fff;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 8px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.stats-grid span {
  background: #f8fbff;
  border: 2px solid #2d4f72;
  border-radius: 10px;
  padding: 8px 4px;
  font-weight: 800;
  text-align: center;
}
.tap-panel.hype-mid {
  background-image: linear-gradient(160deg, #f4f8ff 0%, #e9f1ff 35%, #dae8ff 100%);
}
.tap-panel.hype-high {
  background-image:
    radial-gradient(circle at 18% 22%, #b2d2ff 0%, transparent 34%),
    radial-gradient(circle at 80% 24%, #9ac3ff 0%, transparent 31%),
    linear-gradient(160deg, #edf4ff 0%, #dce9ff 50%, #c8dcff 100%);
}
.tap-panel.hype-awaken {
  background-image:
    radial-gradient(circle at 12% 20%, #a8c8ff 0%, transparent 30%),
    radial-gradient(circle at 88% 18%, #9ec0ff 0%, transparent 30%),
    radial-gradient(circle at 40% 80%, #7ca5ec 0%, transparent 35%),
    linear-gradient(165deg, #e9f1ff 0%, #cfddff 42%, #a8c2f5 100%);
}

.flight-panel { color: #fff; background: linear-gradient(180deg, #41b9ff, #6accff 45%, #9fdcff); overflow: hidden; }
.flight-panel.town { background: linear-gradient(180deg, #42b4ff, #7eceff 50%, #acd386); }
.flight-panel.sky { background: linear-gradient(180deg, #1694ff, #7dd0ff 70%, #eef8ff); }
.flight-panel.cloud { background: linear-gradient(180deg, #57beff, #9bddff 50%, #d8ecff); }
.flight-panel.strato { background: linear-gradient(180deg, #2f72d8, #5ca2f2 48%, #b8d5ff); }
.flight-panel.space { background: linear-gradient(180deg, #081346, #1c2e7f 45%, #2d449f); }
.flight-hud { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 800; }
.distance-now { font-size: clamp(2rem, 7vw, 4rem); color: #ffea70; text-shadow: 0 3px 0 #2b1f00; }
.track { height: 20px; background: #ffffff44; border: 2px solid #fff; border-radius: 999px; margin: 14px 0; overflow: hidden; }
.track span { display: block; height: 100%; background: linear-gradient(90deg, #ffd53d, #ff8935, #ff3636); }
.flight-zone { position: relative; min-height: 320px; overflow: hidden; border-radius: 14px; }
.flight-layers {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #24457f55 0 18%, transparent 18%),
    repeating-linear-gradient(90deg, #ffffff2e 0 12px, transparent 12px 30px);
  opacity: .18;
}
.flight-panel.town .flight-layers {
  opacity: .4;
  background:
    linear-gradient(0deg, #27496f 0 24%, transparent 24%),
    repeating-linear-gradient(90deg, #3f6289 0 46px, #5d82a9 46px 70px, transparent 70px 90px);
}
.flight-panel.sky .flight-layers { opacity: .28; }
.flight-panel.cloud .flight-layers {
  opacity: .33;
  background:
    radial-gradient(circle at 20% 70%, #ffffffbb 0 8%, transparent 9%),
    radial-gradient(circle at 48% 50%, #ffffffcc 0 10%, transparent 11%),
    radial-gradient(circle at 72% 67%, #ffffffb6 0 8%, transparent 9%);
}
.flight-panel.strato .flight-layers {
  opacity: .36;
  background:
    linear-gradient(180deg, #b9d6ff33 0 35%, transparent 90%),
    radial-gradient(circle at 50% 130%, #f7fbff 0 20%, transparent 21%);
}
.flight-panel.space .flight-layers {
  opacity: .75;
  background:
    radial-gradient(circle at 82% 22%, #a3c0ff 0 2%, transparent 3%),
    radial-gradient(circle at 30% 44%, #ffffff 0 1.4%, transparent 2%),
    radial-gradient(circle at 54% 76%, #ced9ff 0 1.6%, transparent 2.2%),
    radial-gradient(circle at 8% 13%, #ecf1ff 0 1.2%, transparent 2%),
    radial-gradient(circle at 88% 85%, #ffffff 0 1.5%, transparent 2.2%),
    radial-gradient(circle at 70% 30%, #8ac3ff66 0 16%, transparent 17%);
}
.wind-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-18deg, #ffffff8c 0 6px, transparent 6px 24px);
  opacity: .45;
  animation: wind-run .7s linear infinite;
}
.flying {
  position: absolute;
  width: clamp(128px, 32vw, 220px);
  margin: 0;
  will-change: transform, left, top;
  transition: filter .2s linear;
  z-index: 2;
}
.flying svg { animation: fly-spin .42s linear infinite; }
.flying.landed svg { animation-duration: .18s; }
.trail {
  position: absolute;
  top: 58%;
  height: 8px;
  background: repeating-linear-gradient(90deg, #fff, #fff 10px, transparent 10px, transparent 24px);
  opacity: .8;
  z-index: 1;
}
.landing-burst {
  position: absolute;
  width: 14px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 3px solid #fff6ac;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.4);
  pointer-events: none;
}
.landing-burst.on { animation: burst .35s ease-out infinite; }
.event-pop { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: #fffbef; border: 3px solid #2f2f2f; color: #1d1d1d; border-radius: 14px; padding: 8px 12px; font-weight: 800; text-align: center; }
.event-pop.rare { background: linear-gradient(180deg, #fff8bf, #ffd572); }
.event-pop.superRare { background: linear-gradient(180deg, #ffe0ff, #d1b6ff); }
.ufo-beam { filter: drop-shadow(0 0 20px #62ffea); }

.result-banner { font-size: clamp(2rem, 8vw, 5rem); color: #f84823; text-shadow: -3px -3px #fff, 3px -3px #fff, -3px 3px #fff, 3px 3px #fff; margin: 0 0 8px; }
.result-card { background: #fffef8; border: 4px solid #dbb96a; border-radius: 16px; padding: 12px; font-size: 1.2rem; }
.result-main { font-size: clamp(1.4rem, 4.2vw, 2.5rem); margin: 0 0 8px; }
.result-main strong { color: #e93418; font-size: 1.2em; }
.result-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.x-btn { background: linear-gradient(180deg, #2a2a2a, #060606); color: #fff; }
.todo-note { font-size: .95rem; opacity: .8; }

.title-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.title-item { border: 3px solid #505050; border-radius: 12px; padding: 10px; min-height: 90px; }
.title-item.on { background: linear-gradient(180deg, #fff8cc, #f7dd92); }
.title-item.off { background: #d9d9d9; color: #4e4e4e; }

@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes fly { from { transform: translate(-10px, -6px) rotate(-5deg); } to { transform: translate(10px, 7px) rotate(5deg); } }
@keyframes mood-wobble { 0%,100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
@keyframes mood-sway { 0%,100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes mood-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes mood-awaken { 0%,100% { transform: translateX(-3px) scale(1); } 50% { transform: translateX(3px) scale(1.03); } }
@keyframes aura-pulse { 0%,100% { opacity: calc(var(--power-heat, .1) * .75); } 50% { opacity: calc(var(--power-heat, .1) * 1.08); } }
@keyframes impact { 0% { opacity: .95; transform: scale(.8); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes judge-burst { 0% { opacity: 0; transform: scale(.4); } 45% { opacity: 1; transform: scale(1.08); } 100% { opacity: 0; transform: scale(1.22); } }
@keyframes wind-run { from { transform: translateX(0); } to { transform: translateX(-34px); } }
@keyframes fly-spin { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes burst { 0% { opacity: .95; transform: translate(-50%, -50%) scale(.4); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(4.6); } }

@media (max-width: 900px) {
  .top-grid { grid-template-columns: 1fr; }
  .hud-top { grid-template-columns: 1fr; }
  .sub-actions { grid-template-columns: 1fr; }
  .difficulty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .difficulty-btn { min-height: 96px; }
  .title-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-bar { flex-direction: column; gap: 6px; }
  .timing-stage { width: min(92vw, 390px); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .game-shell.stage-tap {
    min-height: var(--app-vh, 100dvh);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .game-shell.stage-tap .tap-panel {
    width: 100%;
  }
  .game-shell { padding: 10px; }
  .panel { padding: 12px; border-width: 3px; border-radius: 18px; }
  .copy { margin: 6px 0 10px; font-size: clamp(0.95rem, 3.8vw, 1.1rem); }
  .top-grid { gap: 10px; }
  .launcher-wrap { order: 1; }
  .condition-card { order: 2; }
  .action-box { order: 3; gap: 10px; }
  .condition-card p { margin: 8px 0; }
  .condition-card .bubble { display: none; }
  .mascot-frame { width: clamp(170px, 48vw, 260px); }
  .launcher { font-size: 1.2rem; }
  .difficulty-box { margin: 6px 0 10px; }
  .difficulty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .difficulty-btn { min-height: 82px; border-radius: 14px; padding: 10px; }
  .difficulty-btn span { font-size: .8rem; line-height: 1.3; }
  .sub-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .hud-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }
  .timer,
  .difficulty-chip,
  .combo-chip,
  .awaken-chip,
  .cond-mini,
  .judge {
    padding: 6px;
    font-size: 0.9rem;
  }
  .timer { font-size: clamp(1.2rem, 5vw, 1.6rem); }
  .power-wrap { margin: 8px 0 6px; }
  .power-label { font-size: 0.92rem; }
  .power-gauge { height: 26px; }
  .tap-main { padding: 6px 0 2px; }
  .timing-stage {
    width: min(100%, clamp(250px, 78vw, 350px));
    margin-bottom: 8px;
    border-width: 5px;
  }
  .tap-panel.mobile-lite .timing-stage,
  .tap-panel.mobile-lite .judge-ring,
  .tap-panel.mobile-lite .timing-ring,
  .tap-panel.mobile-lite .combo-chip,
  .tap-panel.mobile-lite .awaken-chip,
  .tap-panel.mobile-lite .mascot-core {
    box-shadow: none;
    filter: none;
  }
  .tap-panel.mobile-lite .aura-layer,
  .tap-panel.mobile-lite .speed-lines,
  .tap-panel.mobile-lite .impact-wave,
  .tap-panel.mobile-lite .judge-center {
    animation: none;
  }
  .tap-panel.mobile-lite .speed-lines { opacity: 0.14; }
  .tap-panel.mobile-lite .judge-center {
    opacity: 0.92;
    transform: none;
    transition: opacity .12s linear;
  }
  .tap-panel.mobile-lite .judge-center.perfect,
  .tap-panel.mobile-lite .judge-center.great,
  .tap-panel.mobile-lite .judge-center.good,
  .tap-panel.mobile-lite .judge-center.miss {
    animation: none;
  }
  .tap-panel.high-diff-lite .timing-stage.extreme-mode {
    box-shadow: 0 0 0 3px #9eb5d8;
  }
  .tap-panel.high-diff-lite .timing-stage.extreme-mode .timing-ring {
    box-shadow: 0 0 10px #ffcb57;
  }
  .tap-panel.high-diff-lite .tap-note {
    opacity: 0.94;
  }
  .judge-ring { border-width: 8px; }
  .timing-ring { border-width: 10px; }
  .judge-pop { bottom: 10px; }
  .bubble { font-size: .92rem; }
  .tap-note { margin-top: 2px; font-size: .9rem; }
  .timing-stats { gap: 6px; }
  .stats-line { font-size: 1rem; padding: 7px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .flight-zone { min-height: 240px; }
  .trail { height: 6px; top: 60%; }
  .event-pop { width: min(92%, 360px); font-size: .88rem; line-height: 1.3; }
  .distance-now { font-size: clamp(1.6rem, 8vw, 2.6rem); }
  .track { margin: 10px 0; height: 16px; }

  .result-card { font-size: 1rem; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .title-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-frame,
  .flying svg,
  .aura-layer,
  .impact-wave,
  .wind-lines,
  .landing-burst.on,
  .judge-center.perfect,
  .judge-center.great,
  .judge-center.good,
  .judge-center.miss {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .logo { font-size: clamp(1.8rem, 11vw, 2.6rem); }
  .principal { font-size: .9rem; padding: 6px 12px; }
  .difficulty-grid { grid-template-columns: 1fr 1fr; }
  .difficulty-btn { min-height: 78px; }
  .difficulty-btn strong { font-size: .95rem; }
  .rec-badge { font-size: .62rem; padding: 2px 6px; }
  .hud-top { grid-template-columns: 1fr 1fr; }
  .timer,
  .difficulty-chip,
  .combo-chip,
  .awaken-chip,
  .cond-mini,
  .judge { font-size: .82rem; }
  .timing-stage {
    width: min(100%, clamp(240px, 82vw, 320px));
    border-radius: 46%;
  }
  .tap-trigger {
    min-height: 58px;
    font-size: clamp(1.05rem, 5.5vw, 1.34rem);
  }
  .judge-center { font-size: clamp(2rem, 14vw, 3.2rem); }
  .title-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .game-shell { padding: 8px; }
  .panel { padding: 10px; }
  .copy { font-size: 0.9rem; }
  .launcher-wrap { margin-bottom: 2px; }
  .mascot-frame { width: clamp(160px, 46vw, 220px); }
  .difficulty-btn span { display: none; }
  .hud-top { gap: 5px; }
  .power-label { font-size: .84rem; }
  .timing-stage { width: min(100%, clamp(232px, 82vw, 298px)); }
  .tap-note { font-size: .82rem; }
  .stats-line { font-size: .92rem; }
  .stats-grid span { font-size: .84rem; padding: 6px 4px; }
  .flight-zone { min-height: 208px; }
  .event-pop { font-size: .82rem; padding: 6px 8px; }
}

/* ============ Site chrome (header/footer/content) ============ */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: #fff; color: #113359; padding: 10px 16px; border: 2px solid #113359; border-radius: 8px; font-weight: 800;
}
.skip-link:focus { left: 8px; top: 8px; }

.site-header, .site-footer {
  width: 100%; max-width: 1060px; margin: 0 auto; padding: clamp(10px, 2vw, 16px);
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between;
}
.site-header { border-bottom: 3px solid #113359; }
.brand { font-size: 1.3rem; font-weight: 900; color: #0f59be; text-decoration: none; text-shadow: 0 2px 0 #fff; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.site-header nav a, .site-footer nav a { color: #1d3a5c; font-weight: 700; text-decoration: none; padding: 4px 6px; border-radius: 8px; }
.site-header nav a:hover, .site-footer nav a:hover { background: #eaf3ff; text-decoration: underline; }
.site-header nav a:focus-visible, .site-footer nav a:focus-visible { outline: 3px solid #ff8a3d; outline-offset: 2px; }
.site-footer { border-top: 3px solid #113359; margin-top: 18px; font-size: .9rem; color: #234; }

.content-shell { width: 100%; max-width: 860px; margin: 0 auto; padding: 12px clamp(12px, 3vw, 24px) 40px; }
.breadcrumb { font-size: .9rem; color: #345; margin-bottom: 8px; }
.breadcrumb a { color: #1d3a5c; }
.content-article { background: #fffdf5; border: 3px solid #294b72; border-radius: 16px; padding: clamp(14px, 3vw, 28px); }
.content-article h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 12px; color: #0f59be; }
.content-article h2 { font-size: clamp(1.2rem, 3.4vw, 1.6rem); margin: 22px 0 8px; color: #25496e; border-left: 6px solid #ffd54d; padding-left: 10px; }
.content-article h3 { font-size: 1.05rem; margin: 6px 0 2px; }
.content-article p, .content-article li { line-height: 1.7; font-size: 1.02rem; }
.content-article ul, .content-article ol { padding-left: 1.4em; margin: 8px 0 12px; }
.content-article .faq-item { border: 2px solid #cdd8e6; border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fbfdff; }
.content-article .faq-item h3 { color: #1d3a5c; }
.back-link { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.sub-links { max-width: 1060px; margin: 16px auto; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sub-links a { color: #1d3a5c; font-weight: 700; text-decoration: none; padding: 8px 12px; border: 2px solid #4a6788; border-radius: 12px; background: #f4f9ff; }
.sub-links a:hover { background: #e3efff; text-decoration: underline; }
.changelog-entry { border-bottom: 1px dashed #b8c4d4; padding-bottom: 10px; margin-bottom: 10px; }

/* Game shell body content (crawler-readable), shown above the fold on the home page */
.seo-body { max-width: 1060px; margin: 18px auto 0; padding: 0 clamp(12px, 3vw, 24px); }
.seo-body h2 { font-size: clamp(1.3rem, 3.6vw, 1.8rem); color: #25496e; margin: 18px 0 8px; border-left: 6px solid #ffd54d; padding-left: 10px; }
.seo-body .howto-steps, .seo-body .judge-list { padding-left: 1.4em; line-height: 1.8; }
.seo-body .faq-item { border: 2px solid #cdd8e6; border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fbfdff; }
.seo-body .faq-item h3 { color: #1d3a5c; margin: 0 0 4px; }
.seo-cta { text-align: center; margin: 16px 0; }

/* Settings panel */
.settings-btn { width: 100%; }
.settings-panel { margin-top: 8px; border: 2px dashed #4a6788; border-radius: 12px; padding: 12px; background: #f4f9ff; }
.setting-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-weight: 700; flex-wrap: wrap; }
.setting-row input[type="range"] { flex: 1; min-width: 120px; }
.btn.small { min-height: 36px; font-size: .9rem; padding: 6px 10px; }
.setting-note { font-size: .82rem; color: #445; opacity: .9; }

/* Reduced motion */
.reduced-motion * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Larger tap targets for action buttons */
.sub-actions .btn, .result-actions .btn, .top-grid .btn { min-height: 48px; }

/* Three-throw championship */
.footer-bar span { white-space: nowrap; }
.throw-badge {
  background: var(--yellow);
  color: #1a1a1a;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
}
.three-summary {
  background: #fffbea;
  border: 2px solid var(--blue);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 8px 0 14px;
}
.three-summary h3 { margin: 0 0 6px; color: var(--blue); }
.three-summary p { margin: 4px 0; }
.three-summary strong { font-size: 1.05rem; }
.ghost-summary {
  background: #eef6ff;
  border: 2px solid var(--blue);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 8px 0 14px;
}
.ghost-summary h3 { margin: 0 0 6px; color: var(--blue); }
.ghost-summary p { margin: 4px 0; }
.ghost-summary .ghost-advice { font-weight: 600; color: #0a4a8c; }
.ghost-summary .ghost-note { font-size: 0.82rem; color: #5a6b7a; }
.ghost-summary .ghost-links { font-size: 0.9rem; }
.ghost-summary .ghost-links a { color: var(--blue); }
@media (max-width: 520px) {
  .footer-bar { flex-wrap: wrap; gap: 4px 10px; }
  .footer-bar span { font-size: 0.8rem; }
}

/* Lab pages */
.lab-intro { background: #eef6ff; border-left: 4px solid var(--blue); padding: 10px 12px; border-radius: 8px; }
.lab-disclaimer { font-size: .85rem; color: #b3402a; background: #fff3ee; border: 1px solid #f0c0b4; padding: 8px 10px; border-radius: 8px; }
.lab-warn { color: #b3402a; font-weight: 700; }
.lab-root { margin: 16px 0; }
.lab-card { border: 2px solid #cdd8e6; border-radius: 14px; padding: 14px 16px; background: #fff; }
.lab-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.lab-controls label { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.lab-stats p { margin: 4px 0; }
.lab-note { font-size: .82rem; color: #445; opacity: .9; }
.cal-stage { margin: 14px 0; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.cal-ring { width: 160px; height: 160px; border-radius: 50%; border: 6px solid var(--yellow); box-sizing: border-box; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(2); }
.cal-ring::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.cal-hint { margin-top: 190px; font-weight: 700; }
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sim-grid label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0; font-weight: 700; }
.sim-grid input, .sim-grid select { flex: 1; max-width: 160px; }
.sim-distance { font-size: 1.2rem; }
.seed-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.seed-table th, .seed-table td { border: 1px solid #cdd8e6; padding: 6px 8px; text-align: left; }
.seed-table th { background: #f0f6ff; }
@media (max-width: 720px) {
  .sim-grid { grid-template-columns: 1fr; }
}

