:root {
  color-scheme: light;
  --ink: #12314c;
  --ink-soft: rgba(18, 49, 76, 0.72);
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(255, 255, 255, 0.66);
  --blue: #0785de;
  --blue-deep: #075ca7;
  --blue-dark: #06477f;
  --cyan: #20c3f0;
  --gold: #ffbf35;
  --gold-light: #ffe892;
  --orange: #ff7a2e;
  --green: #2bbf7d;
  --danger: #d9435f;
  --shadow-soft: 0 12px 30px rgba(5, 58, 116, 0.18);
  --shadow: 0 22px 58px rgba(5, 58, 116, 0.3);
  --shadow-strong: 0 30px 80px rgba(4, 44, 93, 0.36);
  --radius: 8px;
  --font-game: "M PLUS Rounded 1c", "M PLUS 1p", "Noto Sans JP", "Noto Sans SC", "Noto Sans KR", "Nunito", "Avenir Next Rounded", "Hiragino Maru Gothic ProN", "Yu Gothic UI", ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #0a79c9;
  font-family: var(--font-game);
  color: var(--ink);
}

button,
select,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 238, 135, 0.96);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #10a1f1;
  isolation: isolate;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 1;
  pointer-events: none;
}

.app-shell::before {
  background:
    linear-gradient(155deg, rgba(255, 244, 177, 0.18) 0%, transparent 30%),
    linear-gradient(20deg, rgba(84, 220, 255, 0.2) 0%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 46%);
  filter: blur(12px);
  animation: skyGlow 14s ease-in-out infinite alternate;
}

.app-shell::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 222, 93, 0.84) 0 1px, transparent 2px);
  background-size: 120px 120px, 180px 180px;
  background-position: 0 0, 40px 60px;
  opacity: 0.34;
  animation: sparkleDrift 26s linear infinite;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  min-height: 78px;
  padding: calc(env(safe-area-inset-top) + 12px) max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand-lockup {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-shadow: 0 3px 14px rgba(6, 45, 92, 0.42);
}

.brand-lockup img {
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(9, 77, 150, 0.34);
}

.brand-lockup strong {
  display: block;
  font-size: 1.14rem;
  letter-spacing: 0;
  line-height: 1;
  font-weight: 1000;
}

.brand-lockup span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 900;
  opacity: 0.92;
  white-space: nowrap;
}

