:root {
  --bg-top: #09070b;
  --bg-bottom: #2a0d16;
  --panel: rgba(18, 13, 20, 0.92);
  --panel-border: #d54f5f;
  --text: #fff3ea;
  --muted: #cdaab0;
  --accent: #87ffce;
  --accent-strong: #ff5168;
  --warning: #ffd36e;
  --danger: #ff314d;
  --road: #12070c;
  --lane: rgba(157, 255, 222, 0.14);
  --shadow: rgba(0, 0, 0, 0.6);
  --frame-dark: #2f0e18;
  --frame-light: #ff9cad;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(135, 255, 206, 0.12), transparent 22%),
    radial-gradient(circle at 84% 14%, rgba(255, 79, 110, 0.2), transparent 18%),
    radial-gradient(circle at 50% 0%, rgba(102, 21, 36, 0.22), transparent 26%),
    linear-gradient(180deg, #040306, var(--bg-top) 24%, var(--bg-bottom));
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 20px;
}

.hud,
.game-panel,
.coach-panel,
.controls {
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 3px var(--frame-dark),
    inset 0 0 0 5px rgba(255, 240, 200, 0.18),
    0 20px 50px var(--shadow);
}

.hud {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.hud.roar-flash,
.typing-box.roar-flash {
  animation: roar-ui-flash 360ms ease-out;
}

.brand h1,
.overlay-card h2 {
  margin: 0;
  font-family: "MS PGothic", "Yu Gothic UI", sans-serif;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgba(255, 81, 104, 0.45), 2px 2px 0 #4a0f19, 4px 4px 0 #16070b;
}

.brand h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
  gap: 12px;
  width: min(700px, 100%);
}

.stat-card,
.status-box,
.typing-box,
.tips {
  background: linear-gradient(180deg, rgba(61, 18, 30, 0.82), rgba(22, 10, 18, 0.96));
  border: 2px solid rgba(255, 156, 173, 0.26);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(43, 12, 20, 0.86);
}

.stat-card {
  padding: 14px 16px;
}

.label,
.status-box span,
.typing-box label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.3rem;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.game-column {
  display: grid;
  gap: 14px;
}

.game-panel {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: 14px 14px 16px;
}

.game-panel.shake-light {
  animation: panel-shake-light 160ms linear;
}

.game-panel.shake-heavy {
  animation: panel-shake-heavy 220ms linear;
}

.skyline {
  position: absolute;
  inset: auto 0 140px;
  height: 180px;
  opacity: 0.7;
  background-repeat: repeat-x;
  background-size: 720px 180px;
  animation: skyline-move linear infinite;
}

.skyline-back {
  background-image:
    linear-gradient(transparent 0 45%, rgba(0, 0, 0, 0.14) 45%),
    linear-gradient(90deg,
      transparent 0 4%,
      rgba(136, 82, 48, 0.35) 4% 8%,
      transparent 8% 13%,
      rgba(136, 82, 48, 0.22) 13% 19%,
      transparent 19% 24%,
      rgba(136, 82, 48, 0.3) 24% 29%,
      transparent 29% 34%,
      rgba(136, 82, 48, 0.24) 34% 39%,
      transparent 39% 100%);
  animation-duration: 16s;
}

.skyline-front {
  inset: auto 0 110px;
  height: 210px;
  background-image:
    linear-gradient(transparent 0 36%, rgba(0, 0, 0, 0.22) 36%),
    linear-gradient(90deg,
      transparent 0 3%,
      rgba(191, 127, 67, 0.42) 3% 7%,
      transparent 7% 10%,
      rgba(191, 127, 67, 0.35) 10% 16%,
      transparent 16% 21%,
      rgba(191, 127, 67, 0.44) 21% 26%,
      transparent 26% 30%,
      rgba(191, 127, 67, 0.32) 30% 35%,
      transparent 35% 100%);
  animation-duration: 9s;
}

.danger-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 42%, rgba(255, 49, 77, 0.22) 100%),
    radial-gradient(circle at 50% 18%, rgba(135, 255, 206, 0.08), transparent 28%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 2;
}

