@font-face {
  font-family: Vazirmatn;
  src: url('./assets/vazirmatn-arabic.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: Vazirmatn;
  src: url('./assets/vazirmatn-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: Vazirmatn, sans-serif;
  color: #fff8e9;
  background: #12372f;
  font-synthesis: none;
  --cream: #fff8e9;
  --gold: #f6cc73;
  --teal: #37ded6;
  --dark: #092f2d;
}
.run-ribbon {
  position: absolute;
  inset-inline-start: 20px;
  top: 93px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid #6deed63d;
  border-radius: 999px;
  background: #092f2dbb;
  backdrop-filter: blur(10px);
  font-size: 12px;
}
.run-ribbon img {
  width: 29px;
  height: 31px;
  object-fit: contain;
}
.run-ribbon .mode {
  color: #a1c9c1;
  font-size: 10px;
  border-inline-start: 1px solid #b8f4dc33;
  padding-inline-start: 9px;
}
.power-meter {
  top: 157px !important;
}
.power-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #79ffde;
  box-shadow: 0 0 15px #79ffde;
}
.chapter-button.future {
  opacity: 0.45;
}
.chapter-button.infinity {
  opacity: 0.65;
}
.chapter-button small {
  display: block;
  font-size: 10px;
  color: #a0c1b4;
}
.chapter-button {
  cursor: default !important;
}
.reward-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px;
}
.reward-line > img {
  width: 37px;
  height: 41px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px #65ffe757);
}
.reward-line span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.reward-line b {
  font-size: 14px;
  color: #ffe8a9;
}
.reward-line small {
  color: #a8c6bb;
  font-size: 11px;
}
.reward-line em {
  font-size: 24px;
  color: #f6cc73;
  margin-inline-start: auto;
  font-style: normal;
  font-weight: 900;
}
.menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.menu-foot .text-button {
  margin: 0;
  padding: 4px 0;
  color: #f6d893;
  font-size: 12px;
}
.menu-foot > span {
  color: #9abdb1;
  font-size: 10px;
}
.menu-copy .eyebrow i {
  font-size: 22px;
  vertical-align: middle;
  color: #f6cc73;
  font-style: normal;
}
.magic-orbit {
  position: absolute;
  left: 36%;
  top: 43%;
  pointer-events: none;
  display: grid;
  justify-items: center;
  gap: 7px;
  animation: magic-float 3s ease-in-out infinite;
}
.magic-orbit img {
  width: 68px;
  height: 77px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px #72fbe8aa);
}
.magic-orbit span {
  color: #ffe6a0;
  font-size: 19px;
  font-weight: 900;
  text-shadow: 0 2px 6px #071d16;
}
@keyframes magic-float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-14px) rotate(5deg);
  }
}
.credit-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 16px;
  border: 1px solid #66f5d744;
  background: #58eab90b;
  border-radius: 15px;
  margin: 10px 0 14px;
}
.credit-note b {
  color: #8dffdb;
  font-size: 21px;
}
.credit-note span {
  color: #a6c6bc;
  font-size: 11px;
  line-height: 1.8;
}
.credit-note.practice b,
.credit-note.pending b {
  font-size: 12px;
  color: #eacf98;
}
.loss-note {
  font-size: 11px !important;
  color: #b6c8bf;
  margin: 9px 0;
}
.result-dialog h1 {
  font-size: clamp(24px, 3vw, 40px);
}
.board-dialog h1 {
  font-size: clamp(22px, 3vw, 35px);
}
.board-dialog > p {
  font-size: 12px;
  color: #a6c6bc;
}
.board-list {
  max-height: 42vh;
  overflow: auto;
  margin: 14px 0;
  text-align: start;
}
.board-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 0;
  border-bottom: 1px solid #88c9ae22;
  font-size: 13px;
}
.board-rank {
  color: #f6cc73;
  font-size: 17px;
  min-width: 22px;
}
.board-row > b {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-row > span:last-child {
  color: #9cf8d9;
  text-align: end;
}
.board-row small {
  display: block;
  color: #aac7bc;
  font-size: 10px;
  margin-top: 4px;
}
.primary:disabled {
  opacity: 0.65;
  cursor: wait;
}
.preview-signature {
  position: absolute;
  left: 5%;
  top: 8%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-shadow: 0 2px 20px #07291e;
}
.preview-signature span {
  color: #f7df9f;
  letter-spacing: 0.24em;
  font-size: 16px;
}
.preview-signature b {
  color: #fff8e9;
  font-size: 35px;
}
.preview-signature small {
  color: #b2e9d5;
  font-size: 11px;
  letter-spacing: 0.08em;
}
html[data-preview='true'] .hud,
html[data-preview='true'] .controls,
html[data-preview='true'] .run-ribbon,
html[data-preview='true'] .power-meter,
html[data-preview='true'] #toast {
  display: none !important;
}
@media (max-height: 520px) {
  .run-ribbon {
    top: 58px;
    inset-inline-start: 12px;
    padding: 4px 9px;
    font-size: 10px;
  }
  .run-ribbon img {
    width: 21px;
    height: 24px;
  }
  .run-ribbon .mode {
    font-size: 8px;
    max-width: 110px;
  }
  .power-meter {
    top: 104px !important;
  }
  .reward-line {
    margin: 7px 0 9px;
    gap: 8px;
  }
  .reward-line > img {
    width: 29px;
    height: 31px;
  }
  .reward-line b {
    font-size: 11px;
  }
  .reward-line small {
    font-size: 9px;
  }
  .reward-line em {
    font-size: 20px;
  }
  .chapter-button {
    padding: 8px 11px !important;
    min-height: 53px !important;
  }
  .chapter-button .chapter-number {
    font-size: 22px !important;
  }
  .menu-copy .chapter-list {
    margin: 11px 0 !important;
  }
  .menu-foot {
    margin-top: 5px;
  }
  .menu-foot .text-button {
    font-size: 10px;
  }
  .menu-foot > span {
    font-size: 8px;
  }
  .menu-copy .input-hint {
    margin-top: 6px !important;
  }
  .menu-copy .saved-note {
    margin-top: 3px !important;
    font-size: 8px !important;
  }
  .magic-orbit img {
    width: 45px;
    height: 53px;
  }
  .magic-orbit span {
    font-size: 13px;
  }
  .result-dialog {
    padding: 18px 28px !important;
  }
  .result-dialog .result-stars {
    font-size: 29px;
    margin-bottom: 5px;
  }
  .result-dialog h1 {
    font-size: 25px !important;
    margin-bottom: 12px !important;
  }
  .result-dialog .credit-note {
    margin: 7px 0;
    padding: 7px 12px;
  }
  .credit-note span {
    font-size: 9px;
  }
  .credit-note b {
    font-size: 17px;
  }
  .result-dialog .result-stats {
    margin: 8px 0 !important;
  }
  .result-dialog .primary {
    min-height: 42px !important;
  }
  .result-dialog .secondary {
    min-height: 35px !important;
    padding: 6px 12px !important;
  }
  .result-dialog .dialog-actions {
    margin-top: 7px !important;
  }
  .result-dialog .loss-note {
    margin: 5px 0;
    font-size: 9px !important;
  }
}
/* Lightweight atmosphere uses opacity/transform; full-screen live filters are
   kept out of gameplay so the same treatment works in the offline WebView. */