.hud {
  position: absolute;
  z-index: 19;
  inset: 0;
  pointer-events: none;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.hud-score,
.hud-counter {
  position: absolute;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: #ffffff;
  -webkit-text-stroke: 2px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 4px 0 rgba(4, 63, 118, 0.2),
    0 9px 16px rgba(4, 46, 90, 0.3);
  filter: drop-shadow(0 8px 16px rgba(4, 46, 90, 0.22));
}

.hud-score {
  top: calc(env(safe-area-inset-top) + 16px);
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
  min-width: clamp(280px, 26vw, 480px);
  font-size: clamp(1.42rem, 2.15vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.hud-high-score {
  top: calc(env(safe-area-inset-top) + 58px);
  min-width: clamp(300px, 28vw, 500px);
  font-size: clamp(1.12rem, 1.62vw, 1.88rem);
  -webkit-text-stroke-width: 1.8px;
  text-shadow:
    0 2px 0 #06477f,
    0 4px 0 rgba(4, 63, 118, 0.16),
    0 8px 14px rgba(4, 46, 90, 0.26);
}

.hud-score .hud-number {
  min-width: 8ch;
  display: inline-block;
  text-align: left;
}

.hud-score-prefix {
  margin-right: 0.34em;
}

.hud-counter {
  gap: 7px;
  font-size: clamp(1.5rem, 2vw, 2.28rem);
  line-height: 1;
}

.hud-counter .hud-number {
  min-width: 2ch;
  display: inline-block;
  text-align: left;
  transform-origin: center;
}

.hud-counter.is-danger {
  color: #ff4242;
  -webkit-text-stroke-color: #7a1018;
  text-shadow:
    0 2px 0 #7a1018,
    0 4px 0 rgba(122, 16, 24, 0.22),
    0 9px 18px rgba(122, 16, 24, 0.38);
  filter:
    drop-shadow(0 0 10px rgba(255, 62, 62, 0.42))
    drop-shadow(0 8px 16px rgba(83, 12, 18, 0.24));
}

.hud-counter.is-danger .hud-number,
.hud-counter.is-danger .hud-times {
  color: #ff4242;
  -webkit-text-stroke-color: #7a1018;
}

.hud-counter.is-danger .hud-clock-icon {
  fill: rgba(255, 226, 120, 0.95);
  stroke: #7a1018;
  filter:
    drop-shadow(0 3px 0 rgba(122, 16, 24, 0.42))
    drop-shadow(0 0 9px rgba(255, 62, 62, 0.45));
}

.hud-counter.is-warning-pop .hud-number {
  animation: hudWarningPop 520ms cubic-bezier(0.12, 0.92, 0.2, 1) both;
}

.hud-goal-stack {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 88px);
  left: max(16px, env(safe-area-inset-left));
  display: inline-grid;
  gap: 8px;
  justify-items: start;
}

.hud-goal-stack .hud-counter {
  position: relative;
}

.hud-goal-counter,
.hud-gray-counter {
  left: auto;
  top: auto;
}

.hud-timer-counter {
  top: calc(env(safe-area-inset-top) + 66px);
  right: max(18px, env(safe-area-inset-right));
}

.hud-bottom-cluster {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
}

.hud-bottom-cluster .hud-counter {
  position: relative;
}

.hud-lives-counter,
.hud-jump-counter {
  left: auto;
  transform: none;
  bottom: auto;
}

.hud-times {
  margin-left: -1px;
  margin-right: -2px;
  font-size: 0.9em;
}

.hud-clock-icon {
  width: clamp(34px, 4vw, 54px);
  height: clamp(34px, 4vw, 54px);
  overflow: visible;
  fill: rgba(255, 245, 175, 0.92);
  stroke: #07528d;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  paint-order: stroke fill;
  filter: drop-shadow(0 3px 0 rgba(6, 71, 127, 0.36));
}

.hud-cloud-icon,
.hud-sun-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.hud-cloud-icon {
  --hud-cloud-width: min(clamp(42px, 4.6vw, 62px), var(--hud-character-size, 62px));
  width: var(--hud-cloud-width);
  height: calc(var(--hud-cloud-width) * 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 42%, #ffffff 0 25%, transparent 26%),
    radial-gradient(circle at 55% 34%, #ffffff 0 27%, transparent 28%),
    radial-gradient(circle at 73% 54%, #eef8ff 0 24%, transparent 25%),
    radial-gradient(ellipse at 48% 69%, #f8fcff 0 55%, transparent 56%);
  filter: drop-shadow(0 3px 0 rgba(5, 58, 110, 0.16));
}

.hud-cloud-icon::before,
.hud-cloud-icon::after {
  content: none;
}

.hud-cloud-icon.is-gray {
  background:
    radial-gradient(circle at 34% 42%, #f4f7f9 0 25%, transparent 26%),
    radial-gradient(circle at 55% 34%, #d9e1e6 0 27%, transparent 28%),
    radial-gradient(circle at 73% 54%, #a9b7c0 0 24%, transparent 25%),
    radial-gradient(ellipse at 48% 69%, #b9c4cc 0 55%, transparent 56%);
}

.hud-sun-icon {
  --hud-sun-size: min(clamp(40px, 4.7vw, 62px), var(--hud-character-size, 62px));
  width: var(--hud-sun-size);
  height: var(--hud-sun-size);
  border-radius: 999px;
  background: radial-gradient(circle at 34% 28%, #ffffff 0 15%, #fff7a9 36%, #ff9d20 70%, #ff3522 100%);
  border: 2px solid #ff8000;
  overflow: visible;
  isolation: isolate;
  box-shadow:
    0 0 0 3px rgba(255, 182, 45, 0.34),
    0 4px 10px rgba(7, 58, 116, 0.24);
}

.hud-sun-icon::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: inherit;
  background: repeating-conic-gradient(from -4deg, #ff8a00 0deg 5deg, transparent 5deg 12deg);
  filter: drop-shadow(0 2px 0 rgba(255, 128, 0, 0.3));
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 68%, #000 70% 100%);
  mask: radial-gradient(circle closest-side, transparent 0 68%, #000 70% 100%);
  z-index: -1;
}

.hud-sun-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 31%, rgba(255, 255, 255, 0.9) 0 4.5%, transparent 5.1%),
    radial-gradient(circle at 64% 31%, rgba(255, 255, 255, 0.9) 0 4.5%, transparent 5.1%),
    radial-gradient(circle at 33% 39%, #102033 0 7.6%, transparent 8.3%),
    radial-gradient(circle at 67% 39%, #102033 0 7.6%, transparent 8.3%),
    radial-gradient(circle at 33% 38%, #ffffff 0 16%, transparent 16.8%),
    radial-gradient(circle at 67% 38%, #ffffff 0 16%, transparent 16.8%);
  pointer-events: none;
}

.award-toast {
  position: absolute;
  z-index: 24;
  left: 50%;
  top: calc(env(safe-area-inset-top) + clamp(82px, 9vh, 112px));
  width: min(calc(100vw - 32px), 680px);
  min-height: clamp(56px, 6.4vw, 76px);
  padding: 8px clamp(14px, 2vw, 24px) 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 18px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(201, 239, 255, 0.74)),
    linear-gradient(135deg, rgba(255, 214, 66, 0.82), rgba(49, 184, 255, 0.62));
  box-shadow:
    0 5px 0 rgba(5, 70, 132, 0.36),
    0 14px 30px rgba(5, 58, 110, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.75);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -14px) scale(0.94);
  transform-origin: top center;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.15, 0.9, 0.24, 1.18);
  overflow: hidden;
}

.award-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  animation: awardToastPop 520ms cubic-bezier(0.14, 0.95, 0.24, 1.15) both;
}

.award-toast::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: calc(var(--radius) - 2px);
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.8), transparent 22%),
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.58) 48%, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.72;
  pointer-events: none;
}

.award-toast img {
  position: relative;
  width: clamp(42px, 4.8vw, 58px);
  height: clamp(42px, 4.8vw, 58px);
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 7px rgba(4, 56, 104, 0.24));
}

.award-toast span {
  position: relative;
  min-width: 0;
  color: #ffffff;
  font-size: clamp(1rem, 2vw, 1.55rem);
  line-height: 1.08;
  font-weight: 1000;
  letter-spacing: 0;
  text-align: center;
  -webkit-text-stroke: 1.7px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 4px 0 rgba(4, 63, 118, 0.2),
    0 10px 16px rgba(4, 46, 90, 0.25);
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  background:
    linear-gradient(180deg, #ffffff 0%, #d8f3ff 54%, #8ed8ff 100%),
    #ffffff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(5, 87, 152, 0.16),
    0 10px 0 rgba(6, 70, 122, 0.18),
    0 15px 28px rgba(7, 58, 116, 0.24);
  backdrop-filter: blur(14px);
  cursor: pointer;
  overflow: hidden;
  color: #06477f;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.icon-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 48%);
  pointer-events: none;
}

.icon-button svg {
  position: relative;
  width: 24px;
  height: 24px;
  stroke-width: 3;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.75));
}

#pauseButton {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  right: max(14px, env(safe-area-inset-right));
  justify-self: end;
}

.icon-button:hover,
.menu-actions button:hover,
.result-actions button:hover,
.pause-actions button:hover,
.ready-screen button:hover,
.settings-screen > button:hover,
.stage-cell:hover {
  transform: translateY(-2px);
  filter: saturate(1.06);
}

.screen {
  position: absolute;
  z-index: 15;
  left: 50%;
  top: 50%;
  width: min(92vw, 560px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 18px;
  justify-items: stretch;
  pointer-events: auto;
  animation: screenIn 420ms cubic-bezier(0.2, 0.85, 0.24, 1) both;
}

.screen-menu {
  width: min(94vw, 660px);
  align-content: center;
  gap: 16px;
}

.title-block {
  display: grid;
  justify-items: center;
  text-align: center;
  filter: drop-shadow(0 28px 48px rgba(2, 48, 110, 0.2));
}

.title-key-art {
  width: min(100%, 660px);
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow:
    0 28px 0 rgba(4, 72, 126, 0.08),
    0 30px 74px rgba(4, 47, 104, 0.32),
    inset 0 0 0 2px rgba(255, 255, 255, 0.48);
  animation: titleFloat 4.8s ease-in-out infinite;
}

.title-block p {
  position: relative;
  margin: -16px 0 0;
  min-height: 46px;
  max-width: min(90%, 540px);
  padding: 8px 28px 10px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff 0%, #d8f5ff 38%, #47c3f4 100%),
    #ffffff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -5px 0 rgba(6, 109, 176, 0.2),
    0 10px 0 rgba(6, 70, 122, 0.18),
    0 18px 34px rgba(5, 58, 116, 0.24);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 1000;
  line-height: 1.05;
  -webkit-text-stroke: 2px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 4px 0 rgba(4, 63, 118, 0.22),
    0 9px 16px rgba(4, 46, 90, 0.28);
  overflow-wrap: anywhere;
}

.menu-actions,
.result-actions,
.pause-actions {
  display: grid;
  gap: 10px;
}

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

#continueButton {
  grid-column: 1 / -1;
}

.menu-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-actions button,
.result-actions button,
.pause-actions button,
.ready-screen button,
.settings-screen > button {
  position: relative;
  min-height: 68px;
  padding: 12px 20px 14px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff 0%, #d9f4ff 46%, #8edaff 100%),
    #ffffff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -6px 0 rgba(5, 87, 152, 0.16),
    0 12px 0 rgba(6, 70, 122, 0.18),
    0 22px 46px rgba(5, 58, 116, 0.24);
  cursor: pointer;
  color: #ffffff;
  font-size: 1.26rem;
  font-weight: 1000;
  line-height: 1.04;
  -webkit-text-stroke: 2px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 5px 0 rgba(4, 63, 118, 0.18),
    0 10px 16px rgba(4, 46, 90, 0.22);
  overflow: hidden;
  overflow-wrap: anywhere;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.menu-action-label,
.menu-action-description {
  position: relative;
  z-index: 1;
}

.menu-action-label {
  display: block;
}

.menu-action-description {
  display: block;
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(0.68rem, 1.35vw, 0.86rem);
  line-height: 1.12;
  font-weight: 1000;
  -webkit-text-stroke: 1px rgba(7, 82, 141, 0.84);
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 rgba(6, 71, 127, 0.5),
    0 4px 8px rgba(4, 46, 90, 0.18);
}

.menu-actions button::before,
.result-actions button::before,
.pause-actions button::before,
.ready-screen button::before,
.settings-screen > button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), transparent 46%);
  pointer-events: none;
}

.menu-actions button::after,
.primary-action::after {
  content: "";
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -45%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: rotate(16deg);
  opacity: 0;
  animation: buttonShine 4.2s ease-in-out infinite;
  pointer-events: none;
}

.primary-action {
  background:
    linear-gradient(180deg, #fff9c5 0%, #ffd44b 48%, #ff9225 100%),
    #ffbd35 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.86) !important;
  -webkit-text-stroke: 2px #774000;
  text-shadow:
    0 2px 0 #8d4e00,
    0 5px 0 rgba(122, 62, 0, 0.22),
    0 10px 18px rgba(93, 45, 0, 0.28) !important;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.86),
    inset 0 -7px 0 rgba(160, 78, 0, 0.22),
    0 12px 0 rgba(122, 62, 0, 0.24),
    0 24px 58px rgba(5, 58, 116, 0.24) !important;
}

.menu-actions button:active,
.result-actions button:active,
.pause-actions button:active,
.ready-screen button:active,
.settings-screen > button:active,
.icon-button:active,
.stage-cell:active {
  transform: translateY(1px) scale(0.99);
}

.result-actions button:disabled {
  cursor: default;
  filter: saturate(0.8) brightness(1.03);
  opacity: 0.74;
  transform: none;
}

.menu-footer {
  display: grid;
  grid-template-columns: 44px 44px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(18, 127, 200, 0.78), rgba(5, 76, 139, 0.78)),
    rgba(5, 72, 130, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    0 16px 42px rgba(5, 58, 116, 0.24);
  backdrop-filter: blur(18px);
  color: #ffffff;
  text-shadow:
    0 2px 0 rgba(3, 51, 101, 0.72),
    0 5px 14px rgba(5, 45, 105, 0.44);
  font-weight: 1000;
}

.menu-footer .icon-button {
  background:
    linear-gradient(180deg, #fff9c5 0%, #ffd44b 52%, #ff9b2d 100%),
    #ffbd35;
  color: #6c3900;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.88),
    inset 0 -5px 0 rgba(148, 70, 0, 0.22),
    0 8px 0 rgba(92, 48, 0, 0.26),
    0 14px 26px rgba(4, 42, 84, 0.28);
}

.menu-footer span {
  justify-self: end;
  text-align: right;
  color: #ffffff;
  -webkit-text-stroke: 1.2px rgba(3, 51, 101, 0.78);
  paint-order: stroke fill;
  overflow-wrap: anywhere;
}

.title-copyright {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 20;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  text-underline-offset: 3px;
  text-shadow:
    0 2px 0 rgba(3, 51, 101, 0.58),
    0 5px 12px rgba(5, 45, 105, 0.34);
  -webkit-text-stroke: 0.8px rgba(3, 51, 101, 0.46);
  paint-order: stroke fill;
  pointer-events: auto;
}

.title-copyright:hover {
  text-decoration: underline;
}

.screen-menu.is-hidden + .title-copyright {
  display: none !important;
}

.screen-panel {
  width: min(94vw, 780px);
  max-height: min(78vh, 760px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(222, 246, 255, 0.78)),
    var(--panel);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(20px);
  overflow: auto;
  scrollbar-width: auto;
  scrollbar-color: rgba(7, 82, 141, 0.58) rgba(255, 255, 255, 0.54);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  position: relative;
  margin: 0;
  font-size: clamp(2.35rem, 4.6vw, 3.65rem);
  line-height: 1;
  font-weight: 1000;
  color: #ffffff;
  -webkit-text-stroke: 2px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #06477f,
    0 7px 0 rgba(4, 63, 118, 0.16),
    0 14px 24px rgba(4, 46, 90, 0.3);
  filter: drop-shadow(0 10px 18px rgba(5, 58, 116, 0.22));
}

.section-heading h2::after {
  content: "";
  position: absolute;
  left: 4px;
  right: -12px;
  bottom: -7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff28a, #ffbd35 48%, rgba(255, 255, 255, 0));
  box-shadow: 0 3px 0 rgba(7, 82, 141, 0.24);
}

.section-heading span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px 5px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff 0%, #d8f4ff 46%, #78d2ff 100%),
    #ffffff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(5, 87, 152, 0.14),
    0 8px 0 rgba(6, 70, 122, 0.15),
    0 14px 24px rgba(5, 58, 116, 0.18);
  font-weight: 1000;
  color: #ffffff;
  -webkit-text-stroke: 1.4px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 5px 10px rgba(4, 46, 90, 0.2);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(48px, 1fr));
  gap: 8px;
}

