:root {
  color-scheme: dark;
  --night: #090611;
  --plum: #2a103c;
  --grape: #8e42d0;
  --violet: #d6a8ff;
  --acid: #d9ff45;
  --lime: #9df72d;
  --amber: #ffb33e;
  --cream: #fff8dc;
  --danger: #ff4c70;
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-right: max(12px, env(safe-area-inset-right));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  --safe-left: max(12px, env(safe-area-inset-left));
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
}

body {
  color: var(--cream);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 4px solid var(--acid);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

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

#game-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  background: #0b0713;
}

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#game-shell::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 34%, rgba(7, 3, 14, 0.08) 58%, rgba(5, 2, 10, 0.55) 112%),
    linear-gradient(to bottom, rgba(6, 3, 13, 0.22), transparent 18%, transparent 72%, rgba(5, 2, 11, 0.28));
}

.loading-screen,
.start-screen,
.upgrade-screen,
.verdict-screen,
.pause-screen,
.end-screen {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
}

.loading-screen {
  background:
    radial-gradient(circle at 50% 46%, rgba(118, 49, 166, 0.3), transparent 34%),
    var(--night);
  transition: opacity 360ms ease;
}

.loading-screen.is-ready {
  opacity: 0;
  pointer-events: none;
}

.loading-seed {
  position: relative;
  width: 82px;
  height: 82px;
  animation: seed-turn 1.8s linear infinite;
}

.loading-seed i {
  position: absolute;
  width: 34px;
  height: 42px;
  border-radius: 50% 50% 45% 55%;
  background: radial-gradient(circle at 34% 28%, #f0c8ff, #8b36c5 45%, #351048 80%);
  box-shadow: 0 0 20px rgba(190, 104, 244, 0.45);
}

.loading-seed i:nth-child(1) {
  left: 24px;
  top: 3px;
}

.loading-seed i:nth-child(2) {
  left: 6px;
  top: 34px;
  transform: rotate(28deg);
}

.loading-seed i:nth-child(3) {
  right: 6px;
  top: 34px;
  transform: rotate(-28deg);
}

.start-screen {
  place-items: stretch center;
  grid-template-rows: auto 1fr auto auto;
  padding: calc(var(--safe-top) + 26px) var(--safe-right) calc(var(--safe-bottom) + 28px);
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(7, 3, 14, 0.12), rgba(7, 3, 14, 0.04) 58%, rgba(7, 3, 14, 0.78)),
    radial-gradient(circle at 50% 62%, rgba(217, 255, 69, 0.12), transparent 35%);
}

.brand-lockup {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--cream);
  font-size: clamp(1rem, 5vw, 1.5rem);
  font-weight: 1000;
  letter-spacing: 0.24em;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.8);
}

.brand-lockup i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 18px var(--acid);
}

.start-fighter {
  align-self: center;
  justify-self: center;
  z-index: 1;
  width: min(104vw, 570px);
  height: auto;
  max-height: 66vh;
  object-fit: contain;
  filter: drop-shadow(0 34px 28px rgba(0, 0, 0, 0.55));
  animation: fighter-breathe 3.4s ease-in-out infinite;
  pointer-events: none;
}

.start-button,
.round-overlay-button {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 2px solid rgba(255, 248, 220, 0.82);
  border-radius: 50%;
  color: #281036;
  background: linear-gradient(145deg, #ecff71, #9fe424 68%, #71ac15);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.42),
    0 0 0 10px rgba(217, 255, 69, 0.08),
    0 0 42px rgba(217, 255, 69, 0.42),
    inset 0 3px 4px rgba(255, 255, 255, 0.55);
  animation: play-pulse 1.8s ease-in-out infinite;
}

.start-actions {
  z-index: 4;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 22px;
}

.start-actions button span {
  position: absolute;
  top: calc(100% + 9px);
  color: var(--cream);
  font-size: 0.68rem;
  font-weight: 1000;
  letter-spacing: 0.17em;
  text-shadow: 0 3px 9px #000;
}

.continue-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  padding: 20px;
  border: 2px solid rgba(255, 248, 220, 0.78);
  border-radius: 50%;
  color: var(--cream);
  background: radial-gradient(circle at 35% 25%, #aa5be0, #511c71 62%, #210b30);
  box-shadow: 0 15px 32px rgba(0, 0, 0, 0.44), 0 0 33px rgba(186, 104, 255, 0.45);
}

.continue-button svg { width: 100%; fill: currentColor; }

.start-button svg,
.round-overlay-button svg {
  width: 54%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-waves {
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 22px;
}

.start-waves i {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 248, 220, 0.62);
  border-radius: 50%;
  background: var(--grape);
  box-shadow: 0 0 12px rgba(171, 89, 226, 0.5);
}

.start-waves .boss-dot {
  border-radius: 3px 3px 50% 50%;
  background: var(--amber);
  transform: rotate(45deg);
}

.hud {
  position: absolute;
  z-index: 10;
  inset: var(--safe-top) var(--safe-right) auto var(--safe-left);
  height: 76px;
  pointer-events: none;
}

.health-cluster,
.score-cluster,
.wave-track,
.boss-health {
  position: absolute;
  display: flex;
  align-items: center;
}

.objective-strip {
  position: absolute;
  top: 74px;
  left: 50%;
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 248, 220, 0.2);
  border-radius: 999px;
  background: rgba(9, 5, 15, 0.58);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.objective-strip i {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 248, 220, 0.38);
  border-radius: 50%;
  background: rgba(110, 58, 135, 0.5);
}