.menu-world::after {
  content: '';
  position: absolute;
  inset: -8%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 32%, #ffe5a724, transparent 35%),
    radial-gradient(ellipse at 58% 75%, #5bffdc1c, transparent 30%);
  animation: garden-breathe 8s ease-in-out infinite alternate;
}
.menu-hero {
  animation: hero-idle 4.2s ease-in-out infinite;
  transform-origin: center bottom;
}
.menu-mushroom {
  animation: garden-breathe 5.6s ease-in-out infinite alternate;
}
.menu-copy > * {
  animation: garden-enter 550ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.menu-copy > :nth-child(2) {
  animation-delay: 65ms;
}
.menu-copy > :nth-child(3) {
  animation-delay: 100ms;
}
.menu-copy > :nth-child(4) {
  animation-delay: 150ms;
}
.menu-copy > :nth-child(5) {
  animation-delay: 200ms;
}
.menu-copy > :nth-child(n + 6) {
  animation-delay: 250ms;
}
.reward-line > img {
  animation: magic-float 3.7s ease-in-out infinite;
}
.primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.primary::after {
  content: '';
  position: absolute;
  inset: -70% auto -70% -40%;
  width: 25%;
  background: linear-gradient(90deg, transparent, #fff9da7a, transparent);
  transform: rotate(24deg) translateX(-200%);
  pointer-events: none;
  animation: reward-sheen 5.5s ease-in-out infinite;
}
.dialog {
  animation: garden-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#interface[data-screen='won'] .result-stars {
  animation: stars-arrive 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  text-shadow: 0 0 26px #f6cc7366;
}
#interface[data-screen='won'] .result-stats > * {
  animation: garden-enter 500ms 150ms ease-out both;
}
.control.held {
  box-shadow:
    inset 0 0 24px #6dffe429,
    0 0 22px #52ffde38;
}
@keyframes garden-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes garden-breathe {
  from {
    opacity: 0.55;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 1;
    transform: translateY(-10px) scale(1.025);
  }
}
@keyframes hero-idle {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-9px) rotate(-1deg);
  }
}
@keyframes reward-sheen {
  0%,
  72% {
    transform: rotate(24deg) translateX(-200%);
    opacity: 0;
  }
  76% {
    opacity: 0.65;
  }
  100% {
    transform: rotate(24deg) translateX(700%);
    opacity: 0;
  }
}
@keyframes stars-arrive {
  from {
    opacity: 0;
    transform: scale(0.72) rotate(-7deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
html[data-host-active='false'] *,
html[data-host-active='false'] *:before,
html[data-host-active='false'] *:after {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .magic-orbit {
    animation: none;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  color: inherit;
}
button:disabled {
  cursor: default;
}
button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 5px;
}
button svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
#game,
#interface {
  position: fixed;
  inset: 0;
}
#game canvas {
  display: block;
}
#interface {
  pointer-events: none;
}
#interface button,
#interface .overlay,
#interface .rotate-gate {
  pointer-events: auto;
}
.hud {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 22px;
  direction: ltr;
  z-index: 3;
  text-shadow: 0 2px 10px #062c39b3;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand-mark {
  height: 48px;
  width: 48px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #69eee4;
  border-radius: 50%;
  font-size: 34px;
  font-style: italic;
  font-weight: 700;
  color: white;
  background: #073d48d1;
  box-shadow: 0 3px 22px #05393644;
}
.brand b {
  display: block;
  letter-spacing: 2px;
  font-size: 21px;
}
.brand small {
  display: block;
  font-size: 12px;
  color: var(--cream);
}
.hud-vitals {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hearts {
  font-size: 30px;
  color: #ff5c6d;
  letter-spacing: 2px;
  text-shadow:
    0 2px 0 #802c38,
    0 4px 12px #152b46a3;
}
.coin-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px 4px 3px;
  background: #133331b0;
  border: 1px solid #ffffff24;
  border-radius: 32px;
}
.coin-counter img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.coin-counter b {
  font-size: 20px;
}
.chapter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: 180px;
  padding: 8px 17px;
  background: #0b363b85;
  backdrop-filter: blur(14px);
  border: 1px solid #ffffff2b;
  border-radius: 18px;
}
.chapter small {
  font-size: 9px;
  opacity: 0.7;
}
[data-native='true'] .chapter {
  top: 40px;
}
.chapter b {
  display: block;
  font-size: 13px;
}
.progress {
  height: 3px;
  background: #ffffff25;
  margin-top: 7px;
  border-radius: 3px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: width 0.12s;
}
.hud-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.clock {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  padding: 9px 14px;
  border-radius: 24px;
  background: #153a3799;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #ffffff50;
  background: #0c333e80;
  backdrop-filter: blur(12px);
}
.icon-button:active {
  transform: scale(0.94);
}
.icon-button.muted {
  opacity: 0.55;
}
.power-meter {
  position: absolute;
  top: 89px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 4px;
  background: #0c3944c9;
  border: 1px solid #56f0ec8c;
  border-radius: 28px;
  font-size: 12px;
  z-index: 4;
}
.power-meter img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.power-meter b {
  color: var(--teal);
}
.controls {
  position: absolute;
  inset: 0;
  direction: ltr;
}
.movement {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: max(26px, env(safe-area-inset-left));
  display: flex;
  gap: 18px;
}
.control {
  width: 84px;
  height: 84px;
  border: 2px solid #fff8e996;
  border-radius: 50%;
  background: #092e374a;
  backdrop-filter: blur(5px);
  box-shadow:
    inset 0 0 28px #fff4ce13,
    0 5px 20px #1733223d;
  display: grid;
  place-items: center;
  color: var(--cream);
}
.control svg {
  width: 42px;
  height: 42px;
  stroke-width: 3;
}
.control.held {
  background: #3ad6ce77;
  border-color: #89fff3;
  transform: scale(0.95);
}
.jump {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  right: max(28px, env(safe-area-inset-right));
  width: 100px;
  height: 100px;
}
.jump svg {
  width: 46px;
  height: 46px;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  background: #0b303866;
  backdrop-filter: blur(8px);
}
.overlay.menu {
  display: block;
  overflow: hidden;
  background: #12372f;
  backdrop-filter: none;
}
.menu-world {
  position: absolute;
  inset: 0;
  background: url('./assets/valley.webp') center/cover;
  transform: scale(1.025);
}
.menu-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      #062a2eef 0%,
      #08312dd9 34%,
      #062e2933 72%,
      #06352e0d
    ),
    linear-gradient(0deg, #082c31e0, transparent 40%);
}
[dir='rtl'] .menu-vignette {
  background:
    linear-gradient(
      270deg,
      #062a2eef 0%,
      #08312dd9 34%,
      #062e2933 72%,
      #06352e0d
    ),
    linear-gradient(0deg, #082c31e0, transparent 40%);
}
.menu-brand {
  position: absolute;
  top: max(26px, env(safe-area-inset-top));
  inset-inline-start: max(36px, env(safe-area-inset-left));
  display: flex;
  gap: 12px;
  align-items: center;
}
.menu-brand b {
  font-size: 22px;
  letter-spacing: 4px;
}
.menu-exit {
  position: absolute;
  top: max(27px, env(safe-area-inset-top));
  inset-inline-end: max(32px, env(safe-area-inset-right));
}
.menu-copy {
  position: absolute;
  inset-inline-start: 6vw;
  width: min(540px, 44vw);
  max-width: 560px;
  top: 50%;
  transform: translateY(-44%);
  margin: 0;
  text-align: start;
}
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 1.5px;
}
.menu-copy h1 {
  font-size: clamp(32px, 5.2vw, 70px);
  line-height: 1.45;
  letter-spacing: -1px;
  margin: 12px 0 3px;
  text-shadow: 0 6px 30px #063038;
}
.subtitle {
  font-size: 18px;
  color: #e6efdfa8;
  margin: 0 0 24px;
}
.menu-hero {
  position: absolute;
  inset-inline-end: 12vw;
  bottom: 5%;
  height: 66%;
  max-height: 540px;
  filter: drop-shadow(0 22px 12px #0625266b);
  transform: rotate(-3deg);
}
[dir='rtl'] .menu-hero {
  transform: rotate(-3deg);
}
.menu-mushroom {
  position: absolute;
  inset-inline-end: -5%;
  bottom: -8%;
  width: 30%;
  filter: drop-shadow(0 12px 12px #05282266);
}
.chapter-list {
  display: flex;
  gap: 8px;
  margin: 22px 0;
}
.chapter-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 13px;
  border: 1px solid #d9f5dd32;
  background: #102f3188;
  border-radius: 14px;
  text-align: start;
  backdrop-filter: blur(8px);
}
.chapter-button b {
  font-size: 11px;
  display: block;
  white-space: nowrap;
}
.chapter-number {
  font-size: 23px;
  opacity: 0.75;
}
.chapter-button small {
  display: block;
  font-size: 15px;
  letter-spacing: 2px;
  line-height: 1.2;
}
.stars {
  color: var(--gold);
}
.chapter-button.selected {
  border-color: var(--gold);
  background: #dbc78022;
}
.chapter-button:disabled {
  opacity: 0.4;
}
.lock {
  font-size: 24px;
}
.primary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border: 1px solid #fff0b8;
  background: linear-gradient(135deg, #ffe4a4, #e4b65f);
  color: #183a32;
  border-radius: 16px;
  font-size: 17px;
  padding: 12px 26px;
  box-shadow: 0 7px 28px #efbf601f;
  transition:
    transform 0.16s,
    filter 0.16s;
}
.primary:hover {
  filter: brightness(1.07);
}
.primary:active {
  transform: translateY(2px);
}
[dir='rtl'] .primary svg {
  transform: scaleX(-1);
}
.menu-copy .primary {
  width: 100%;
  max-width: 410px;
}
.input-hint {
  font-size: 11px;
  line-height: 1.9;
  color: #dfece0ad;
  max-width: 420px;
}
.saved-note {
  font-size: 10px;
  color: #a9c2bca6;
  margin-top: 14px;
}
.dialog {
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  max-width: 520px;
  min-width: min(390px, 85vw);
  text-align: center;
  padding: 32px;
  border: 1px solid #f4edcc3a;
  border-radius: 28px;
  background: linear-gradient(145deg, #103a39ee, #092e36f2);
  box-shadow: 0 22px 80px #001f2966;
}
.dialog h1 {
  font-size: 32px;
  line-height: 1.5;
  margin: 10px 0 24px;
}
.dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: #c8ddd4;
}
.dialog-symbol {
  display: block;
  font-size: 36px;
  color: var(--gold);
  margin-bottom: 14px;
}
.dialog .primary {
  width: 100%;
  margin-top: 18px;
}
.secondary {
  min-height: 43px;
  border: 1px solid #cce9d52b;
  background: #ffffff08;
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 13px;
}
.dialog > .secondary {
  width: 100%;
  margin-top: 10px;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.dialog-actions > * {
  flex: 1;
}
.text-button {
  background: none;
  border: 0;
  font-size: 12px;
  color: #d1e5d1a3;
  padding: 15px 10px 0;
}
.result-stars {
  font-size: 50px;
  letter-spacing: 9px;
  color: var(--gold);
  margin-top: 14px;
  direction: ltr;
  text-shadow: 0 4px 20px #fdcb6e30;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid #cce7d322;
  border-bottom: 1px solid #cce7d322;
  padding: 18px 0;
}
.result-stats small {
  font-size: 11px;
  color: #c3d9ca;
}
.result-stats b {
  display: block;
  font-size: 23px;
  margin-top: 7px;
}
.result-stats em {
  font-size: 12px;
  font-style: normal;
  opacity: 0.5;
}
.best-note {
  margin: 16px 0 0;
  font-size: 11px !important;
  color: var(--gold) !important;
}
.loading-card {
  text-align: center;
}
.loading-card .brand-mark {
  width: 72px;
  height: 72px;
  font-size: 49px;
}
.loading-card h1 {
  font-size: 30px;
}
.loading-card p {
  color: #c2d9cc;
  font-size: 13px;
}
.load-track {
  width: 220px;
  height: 4px;
  border-radius: 10px;
  background: #ffffff20;
  margin: 25px auto;
  overflow: hidden;
}
.load-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.2s;
}
.rotate-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: radial-gradient(ellipse at 50% 20%, #17665d, #06292f 70%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 35px;
}
.rotate-gate h2 {
  font-size: 25px;
  margin: 30px 0 6px;
}
.rotate-gate p {
  font-size: 13px;
  color: #c7ded0;
}
.phone-outline {
  width: 56px;
  height: 95px;
  border: 3px solid var(--gold);
  border-radius: 15px;
  transform: rotate(90deg);
  box-shadow: 0 0 30px #e8c37a22;
  position: relative;
}
.phone-outline:after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}
.toast {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 7;
  padding: 12px 22px;
  border: 1px solid #f9e4af5e;
  border-radius: 18px;
  background: #0c3d37df;
  backdrop-filter: blur(12px);
  color: var(--cream);
  font-size: 14px;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-height: 520px) {
  .hud {
    top: max(9px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    gap: 12px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 25px;
  }
  .brand b {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .brand small {
    font-size: 9px;
  }
  .brand {
    gap: 6px;
  }
  .hearts {
    font-size: 23px;
  }
  .hud-vitals {
    gap: 9px;
  }
  .coin-counter {
    padding: 1px 9px 1px 1px;
  }
  .coin-counter img {
    width: 26px;
    height: 26px;
  }
  .coin-counter b {
    font-size: 15px;
  }
  .chapter {
    min-width: 140px;
    padding: 5px 10px;
    border-radius: 12px;
  }
  .chapter small {
    display: none;
  }
  .chapter b {
    font-size: 10px;
  }
  .progress {
    margin-top: 4px;
  }
  .icon-button {
    width: 36px;
    height: 36px;
  }
  .icon-button svg {
    width: 19px;
    height: 19px;
  }
  .clock {
    font-size: 12px;
    padding: 7px 10px;
  }
  .hud-actions {
    gap: 5px;
  }
  .power-meter {
    top: 58px;
    left: 16px;
    font-size: 9px;
    padding: 2px 10px 2px 3px;
  }
  .power-meter img {
    width: 28px;
    height: 28px;
  }
  .control {
    width: 64px;
    height: 64px;
  }
  .control svg {
    width: 32px;
    height: 32px;
  }
  .jump {
    width: 74px;
    height: 74px;
  }
  .movement {
    gap: 12px;
    bottom: max(15px, env(safe-area-inset-bottom));
    left: max(22px, env(safe-area-inset-left));
  }
  .jump {
    bottom: max(15px, env(safe-area-inset-bottom));
    right: max(24px, env(safe-area-inset-right));
  }
  .menu-brand {
    top: 16px;
    inset-inline-start: 25px;
  }
  .menu-brand b {
    font-size: 15px;
  }
  .menu-exit {
    top: 16px;
    inset-inline-end: 25px;
  }
  .menu-copy {
    max-width: 420px;
    transform: translateY(-42%);
    margin: 0;
  }
  .eyebrow {
    font-size: 9px;
  }
  .menu-copy h1 {
    font-size: 36px;
    margin: 6px 0 0;
    line-height: 1.4;
  }
  .subtitle {
    font-size: 12px;
    margin: 0 0 12px;
  }
  .chapter-list {
    margin: 12px 0;
    gap: 6px;
  }
  .chapter-button {
    min-height: 53px;
    padding: 6px 9px;
    gap: 8px;
  }
  .chapter-number {
    font-size: 19px;
  }
  .chapter-button b {
    font-size: 9px;
  }
  .chapter-button small {
    font-size: 13px;
  }
  .primary {
    min-height: 43px;
    padding: 7px 18px;
    font-size: 13px;
    border-radius: 12px;
  }
  .menu-copy .primary {
    max-width: 350px;
  }
  .input-hint {
    font-size: 9px;
    margin: 8px 0;
  }
  .saved-note {
    font-size: 8px;
    margin-top: 8px;
  }
  .menu-hero {
    height: 71%;
    inset-inline-end: 8vw;
    bottom: 0;
  }
  .menu-mushroom {
    width: 26%;
  }
  .dialog {
    padding: 20px 26px;
    border-radius: 22px;
    max-width: 480px;
  }
  .dialog h1 {
    font-size: 24px;
    margin: 6px 0 12px;
  }
  .dialog-symbol {
    font-size: 24px;
    margin-bottom: 6px;
  }
  .dialog .primary {
    margin-top: 12px;
  }
  .dialog-actions {
    margin-top: 8px;
  }
  .secondary {
    min-height: 36px;
    font-size: 11px;
    padding: 8px 12px;
  }
  .result-stars {
    font-size: 34px;
    margin-top: 6px;
  }
  .result-stats {
    padding: 12px 0;
  }
  .result-stats b {
    font-size: 18px;
  }
  .result-stats small {
    font-size: 9px;
  }
  .best-note {
    font-size: 9px !important;
    margin-top: 10px;
  }
  .dialog p {
    font-size: 10px;
  }
  .text-button {
    font-size: 10px;
    padding-top: 12px;
  }
  .toast {
    font-size: 11px;
    padding: 9px 16px;
  }
}
@media (max-width: 740px) and (orientation: landscape) {
  .brand small {
    display: none;
  }
  .chapter {
    min-width: 115px;
  }
  .chapter b {
    font-size: 9px;
  }
  .clock {
    display: none;
  }
  .menu-copy {
    max-width: 350px;
  }
  .menu-copy h1 {
    font-size: 31px;
  }
  .menu-hero {
    inset-inline-end: 4vw;
    height: 66%;
  }
  .chapter-button {
    padding: 6px;
  }
  .chapter-button b {
    font-size: 8px;
  }
  .chapter-number {
    font-size: 16px;
  }
  .input-hint {
    max-width: 320px;
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
  .menu-world {
    transform: none;
  }
  .primary:active,
  .control.held {
    transform: none;
  }
}