.stage-cell {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(218, 242, 255, 0.88)),
    #ffffff;
  box-shadow: 0 10px 24px rgba(7, 58, 116, 0.14);
  cursor: pointer;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 3px;
  color: var(--ink);
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.stage-best {
  position: absolute;
  z-index: 3;
  left: 2px;
  right: 2px;
  bottom: 4px;
  color: #ffffff;
  font-size: clamp(0.6rem, 1.04vw, 0.8rem);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-stroke: 1px #06477f;
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 #06477f,
    0 3px 5px rgba(4, 46, 90, 0.42),
    0 0 5px rgba(255, 255, 255, 0.55);
  filter: drop-shadow(0 2px 3px rgba(4, 46, 90, 0.28));
  pointer-events: none;
}

.stage-cell:focus,
.stage-cell:focus-visible {
  outline: 4px solid #fff28a;
  outline-offset: 4px;
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 0 0 5px rgba(7, 82, 141, 0.78),
    0 0 0 10px rgba(255, 242, 138, 0.34),
    0 18px 36px rgba(6, 72, 130, 0.28);
  z-index: 2;
}

.stage-cell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), transparent 52%);
  pointer-events: none;
}

.stage-cell::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 46%;
  height: 4px;
  border-radius: 999px;
  background: rgba(7, 133, 222, 0.18);
  transform: translateX(-50%);
}