.objective-strip i.available {
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(255, 179, 62, 0.68);
  animation: objective-beat 1.4s ease-in-out infinite;
}

.objective-strip i.complete {
  border-radius: 4px 50% 50%;
  border-color: var(--cream);
  background: var(--acid);
  box-shadow: 0 0 10px rgba(217, 255, 69, 0.72);
  transform: rotate(45deg);
}

.health-cluster {
  top: 0;
  left: 0;
  width: min(36vw, 170px);
  gap: 7px;
}

.health-cluster > svg {
  width: 30px;
  flex: 0 0 30px;
  fill: var(--danger);
  filter: drop-shadow(0 0 9px rgba(255, 76, 112, 0.58));
}

.health-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 248, 220, 0.52);
  border-radius: 999px;
  background: rgba(9, 5, 15, 0.72);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
}

.health-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff365f, #ff7a6d);
  box-shadow: 0 0 12px rgba(255, 76, 112, 0.65);
  transform-origin: left center;
  transition: width 160ms ease;
}

.score-cluster {
  top: 0;
  right: 86px;
  gap: 4px;
  min-width: 60px;
  height: 34px;
  padding: 4px 9px 4px 6px;
  border: 1px solid rgba(218, 255, 69, 0.32);
  border-radius: 999px;
  background: rgba(12, 7, 19, 0.58);
  backdrop-filter: blur(9px);
}

.score-cluster svg,
.final-score svg {
  width: 25px;
  fill: var(--acid);
  filter: drop-shadow(0 0 8px rgba(217, 255, 69, 0.7));
}

.score-cluster strong,
.final-score strong {
  min-width: 24px;
  color: var(--cream);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-shadow: 0 2px 8px #000;
}

.wave-track {
  top: 43px;
  left: 50%;
  justify-content: center;
  transform: translateX(-50%);
}

.wave-pip {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 2px solid rgba(255, 248, 220, 0.45);
  border-radius: 50%;
  background: rgba(10, 6, 16, 0.75);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.wave-pip span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212, 166, 245, 0.45);
}

.wave-pip svg {
  width: 17px;
  fill: rgba(255, 179, 62, 0.45);
}

.wave-line {
  width: 26px;
  height: 3px;
  background: rgba(255, 248, 220, 0.2);
}

.wave-pip.active {
  border-color: var(--acid);
  transform: scale(1.18);
  box-shadow: 0 0 17px rgba(217, 255, 69, 0.7);
}

.wave-pip.active span {
  background: var(--acid);
}

.wave-pip.active svg {
  fill: var(--amber);
}

.wave-pip.complete,
.wave-line.complete {
  border-color: var(--violet);
  background: var(--grape);
}

.wave-pip.complete span {
  background: var(--violet);
}

.boss-health {
  top: 75px;
  left: 50%;
  width: min(72vw, 360px);
  gap: 8px;
  transform: translateX(-50%);
}

.boss-health svg {
  width: 29px;
  fill: var(--amber);
  filter: drop-shadow(0 0 8px rgba(255, 179, 62, 0.62));
}

.boss-health div {
  flex: 1;
  height: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 248, 220, 0.46);
  border-radius: 999px;
  background: rgba(9, 5, 14, 0.82);
}

.boss-health i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #9f2fcc, #ff477d, #ffb33e);
  box-shadow: 0 0 14px rgba(255, 72, 123, 0.7);
  transition: width 140ms linear;
}

.utility-button {
  position: absolute;
  z-index: 14;
  top: var(--safe-top);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid rgba(255, 248, 220, 0.28);
  border-radius: 13px;
  color: rgba(255, 248, 220, 0.88);
  background: rgba(10, 6, 16, 0.54);
  backdrop-filter: blur(9px);
}

.utility-button svg {
  width: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  fill-rule: evenodd;
}

.sound-button {
  right: calc(var(--safe-right) + 43px);
}

.pause-button {
  right: 0;
  right: var(--safe-right);
}

.map-button {
  left: var(--safe-left);
  top: calc(var(--safe-top) + 48px);
}

.map-button svg {
  fill: none;
}

.sound-button .sound-off,
.sound-button[aria-pressed="false"] .sound-on {
  display: none;
}

.sound-button[aria-pressed="false"] .sound-off {
  display: block;
}

.joystick-zone {
  position: absolute;
  z-index: 16;
  left: 0;
  bottom: 0;
  width: 54vw;
  max-width: 330px;
  height: min(38vh, 320px);
  min-height: 210px;
  touch-action: none;
}

.joystick-base {
  position: absolute;
  left: calc(var(--safe-left) + 20px);
  bottom: calc(var(--safe-bottom) + 20px);
  width: 126px;
  height: 126px;
  border: 2px solid rgba(222, 186, 248, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(179, 94, 231, 0.2) 0 34%, rgba(28, 10, 39, 0.47) 35% 64%, rgba(8, 4, 13, 0.44) 65%),
    rgba(17, 8, 25, 0.3);
  box-shadow:
    inset 0 0 35px rgba(183, 91, 238, 0.18),
    0 18px 32px rgba(0, 0, 0, 0.38);
  opacity: 0.82;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, left 100ms ease, bottom 100ms ease;
}

.joystick-zone.is-active .joystick-base {
  opacity: 1;
  transform: scale(1.04);
}

.joystick-base > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 12px;
  fill: rgba(231, 204, 249, 0.36);
}

