:root {
  --black: #020504;
  --ink: #07110e;
  --regza-green: #00442d;
  --green: #00c886;
  --mint: #89ffd5;
  --cyan: #36e9ff;
  --red: #ff5d63;
  --pink: #ff8bd1;
  --yellow: #ffd662;
  --cream: #fff7dc;
  --silver: #ecf5f2;
  --muted: rgba(236, 245, 242, 0.66);
  --line: rgba(236, 245, 242, 0.16);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
  color: var(--silver);
  font-family: "Yu Gothic UI", "Meiryo", "Cascadia Mono", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 640px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 200, 134, 0.20), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(255, 214, 98, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(0, 68, 45, 0.22), rgba(2, 5, 4, 0.95)),
    #020504;
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 42px);
  opacity: 0.7;
}

.title-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #07110e;
}

.title-screen[hidden] {
  display: none;
}

.title-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(238, 248, 235, 0.1), rgba(2, 5, 4, 0.72)),
    url("./assets/backgrounds/bg_sunny.png") center / cover no-repeat;
  opacity: 0.92;
}

.title-content {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 32px));
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(280px, 1.08fr);
  align-items: center;
  gap: 20px;
}

.title-copy {
  display: grid;
  align-content: center;
  gap: 24px;
  min-width: 0;
  padding-left: clamp(4px, 3vw, 22px);
}

.title-copy h2 {
  margin: 0;
  color: var(--cream);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.02;
  font-weight: 900;
  text-shadow:
    0 4px 0 rgba(0, 68, 45, 0.98),
    0 0 22px rgba(255, 214, 98, 0.44),
    0 0 34px rgba(0, 200, 134, 0.3);
}

.title-actions {
  width: min(320px, 100%);
  display: grid;
  gap: 10px;
}

.menu-button,
.setting-row {
  min-height: 54px;
  border: 1px solid rgba(255, 214, 98, 0.4);
  border-radius: 999px;
  background: rgba(7, 17, 14, 0.78);
  color: var(--cream);
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 12px 24px rgba(2, 5, 4, 0.24);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-menu-button {
  background: linear-gradient(135deg, rgba(0, 200, 134, 0.9), rgba(255, 214, 98, 0.58));
  color: #fffdf2;
  border-color: rgba(255, 247, 220, 0.72);
  text-shadow: 0 2px 0 rgba(0, 68, 45, 0.8);
}

.menu-button:hover,
.setting-row:hover {
  border-color: rgba(0, 200, 134, 0.88);
  background: rgba(0, 68, 45, 0.74);
  transform: translateY(-1px);
}

.title-hero {
  position: relative;
  height: min(100%, 600px);
  min-height: 320px;
}

.title-dino {
  position: absolute;
  right: clamp(0px, 2vw, 30px);
  bottom: 0;
  width: min(94%, 470px);
  max-height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 22px 26px rgba(2, 5, 4, 0.42));
  animation: titleDinoFloat 2600ms ease-in-out infinite;
}

.title-egg {
  position: absolute;
  width: clamp(68px, 11vw, 122px);
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(2, 5, 4, 0.3));
  animation: titleEggBob 2200ms ease-in-out infinite;
}

.title-egg-a {
  left: 4%;
  bottom: 12%;
}

.title-egg-b {
  right: 12%;
  top: 5%;
  animation-delay: -620ms;
}

.title-egg-c {
  left: 18%;
  top: 18%;
  animation-delay: -1180ms;
}

.menu-modal {
  z-index: 42;
}

.menu-box {
  width: min(430px, calc(100vw - 28px));
}

.settings-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 6px;
}

.setting-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.setting-row strong {
  color: var(--yellow);
}

.topbar {
  position: relative;
  z-index: 5;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(420px, auto) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 22px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(2, 5, 4, 0.92), rgba(2, 5, 4, 0.5));
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  color: var(--cream);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.08;
  font-weight: 900;
  text-shadow:
    0 2px 0 rgba(0, 68, 45, 0.95),
    0 0 18px rgba(255, 214, 98, 0.32),
    0 0 26px rgba(0, 200, 134, 0.24);
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 8px;
}

.hud-item,
.next-panel,
.signal-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(7, 17, 14, 0.74);
  box-shadow: inset 0 0 0 1px rgba(0, 200, 134, 0.04);
}

.hud-item {
  height: 50px;
  display: grid;
  place-content: center;
  padding: 6px 10px;
  text-align: center;
}