.stage-cell:focus::after,
.stage-cell:focus-visible::after {
  bottom: -13px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid #fff28a;
  border-radius: 0;
  background: transparent;
  filter:
    drop-shadow(0 3px 0 #07528d)
    drop-shadow(0 7px 10px rgba(5, 58, 110, 0.28));
  animation: selectedCursorBob 780ms ease-in-out infinite;
}

.stage-number {
  position: relative;
  z-index: 1;
  align-self: end;
  font-size: clamp(1.02rem, 1.7vw, 1.28rem);
  line-height: 1;
  color: #ffffff;
  -webkit-text-stroke: 1.6px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 5px 9px rgba(4, 46, 90, 0.24);
  filter: drop-shadow(0 4px 5px rgba(5, 58, 116, 0.18));
}

.stage-trophy {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 4px 6px rgba(6, 50, 96, 0.22));
}

.stage-trophy img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-trophy.is-empty {
  opacity: 0;
}

.stage-cell.is-locked {
  opacity: 0.5;
  filter: grayscale(0.65);
}

.ready-screen,
.result-screen,
.pause-screen {
  width: min(94vw, 640px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 243, 143, 0.34), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(218, 244, 255, 0.88)),
    var(--panel-strong);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -8px 0 rgba(7, 82, 141, 0.08),
    var(--shadow-strong);
  backdrop-filter: blur(20px);
  text-align: center;
}

