@font-face {
  font-family: "Pixel Block Party";
  src: url("public/original/Fonts/Pixel Block Party.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Munro Narrow";
  src: url("public/original/Fonts/munro_narrow.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Munro Small";
  src: url("public/original/Fonts/munro_small.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --app-vw: 100vw;
  --app-vh: 100vh;
  --app-vv-left: 0px;
  --app-vv-top: 0px;
  --game-vw: var(--app-vw);
  --game-vh: var(--app-vh);
  --game-aspect: 1.7786667;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --rounded: "Arial Rounded MT Bold", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --system: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --white: #fff;
  --black: #000;
  --panel-bg: rgba(0, 0, 0, 0.9);
  /* Native StandardButton composites 88% black over its white backing view. */
  --button-bg: #1f1f1f;
}

@supports (height: 100svh) {
  :root:not(.is-installed-app) {
    --app-vh: 100svh;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  user-drag: none;
  touch-action: none;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Pixel Block Party", ui-monospace, monospace;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: max(2px, .53cqh) solid #fff;
  outline-offset: max(2px, .53cqh);
}

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

.app-shell {
  position: fixed;
  inset: 0 auto auto 0;
  display: grid;
  place-items: center;
  width: var(--app-vw);
  height: var(--app-vh);
  min-height: var(--app-vh);
  padding: 0;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  transform: translate3d(var(--app-vv-left), var(--app-vv-top), 0);
  transform-origin: top left;
}

.app-shell,
.app-shell * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.safe-area-probe {
  position: fixed;
  inset: 0;
  z-index: -1;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  visibility: hidden;
  pointer-events: none;
}

.game-frame {
  position: relative;
  width: min(var(--game-vw), calc(var(--game-vh) * var(--game-aspect)));
  height: min(var(--game-vh), calc(var(--game-vw) / var(--game-aspect)));
  overflow: hidden;
  container-type: size;
  background: #000;
  isolation: isolate;
  touch-action: none;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

.screen-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.loading-screen {
  display: grid;
  place-items: center;
  background: transparent;
  pointer-events: none;
}

.loading-word {
  margin-top: 20cqh;
  font-size: clamp(10px, 3.1cqh, 24px);
  line-height: 1;
}

.title-screen {
  overflow: hidden;
  background: transparent;
}

.title-screen.is-title-measuring {
  visibility: hidden;
}

.title-screen.is-exiting,
.title-screen.is-returning {
  pointer-events: none;
}

.title-screen.is-exiting .title-logo,
.title-screen.is-exiting .remastered-label,
.title-screen.is-exiting .title-tools,
.title-screen.is-exiting .title-sound-button {
  transition: transform 1072ms cubic-bezier(.333333, 0, .666667, .333333);
}

.title-screen.is-returning .title-logo,
.title-screen.is-returning .remastered-label,
.title-screen.is-returning .title-tools,
.title-screen.is-returning .title-sound-button {
  transition: transform 1072ms cubic-bezier(.333333, .666667, .666667, 1);
}

.title-screen.is-title-measuring .title-logo,
.title-screen.is-title-measuring .remastered-label,
.title-screen.is-title-measuring .title-tools,
.title-screen.is-title-measuring .title-sound-button {
  transition: none;
}

.title-screen.is-exiting .title-logo,
.title-screen.is-title-offscreen .title-logo,
.title-screen.is-exiting .title-tools,
.title-screen.is-title-offscreen .title-tools,
.title-screen.is-exiting .title-sound-button,
.title-screen.is-title-offscreen .title-sound-button {
  transform: translateY(var(--title-shift-y));
}

.title-screen.is-exiting .remastered-label,
.title-screen.is-title-offscreen .remastered-label {
  transform: translateX(max(8px, 3.33cqh)) translateY(var(--title-shift-y));
}

.title-hero {
  position: absolute;
  top: 11.475cqh;
  left: 50%;
  width: min(88cqw, 165.33cqh);
  transform: translateX(-50%);
  text-align: center;
  transition: opacity 400ms linear;
}

.title-logo {
  position: relative;
  display: inline-block;
  height: auto;
  font-family: "Munro Narrow", ui-monospace, monospace;
  font-size: max(40px, 20.27cqh);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-rendering: geometricPrecision;
}

.title-logo > span {
  display: block;
}

.title-i {
  position: relative;
  display: inline-block;
}

.title-chai {
  position: absolute;
  z-index: 1;
  top: 10.8%;
  left: 25%;
  width: .1142857em;
  height: .1571429em;
  transform: translateX(-50%);
  object-fit: contain;
  image-rendering: pixelated;
}

.remastered-label {
  position: relative;
  min-height: 6cqh;
  margin-top: max(8px, 2.67cqh);
  font-size: max(11px, 5.33cqh);
  line-height: 1;
  letter-spacing: -.9875em;
  opacity: 0;
  transform: translateX(max(8px, 3.33cqh));
  white-space: nowrap;
}

.title-screen.is-ready .remastered-label {
  animation: remastered-arrive 1150ms ease-out 80ms both,
    remastered-color 960ms steps(1, end) 1260ms infinite;
}

.title-start {
  display: block;
  margin: 15cqh auto 0;
  padding: 2cqh 3cqw;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-family: "Pixel Block Party", ui-monospace, monospace;
  font-size: max(9px, 4cqh);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.title-screen.is-ready .title-start {
  animation: title-blink 1.92s steps(1, end) 1260ms infinite;
}

.title-screen.is-exiting .title-start,
.title-screen.is-returning .title-start,
.title-screen.is-title-offscreen .title-start {
  visibility: hidden;
  opacity: 0;
  animation: none;
}

.title-screen.is-ready.has-returned .title-start {
  animation-delay: 0ms;
}

.title-screen.is-exiting .remastered-label,
.title-screen.is-returning .remastered-label {
  color: var(--remastered-held-color, #fff);
  letter-spacing: .75em;
  opacity: 1;
  animation: none;
}

.title-screen.is-ready.has-returned .remastered-label {
  letter-spacing: .75em;
  opacity: 1;
  animation: remastered-color 960ms steps(1, end) infinite;
}

.title-tools {
  position: absolute;
  z-index: 2;
  top: max(5.33cqh, env(safe-area-inset-top));
  right: max(2.4cqw, env(safe-area-inset-right));
  display: flex;
  gap: 2.4cqw;
  transition: opacity 400ms linear;
}

.title-sound-button {
  position: absolute;
  z-index: 2;
  top: max(5.33cqh, env(safe-area-inset-top));
  left: calc(5.33cqh + env(safe-area-inset-left, 0px));
  transition: opacity 400ms linear;
}

.pixel-button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: max(1px, .27cqh) solid #fff;
  border-radius: 0;
  outline: 0;
  background: var(--button-bg);
  color: #fff;
  cursor: pointer;
  touch-action: none;
}

.pixel-button:active,
.pixel-button.is-pressed {
  transform: translateY(.8cqh);
  border-width: max(2px, .8cqh);
}

.icon-button {
  width: 8cqh;
  height: 8cqh;
  background: #000;
}

.leaderboard-icon {
  display: block;
  width: 8cqh;
  height: 8cqh;
  fill: #fff;
  transform: translate(-.3cqh, -.3cqh);
}

#recordsBtn:active,
#recordsBtn.is-pressed,
#creditsBtn:active,
#creditsBtn.is-pressed,
#soundBtn:active,
#soundBtn.is-pressed {
  border-width: max(1px, .27cqh);
}

#soundBtn:active,
#soundBtn.is-pressed {
  transform: none;
  translate: 0 .8cqh;
}

.sound-icon {
  display: block;
  width: 6.4cqh;
  height: 6.4cqh;
  overflow: visible;
}

.speaker-body {
  fill: #fff;
}

.sound-waves,
.sound-slash-outline,
.sound-slash {
  fill: none;
  stroke: #fff;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-slash-outline,
.sound-slash {
  display: none;
}

.sound-slash-outline {
  stroke: #000;
  stroke-width: 5;
}

.sound-slash {
  stroke-width: 2.7;
}

.is-muted .sound-slash-outline,
.is-muted .sound-slash {
  display: block;
}

.title-screen.is-panel-open:not(.is-credits-open):not(.is-credits-closing):not(.is-records-closing) .title-hero,
.title-screen.is-panel-open:not(.is-credits-open):not(.is-credits-closing):not(.is-records-closing) .title-tools,
.title-screen.is-panel-open:not(.is-credits-open):not(.is-credits-closing):not(.is-records-closing) .title-sound-button {
  opacity: 0;
  pointer-events: none;
}

.title-screen.is-records-closing .title-hero,
.title-screen.is-records-closing .title-tools,
.title-screen.is-records-closing .title-sound-button {
  opacity: 1;
  pointer-events: none;
  transition-duration: 600ms;
  transition-delay: 133ms;
}

.title-screen.is-credits-open .title-tools,
.title-screen.is-credits-open .title-sound-button {
  opacity: 0;
  pointer-events: none;
  transition-duration: 800ms;
}

.title-screen.is-credits-closing .title-tools,
.title-screen.is-credits-closing .title-sound-button {
  pointer-events: none;
  transition-duration: 800ms;
}

.title-screen.is-credits-open .title-start,
.title-screen.is-credits-closing .title-start {
  opacity: 0 !important;
  pointer-events: none;
}

.two-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2cqw;
  margin-top: 4cqh;
}

.records-window {
  --window-width: 80cqh;
  --window-height: 42.67cqh;
  position: relative;
  width: var(--window-width);
  height: var(--window-height);
  text-align: center;
}

#recordsPanel {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.records-window-frame {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: var(--window-width);
  height: var(--window-height);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: native-window-in 400ms cubic-bezier(.55, 0, 1, .75) both;
}

.records-window-frame.native-window {
  background: #000;
}

.records-window-reveal {
  position: absolute;
  z-index: 2;
  inset: 0;
  clip-path: inset(0);
  background: transparent;
  will-change: clip-path;
  animation: native-content-reveal-in 400ms cubic-bezier(.55, 0, 1, .75) both;
}

.records-window.is-entering,
.records-window.is-exiting {
  pointer-events: none;
}

.records-window.is-exiting .records-window-frame {
  animation: native-window-out 400ms cubic-bezier(.55, 0, 1, .75) both;
}

.records-window.is-exiting .records-window-reveal {
  animation: native-content-reveal-out 400ms cubic-bezier(.55, 0, 1, .75) both;
}

.records-window-content {
  position: absolute;
  inset: 0;
  width: var(--window-width);
  height: var(--window-height);
}

.records-grid {
  position: absolute;
  top: 5.33cqh;
  right: 5.33cqh;
  left: 5.33cqh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.2cqh 2.67cqh;
  margin: 0;
}

.records-grid > div {
  min-width: 0;
}

.records-grid > div:nth-child(-n + 2) {
  transform: translateY(-.4cqh);
}

.records-grid > div:nth-child(n + 3) {
  transform: translateY(.4cqh);
}

.records-grid dt {
  min-height: 3.2cqh;
  margin-bottom: 1.33cqh;
  color: #bdbdbd;
  font-size: 2.67cqh;
  line-height: 1.2;
  white-space: nowrap;
}

.records-grid dd {
  margin: 0;
  font-size: 4cqh;
  line-height: 1;
}

.records-window-actions {
  position: absolute;
  right: 2.67cqh;
  bottom: 2.67cqh;
  left: 2.67cqh;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.67cqh;
}

.records-window-actions.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.records-window-actions .text-button {
  width: auto;
  height: 9.6cqh;
  min-height: 0;
  padding: 0 0 0 1.07cqh;
  font-size: 4cqh;
}

#gameRecordsOverlay {
  background: transparent;
}

.text-button {
  min-height: 10.6cqh;
  padding: 1.5cqh 2cqw;
  font-size: clamp(9px, 4cqh, 24px);
  line-height: 1;
}

.credits-panel {
  position: absolute;
  z-index: 4;
  top: 49cqh;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(96cqw, 420px);
  min-height: 30.4cqh;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 800ms linear;
}

.credits-panel p {
  margin: 0;
  font-size: clamp(10px, 4.8cqh, 29px);
  line-height: 1;
}

.credits-panel h2 {
  margin: 1.6cqh 0 0;
  font-size: clamp(17px, 8cqh, 48px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.remake-catalog {
  display: flex;
  visibility: hidden;
  justify-content: center;
  gap: 2.13cqh;
  margin-top: 6.4cqh;
}

.remake-catalog.is-ready {
  visibility: visible;
}

.remake-link {
  flex: 0 0 auto;
  width: 8cqh;
  height: 8cqh;
  border-width: max(1px, .27cqh);
  background: #000;
}

.credits-button img,
.remake-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.remake-link:active {
  border-width: max(1px, .27cqh);
}

.credits-back-button {
  position: absolute;
  z-index: 5;
  top: max(5.33cqh, env(safe-area-inset-top));
  left: calc(5.33cqh + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  width: 22.67cqh;
  height: 8cqh;
  gap: 1.2cqh;
  padding: 0 1.3cqh;
  border-width: max(1px, .27cqh);
  font-size: max(12px, 4.53cqh);
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 800ms linear;
}

.credits-back-button:active {
  border-width: max(1px, .27cqh);
}

.back-triangle {
  flex: 0 0 auto;
  width: 4.53cqh;
  height: 4.53cqh;
  background: #fff;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.back-label {
  display: block;
}

.title-screen.is-credits-open .credits-panel,
.title-screen.is-credits-open .credits-back-button {
  opacity: 1;
}

.title-screen.is-credits-interactive .credits-panel {
  pointer-events: auto;
}

.title-screen.is-credits-open .credits-back-button:not(:disabled) {
  pointer-events: auto;
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pause-button {
  position: absolute;
  top: max(1.33cqh, env(safe-area-inset-top));
  left: max(1.33cqh, env(safe-area-inset-left));
  width: 8cqh;
  height: 8cqh;
  pointer-events: auto;
}

.pause-button svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pause-button:active,
.pause-button.is-pressed {
  border-width: max(1px, .27cqh);
}

.score-label {
  position: absolute;
  top: max(1.33cqh, env(safe-area-inset-top));
  right: max(1.33cqh, env(safe-area-inset-right));
  padding: .5cqh .2cqw;
  background: #000;
  font-size: clamp(8px, 2.67cqh, 18px);
  line-height: 1;
  text-align: right;
}

.debug-panel,
.debug-panel * {
  touch-action: pan-y;
}

.debug-panel {
  position: absolute;
  z-index: 12;
  top: max(14.67cqh, calc(env(safe-area-inset-top) + 14.67cqh));
  right: max(1.33cqh, env(safe-area-inset-right));
  width: min(39cqw, 340px);
  max-height: 83.33cqh;
  overflow: auto;
  border: max(1px, .27cqh) solid #39ff7a;
  background: rgba(0, 10, 3, .94);
  box-shadow: 0 0 1.6cqh rgba(57, 255, 122, .2);
  color: #8dffad;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: clamp(8px, 2.13cqh, 12px);
  line-height: 1.28;
  pointer-events: auto;
  scrollbar-color: #39ff7a #001a08;
  scrollbar-width: thin;
}

.debug-panel__header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1cqw;
  padding: 1.1cqh 1cqw;
  border-bottom: max(1px, .27cqh) solid #39ff7a;
  background: #001a08;
  color: #d4ffe0;
  letter-spacing: .04em;
}

.debug-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 1cqw;
  color: #39ff7a;
}

.debug-panel__collapse {
  display: grid;
  place-items: center;
  width: max(18px, 4.8cqh);
  height: max(18px, 4.8cqh);
  padding: 0;
  border: max(1px, .27cqh) solid #39ff7a;
  border-radius: 0;
  background: #00270c;
  color: #d4ffe0;
  line-height: 1;
  cursor: pointer;
}

.debug-panel__body {
  padding: 1cqh .8cqw 1.2cqh;
}

.debug-panel__controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8cqh;
  margin-bottom: 1.2cqh;
}

.debug-panel__controls button {
  min-height: 4.8cqh;
  padding: .7cqh .65cqw;
  border: max(1px, .27cqh) solid #39ff7a;
  border-radius: 0;
  background: #063413;
  color: #d4ffe0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.debug-panel__controls button.is-off {
  border-color: #ffca5a;
  background: #322400;
  color: #ffe3a7;
}

.debug-panel__metrics {
  min-width: max-content;
  margin: 0;
  color: #8dffad;
  font: inherit;
  white-space: pre;
}

.debug-panel.is-collapsed {
  width: min(29cqw, 220px);
  overflow: hidden;
}

.debug-panel.is-collapsed .debug-panel__header {
  border-bottom: 0;
}

.debug-panel.is-collapsed .debug-panel__body {
  display: none;
}

.tutorial-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  text-align: center;
}

.tutorial-text {
  position: absolute;
  z-index: 1;
  top: 36cqh;
  left: 8cqw;
  right: 8cqw;
  transform: translateY(-50%);
  white-space: pre-line;
  font-size: clamp(11px, 5.33cqh, 32px);
  line-height: 1.4;
}

.tutorial-overlay.no-goals .tutorial-text {
  top: 44cqh;
}

.tutorial-goals {
  position: absolute;
  z-index: 1;
  top: 47.47cqh;
  left: 50%;
  display: grid;
  gap: 4cqh;
  width: max-content;
  transform: translateX(-50%);
  text-align: left;
}

.tutorial-goal {
  display: grid;
  grid-template-columns: 5.33cqh auto;
  align-items: center;
  gap: 2.67cqh;
  font-size: clamp(9px, 4cqh, 24px);
  line-height: 1;
}

.tutorial-goal-label {
  display: grid;
  white-space: nowrap;
}

.tutorial-goal-label::after,
.tutorial-goal-label-text {
  grid-area: 1 / 1;
}

.tutorial-goal-label::after {
  content: attr(data-layout-text);
  visibility: hidden;
}

.tutorial-overlay.is-entering .tutorial-text {
  animation: tutorial-item-in 850ms linear both;
}

.tutorial-overlay.is-entering .tutorial-goal {
  animation: tutorial-item-in 850ms linear both;
}

.tutorial-overlay.is-entering .tutorial-goal:nth-child(1) {
  animation-delay: 850ms;
}

.tutorial-overlay.is-entering .tutorial-goal:nth-child(2) {
  animation-delay: 1700ms;
}

.tutorial-overlay.is-transitioning .tutorial-text,
.tutorial-overlay.is-transitioning .tutorial-goal {
  animation: none;
  opacity: 0;
  transition: opacity 850ms linear;
}

.tutorial-check {
  position: relative;
  display: block;
  width: 5.33cqh;
  height: 5.33cqh;
  border: max(1px, .27cqh) solid #fff;
  background: transparent;
}

.tutorial-goal.is-complete .tutorial-check::before,
.tutorial-goal.is-complete .tutorial-check::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 14.645%;
  width: 70.71%;
  height: max(2px, .53cqh);
  background: #fff;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}

.tutorial-goal.is-complete .tutorial-check::after {
  transform: translateY(-50%) rotate(-45deg);
}

.tutorial-skip {
  position: absolute;
  z-index: 2;
  right: max(2.67cqh, env(safe-area-inset-right));
  bottom: max(2.67cqh, env(safe-area-inset-bottom));
  width: 18.67cqh;
  height: 8cqh;
  padding: 0 0 0 .8cqh;
  pointer-events: auto;
  background: var(--button-bg);
  font-size: clamp(9px, 4cqh, 24px);
}

.tutorial-fade {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.modal-layer {
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .8);
}

.pop-panel {
  animation: panel-pop 280ms cubic-bezier(.2, .85, .38, 1.2) both;
  transform-origin: center;
}

.native-window {
  position: relative;
  overflow: hidden;
  contain: layout paint;
  border: max(1px, .27cqh) solid #fff;
  background: #000;
}

#pauseOverlay {
  isolation: isolate;
  background: transparent;
}

#pauseOverlay::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: #000;
  content: "";
  opacity: .63;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: opacity 350ms linear;
}