.status-box {
  padding: 12px 14px;
}

.meter {
  margin-top: 10px;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(25, 8, 6, 0.7);
  border: 1px solid rgba(245, 213, 148, 0.2);
}

.meter-fill {
  height: 100%;
  width: 0;
  transition: width 140ms ease;
}

.zombie-fill {
  background: linear-gradient(90deg, #ffbb74, #ff314d);
}

.boost-fill {
  background: linear-gradient(90deg, #afffdf, #3fd3a1);
}

.stage-fill {
  background: linear-gradient(90deg, #ffc3cf, #fff1e5);
}

.road {
  position: relative;
  margin-top: 14px;
  height: 330px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 90, 115, 0.14), transparent 40%),
    radial-gradient(circle at 50% 12%, rgba(135, 255, 206, 0.08), transparent 30%),
    linear-gradient(180deg, #34101a 0%, var(--road) 55%, #050306 100%);
}

.road::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 38% 50%, rgba(255, 179, 111, 0.08), transparent 22%),
    radial-gradient(circle at 34% 60%, rgba(0, 0, 0, 0.35), transparent 40%);
  pointer-events: none;
}

.background-zombie {
  position: absolute;
  left: 28%;
  bottom: 78px;
  width: 58px;
  height: 106px;
  opacity: 0.28;
  filter: blur(1.4px);
  transform-origin: bottom center;
  animation: background-zombie-sway 1.8s ease-in-out infinite alternate;
}

.background-zombie-head,
.background-zombie-body {
  position: absolute;
}

.background-zombie-head {
  left: 17px;
  top: 0;
  width: 22px;
  height: 24px;
  border-radius: 48% 52% 44% 50%;
  background: linear-gradient(180deg, #7f8871, #40463b);
}

.background-zombie-body {
  left: 10px;
  top: 20px;
  width: 38px;
  height: 62px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, #564a4c, #292326 55%, #392824);
}

.background-zombie-shadow {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  filter: blur(6px);
}

.lane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--lane), transparent);
}

.lane-left {
  left: 33.333%;
}

.lane-center {
  left: 50%;
}

.lane-right {
  left: 66.666%;
}

.road-stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0 18px,
    rgba(255, 255, 255, 0.08) 18px 34px
  );
  transform: perspective(220px) rotateX(65deg);
  transform-origin: bottom;
  animation: road-flow 0.8s linear infinite;
  opacity: 0.65;
}

.runner,
.zombie {
  position: absolute;
  bottom: 52px;
  width: 90px;
  height: 142px;
  transition: left 180ms ease, transform 140ms ease, filter 140ms ease;
}

.runner {
  left: calc(50% - 52px);
}

.zombie {
  left: calc(50% - 170px);
  opacity: 0.96;
  transform-origin: bottom center;
}

.runner-body,
.zombie-torso,
.zombie-head,
.zombie-arm,
.zombie-leg {
  position: absolute;
  display: block;
}