.result-screen {
  width: min(96vw, 760px);
}

.ready-copy,
.result-copy {
  display: grid;
  row-gap: 18px;
  justify-items: center;
}

.ready-stage-selector {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  column-gap: 12px;
  width: min(100%, 560px);
}

.ready-stage-selector.has-stage-controls {
  grid-template-columns: 48px minmax(0, auto) 48px;
}

.settings-screen {
  width: min(92vw, 520px);
}

.settings-list {
  display: grid;
  gap: 10px;
}

.setting-row {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  align-items: center;
  gap: 12px;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.setting-row > span {
  color: #ffffff;
  -webkit-text-stroke: 1.35px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(6, 71, 127, 0.36),
    0 5px 10px rgba(4, 46, 90, 0.18);
}

.setting-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(17, 48, 75, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  padding: 0 10px;
  font-weight: 1000;
}

.audio-row {
  grid-template-columns: minmax(0, 0.82fr) minmax(220px, 1.35fr);
}

.audio-controls {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
}

.volume-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
}

.volume-control input[type="range"] {
  --volume-level: 100%;
  width: 100%;
  height: 34px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid rgba(17, 48, 75, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #2fb8ff 0 var(--volume-level), rgba(34, 65, 88, 0.22) var(--volume-level) 100%);
  box-shadow: inset 0 2px 5px rgba(5, 58, 116, 0.12);
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -9px;
  appearance: none;
  border: 2px solid #247bbf;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(7, 58, 116, 0.22);
}

.volume-control input[type="range"]::-moz-range-track {
  height: 12px;
  border: 1px solid rgba(17, 48, 75, 0.18);
  border-radius: 999px;
  background: rgba(34, 65, 88, 0.22);
  box-shadow: inset 0 2px 5px rgba(5, 58, 116, 0.12);
}

.volume-control input[type="range"]::-moz-range-progress {
  height: 12px;
  border-radius: 999px;
  background: #2fb8ff;
}

.volume-control input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid #247bbf;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(7, 58, 116, 0.22);
}