.hud-item span,
.next-panel span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.hud-item strong {
  margin-top: 3px;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
}

.stage-hud strong {
  color: var(--yellow);
  font-size: 16px;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(7, 17, 14, 0.78);
  color: var(--silver);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.end-button,
.primary-result-button,
.secondary-result-button {
  border: 1px solid rgba(255, 214, 98, 0.38);
  border-radius: 999px;
  background: rgba(255, 214, 98, 0.12);
  color: var(--cream);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.end-button {
  min-width: 82px;
  height: 46px;
  padding: 0 16px;
}

.icon-button:hover,
.control-button:hover,
.end-button:hover,
.primary-result-button:hover,
.secondary-result-button:hover {
  border-color: rgba(0, 200, 134, 0.78);
  background: rgba(0, 68, 45, 0.64);
  transform: translateY(-1px);
}

.secondary-result-button {
  min-height: 46px;
  padding: 0 18px;
  background: rgba(7, 17, 14, 0.68);
}

.icon-button.is-muted {
  color: rgba(236, 245, 242, 0.48);
  border-color: rgba(236, 245, 242, 0.14);
  background: rgba(7, 17, 14, 0.52);
}

.icon-button:focus-visible,
.control-button:focus-visible,
.end-button:focus-visible,
.primary-result-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.game-layout {
  position: relative;
  z-index: 3;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(230px, 320px);
  gap: 18px;
  padding: 14px 22px 10px;
}

.playfield-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(236, 245, 242, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 68, 45, 0.14), rgba(2, 5, 4, 0.82)),
    rgba(2, 5, 4, 0.5);
  box-shadow:
    0 0 0 1px rgba(0, 200, 134, 0.08),
    0 0 44px rgba(0, 68, 45, 0.28);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
  touch-action: none;
}

.nursery-gauge {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  pointer-events: none;
}

.nursery-gauge span {
  height: 16px;
  border: 1px solid rgba(236, 245, 242, 0.14);
  background: rgba(2, 5, 4, 0.6);
}

.nursery-gauge span.is-lit {
  border-color: rgba(0, 200, 134, 0.88);
  background: linear-gradient(90deg, var(--green), var(--yellow));
  box-shadow: 0 0 16px rgba(0, 200, 134, 0.36);
}

.toast {
  position: absolute;
  left: 50%;
  top: 16px;
  max-width: min(520px, calc(100% - 32px));
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 8px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(0, 200, 134, 0.35);
  background: rgba(7, 17, 14, 0.82);
  color: rgba(236, 245, 242, 0.9);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  opacity: 0.94;
}

.side-stage {
  position: relative;
  display: grid;
  grid-template-areas:
    "next"
    "dino"
    "signal";
  grid-template-rows: auto minmax(220px, 1fr) auto;
  gap: 12px;
  min-height: 0;
}

.next-panel {
  grid-area: next;
  min-height: 98px;
  display: grid;
  grid-template-columns: 1fr 78px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.next-panel span,
.next-panel strong {
  grid-column: 1;
}

.next-panel strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.egg-preview {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 66px;
  height: 80px;
  justify-self: end;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.32));
}

.badge {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: rgba(236, 245, 242, 0.42);
  transform-origin: center;
  transition: transform 180ms ease, color 180ms ease;
}

.badge-art,
.badge small {
  display: block;
  line-height: 1;
}

.badge-art {
  position: relative;
  width: min(100%, 68px);
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  border: 4px solid #c6a046;
  border-radius: 50%;
  background-color: #edf2dc;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 86%;
  box-shadow:
    0 0 0 2px #fff3b6 inset,
    0 0 0 5px rgba(77, 48, 10, 0.65) inset,
    0 8px 16px rgba(0, 0, 0, 0.3);
  filter: grayscale(1);
  opacity: 0.42;
  transition: filter 180ms ease, opacity 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.badge-art::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(77, 48, 10, 0.18);
  pointer-events: none;
}