#pauseOverlay.is-entering::before {
  opacity: 0;
  transition: none;
}

#pauseOverlay.is-exiting {
  pointer-events: none;
}

#pauseOverlay.is-exiting::before {
  opacity: 0;
}

.pause-panel {
  --window-width: 64cqh;
  --window-height: 28.8cqh;
  position: relative;
  z-index: 1;
  width: var(--window-width);
  height: var(--window-height);
  text-align: center;
}

.pause-panel-frame {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: var(--window-width);
  height: var(--window-height);
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: none;
  animation: native-window-in 350ms cubic-bezier(.55, 0, 1, .75) both;
}

#pauseOverlay.is-exiting .pause-panel-frame {
  animation: native-window-out 350ms cubic-bezier(.55, 0, 1, .75) both;
}

.pause-panel-reveal {
  position: absolute;
  z-index: 1;
  inset: 0;
  clip-path: inset(0);
  background: #000;
  will-change: clip-path;
  animation: native-content-reveal-in 350ms cubic-bezier(.55, 0, 1, .75) both;
}

#pauseOverlay.is-exiting .pause-panel-reveal {
  animation: native-content-reveal-out 350ms cubic-bezier(.55, 0, 1, .75) both;
}

.pause-panel-content {
  position: absolute;
  inset: 0;
  width: var(--window-width);
  height: var(--window-height);
}