.volume-control output {
  min-width: 44px;
  padding: 6px 8px;
  border: 1px solid rgba(17, 48, 75, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
}

.switch-row input {
  justify-self: end;
}

.audio-toggle {
  justify-self: start;
}

.switch-row input,
.audio-toggle {
  width: 58px;
  height: 32px;
  appearance: none;
  border: 1px solid rgba(17, 48, 75, 0.18);
  border-radius: 999px;
  background: rgba(34, 65, 88, 0.22);
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 2px 6px rgba(5, 58, 116, 0.12);
  transition: background 160ms ease;
}

.switch-row input::before,
.audio-toggle::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(7, 58, 116, 0.22);
  transition: transform 160ms ease;
}

.switch-row input:checked,
.audio-toggle:checked {
  background: linear-gradient(180deg, #6fe1a8, #23a96c);
}

.switch-row input:checked::before,
.audio-toggle:checked::before {
  transform: translateX(26px);
}

.ready-copy span,
.result-copy span {
  display: inline-flex;
  margin-bottom: 0;
  padding: 7px 18px 9px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fff9c5 0%, #ffd44b 50%, #ff9225 100%),
    #ffbd35;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.86),
    inset 0 -5px 0 rgba(160, 78, 0, 0.2),
    0 8px 0 rgba(122, 62, 0, 0.22),
    0 16px 26px rgba(5, 58, 116, 0.22);
  color: #ffffff;
  font-weight: 1000;
  font-size: clamp(1.06rem, 2vw, 1.34rem);
  line-height: 1;
  white-space: nowrap;
  -webkit-text-stroke: 1.7px #774000;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #8d4e00,
    0 5px 12px rgba(93, 45, 0, 0.28);
}

.ready-copy h2,
.result-copy h2 {
  margin: 0;
  max-width: calc(94vw - 56px);
  font-size: clamp(2.45rem, 7vw, 4.85rem);
  line-height: 0.92;
  font-weight: 1000;
  color: #ffffff;
  -webkit-text-stroke: clamp(2px, 0.42vw, 3.5px) #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #06477f,
    0 7px 0 rgba(4, 63, 118, 0.18),
    0 16px 24px rgba(4, 46, 90, 0.3);
  filter: drop-shadow(0 12px 18px rgba(5, 58, 116, 0.24));
}

.ready-copy h2 {
  white-space: nowrap;
}

.result-copy h2 {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.ready-screen .ready-stage-step {
  width: 48px;
  height: 48px;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 1.22rem;
  line-height: 1;
  -webkit-text-stroke-width: 1.2px;
}

.ready-screen .ready-stage-step:disabled {
  cursor: default;
  opacity: 0.45;
  filter: grayscale(0.25);
  transform: none;
}

.ready-copy p,
.result-copy p {
  margin: 0;
  color: #ffffff;
  font-size: 1.26rem;
  line-height: 1.22;
  font-weight: 1000;
  -webkit-text-stroke: 1.5px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(6, 71, 127, 0.3),
    0 5px 12px rgba(4, 46, 90, 0.2);
  overflow-wrap: anywhere;
}

.ready-tutorial {
  width: min(100%, 520px);
  margin: 20px auto 16px;
  color: #111827;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 700;
  text-align: left;
  -webkit-text-stroke: 0;
  text-shadow: none;
  overflow-wrap: anywhere;
}

.result-copy p {
  display: inline-flex;
  justify-content: center;
  min-width: min(100%, 220px);
  padding: 7px 16px 9px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(25, 148, 218, 0.86), rgba(5, 92, 167, 0.84)),
    rgba(5, 72, 130, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(5, 58, 116, 0.2);
}

.record-badge {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: min(100%, 260px);
  padding: 8px 22px 10px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(1.24rem, 3.2vw, 1.9rem);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: 0;
  -webkit-text-stroke: 1.6px #8f3e00;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(126, 52, 0, 0.56),
    0 5px 13px rgba(117, 51, 0, 0.26);
  background:
    linear-gradient(180deg, #fff6a6 0%, #ffbf35 48%, #ff7b22 100%),
    #ffbf35;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.78),
    inset 0 -5px 0 rgba(133, 52, 0, 0.22),
    0 7px 0 rgba(126, 52, 0, 0.2),
    0 18px 36px rgba(255, 138, 0, 0.28);
  animation: recordBadgePop 760ms cubic-bezier(0.18, 1.25, 0.28, 1) both, recordBadgePulse 1.55s ease-in-out 760ms infinite;
}

.record-badge::after {
  content: "";
  position: absolute;
  inset: -50% -18%;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.8) 48%, transparent 60%);
  transform: translateX(-72%);
  animation: recordBadgeShine 1.9s ease-in-out 520ms infinite;
}

.trophy-row {
  min-height: 0;
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.trophy-row:not(.is-hidden) {
  min-height: 112px;
}

.trophy {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 14px 16px rgba(93, 62, 10, 0.32));
  animation: trophyPop 540ms ease both;
}

.award-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.award-stat {
  min-height: 70px;
  padding: 9px 11px 10px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(215, 243, 255, 0.78)),
    rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(7, 58, 116, 0.13);
  display: grid;
  align-content: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.award-stat span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.05;
  font-weight: 1000;
}