.badge-art b {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(0, 68, 45, 0.82);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.badge-art[style] b {
  opacity: 0;
}

.badge-art-sprite {
  background-size: 112%;
}

.badge-art-egg {
  background-size: 72%;
}

.badge-art-background {
  background-size: cover;
}

.badge small {
  max-width: 90%;
  overflow: hidden;
  color: currentColor;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.is-unlocked {
  color: #ffffff;
}

.badge.is-unlocked .badge-art {
  filter: none;
  opacity: 1;
  border-color: #d9b65a;
  box-shadow:
    0 0 0 2px #fff4b8 inset,
    0 0 0 5px rgba(77, 48, 10, 0.66) inset,
    0 8px 18px rgba(0, 0, 0, 0.34),
    0 0 18px rgba(255, 214, 98, 0.22);
}

.badge.is-new::after {
  content: "新";
  position: absolute;
  top: -5px;
  right: -6px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}

.badge.is-new {
  position: relative;
  animation: badgePop 620ms ease-out;
}

.regzaurus-stage {
  grid-area: dino;
  position: relative;
  min-height: 270px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.aura {
  position: absolute;
  width: min(260px, 88%);
  aspect-ratio: 1;
  border: 1px solid rgba(0, 200, 134, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 200, 134, 0.22), transparent 42%),
    radial-gradient(circle at 58% 68%, rgba(255, 214, 98, 0.16), transparent 42%),
    rgba(2, 5, 4, 0.18);
  opacity: 0.72;
}

.regzaurus-sprite {
  position: relative;
  z-index: 2;
  width: min(230px, 86%);
  max-height: 86%;
  object-fit: contain;
  transform-origin: 50% 70%;
  filter:
    drop-shadow(0 18px 22px rgba(0, 0, 0, 0.36))
    drop-shadow(0 0 18px rgba(0, 200, 134, 0.16));
  transition: transform 160ms ease;
}

.face-bubble {
  display: none;
}

.face-bubble.is-visible {
  display: none;
}

.regzaurus-stage.is-jumping .regzaurus-sprite {
  animation: happyHop 760ms ease-in-out infinite;
}

.regzaurus-stage.is-running .regzaurus-sprite {
  animation: runLean 380ms ease-in-out infinite;
}

.regzaurus-stage.is-attack .aura {
  border-color: rgba(255, 214, 98, 0.44);
  background:
    radial-gradient(circle at 52% 28%, rgba(255, 214, 98, 0.28), transparent 42%),
    radial-gradient(circle at 50% 62%, rgba(255, 93, 99, 0.18), transparent 36%),
    radial-gradient(circle at 60% 70%, rgba(54, 233, 255, 0.20), transparent 42%);
  animation: auraPulse 520ms ease-in-out infinite;
}

.signal-panel {
  grid-area: signal;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 12px 14px;
}

.difficulty-pill {
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid rgba(255, 214, 98, 0.24);
  border-radius: 999px;
  background: rgba(255, 214, 98, 0.10);
  color: var(--cream);
  font-size: 12px;
  font-weight: 800;
}

.stage-time {
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid rgba(0, 200, 134, 0.28);
  border-radius: 999px;
  background: rgba(0, 200, 134, 0.1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.signal-panel strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(236, 245, 242, 0.84);
  font-size: 14px;
  line-height: 1.25;
}

.signal-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.signal-meter span {
  height: 7px;
  overflow: hidden;
  background: rgba(236, 245, 242, 0.16);
}

.signal-meter span::before {
  content: "";
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--red), var(--yellow));
  transform: translateX(-104%);
  animation: meterRun 1.55s ease-in-out infinite;
}

.signal-meter span:nth-child(2)::before { animation-delay: 120ms; }
.signal-meter span:nth-child(3)::before { animation-delay: 240ms; }
.signal-meter span:nth-child(4)::before { animation-delay: 360ms; }

.touch-controls {
  position: relative;
  z-index: 4;
  display: none;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
  padding: 8px 18px 14px;
}

.control-button {
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 17, 14, 0.86);
  color: var(--silver);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.control-button.drop {
  color: #ffffff;
  border-color: rgba(0, 200, 134, 0.58);
  background: rgba(0, 68, 45, 0.76);
}

body.is-first-drop .control-button.drop {
  border-color: rgba(255, 214, 98, 0.96);
  background: linear-gradient(180deg, rgba(0, 200, 134, 0.94), rgba(0, 68, 45, 0.9));
  box-shadow: 0 0 0 1px rgba(255, 214, 98, 0.28) inset, 0 0 22px rgba(255, 214, 98, 0.24);
  animation: firstDropPulse 980ms ease-in-out infinite;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 4, 0.66);
  backdrop-filter: blur(6px);
}

.result-modal[hidden] {
  display: none;
}