.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 59px;
  height: 59px;
  margin: -29.5px;
  border: 2px solid rgba(255, 248, 220, 0.65);
  border-radius: 50%;
  background: radial-gradient(circle at 33% 26%, #dca9ff, #8136b7 47%, #2d123c 80%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(184, 94, 238, 0.38),
    inset 0 3px 5px rgba(255, 255, 255, 0.28);
}

.action-cluster {
  position: absolute;
  z-index: 18;
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 13px);
  width: 178px;
  height: 196px;
  pointer-events: none;
}

.attack-button,
.ability-button {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 248, 220, 0.65);
  border-radius: 50%;
  color: #291036;
  pointer-events: auto;
  touch-action: manipulation;
}

.attack-button {
  right: 0;
  bottom: 0;
  width: 100px;
  height: 100px;
  padding: 18px;
  background: linear-gradient(145deg, #e9ff70, #9cdf26 64%, #5e9611);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.43),
    0 0 26px rgba(217, 255, 69, 0.3),
    inset 0 4px 6px rgba(255, 255, 255, 0.5);
}

.attack-button svg {
  z-index: 2;
  width: 100%;
  fill: currentColor;
}

.attack-button .interact-icon { display: none; }
.attack-button .grapple-icon { display: none; fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

.attack-button.is-context {
  color: #fff8dc;
  background: linear-gradient(145deg, #ffcf5d, #f07838 64%, #8b2d50);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.43), 0 0 35px rgba(255, 179, 62, 0.55), inset 0 4px 6px rgba(255, 255, 255, 0.4);
  animation: context-prompt 0.9s ease-in-out infinite;
}

.attack-button.is-context .attack-icon { display: none; }
.attack-button.is-context .interact-icon { display: block; }

.action-cluster.sideview-controls .attack-button {
  color: #261033;
  background: radial-gradient(circle at 38% 28%, #efff9a, #a8ed31 58%, #57920b);
}

.action-cluster.sideview-controls .attack-button .attack-icon,
.action-cluster.sideview-controls .attack-button .interact-icon { display: none; }
.action-cluster.sideview-controls .attack-button .grapple-icon { display: block; }

.attack-button.is-held {
  transform: scale(0.94);
  filter: brightness(1.18);
}

.attack-button.is-prompted {
  animation: attack-prompt 0.8s ease-in-out infinite;
}

.attack-glow {
  position: absolute;
  inset: -10px;
  border: 3px solid rgba(217, 255, 69, 0.58);
  border-radius: 50%;
  opacity: 0;
}

.attack-button.is-prompted .attack-glow {
  animation: ring-out 1.25s ease-out infinite;
}

.ability-button {
  width: 67px;
  height: 67px;
  padding: 13px;
  overflow: hidden;
  color: var(--cream);
  background: radial-gradient(circle at 38% 28%, #a455d7, #42145a 67%, #15091f);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.4),
    inset 0 3px 4px rgba(255, 255, 255, 0.24);
}

.ability-button svg {
  z-index: 2;
  width: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 3;
  fill-rule: evenodd;
}

.dash-button {
  left: 10px;
  bottom: 8px;
}

.companion-button {
  right: 13px;
  top: 0;
  color: rgba(255, 248, 220, 0.45);
  border-color: rgba(255, 248, 220, 0.32);
}

.companion-button.is-ready {
  color: #1c2a08;
  border-color: var(--cream);
  background: radial-gradient(circle at 35% 28%, #f4ff9b, #a8f42b 55%, #5d970b);
  box-shadow:
    0 0 0 7px rgba(168, 244, 43, 0.12),
    0 0 32px rgba(168, 244, 43, 0.7),
    inset 0 3px 4px rgba(255, 255, 255, 0.5);
  animation: companion-ready 1.25s ease-in-out infinite;
}

.companion-button::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(var(--acid) calc(var(--charge, 0) * 1turn), rgba(255, 248, 220, 0.13) 0);
  mask: radial-gradient(circle, transparent 61%, #000 63%);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 63%);
  filter: drop-shadow(0 0 7px rgba(217, 255, 69, 0.5));
}

.companion-button .cooldown-ring {
  background: conic-gradient(transparent calc(var(--charge, 0) * 1turn), rgba(7, 3, 12, 0.8) 0);
}

.ability-button:disabled {
  opacity: 0.56;
}

.cooldown-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(transparent calc(var(--cooldown, 0) * 1turn), rgba(7, 3, 12, 0.78) 0);
}

.tutorial-focus {
  position: absolute;
  z-index: 17;
  left: calc(var(--safe-left) + 4px);
  bottom: calc(var(--safe-bottom) + 4px);
  width: 158px;
  height: 158px;
  pointer-events: none;
}

.tutorial-focus i {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(217, 255, 69, 0.56);
  border-radius: 50%;
  animation: tutorial-wave 1.8s ease-out infinite;
}

.tutorial-focus i:nth-child(2) {
  animation-delay: 0.45s;
}

.tutorial-focus i:nth-child(3) {
  animation-delay: 0.9s;
}

.upgrade-screen,
.verdict-screen,
.pause-screen,
.end-screen {
  background: rgba(8, 3, 13, 0.72);
  backdrop-filter: blur(9px) saturate(1.2);
}

.map-screen {
  position: absolute;
  z-index: 32;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 24px;
  padding: calc(var(--safe-top) + 45px) var(--safe-right) calc(var(--safe-bottom) + 30px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(134, 53, 186, 0.3), transparent 48%),
    rgba(8, 3, 13, 0.88);
  backdrop-filter: blur(11px) saturate(1.25);
}

.map-title,
.guide-title {
  position: absolute;
  top: calc(var(--safe-top) + 20px);
  display: grid;
  justify-items: center;
  color: var(--cream);
  line-height: .9;
  letter-spacing: .18em;
  text-shadow: 0 0 24px rgba(217,255,69,.35), 0 4px 12px #000;
}

.map-title small,
.guide-title small { color: var(--acid); font-size: .64rem; font-weight: 1000; }
.map-title strong,
.guide-title strong { font-size: clamp(1rem, 5vw, 1.45rem); font-weight: 1000; }

.map-vine {
  position: relative;
  align-self: center;
  width: min(84vw, 420px);
  height: min(66vh, 560px);
}

.map-line {
  position: absolute;
  left: 50%;
  width: 16px;
  height: 28%;
  border-radius: 999px;
  background: linear-gradient(90deg, #351147, #8034a9 45%, #422059);
  box-shadow: 0 0 18px rgba(164, 85, 215, 0.42);
  transform-origin: 50% 0;
}

.map-line::after {
  content: "";
  position: absolute;
  inset: 10% -9px;
  border-left: 4px solid rgba(81, 139, 26, 0.72);
  border-radius: 50%;
  transform: rotate(13deg);
}

.map-line.line-one {
  top: 14%;
  transform: rotate(-10deg);
}

.map-line.line-two {
  top: 39%;
  transform: rotate(11deg);
}

.map-line.line-three {
  top: 65%;
  transform: rotate(-8deg);
}

.map-node {
  --node-color: var(--violet);
  position: absolute;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 5px solid rgba(255, 248, 220, 0.24);
  border-radius: 50%;
  color: #271033;
  background: #372143;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}

.map-node b {
  font-size: 1.25rem;
  line-height: 1;
}

.map-node em {
  position: absolute;
  top: calc(100% + 9px);
  width: 120px;
  color: rgba(255, 248, 220, 0.72);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 3px 10px #000;
}

.map-node.cellar { --node-color: var(--acid); left: 38%; top: 11%; }
.map-node.vineway { --node-color: var(--amber); left: 62%; top: 37%; }
.map-node.press { --node-color: #ff5aa9; left: 38%; top: 63%; }
.map-node.sourwood { --node-color: var(--violet); left: 62%; top: 89%; }

.map-node.complete,
.map-node.active {
  border-color: rgba(255, 248, 220, 0.82);
  background: var(--node-color);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.45),
    0 0 0 9px rgba(176, 91, 222, 0.16),
    0 0 34px rgba(176, 91, 222, 0.62),
    0 0 0 9px color-mix(in srgb, var(--node-color) 16%, transparent),
    0 0 34px color-mix(in srgb, var(--node-color) 62%, transparent);
}

.map-node.active {
  animation: map-node-pulse 1.4s ease-in-out infinite;
}

.map-node.locked {
  filter: grayscale(0.85) brightness(0.7);
}

.side-route-node {
  position: absolute;
  left: 20%;
  top: 48%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 3px dashed rgba(255, 248, 220, 0.24);
  border-radius: 50%;
  color: rgba(255, 248, 220, 0.35);
  background: rgba(18, 8, 28, 0.8);
  box-shadow: 0 10px 25px rgba(0,0,0,.45);
}

.side-route-node.discovered {
  border-style: solid;
  border-color: var(--acid);
  color: #25102e;
  background: var(--acid);
  box-shadow: 0 0 24px rgba(217,255,69,.62);
}

.side-mastery-node {
  position: absolute;
  left: 9%;
  top: 39%;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 2px solid rgba(255,205,84,.18);
  border-radius: 50%;
  color: rgba(255,205,84,.2);
  background: rgba(16,7,24,.8);
  transform: rotate(-12deg) scale(.82);
  transition: 180ms ease;
}

.side-mastery-node.discovered {
  border-color: var(--amber);
  color: #2b1234;
  background: var(--amber);
  box-shadow: 0 0 22px rgba(255,205,84,.72);
  transform: rotate(-12deg) scale(1);
}

.map-stamps {
  display: flex;
  gap: 12px;
  height: 36px;
}

.map-stamps i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255,248,220,.2);
  border-radius: 50%;
  color: rgba(255,248,220,.25);
  font-style: normal;
  background: rgba(12,6,20,.7);
}

.map-stamps i.unlocked {
  border-color: var(--cream);
  color: #281035;
  background: var(--acid);
  box-shadow: 0 0 18px rgba(217,255,69,.5);
}

.guide-button {
  position: absolute;
  left: var(--safe-left);
  bottom: calc(var(--safe-bottom) + 22px);
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 13px;
  border: 2px solid rgba(255,248,220,.58);
  border-radius: 20px;
  color: var(--cream);
  background: linear-gradient(145deg, #70329a, #2d103e);
  box-shadow: 0 14px 28px rgba(0,0,0,.42), 0 0 18px rgba(177,91,226,.35);
}

.guide-button svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

.field-guide-screen {
  position: absolute;
  z-index: 34;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 34px) var(--safe-right) calc(var(--safe-bottom) + 28px);
  background: radial-gradient(circle at 50% 38%, rgba(135,55,184,.32), transparent 52%), rgba(7,3,13,.94);
  backdrop-filter: blur(12px) saturate(1.25);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 176px));
  gap: 14px;
  width: min(92vw, 390px);
}

.guide-grid .vineway-note { grid-column: 1 / -1; min-height: 112px; }
.guide-grid .vineway-note .note-vine { font-size: 3.2rem; color: var(--acid); }
.guide-grid .vineway-note .note-receipt { color: var(--amber); font-size: 2.3rem; transform: rotate(-12deg); }

.guide-grid article {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  place-items: center;
  min-height: 190px;
  overflow: hidden;
  border: 2px solid rgba(255,248,220,.32);
  border-radius: 34px;
  background: radial-gradient(circle at 50% 22%, rgba(153,70,203,.4), transparent 48%), linear-gradient(180deg, #2f113f, #11071a);
  box-shadow: 0 18px 32px rgba(0,0,0,.44), inset 0 2px 3px rgba(255,255,255,.11);
}

.guide-grid article::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,248,220,.55);
  font-size: 3rem;
  font-weight: 1000;
  background: rgba(13,6,20,.78);
  backdrop-filter: blur(9px) grayscale(1);
}

.guide-grid article.unlocked::after { display: none; }
.guide-grid article:first-child::after { display: none; }

.guide-grid img {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 88px;
  height: 98px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 10px rgba(0,0,0,.55));
  animation: guide-foe 2.2s ease-in-out infinite;
}

.guide-grid b,
.guide-grid i,
.guide-grid span {
  align-self: end;
  margin-bottom: 20px;
  color: var(--cream);
  font-size: 1.35rem;
  font-style: normal;
  text-shadow: 0 0 12px rgba(255,255,255,.45);
}

.guide-grid b { color: var(--acid); animation: guide-arrow 1.1s ease-in-out infinite; }
.guide-grid i { color: var(--amber); font-size: 1.8rem; }
.guide-grid .orb { color: var(--danger); animation: guide-orb 1.4s linear infinite; }
.guide-grid .twin-vents { color: var(--amber); font-size: 1rem; }
.guide-grid .danger-line,
.guide-grid .danger-ring { color: var(--danger); }
.guide-grid .danger-line::before { content: "━"; }
.guide-grid .danger-ring::before { content: "◯"; }

.field-guide-screen .map-close-button { position: absolute; right: var(--safe-right); bottom: calc(var(--safe-bottom) + 20px); }

@keyframes guide-foe { 50% { transform: translate(-50%, -5px) rotate(2deg); } }
@keyframes guide-arrow { 50% { transform: translate(5px, -3px); } }
@keyframes guide-orb { to { transform: rotate(360deg); } }

.map-close-button {
  width: 70px;
  height: 70px;
  padding: 18px;
  color: var(--cream);
  background: linear-gradient(145deg, #6f2f97, #2e113e);
  animation: none;
}

.map-close-button svg {
  fill: none;
}

@keyframes map-node-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

.upgrade-screen {
  overflow: hidden;
}

.verdict-screen {
  z-index: 35;
  overflow: hidden;
  grid-template-rows: 1fr auto auto 1fr;
  gap: 16px;
  padding: calc(var(--safe-top) + 18px) calc(var(--safe-right) + 18px) calc(var(--safe-bottom) + 18px) calc(var(--safe-left) + 18px);
  background:
    radial-gradient(circle at 50% 34%, rgba(217, 255, 69, .18), transparent 24%),
    radial-gradient(circle at 50% 58%, rgba(137, 52, 187, .44), transparent 58%),
    rgba(7, 3, 12, .9);
  backdrop-filter: blur(13px) saturate(1.3);
}

.verdict-orbit {
  position: absolute;
  top: 7%;
  left: 50%;
  width: min(72vw, 320px);
  aspect-ratio: 1;
  border: 2px dashed rgba(217, 255, 69, .18);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: verdict-turn 18s linear infinite;
}

.verdict-clue,
.lesson-clue {
  display: block;
  position: relative;
  width: 48px;
  height: 48px;
  border: 3px solid #fff8dc;
  background: #5d2677;
  box-shadow: 0 0 22px rgba(217, 255, 69, .35);
}

.verdict-clue { position: absolute; }
.verdict-clue.eye { left: 50%; top: -24px; margin-left: -24px; border-radius: 70% 12%; transform: rotate(45deg); }
.verdict-clue.page { right: -12px; bottom: 18%; border-radius: 6px; transform: rotate(8deg); }
.verdict-clue.heart { left: -12px; bottom: 18%; border-radius: 55% 55% 48% 12%; transform: rotate(-45deg); }
.verdict-clue.eye::after,
.lesson-clue.eye::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--acid); box-shadow: inset 0 0 0 6px #351545; }
.verdict-clue.page::before,
.verdict-clue.page::after,
.lesson-clue.page::before,
.lesson-clue.page::after { content: ""; position: absolute; left: 9px; right: 9px; height: 4px; border-radius: 4px; background: var(--acid); box-shadow: 0 10px 0 rgba(255,248,220,.72); }
.verdict-clue.page::before,
.lesson-clue.page::before { top: 11px; }
.verdict-clue.heart::after,
.lesson-clue.heart::after { content: "♥"; position: absolute; inset: 2px; color: #ff5aa9; font-size: 2.25rem; line-height: 1; text-align: center; transform: rotate(45deg); }

.verdict-prompt {
  z-index: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--acid);
  filter: drop-shadow(0 0 18px rgba(217, 255, 69, .5));
}
.verdict-prompt > strong { font-size: clamp(2.3rem, 10vw, 3.7rem); }
.verdict-grape { position: relative; width: 72px; height: 70px; }
.verdict-grape i { position: absolute; width: 32px; height: 32px; border: 3px solid #e8b8ff; border-radius: 50%; background: linear-gradient(145deg, #bc63ec, #4c126a); }
.verdict-grape i:nth-child(1) { left: 20px; top: 0; }
.verdict-grape i:nth-child(2) { left: 3px; top: 27px; }
.verdict-grape i:nth-child(3) { right: 3px; top: 27px; }
.verdict-grape b { position: absolute; left: 43px; top: -13px; width: 28px; height: 15px; border-radius: 100% 0; background: var(--acid); transform: rotate(-24deg); }

.verdict-grid {
  z-index: 2;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 154px));
  gap: 12px;
  justify-content: center;
  width: min(92vw, 340px);
}
.verdict-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  min-height: 130px;
  padding: 15px 12px 12px;
  border: 2px solid rgba(255, 248, 220, .64);
  border-radius: 34px;
  color: var(--cream);
  background: linear-gradient(160deg, rgba(100, 39, 132, .97), rgba(21, 8, 30, .98));
  box-shadow: 0 18px 34px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.13);
}
.verdict-card:active { transform: scale(.96); filter: brightness(1.28); }
.verdict-card svg { width: 62px; height: 62px; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.verdict-card span { font-size: .78rem; font-weight: 1000; letter-spacing: .12em; }
.verdict-card.say { color: #ffd462; }
.verdict-card.solve { color: #8ee8ff; }
.verdict-card.save { color: #ff83bd; }
.verdict-card.drop { color: var(--acid); }
.perk-mark { position: absolute; top: 9px; right: 11px; display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 5px; border-radius: 999px; color: #160820; background: currentColor; font-size: .7rem; font-style: normal; font-weight: 1000; box-shadow: 0 0 13px currentColor; }

@keyframes verdict-turn { to { transform: translateX(-50%) rotate(360deg); } }

.upgrade-halo {
  position: absolute;
  width: min(92vw, 520px);
  height: min(92vw, 520px);
  border: 2px solid rgba(217, 255, 69, 0.14);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126, 51, 175, 0.32), transparent 62%);
  box-shadow: 0 0 80px rgba(134, 53, 186, 0.28);
  animation: halo-turn 12s linear infinite;
}

.upgrade-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 112px));
  gap: clamp(10px, 4vw, 20px);
  width: min(92vw, 430px);
  align-items: center;
  justify-content: center;
}