.award-stat strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  font-size: clamp(1.02rem, 2vw, 1.34rem);
  line-height: 1;
  font-weight: 1000;
  -webkit-text-stroke: 1.4px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 5px 10px rgba(4, 46, 90, 0.22);
}

.award-trophy-stat img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(93, 62, 10, 0.28));
}

.award-progress {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.award-progress span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px 5px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff 0%, #d8f4ff 46%, #78d2ff 100%),
    #ffffff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(5, 87, 152, 0.14),
    0 8px 0 rgba(6, 70, 122, 0.15),
    0 14px 24px rgba(5, 58, 116, 0.18);
  font-weight: 1000;
  color: #ffffff;
  -webkit-text-stroke: 1.4px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 #06477f,
    0 5px 10px rgba(4, 46, 90, 0.2);
}

.award-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.award-item {
  min-height: 92px;
  padding: 10px 12px 10px 10px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(213, 241, 255, 0.78)),
    rgba(255, 255, 255, 0.76);
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.86),
    0 10px 26px rgba(7, 58, 116, 0.14);
}

.award-icon {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: var(--radius);
  filter: drop-shadow(0 6px 8px rgba(4, 52, 96, 0.2));
}

.award-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.award-item strong {
  font-size: 1.04rem;
  line-height: 1.05;
  color: #ffffff;
  -webkit-text-stroke: 1.5px #07528d;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(6, 71, 127, 0.38),
    0 5px 12px rgba(4, 46, 90, 0.2);
  overflow-wrap: anywhere;
}

.award-item span {
  color: #ffffff;
  font-size: 0.84rem;
  line-height: 1.2;
  font-weight: 900;
  -webkit-text-stroke: 1px rgba(7, 82, 141, 0.78);
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 rgba(6, 71, 127, 0.32),
    0 4px 8px rgba(4, 46, 90, 0.16);
}

.award-item.is-locked {
  opacity: 0.64;
  filter: grayscale(0.72);
}

.award-item.is-locked .award-icon {
  opacity: 0.48;
}

.control-zones {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
}

.control-zone {
  --control-size: clamp(74px, 18vw, 132px);
  --control-arrow-size: clamp(18px, 5vw, 34px);
  --control-arrow-inset: clamp(28px, 6.5vw, 49px);
  --control-offset: clamp(18px, 5vw, 54px);
  --control-bottom: calc(env(safe-area-inset-bottom) + 28px);
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  position: relative;
}

.control-zone::before {
  content: "";
  position: absolute;
  bottom: calc(var(--control-bottom) + var(--control-arrow-inset));
  width: var(--control-arrow-size);
  height: var(--control-arrow-size);
  border: solid rgba(255, 255, 255, 0.82);
  border-width: 0 5px 5px 0;
  filter: drop-shadow(0 3px 10px rgba(5, 45, 95, 0.3));
}

.control-zone::after {
  content: "";
  position: absolute;
  bottom: var(--control-bottom);
  width: var(--control-size);
  height: var(--control-size);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 18px rgba(255, 255, 255, 0.24), 0 12px 34px rgba(7, 52, 105, 0.16);
}

#leftZone::after {
  left: var(--control-offset);
}

#leftZone::before {
  left: calc(var(--control-offset) + var(--control-arrow-inset));
  transform: rotate(135deg);
}

#rightZone::after {
  right: var(--control-offset);
}

#rightZone::before {
  right: calc(var(--control-offset) + var(--control-arrow-inset));
  transform: rotate(-45deg);
}

.is-hidden {
  display: none !important;
}

@keyframes skyGlow {
  from {
    transform: translate3d(-1%, -1%, 0) scale(1);
    opacity: 0.76;
  }
  to {
    transform: translate3d(1%, 1%, 0) scale(1.05);
    opacity: 1;
  }
}

@keyframes sparkleDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-120px, 120px, 0);
  }
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 18px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

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

@keyframes buttonShine {
  0%,
  34% {
    opacity: 0;
    transform: translateX(0) rotate(16deg);
  }
  46% {
    opacity: 0.78;
  }
  62%,
  100% {
    opacity: 0;
    transform: translateX(460%) rotate(16deg);
  }
}

@keyframes selectedCursorBob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes hudWarningPop {
  from {
    transform: scale(1.72);
  }
  72% {
    transform: scale(0.94);
  }
  to {
    transform: scale(1);
  }
}

@keyframes awardToastPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.82);
  }
  58% {
    opacity: 1;
    transform: translate(-50%, 3px) scale(1.035);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes trophyPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.72) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes recordBadgePop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.62) rotate(-4deg);
  }
  62% {
    opacity: 1;
    transform: translateY(-2px) scale(1.08) rotate(1.5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes recordBadgePulse {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.12) brightness(1.08);
  }
}