.result-box {
  width: min(560px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  border: 1px solid rgba(255, 214, 98, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 68, 45, 0.92), rgba(2, 5, 4, 0.96)),
    var(--ink);
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 22px;
  text-align: center;
}

.compact-result {
  width: min(440px, 100%);
}

.result-kicker {
  margin: 0 0 6px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
}

.result-box h2 {
  margin: 0 0 16px;
  color: #ffffff;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: clamp(25px, 6vw, 38px);
  line-height: 1.12;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.result-stats div {
  min-width: 0;
  border: 1px solid rgba(236, 245, 242, 0.14);
  background: rgba(2, 5, 4, 0.36);
  padding: 10px 8px;
}

.result-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.result-stats strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.result-note {
  min-height: 22px;
  margin: 6px 0 16px;
  color: var(--cream);
  font-weight: 800;
}

.primary-result-button {
  min-height: 48px;
  padding: 0 24px;
  border-color: rgba(255, 214, 98, 0.68);
  background: linear-gradient(180deg, rgba(0, 200, 134, 0.92), rgba(0, 68, 45, 0.92));
  color: #ffffff;
  font-size: 17px;
}

.compact-result .primary-result-button {
  min-width: 150px;
  min-height: 54px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), 0 0 18px rgba(255, 214, 98, 0.18);
  animation: resultButtonPulse 1200ms ease-in-out infinite;
}

.final-badge-rack {
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.badge-category {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.final-badge-rack .badge {
  min-height: 82px;
}

.final-badge-rack .badge.is-unlocked .badge-art {
  animation: badgeShine 2100ms ease-in-out infinite;
}

.near-badge-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.near-badge-list[hidden] {
  display: none;
}

.near-badge-list > strong {
  grid-column: 1 / -1;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.near-badge-list span {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 3px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 98, 0.2);
  border-radius: 8px;
  background: rgba(2, 5, 4, 0.42);
  padding: 8px 8px 10px;
  text-align: left;
}

.near-badge-art {
  grid-row: 1 / span 2;
  width: 32px;
  aspect-ratio: 1;
  display: grid;
  border-radius: 50%;
  border: 2px solid #c6a046;
  background-color: #edf2dc;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 82%;
  box-shadow: 0 0 0 2px rgba(77, 48, 10, 0.6) inset;
  filter: grayscale(1);
  opacity: 0.62;
}

.near-badge-art b {
  display: grid;
  place-items: center;
  color: rgba(0, 68, 45, 0.78);
  font-size: 10px;
  font-weight: 900;
}

.near-badge-art[style] b {
  opacity: 0;
}

.near-badge-list em,
.near-badge-list small {
  min-width: 0;
  overflow: hidden;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.near-badge-list em {
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.near-badge-list small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.near-badge-list i {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  width: var(--p);
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.share-text-panel {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid rgba(255, 214, 98, 0.26);
  border-radius: 8px;
  background: rgba(2, 5, 4, 0.52);
}

.share-text-panel[hidden] {
  display: none;
}

.share-text-panel strong {
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.share-text-panel textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid rgba(236, 245, 242, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #123d2c;
  font: 800 12px/1.55 "Yu Gothic UI", "Meiryo", sans-serif;
}

.share-text-panel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.tutorial-steps {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.tutorial-steps span {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 214, 98, 0.2);
  border-radius: 8px;
  background: rgba(2, 5, 4, 0.36);
  padding: 10px;
}

.tutorial-steps b {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 200, 134, 0.72), rgba(255, 214, 98, 0.58));
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
}

.tutorial-steps strong {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.28;
  text-align: left;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

body.is-paused .playfield-wrap::after,
body.is-game-over .playfield-wrap::after {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 5, 4, 0.58);
  color: #ffffff;
  font-size: clamp(30px, 6vw, 70px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 24px rgba(0, 200, 134, 0.8);
  pointer-events: none;
}

body.is-paused .playfield-wrap::after { content: "おやすみ中"; }
body.is-game-over .playfield-wrap::after { content: "おやすみ"; }

@keyframes happyHop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  44% { transform: translateY(-18px) rotate(-2deg); }
}

@keyframes runLean {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(4px) rotate(1.5deg); }
}

@keyframes auraPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes meterRun {
  0% { transform: translateX(-104%); }
  48%, 68% { transform: translateX(0); }
  100% { transform: translateX(104%); }
}

@keyframes badgePop {
  0% { transform: scale(0.72); }
  52% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes badgeShine {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

@keyframes firstDropPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes resultButtonPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes titleDinoFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes titleEggBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

@keyframes titleDinoFloatMobile {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); }
  50% { transform: translateX(-50%) translateY(-8px) rotate(1deg); }
}

@media (max-width: 980px) {
  .title-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    text-align: center;
    gap: 0;
  }
  .title-copy {
    justify-items: center;
    padding: 0;
    gap: 14px;
  }
  .title-copy h2 {
    font-size: clamp(38px, 10vw, 64px);
  }
  .title-actions {
    width: min(320px, 82vw);
  }
  .title-hero {
    min-height: 290px;
  }
  .title-dino {
    left: 50%;
    right: auto;
    width: min(72vw, 350px);
    transform: translateX(-50%);
    animation-name: titleDinoFloatMobile;
  }
  .app { min-height: 720px; }
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .hud {
    grid-column: 1 / -1;
    width: 100%;
  }
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 1fr) auto;
    gap: 10px;
    padding: 10px 14px 6px;
  }
  .side-stage {
    grid-template-areas:
      "next dino signal";
    grid-template-columns: minmax(110px, 1fr) minmax(150px, 230px) minmax(126px, 1fr);
    grid-template-rows: auto;
    align-items: stretch;
  }
  .regzaurus-stage {
    min-height: 136px;
    place-items: center;
  }
  .regzaurus-sprite {
    width: min(132px, 96%);
  }
  .face-bubble {
    top: 0;
    right: -8px;
    width: min(92px, 58%);
  }
  .next-panel,
  .signal-panel {
    min-height: 0;
  }
  .egg-preview {
    width: 52px;
    height: 62px;
  }
  .touch-controls {
    display: grid;
  }
}