.upgrade-card {
  display: grid;
  place-items: center;
  min-height: 154px;
  padding: 18px 10px 14px;
  border: 2px solid rgba(255, 248, 220, 0.6);
  border-radius: 48px;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(82, 30, 110, 0.92), rgba(21, 9, 30, 0.96));
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.42),
    inset 0 3px 4px rgba(255, 255, 255, 0.15);
  transition: transform 140ms ease, filter 140ms ease;
}

.upgrade-card:active {
  transform: translateY(4px) scale(0.97);
  filter: brightness(1.2);
}

.upgrade-card > svg {
  width: 66px;
  max-width: 72%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upgrade-card.power {
  color: var(--amber);
}

.upgrade-card.speed {
  color: var(--acid);
}

.upgrade-card.shield {
  color: #8ee8ff;
}

.level-dots {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.level-dots i {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.32;
}

.level-dots i.filled {
  background: currentColor;
  opacity: 1;
  box-shadow: 0 0 9px currentColor;
}

.pause-panel {
  display: grid;
  place-items: center;
  gap: 16px;
  width: min(86vw, 360px);
  padding: 34px 28px 28px;
  border: 2px solid rgba(255, 248, 220, 0.24);
  border-radius: 44px;
  background:
    radial-gradient(circle at 50% 0, rgba(217, 255, 69, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(63, 22, 83, 0.94), rgba(15, 7, 23, 0.97));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62), inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.whining-orb { color: #ff83bd; font-size: 2rem; }
.journey-memory { width: 100%; color: var(--cream); text-align: center; }
.journey-memory p { margin: 4px 0; font-size: .875rem; line-height: 1.4; }
.journey-memory span { color: var(--amber); font-size: 1.4rem; }
#journey-save-status { color: #e9dff0; }
.pause-screen { overflow-y: auto; }
.whining-toggle em { color: #ff83bd; }
.whining-toggle[aria-checked="true"] > i { background: #a33072; }
.whining-toggle[aria-checked="true"] > i span { background: #ff83bd; }

.pause-screen .round-overlay-button {
  width: 104px;
  height: 104px;
}

.help-toggle {
  display: grid;
  grid-template-columns: 48px 1fr 54px;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0 14px;
  width: 100%;
  min-height: 76px;
  padding: 11px 14px;
  border: 2px solid rgba(255, 248, 220, 0.26);
  border-radius: 26px;
  color: var(--cream);
  background: rgba(8, 3, 13, 0.54);
}

.help-orb {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--acid);
  font-size: 1.6rem;
  font-weight: 1000;
  box-shadow: 0 0 18px rgba(217, 255, 69, 0.24);
}

.help-toggle strong { align-self: end; font-size: 1rem; letter-spacing: .14em; text-align: left; }
.help-toggle em { grid-column: 2; align-self: start; color: var(--acid); font-size: .82rem; font-style: normal; font-weight: 900; text-align: left; }
.help-toggle > i {
  grid-column: 3;
  grid-row: 1 / 3;
  position: relative;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: #303037;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .55);
  transition: background 160ms ease;
}

.help-toggle > i span {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d8d5da;
  transition: transform 160ms ease, background 160ms ease;
}

.help-toggle[aria-checked="true"] > i { background: #709f16; }
.help-toggle[aria-checked="true"] > i span { transform: translateX(22px); background: var(--acid); }

.context-help {
  position: absolute;
  z-index: 36;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 18px) calc(var(--safe-right) + 18px) calc(var(--safe-bottom) + 18px) calc(var(--safe-left) + 18px);
  background: rgba(7, 3, 12, 0.76);
  backdrop-filter: blur(12px) saturate(1.25);
}

.context-help-card {
  display: grid;
  place-items: center;
  width: min(90vw, 390px);
  padding: 30px 24px 24px;
  border: 2px solid rgba(255, 248, 220, 0.28);
  border-radius: 42px;
  background:
    radial-gradient(circle at 50% 10%, rgba(217, 255, 69, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(67, 23, 90, 0.98), rgba(13, 6, 21, 0.99));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.context-help-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  width: 100%;
}

.context-help-card[data-tip="press-cork"] .sideview-help,
.context-help-card[data-tip="press-cork"] .mystery-help,
.context-help-card[data-tip="sideview-controls"] .cork-help,
.context-help-card[data-tip="sideview-controls"] .mystery-help,
.context-help-card[data-tip="press-mystery"] .cork-help,
.context-help-card[data-tip="press-mystery"] .sideview-help { display: none; }

.cork-help { gap: 24px; }
.cork-help > b { color: var(--acid); font-size: 2.4rem; animation: lesson-arrow 1s ease-in-out infinite; }
.lesson-cork {
  position: relative;
  width: 76px;
  height: 45px;
  border: 4px solid #321514;
  border-radius: 14px;
  background: linear-gradient(90deg, #6c2e18, #d98f4b 22%, #f0b96f 52%, #73351c);
  box-shadow: 0 0 28px rgba(255, 179, 62, .44);
  transform: rotate(-5deg);
}

.lesson-cork i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: #722e47; }
.lesson-socket { position: relative; width: 82px; height: 54px; border: 6px solid #ffd45f; border-radius: 50%; box-shadow: 0 0 28px rgba(255, 212, 95, .6), inset 0 0 20px rgba(255, 212, 95, .22); }
.lesson-socket i { position: absolute; left: 50%; bottom: -17px; width: 52px; height: 20px; margin-left: -26px; border: 5px solid #ffd45f; border-top: 0; border-radius: 0 0 50% 50%; }

.sideview-help { gap: 8px; }
.lesson-plus { color: rgba(255, 248, 220, .5); font-size: 1.2rem; font-weight: 1000; }
.lesson-control { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border: 3px solid rgba(255, 248, 220, .5); border-radius: 50%; color: var(--acid); background: radial-gradient(circle, rgba(151, 66, 201, .48), rgba(27, 10, 39, .9)); box-shadow: 0 12px 24px rgba(0, 0, 0, .35); }
.lesson-jump::after { content: ""; position: absolute; inset: 17px; border: 3px solid rgba(231, 204, 249, .45); border-radius: 50%; }
.lesson-jump i { z-index: 1; font-size: 2.2rem; font-style: normal; animation: lesson-jump .8s ease-in-out infinite; }
.lesson-grapple i { position: absolute; left: 50%; top: -16px; width: 4px; height: 54px; background: linear-gradient(#84bd25, var(--acid)); transform: rotate(20deg); transform-origin: top; }
.lesson-grapple i::before { content: ""; position: absolute; left: -7px; bottom: -8px; width: 18px; height: 18px; border: 4px solid var(--acid); border-radius: 50%; }
.lesson-grapple b { z-index: 1; align-self: end; padding-bottom: 6px; color: var(--cream); font-size: 1.7rem; }
.lesson-dash { font-size: 2.4rem; animation: lesson-arrow 1s ease-in-out infinite; }
.mystery-help { gap: 8px; }
.mystery-help .lesson-clue { flex: 0 0 44px; width: 44px; height: 44px; }
.mystery-help > b { margin-left: 2px; color: var(--acid); font-size: 1.7rem; animation: lesson-arrow 1s ease-in-out infinite; }
.lesson-choice { display: grid; place-items: center; width: 50px; height: 50px; border: 3px solid var(--acid); border-radius: 50%; color: var(--acid); font-size: 1.8rem; font-weight: 1000; box-shadow: 0 0 18px rgba(217,255,69,.4); }

.context-help h2 { margin: 6px 0 8px; color: var(--cream); font-size: clamp(1.35rem, 6vw, 1.8rem); line-height: 1.05; text-align: center; }
.context-help p { max-width: 300px; margin: 0 0 22px; color: #e9dff0; font-size: 1rem; font-weight: 750; line-height: 1.35; text-align: center; }
.context-help-continue { display: grid; place-items: center; width: 86px; height: 86px; padding: 23px; border: 3px solid rgba(255, 248, 220, .72); border-radius: 50%; color: #25102f; background: linear-gradient(145deg, #edff86, #9ce329 66%, #5c9411); box-shadow: 0 16px 28px rgba(0, 0, 0, .42), 0 0 32px rgba(217, 255, 69, .32); }
.context-help-continue svg { width: 100%; fill: currentColor; }

@keyframes lesson-arrow { 50% { transform: translateX(7px); } }
@keyframes lesson-jump { 50% { transform: translateY(-7px); } }

.end-screen {
  grid-template-rows: 1fr auto auto auto auto 1fr;
  align-items: end;
  gap: 24px;
  padding: calc(var(--safe-top) + 30px) var(--safe-right) calc(var(--safe-bottom) + 32px);
}

.aged-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px 18px;
  border: 2px solid rgba(255,79,163,.7);
  border-radius: 999px;
  color: var(--cream);
  background: linear-gradient(145deg, #772861, #2d103e);
  box-shadow: 0 12px 25px rgba(0,0,0,.4), 0 0 22px rgba(255,79,163,.3);
}

.aged-button span { color: #ff83bd; font-size: 1.45rem; }
.aged-button strong { font-size: .78rem; letter-spacing: .14em; }
.aged-button[hidden] { display: none; }

.ending-mark {
  max-width: 330px;
  margin: 0;
  color: var(--cream);
  font-size: clamp(.78rem, 3.5vw, 1rem);
  font-weight: 1000;
  letter-spacing: .15em;
  text-align: center;
  text-shadow: 0 0 22px rgba(217,255,69,.55), 0 3px 10px #000;
}

.end-screen.is-loss .ending-mark { color: var(--danger); }

.end-emblem {
  position: relative;
  align-self: end;
  width: min(42vw, 180px);
  filter: drop-shadow(0 0 34px rgba(255, 179, 62, 0.42));
}

.end-emblem svg {
  width: 100%;
  fill: var(--amber);
  stroke: var(--cream);
  stroke-width: 4;
  stroke-linejoin: round;
}

.end-emblem .broken-emblem {
  display: none;
  fill: #472157;
  stroke: var(--danger);
}

.end-screen.is-loss .crown-emblem {
  display: none;
}

.end-screen.is-loss .broken-emblem {
  display: block;
}

.final-score {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  border: 1px solid rgba(217, 255, 69, 0.35);
  border-radius: 999px;
  background: rgba(9, 5, 15, 0.62);
}

.final-score svg {
  width: 33px;
}

.final-score strong {
  font-size: 1.5rem;
}

.restart-button {
  width: 88px;
  height: 88px;
  animation: none;
}

@keyframes seed-turn {
  to { transform: rotate(360deg); }
}

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

@keyframes play-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes ring-out {
  0% { transform: scale(0.76); opacity: 0.8; }
  100% { transform: scale(1.34); opacity: 0; }
}

@keyframes attack-prompt {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes companion-ready {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

@keyframes tutorial-wave {
  0% { transform: scale(0.72); opacity: 0.75; }
  100% { transform: scale(1.18); opacity: 0; }
}

@keyframes objective-beat {
  50% { transform: scale(1.25); filter: brightness(1.35); }
}

@keyframes context-prompt {
  50% { transform: scale(1.08) rotate(-2deg); }
}

@keyframes halo-turn {
  to { transform: rotate(360deg); }
}

@media (orientation: landscape) and (max-height: 620px) {
  .start-screen {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .brand-lockup {
    grid-column: 1 / -1;
  }

  .start-fighter {
    grid-row: 2 / 4;
    width: min(52vw, 470px);
    max-height: 82vh;
  }

  .start-button {
    align-self: end;
    margin-bottom: 18px;
  }

  .start-waves {
    padding-top: 8px;
  }

  .joystick-zone {
    height: 76vh;
  }

  .action-cluster {
    transform: scale(0.88);
    transform-origin: right bottom;
  }

  .upgrade-card {
    min-height: 126px;
    border-radius: 38px;
  }

  .boss-health {
    top: 41px;
  }
}

@media (min-width: 760px) {
  #game-shell {
    max-width: 720px;
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
  }
}

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

.berry-mode-link{position:relative;z-index:2;color:#fff;background:#78344c;padding:12px 20px;border-radius:14px;text-decoration:none;font:700 16px system-ui;margin:8px}.eutopia-mode-link{background:#4a3060;margin-left:4px}.start-screen{grid-template-rows:auto 1fr auto auto auto}

.save-status {
  position: absolute;
  z-index: 100;
  top: calc(var(--safe-top) + 48px);
  left: var(--safe-left);
  right: var(--safe-right);
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #ffcd54;
  border-radius: 10px;
  background: #211329f2;
  color: #fff8dc;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}

@media (max-height: 480px) {
  .start-screen, .upgrade-screen, .verdict-screen, .pause-screen,
  .map-screen, .field-guide-screen, .context-help, .end-screen {
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .start-fighter { max-height: 55dvh; }
  .brand-lockup { font-size: clamp(22px, 6dvh, 40px); }
  .start-button, .continue-button { width: 80px; height: 80px; }
  .start-actions { align-self: center; }
  .start-waves { display: none; }
  .upgrade-grid { padding-block: 12px; }
  .pause-screen, .context-help, .field-guide-screen { align-items: start; }
  .pause-screen { padding-block: calc(var(--safe-top) + 16px) calc(var(--safe-bottom) + 16px); }
  .field-guide-screen { gap: 16px; padding-top: calc(var(--safe-top) + 68px); }
  .field-guide-screen .map-close-button { position: static; }
  .map-screen { grid-template-rows: auto auto; align-content: start; padding-top: calc(var(--safe-top) + 68px); }
  .save-status { left: 25%; right: 25%; top: var(--safe-top); }
}