.pause-panel h2 {
  position: absolute;
  top: 5.6cqh;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-family: "Munro Small", ui-monospace, monospace;
  font-size: max(24px, 10.67cqh);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.panel-rule {
  width: calc(100% - 8cqw);
  height: max(1px, .27cqh);
  margin: 2.6cqh auto;
  background: #fff;
}

.pause-panel .panel-rule {
  position: absolute;
  top: 12.27cqh;
  left: 10.67cqh;
  width: 42.67cqh;
  height: max(1px, .27cqh);
  margin: 0;
  background: #fff;
}

.pause-panel .two-actions {
  position: absolute;
  top: 14.93cqh;
  left: 2.67cqh;
  display: grid;
  grid-template-columns: repeat(2, 28cqh);
  gap: 2.67cqh;
  margin: 0;
}

.pause-panel .text-button {
  width: 28cqh;
  height: 11.2cqh;
  min-height: 11.2cqh;
  padding: 0 0 0 1.07cqh;
  font-size: 4cqh;
}

.revive-layer {
  display: block;
  background: transparent;
}

.revive-stack {
  position: absolute;
  inset: 0;
}

.revive-panel {
  --window-width: 88.8cqh;
  --window-height: 20.27cqh;
  /* Manual revive-menu tuning: sizes are uncapped; negative offsets move up/left. */
  --revive-title-size: 8cqh;
  --revive-close-size: 13.33cqh;
  --revive-close-offset-x: 0cqh;
  --revive-close-offset-y: -2.0cqh;
  position: absolute;
  /* Native ReviveView keeps this center fixed half a window above mid-screen. */
  top: calc(50% - 10.135cqh);
  left: 50%;
  width: var(--window-width);
  height: var(--window-height);
  transform: translate(-50%, -50%);
}

.revive-panel-frame,
.revive-ticker-frame {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: var(--window-width);
  height: var(--window-height);
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: none;
}

.revive-panel-frame {
  animation: native-window-in 450ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-panel-reveal,
.revive-ticker-reveal {
  position: absolute;
  z-index: 1;
  inset: 0;
  clip-path: inset(0);
  background: #000;
  will-change: clip-path;
}

.revive-panel-reveal {
  animation: native-content-reveal-in 450ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-panel-content {
  position: absolute;
  inset: 0;
}

.revive-panel h2 {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  place-items: center;
  width: 55.2cqh;
  margin: 0;
  transform: translateY(-50%);
  font-size: var(--revive-title-size);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.square-action {
  position: absolute;
  top: 3.47cqh;
  width: 13.33cqh;
  height: 13.33cqh;
  border-width: max(2px, .53cqh);
}

.revive-action {
  left: 55.2cqh;
}

.heart {
  display: block;
  width: 9.6cqh;
  height: 7.3cqh;
  overflow: visible;
}

.close-action {
  left: 72cqh;
  padding: 0;
  font-family: Verdana, sans-serif;
  font-size: var(--revive-close-size);
  font-weight: 400;
  line-height: 1;
}

.close-action span {
  display: block;
  transform: translate(var(--revive-close-offset-x), var(--revive-close-offset-y));
}

.square-action:active,
.square-action.is-pressed {
  border-width: max(2px, .53cqh);
}

.square-action:disabled {
  cursor: default;
}

.revive-ticker {
  --window-width: 75.47cqh;
  --window-height: 6.4cqh;
  position: absolute;
  top: calc(50% + 2.13cqh);
  left: 50%;
  width: var(--window-width);
  height: var(--window-height);
  padding: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  /* Native uses 10pt on phone and 20pt on iPad; keep that height ratio while
     allowing compact landscape screens to scale below 10px when necessary. */
  font-size: min(2.67cqh, 20px);
  line-height: 1;
  white-space: nowrap;
}

.revive-ticker.has-five-digit-high-score {
  --window-width: 79.47cqh;
}

.revive-ticker.has-six-digit-high-score {
  --window-width: 83.47cqh;
}

.revive-ticker-frame {
  animation: native-window-in 417ms 450ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-ticker-reveal {
  display: grid;
  place-items: center;
  animation: native-content-reveal-in 417ms 450ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-layer.is-exiting {
  pointer-events: none;
}

.revive-layer.is-exiting .revive-panel-frame {
  animation: native-window-out 450ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-layer.is-exiting .revive-panel-reveal {
  animation: native-content-reveal-out 450ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-layer.is-exiting .revive-ticker-frame {
  animation: native-window-out 417ms cubic-bezier(.55, 0, 1, .75) both;
}

.revive-layer.is-exiting .revive-ticker-reveal {
  animation: native-content-reveal-out 417ms cubic-bezier(.55, 0, 1, .75) both;
}

.pause-button.is-revive-returning {
  animation: pause-button-return 1s linear both;
}

.hud.is-replay-returning {
  animation: pause-button-return 1s linear both;
}

#gameOverOverlay {
  background: transparent;
}

#gameOverOverlay.is-entering,
#gameOverOverlay.is-exiting {
  pointer-events: none;
}

.game-over-panel {
  --window-width: 80cqh;
  --window-height: 42.67cqh;
  position: relative;
  width: var(--window-width);
  height: var(--window-height);
  text-align: center;
}

.game-over-panel-frame {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: var(--window-width);
  height: var(--window-height);
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: none;
  animation: native-window-in 400ms cubic-bezier(.55, 0, 1, .75) both;
}

#gameOverOverlay.is-exiting .game-over-panel-frame {
  animation: native-window-out 400ms cubic-bezier(.55, 0, 1, .75) both;
}

.game-over-panel-reveal {
  position: absolute;
  z-index: 1;
  inset: 0;
  clip-path: inset(0);
  background: #000;
  will-change: clip-path;
  animation: native-content-reveal-in 400ms cubic-bezier(.55, 0, 1, .75) both;
}

#gameOverOverlay.is-exiting .game-over-panel-reveal {
  animation: native-content-reveal-out 400ms cubic-bezier(.55, 0, 1, .75) both;
}

.game-over-panel-content {
  position: absolute;
  inset: 0;
  width: 80cqh;
  height: 42.67cqh;
}

.corner-left,
.corner-right {
  position: absolute;
  top: 2.67cqh;
  width: 8cqh;
  height: 8cqh;
}

.corner-left { left: 2.67cqh; }
.corner-right { right: 2.67cqh; }

.game-over-panel .corner-left:active,
.game-over-panel .corner-left.is-pressed,
.game-over-panel .corner-right:active,
.game-over-panel .corner-right.is-pressed {
  border-width: max(1px, .27cqh);
}

.close-small {
  padding: 0;
  font-family: Verdana, sans-serif;
  font-size: 8cqh;
  line-height: 1;
}

.close-small span {
  display: block;
  transform: translateY(-1.1cqh);
}

.final-score {
  position: absolute;
  top: 9.33cqh;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9.33cqh;
  line-height: 1;
  white-space: nowrap;
}

.best-score {
  position: absolute;
  top: 20.13cqh;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: 5.33cqh;
  line-height: 1;
  white-space: nowrap;
}

.game-over-panel .panel-rule {
  position: absolute;
  top: 26.13cqh;
  left: 10.67cqh;
  width: 58.67cqh;
  height: max(1px, .27cqh);
  margin: 0;
}

.replay-button {
  position: absolute;
  right: 2.67cqh;
  bottom: 2.67cqh;
  left: 2.67cqh;
  width: auto;
  height: 11.2cqh;
  min-height: 0;
  margin: 0;
  padding: 0 0 0 1.07cqh;
  font-size: 4cqh;
}

.fatal-error {
  display: grid;
  z-index: 40;
  place-content: center;
  gap: 4cqh;
  padding: 8cqh 8cqw;
  background: #000;
  text-align: center;
}

.fatal-error h2,
.fatal-error p {
  margin: 0;
}

.fatal-error h2 {
  font-size: clamp(15px, 6cqh, 36px);
}

.fatal-error p {
  max-width: 72ch;
  font-family: "Munro Small", ui-monospace, monospace;
  font-size: clamp(14px, 4.5cqh, 28px);
  line-height: 1.2;
}

/* Portrait phones and unusually shaped desktop browser windows are gated:
   gameplay and its original control spacing need a landscape-sized surface. */
.rotate-overlay,
.resize-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  padding: max(24px, var(--safe-top)) max(24px, var(--safe-right)) max(24px, var(--safe-bottom)) max(24px, var(--safe-left));
  place-content: center;
  place-items: center;
  gap: 13px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 28%, rgba(153, 28, 39, 0.5), transparent 42%),
    #050506;
  font-family: var(--rounded);
  text-align: center;
}

.resize-overlay {
  z-index: 1001;
  pointer-events: auto;
}

.rotate-overlay > img,
.resize-overlay > img {
  width: min(24vw, 96px);
  height: auto;
  border-radius: 22%;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.rotate-overlay strong,
.resize-overlay strong {
  margin-top: 2px;
  font-size: clamp(22px, 8vw, 38px);
}

.rotate-overlay > span {
  color: #d3d3d8;
  font-family: var(--system);
  font-size: clamp(14px, 4.6vw, 19px);
  line-height: 1.4;
}

.browser-resize {
  display: none;
  grid-template: 50px 54px 50px / 48px 82px 48px;
  width: 178px;
  height: 154px;
  place-items: center;
  color: #ff8b94;
}

.browser-resize i {
  position: relative;
  grid-area: 2 / 2;
  display: block;
  width: 74px;
  height: 48px;
  border: 3px solid #fff;
  border-radius: 6px;
  box-shadow: inset 0 8px 0 -5px #fff;
}

.browser-resize i::before {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 3px;
  height: 3px;
  content: "";
  background: #ff8b94;
  border-radius: 50%;
  box-shadow: 6px 0 #ff8b94, 12px 0 #ff8b94;
}

.resize-arrow {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  animation: resize-arrow-left 1.55s ease-in-out infinite;
}

.resize-arrow svg {
  display: block;
  width: 40px;
  height: 40px;
  overflow: visible;
}

.resize-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resize-arrow-point-left svg {
  transform: rotate(180deg);
}

.resize-arrow-point-up svg {
  transform: rotate(-90deg);
}

.resize-arrow-point-down svg {
  transform: rotate(90deg);
}

.resize-arrow-left {
  grid-area: 2 / 1;
  animation-name: resize-arrow-right;
}

.resize-arrow-top {
  grid-area: 1 / 2;
  animation-name: resize-arrow-down;
}

.resize-arrow-right {
  grid-area: 2 / 3;
  animation-name: resize-arrow-left;
}

.resize-arrow-bottom {
  grid-area: 3 / 2;
  animation-name: resize-arrow-up;
}

.resize-copy {
  display: none;
  max-width: min(92vw, 760px);
  place-items: center;
}

.resize-copy > strong {
  display: block;
  text-wrap: balance;
}

.install-hint {
  max-width: min(90vw, 360px);
  margin: 3px 0 0;
  color: #aeb0b8;
  font-family: var(--system);
  font-size: clamp(12px, 3.45vw, 14px);
  line-height: 1.4;
}

.install-lead {
  display: block;
  text-wrap: balance;
}

.install-hint > span[aria-label="More"] {
  color: #fff;
  letter-spacing: 0.04em;
}

.phone-rotate {
  position: relative;
  width: 66px;
  height: 52px;
}

.phone-rotate span {
  position: absolute;
  inset: 0;
  display: block;
  width: 28px;
  height: 43px;
  margin: auto;
  border: 3px solid #fff;
  border-radius: 6px;
  animation: turn-phone 1.8s ease-in-out infinite;
}

.phone-rotate::after {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  margin: auto;
  content: "";
  border-top: 3px solid #ff8b94;
  border-right: 3px solid #ff8b94;
  border-radius: 50%;
  transform: rotate(28deg);
}

/* Keep the browser resize guard fully visible when a desktop window is made
   exceptionally short or narrow. Above this breakpoint the composition keeps
   its original fixed dimensions; below it every part follows the limiting
   viewport edge so the centered guard cannot be clipped. */
@media (max-height: 360px), (max-width: 360px) {
  .resize-overlay {
    padding:
      max(clamp(8px, 4vmin, 24px), var(--safe-top))
      max(clamp(8px, 4vmin, 24px), var(--safe-right))
      max(clamp(8px, 4vmin, 24px), var(--safe-bottom))
      max(clamp(8px, 4vmin, 24px), var(--safe-left));
    gap: clamp(5px, 3vmin, 13px);
  }

  .resize-overlay > img {
    width: min(24vw, 24vmin, 96px);
  }

  .resize-copy > strong {
    font-size: clamp(16px, 8vmin, 38px);
    line-height: 1.1;
  }

  .browser-resize {
    grid-template:
      min(12vmin, 50px) min(13vmin, 54px) min(12vmin, 50px) /
      min(11.5vmin, 48px) min(19.7vmin, 82px) min(11.5vmin, 48px);
    width: min(42.7vmin, 178px);
    height: min(37vmin, 154px);
  }

  .browser-resize i {
    width: min(17.8vmin, 74px);
    height: min(11.5vmin, 48px);
    border-width: min(0.72vmin, 3px);
    border-radius: min(1.45vmin, 6px);
    box-shadow: inset 0 min(1.92vmin, 8px) 0 max(-5px, -1.2vmin) #fff;
  }

  .browser-resize i::before {
    top: min(0.96vmin, 4px);
    left: min(1.2vmin, 5px);
    width: min(0.72vmin, 3px);
    height: min(0.72vmin, 3px);
    box-shadow:
      min(1.45vmin, 6px) 0 #ff8b94,
      min(2.9vmin, 12px) 0 #ff8b94;
  }

  .resize-arrow {
    width: min(11.5vmin, 48px);
    height: min(11.5vmin, 48px);
  }

  .resize-arrow svg {
    width: min(9.6vmin, 40px);
    height: min(9.6vmin, 40px);
  }
}

@keyframes resize-arrow-left {
  0%,
  100% {
    transform: translateX(5px);
  }

  50% {
    transform: translateX(-5px);
  }
}

@keyframes resize-arrow-right {
  0%,
  100% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }
}

@keyframes resize-arrow-up {
  0%,
  100% {
    transform: translateY(5px);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes resize-arrow-down {
  0%,
  100% {
    transform: translateY(-5px);
  }

  50% {
    transform: translateY(5px);
  }
}

@keyframes remastered-arrive {
  0% {
    letter-spacing: -.9875em;
    opacity: 0;
    top: -.6em;
  }
  35% { opacity: .35; }
  100% {
    letter-spacing: .75em;
    opacity: 1;
    top: 0;
  }
}

@keyframes remastered-color {
  0% { color: #27e32d; }
  16.66% { color: #0787ff; }
  33.33% { color: #ff7400; }
  50% { color: #fa2915; }
  66.66% { color: #8f38d5; }
  83.33% { color: #ff36b9; }
}

@keyframes title-blink {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes native-window-in {
  0% {
    width: 0;
    height: 0;
  }
  100% {
    width: var(--window-width);
    height: var(--window-height);
  }
}

@keyframes native-window-out {
  0% {
    width: var(--window-width);
    height: var(--window-height);
  }
  100% {
    width: 0;
    height: 0;
  }
}

@keyframes native-content-reveal-in {
  from { clip-path: inset(50%); }
  to { clip-path: inset(0); }
}

@keyframes native-content-reveal-out {
  from { clip-path: inset(0); }
  to { clip-path: inset(50%); }
}

@keyframes tutorial-item-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pause-button-return {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes panel-pop {
  0% { transform: scale(.02); opacity: .4; }
  75% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes turn-phone {
  0%,
  28% {
    transform: rotate(0deg);
  }

  60%,
  100% {
    transform: rotate(90deg);
  }
}

@media (orientation: portrait) and (max-aspect-ratio: 1 / 1) {
  .rotate-overlay {
    display: grid;
  }

  .game-frame {
    visibility: hidden;
    pointer-events: none;
  }
}

html[data-browser-window-fit="too-wide"] .resize-overlay,
html[data-browser-window-fit="too-wide"] .browser-resize-narrower,
html[data-browser-window-fit="too-tall"] .resize-overlay,
html[data-browser-window-fit="too-tall"] .browser-resize-wider,
html[data-browser-window-fit] .resize-copy {
  display: grid;
}

html[data-browser-window-fit] .rotate-overlay {
  display: none;
}

html[data-browser-window-fit] .game-frame {
  pointer-events: none;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  :root {
    --app-vh: 100vh;
    --app-vv-left: 0px;
    --app-vv-top: 0px;
  }

  html,
  body {
    height: 100vh;
    min-height: 100vh;
  }

  .app-shell {
    inset: 0;
    width: auto;
    height: auto;
    min-height: 0;
    transform: none;
  }

  .install-hint {
    display: none;
  }
}

html.is-installed-app {
  --app-vh: 100vh;
  --app-vv-left: 0px;
  --app-vv-top: 0px;
}

html.is-installed-app,
html.is-installed-app body {
  height: 100vh;
  min-height: 100vh;
}

html.is-installed-app .app-shell {
  inset: 0;
  width: auto;
  height: auto;
  min-height: 0;
  transform: none;
}

html.is-installed-app .install-hint {
  display: none;
}

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

  .title-screen.is-ready .remastered-label,
  .title-screen.is-ready .title-start {
    opacity: 1;
  }

  .title-screen.is-records-closing .title-hero,
  .title-screen.is-records-closing .title-tools,
  .title-screen.is-records-closing .title-sound-button {
    transition-delay: 0ms;
  }
}