.runner-body {
  background:
    radial-gradient(circle at 50% 16%, #ffffff 0 10px, transparent 11px),
    linear-gradient(180deg, #86d7ff, #2b7db7);
  clip-path: polygon(25% 0%, 75% 0%, 85% 24%, 76% 58%, 88% 100%, 62% 100%, 55% 76%, 45% 76%, 38% 100%, 12% 100%, 24% 58%, 15% 24%);
  box-shadow: 0 16px 40px rgba(34, 212, 168, 0.24);
}

.zombie-aura {
  position: absolute;
  inset: 10px -8px -6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(210, 50, 33, 0.28), transparent 48%),
    radial-gradient(circle at 50% 75%, rgba(0, 0, 0, 0.34), transparent 70%);
  filter: blur(10px);
  opacity: 0.9;
}

.zombie-head {
  left: 22px;
  top: -2px;
  width: 44px;
  height: 50px;
  border-radius: 46% 54% 42% 48%;
  background:
    radial-gradient(circle at 48% 7%, rgba(127, 20, 15, 0.95) 0 8px, transparent 9px),
    radial-gradient(circle at 35% 28%, #8da28c 0 7px, transparent 8px),
    radial-gradient(circle at 65% 24%, #9faf8f 0 8px, transparent 9px),
    linear-gradient(180deg, #c3b8a4, #7b8267 62%, #4a5143);
  border: 2px solid rgba(53, 46, 34, 0.72);
  box-shadow:
    inset 0 -7px 0 rgba(51, 31, 24, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.24);
  animation: zombie-head-bob 0.7s ease-in-out infinite alternate;
}

.zombie-head::before {
  content: "";
  position: absolute;
  left: 12px;
  top: -4px;
  width: 18px;
  height: 12px;
  border-radius: 4px 6px 2px 2px;
  background:
    linear-gradient(180deg, #7b120d, #310706);
  box-shadow:
    0 0 0 2px rgba(73, 28, 19, 0.4),
    inset 0 -2px 0 rgba(255, 204, 185, 0.16);
  transform: rotate(-6deg);
}

.zombie-head::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 9px;
  width: 10px;
  height: 16px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, rgba(114, 10, 10, 0.0), rgba(114, 10, 10, 0.82));
  filter: blur(1px);
}

.zombie-eye {
  position: absolute;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 100, 60, 0.8);
}

.zombie-eye-left {
  left: 8px;
  background: radial-gradient(circle, #d9eef0 0 2px, #61767a 3px 100%);
}

.zombie-eye-right {
  right: 8px;
  background: radial-gradient(circle, #ffd38b 0 2px, #b81612 3px 100%);
}

.zombie-mouth {
  position: absolute;
  left: 9px;
  bottom: 5px;
  width: 22px;
  height: 15px;
  border-radius: 0 0 14px 14px;
  background:
    linear-gradient(180deg, #140404, #6f1e16);
  box-shadow:
    inset 0 2px 0 rgba(255, 183, 147, 0.18),
    inset 0 -4px 0 rgba(31, 5, 5, 0.6);
}

.zombie-mouth::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #f5e1c5 0 3px, transparent 3px 5px);
  opacity: 0.8;
}

.zombie-mouth::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: -8px;
  width: 6px;
  height: 12px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, rgba(112, 10, 10, 0.9), rgba(112, 10, 10, 0));
}

.zombie-torso {
  left: 20px;
  top: 38px;
  width: 48px;
  height: 58px;
  border-radius: 18px 18px 12px 12px;
  background:
    linear-gradient(180deg, #504c57, #2a252d 45%, #57413c 75%, #2d1a17);
  border: 2px solid rgba(50, 28, 22, 0.8);
  box-shadow:
    inset 8px 0 0 rgba(162, 27, 18, 0.14),
    inset -6px -8px 0 rgba(16, 10, 9, 0.32),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.zombie-torso::before,
.zombie-torso::after {
  content: "";
  position: absolute;
  background: rgba(128, 152, 111, 0.4);
}

.zombie-torso::before {
  left: 8px;
  top: 8px;
  width: 14px;
  height: 18px;
  border-radius: 3px;
}

.zombie-torso::after {
  right: 7px;
  bottom: 12px;
  width: 18px;
  height: 4px;
  transform: rotate(-18deg);
}

.zombie-arm {
  top: 42px;
  width: 16px;
  height: 60px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #9baa86, #5d6653 45%, #3e4338);
  border: 2px solid rgba(51, 40, 30, 0.76);
  box-shadow: inset 0 -6px 0 rgba(39, 23, 18, 0.26);
  transform-origin: top center;
}

.zombie-arm-left {
  left: -2px;
  top: 34px;
  width: 18px;
  height: 74px;
  transform: rotate(46deg);
  animation: zombie-arm-left-swing 0.55s ease-in-out infinite alternate;
}

.zombie-arm-right {
  right: -6px;
  top: 30px;
  width: 18px;
  height: 88px;
  transform: rotate(-64deg);
  animation: zombie-arm-right-swing 0.62s ease-in-out infinite alternate;
}

.zombie-arm-right::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: -10px;
  width: 30px;
  height: 22px;
  border-radius: 16px 18px 12px 12px;
  background:
    radial-gradient(circle at 28% 38%, #d6d1bc 0 2px, transparent 3px),
    linear-gradient(180deg, #aab28e, #6a725d 52%, #4d4336);
  border: 2px solid rgba(51, 40, 30, 0.76);
  box-shadow: inset 0 -4px 0 rgba(39, 23, 18, 0.26);
}

.zombie-leg {
  bottom: 4px;
  width: 18px;
  height: 52px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #40383d, #2d262b 55%, #54453c);
  border: 2px solid rgba(41, 25, 20, 0.84);
  transform-origin: top center;
}

.zombie-leg-left {
  left: 24px;
  transform: rotate(10deg);
  animation: zombie-leg-left-step 0.42s ease-in-out infinite alternate;
}

.zombie-leg-right {
  right: 22px;
  transform: rotate(-10deg);
  animation: zombie-leg-right-step 0.42s ease-in-out infinite alternate;
}

.runner-shadow,
.zombie-shadow {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -10px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  filter: blur(6px);
}

.zombie-shadow {
  left: 6px;
  right: 6px;
  bottom: -12px;
  height: 22px;
  background: rgba(0, 0, 0, 0.42);
  filter: blur(8px);
}

.zombie-roar {
  position: absolute;
  left: 36px;
  top: 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 196, 121, 0.0);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.zombie-roar.active {
  animation: zombie-roar-pulse 520ms ease-out;
}

.event-card {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: min(320px, calc(100% - 120px));
  padding: 8px 14px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(63, 18, 29, 0.88), rgba(16, 9, 15, 0.92));
  border: 3px solid var(--frame-light);
  box-shadow:
    inset 0 0 0 3px var(--frame-dark),
    0 0 18px rgba(255, 81, 104, 0.16),
    0 12px 24px rgba(0, 0, 0, 0.36);
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

.event-type {
  color: var(--warning);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.prompt-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  min-height: 34px;
  font-family: "MS PGothic", "Yu Gothic UI", sans-serif;
}

.prompt-current {
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(255, 81, 104, 0.28), 2px 2px 0 #4a0f19;
}

.prompt-ghost {
  color: rgba(236, 246, 255, 0.25);
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0.08em;
}

.prompt-meaning {
  margin: 10px 0 2px;
  color: var(--warning);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.event-help {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.controls {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  padding: 14px;
}

.coach-panel {
  padding: 16px;
  position: sticky;
  top: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(24, 14, 22, 0.96), rgba(13, 10, 16, 0.98)),
    radial-gradient(circle at top right, rgba(135, 255, 206, 0.08), transparent 24%);
}

.coach-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.coach-header h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.coach-instruction {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 280px;
  padding: 14px 16px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 96, 120, 0.92), rgba(136, 22, 48, 0.95));
  border: 2px solid rgba(255, 214, 220, 0.32);
}

.coach-instruction strong {
  display: block;
  font-size: 1rem;
}

.coach-instruction p {
  margin: 4px 0 0;
  color: var(--muted);
}

.coach-key {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 230, 160, 0.94), rgba(228, 97, 92, 0.92));
  border: 2px solid rgba(255, 240, 200, 0.35);
  font-family: "MS PGothic", "Yu Gothic UI", sans-serif;
  font-size: 1.4rem;
  color: #2d0e15;
}

.hand-map {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.hand-card {
  padding: 16px 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(58, 18, 29, 0.84), rgba(22, 12, 18, 0.96));
  border: 2px solid rgba(255, 156, 173, 0.16);
  opacity: 0.6;
  transition: opacity 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.hand-card.active {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(135, 255, 206, 0.72);
}

.hand-title {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hand-card p {
  margin: 8px 0 0;
}

.finger-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #051019;
  font-size: 0.85rem;
  font-weight: 700;
}

.pinky { background: #d46659; }
.ring { background: #d86d7e; }
.middle { background: #ddb764; }
.index { background: #5bd0a2; }

.keyboard {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}

.keyboard-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
}

.keyboard-row-wide {
  padding-left: 24px;
  padding-right: 24px;
}

.key {
  width: clamp(34px, 8.4%, 48px);
  aspect-ratio: 1 / 1;
  height: auto;
  border: 0;
  border-radius: 4px;
  color: #2f140d;
  font-family: "MS PGothic", "Yu Gothic UI", sans-serif;
  font-size: 0.95rem;
  cursor: default;
  position: relative;
  border: 2px solid rgba(74, 36, 22, 0.8);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease, box-shadow 120ms ease, outline-color 120ms ease;
}

.key-home-anchor::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(3, 18, 13, 0.72);
}

.finger-pinky { background: linear-gradient(180deg, #e38b7b, #a14538); }
.finger-ring { background: linear-gradient(180deg, #ff9b9c, #a83f52); }
.finger-middle { background: linear-gradient(180deg, #ffe08f, #a46f2c); }
.finger-index { background: linear-gradient(180deg, #95ffd5, #2d9d72); }

.key.active {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 3px rgba(135, 255, 206, 0.46),
    0 12px 22px rgba(72, 213, 162, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.key.typed {
  box-shadow:
    0 0 0 3px rgba(255, 126, 146, 0.32),
    0 0 24px rgba(255, 81, 104, 0.24),
    inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.typing-box {
  padding: 12px;
}

.typing-box input {
  margin-top: 8px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: rgba(32, 10, 8, 0.9);
  color: var(--text);
  padding: 14px 16px;
  font-size: 1.05rem;
  outline: none;
  border: 2px solid rgba(245, 213, 148, 0.16);
  box-shadow: inset 0 0 0 1px transparent;
}

.typing-box input:focus {
  box-shadow: inset 0 0 0 1px rgba(255, 209, 92, 0.5);
}

.tips {
  display: grid;
  gap: 8px;
  padding: 12px;
  align-content: center;
  color: var(--muted);
}

.beginner-tips p {
  margin: 0;
}

kbd {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(80, 36, 24, 0.95);
  color: var(--text);
  font-family: "MS PGothic", "Yu Gothic UI", sans-serif;
  font-size: 0.78rem;
  border: 1px solid rgba(245, 213, 148, 0.24);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 16, 0.74);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 5;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay-card {
  width: min(480px, calc(100% - 32px));
  padding: 28px;
  text-align: center;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(44, 12, 20, 0.98), rgba(14, 7, 12, 0.99)),
    radial-gradient(circle at top, rgba(255, 81, 104, 0.1), transparent 30%);
  border: 3px solid var(--frame-light);
  box-shadow:
    inset 0 0 0 3px var(--frame-dark),
    0 0 30px rgba(255, 81, 104, 0.16),
    0 32px 80px rgba(0, 0, 0, 0.52);
}

.overlay-card p {
  color: var(--muted);
}

.difficulty-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.difficulty-button {
  border: 2px solid rgba(255, 156, 173, 0.22);
  background: linear-gradient(180deg, rgba(74, 24, 36, 0.95), rgba(29, 12, 19, 0.96));
  color: var(--text);
  padding: 10px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.difficulty-button.active {
  background: linear-gradient(180deg, rgba(141, 255, 212, 0.96), rgba(34, 155, 108, 0.98));
  border-color: rgba(211, 255, 239, 0.88);
  color: #08140f;
}

.difficulty-note {
  margin: 10px 0 0;
  font-size: 0.95rem;
}

.overlay-card button {
  margin-top: 16px;
  border: 0;
  border-radius: 4px;
  padding: 14px 26px;
  font-family: "MS PGothic", "Yu Gothic UI", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: #fff7f3;
  background: linear-gradient(180deg, #ff6e84, #b61f42);
  box-shadow: inset 0 -3px 0 rgba(64, 10, 23, 0.54), 0 0 18px rgba(255, 81, 104, 0.22);
  cursor: pointer;
}

.feedback-success {
  animation: flash-success 220ms ease;
}

.feedback-danger {
  animation: flash-danger 260ms ease;
}

@keyframes skyline-move {
  from { transform: translateX(0); }
  to { transform: translateX(-720px); }
}

@keyframes road-flow {
  from { background-position: 0 0; }
  to { background-position: 0 34px; }
}

@keyframes flash-success {
  0% { box-shadow: 0 0 0 rgba(34, 212, 168, 0); }
  40% { box-shadow: 0 0 0 4px rgba(34, 212, 168, 0.2); }
  100% { box-shadow: 0 0 0 rgba(34, 212, 168, 0); }
}

@keyframes flash-danger {
  0% { transform: translate(-50%, -50%) scale(1); }
  35% { transform: translate(-50%, -50%) scale(1.03); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes zombie-head-bob {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(2px) rotate(2deg); }
}

@keyframes zombie-arm-left-swing {
  from { transform: rotate(34deg) translateY(0); }
  to { transform: rotate(54deg) translateY(6px); }
}

@keyframes zombie-arm-right-swing {
  from { transform: rotate(-58deg) translateY(0); }
  to { transform: rotate(-76deg) translateY(6px); }
}

@keyframes zombie-leg-left-step {
  from { transform: rotate(14deg); }
  to { transform: rotate(-4deg); }
}

@keyframes zombie-leg-right-step {
  from { transform: rotate(-14deg); }
  to { transform: rotate(4deg); }
}

@keyframes zombie-roar-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.2);
    border-color: rgba(255, 214, 152, 0.8);
    box-shadow: 0 0 0 rgba(255, 134, 86, 0);
  }
  100% {
    opacity: 0;
    transform: scale(8);
    border-color: rgba(255, 112, 69, 0);
    box-shadow: 0 0 36px rgba(255, 134, 86, 0.22);
  }
}

@keyframes background-zombie-sway {
  from { transform: translateY(0) rotate(-3deg); }
  to { transform: translateY(3px) rotate(2deg); }
}

@keyframes panel-shake-light {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, 0); }
  100% { transform: translate(0, 0); }
}

@keyframes panel-shake-heavy {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 1px); }
  100% { transform: translate(0, 0); }
}

@keyframes roar-ui-flash {
  0% {
    box-shadow:
      inset 0 0 0 3px var(--frame-dark),
      inset 0 0 0 5px rgba(255, 240, 200, 0.18),
      0 20px 50px var(--shadow),
      0 0 0 rgba(217, 58, 35, 0);
  }
  25% {
    box-shadow:
      inset 0 0 0 3px #6c120d,
      inset 0 0 0 5px rgba(255, 174, 160, 0.24),
      0 20px 50px var(--shadow),
      0 0 22px rgba(217, 58, 35, 0.32);
  }
  100% {
    box-shadow:
      inset 0 0 0 3px var(--frame-dark),
      inset 0 0 0 5px rgba(255, 240, 200, 0.18),
      0 20px 50px var(--shadow),
      0 0 0 rgba(217, 58, 35, 0);
  }
}

@media (max-width: 900px) {
  .play-layout {
    grid-template-columns: 1fr;
  }

  .hud,
  .controls {
    grid-template-columns: 1fr;
    display: grid;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .coach-header,
  .hand-map {
    grid-template-columns: 1fr;
    display: grid;
  }

  .coach-instruction {
    min-width: 0;
  }

  .coach-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 16px, 100%);
    padding-top: 12px;
  }

  .hud,
  .game-panel,
  .controls,
  .coach-panel {
    border-radius: 18px;
  }

  .status-row,
  .controls,
  .hand-map {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-panel {
    min-height: 400px;
    padding: 14px;
  }

  .road {
    height: 280px;
  }

  .runner,
  .zombie {
    transform: scale(0.88);
    transform-origin: bottom center;
  }

  .keyboard-row {
    gap: 6px;
  }

  .keyboard-row-wide {
    padding-left: 12px;
    padding-right: 12px;
  }

  .key {
    width: clamp(30px, 8.5vw, 38px);
    height: auto;
    border-radius: 10px;
    font-size: 0.8rem;
  }

  .difficulty-picker {
    grid-template-columns: 1fr;
  }
}