@media (max-width: 620px) {
  .title-screen {
    align-items: start;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .title-content {
    width: min(calc(100vw - 20px), 430px);
    height: min(calc(100vh - 20px), 740px);
    align-content: start;
  }
  .title-copy h2 {
    font-size: clamp(34px, 12vw, 52px);
  }
  .menu-button,
  .setting-row {
    min-height: 50px;
  }
  .title-hero {
    min-height: 270px;
  }
  .title-dino {
    width: min(78vw, 310px);
  }
  .title-egg {
    width: clamp(54px, 17vw, 86px);
  }
  .app { min-height: 680px; }
  .topbar {
    min-height: 66px;
    padding: 10px 12px 8px;
  }
  .brand { gap: 8px; }
  .brand h1 { font-size: 20px; }
  .hud {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .hud-item {
    height: 42px;
    padding: 5px;
  }
  .hud-item strong { font-size: 16px; }
  .stage-hud strong { font-size: 15px; }
  .icon-button {
    width: 40px;
    height: 40px;
  }
  .end-button {
    min-width: 72px;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }
  .game-layout {
    grid-template-rows: minmax(430px, 1fr) auto;
    padding: 8px 10px 4px;
  }
  #gameCanvas { min-height: 430px; }
  .nursery-gauge {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 4px;
  }
  .nursery-gauge span { height: 12px; }
  .toast {
    top: 10px;
    min-height: 30px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .side-stage {
    grid-template-columns: minmax(96px, 1fr) 138px minmax(96px, 1fr);
    gap: 8px;
  }
  .regzaurus-stage {
    min-height: 112px;
  }
  .regzaurus-sprite {
    width: min(142px, 106%);
  }
  .next-panel,
  .signal-panel {
    padding: 7px;
  }
  .next-panel {
    grid-template-columns: 1fr 44px;
  }
  .next-panel strong { font-size: 15px; }
  .signal-panel strong { font-size: 11px; }
  .difficulty-pill,
  .stage-time { font-size: 10px; }
  .result-box {
    padding: 18px 14px;
  }
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .final-badge-rack {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 8px;
  }
  .near-badge-list {
    grid-template-columns: 1fr;
  }
  .final-badge-rack .badge {
    min-height: 78px;
  }
  .badge-art { width: min(100%, 62px); }
  .badge-art b { font-size: 14px; }
  .badge small { font-size: 8px; }
  .touch-controls {
    gap: 8px;
    padding: 6px 10px 10px;
  }
  .control-button {
    height: 48px;
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-dino,
  .title-egg,
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