@keyframes recordBadgeShine {
  0%,
  34% {
    transform: translateX(-72%);
  }
  78%,
  100% {
    transform: translateX(72%);
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 44px minmax(84px, 1fr) 44px;
  }

  .brand-lockup span {
    display: none;
  }

  .hud-score {
    top: calc(env(safe-area-inset-top) + 18px);
    min-width: clamp(190px, 58vw, 280px);
    font-size: clamp(1.04rem, 4.2vw, 1.38rem);
    -webkit-text-stroke-width: 1.5px;
  }

  .hud-high-score {
    top: calc(env(safe-area-inset-top) + 48px);
    min-width: clamp(210px, 62vw, 300px);
    font-size: clamp(0.88rem, 3.4vw, 1.1rem);
    -webkit-text-stroke-width: 1.25px;
  }

  .hud-score .hud-number {
    min-width: 6.5ch;
  }

  .hud-counter {
    gap: 5px;
    font-size: clamp(1.18rem, 4.4vw, 1.5rem);
    -webkit-text-stroke-width: 1.5px;
  }

  .hud-goal-stack {
    top: calc(env(safe-area-inset-top) + 82px);
    left: max(12px, env(safe-area-inset-left));
    gap: 5px;
  }

  .hud-timer-counter {
    top: calc(env(safe-area-inset-top) + 62px);
    right: max(12px, env(safe-area-inset-right));
  }

  .hud-bottom-cluster {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom) + 22px);
    gap: clamp(12px, 4.4vw, 24px);
  }

  .hud-cloud-icon {
    --hud-cloud-width: min(34px, var(--hud-character-size, 34px));
    width: var(--hud-cloud-width);
    height: calc(var(--hud-cloud-width) * 0.62);
  }

  .hud-clock-icon {
    width: clamp(28px, 8vw, 38px);
    height: clamp(28px, 8vw, 38px);
  }

  .hud-sun-icon {
    --hud-sun-size: min(clamp(32px, 8.2vw, 42px), var(--hud-character-size, 42px));
    width: var(--hud-sun-size);
    height: var(--hud-sun-size);
  }

  .hud-sun-icon::after {
    inset: 0;
    width: auto;
    height: auto;
    box-shadow: none;
  }

  .award-toast {
    top: calc(env(safe-area-inset-top) + 78px);
    width: min(calc(100vw - 20px), 430px);
    min-height: 50px;
    padding: 7px 10px 9px;
    gap: 8px;
  }

  .award-toast img {
    width: 38px;
    height: 38px;
  }

  .award-toast span {
    font-size: clamp(0.88rem, 4.2vw, 1.08rem);
    -webkit-text-stroke-width: 1.25px;
  }

  .screen-menu {
    width: min(94vw, 520px);
  }

  .menu-actions {
    grid-template-columns: 1fr;
  }

  #continueButton {
    grid-column: auto;
  }

  .stage-grid {
    grid-template-columns: repeat(5, minmax(46px, 1fr));
  }

  .setting-row {
    grid-template-columns: minmax(82px, 0.8fr) minmax(150px, 1.35fr);
  }

  .audio-row {
    grid-template-columns: minmax(82px, 0.8fr) minmax(0, 1.35fr);
  }

  .audio-controls {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .switch-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .section-heading h2 {
    font-size: 2.15rem;
  }

  .ready-copy h2,
  .result-copy h2 {
    font-size: clamp(2.35rem, 11vw, 3.25rem);
  }

  .ready-stage-selector.has-stage-controls {
    grid-template-columns: 40px minmax(0, auto) 40px;
    column-gap: 8px;
  }

  .ready-screen .ready-stage-step {
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    font-size: 1rem;
  }

  .ready-copy span,
  .result-copy span {
    font-size: 0.98rem;
    -webkit-text-stroke-width: 1.4px;
  }

  .ready-copy p,
  .result-copy p {
    font-size: 1.05rem;
  }

  .trophy-row {
    min-height: 0;
  }

  .trophy-row:not(.is-hidden) {
    min-height: 86px;
  }

  .trophy {
    width: 86px;
    height: 86px;
  }
}

@media (max-height: 620px) {
  .screen {
    gap: 10px;
  }

  .screen-menu {
    width: min(94vw, 560px);
  }

  .title-key-art {
    width: min(100%, 500px);
  }

  .title-block p {
    margin-top: -10px;
    min-height: 36px;
    padding: 6px 18px;
    font-size: 1.06rem;
    -webkit-text-stroke-width: 1.6px;
  }

  .menu-actions button,
  .result-actions button,
  .pause-actions button,
  .ready-screen button,
  .settings-screen > button {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 1.04rem;
    -webkit-text-stroke-width: 1.6px;
  }

  .ready-screen .ready-stage-step {
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0;
    font-size: 0.95rem;
    -webkit-text-stroke-width: 1.1px;
  }

  .trophy-row {
    min-height: 0;
    margin-top: 8px;
  }

  .trophy-row:not(.is-hidden) {
    min-height: 72px;
  }

  .trophy {
    width: 72px;
    height: 72px;
  }
}

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