:root {
  --void: #030306;
  --text: #f7f4ff;
  --muted: #bdb6d7;
  --line: rgba(247, 244, 255, 0.82);
  --purple: #7c3cff;
  --blue: #1b6fd6;
  --candle: #f8d56b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  position: fixed;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: "Trebuchet MS", Arial, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: crosshair;
  background: var(--void);
  overscroll-behavior: none;
  touch-action: none;
}

.world,
.forest-area,
.lab-interior,
.bedroom-interior,
.dilly-interior,
.dialogue-box,
.readout,
.quick-nav,
.zoom-controls,
.flight-controls,
button,
a {
  touch-action: none;
}

.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1800px;
  transform-origin: 0 0;
  background:
    radial-gradient(circle at 22% 16%, rgba(124, 60, 255, 0.18), transparent 26%),
    radial-gradient(circle at 78% 22%, rgba(27, 111, 214, 0.12), transparent 30%),
    linear-gradient(135deg, #092114 0%, #11351f 46%, #092719 100%);
  will-change: transform;
}

.readout {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.readout {
  position: absolute;
  left: 14px;
  top: 14px;
  right: auto;
  bottom: auto;
  width: 132px;
  border: 2px solid rgba(247, 244, 255, 0.58);
  border-radius: 6px;
  padding: 7px 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 40%),
    rgba(5, 5, 8, 0.78);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.72), 0 0 14px rgba(124, 60, 255, 0.18);
  text-align: left;
  text-transform: uppercase;
  pointer-events: auto;
}

.sheet-title {
  margin: 0 0 5px;
  border-bottom: 2px solid rgba(247, 244, 255, 0.48);
  padding-bottom: 4px;
  color: var(--text);
  font-size: 0.54rem;
  letter-spacing: 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 0;
  color: var(--text);
  font-size: 0.56rem;
  line-height: 1.12;
}

.stat-row span:first-child {
  color: var(--muted);
}

.quick-nav {
  position: absolute;
  left: 14px;
  right: auto;
  bottom: 14px;
  top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 69px));
  gap: 6px;
  pointer-events: auto;
}

.quick-nav a,
.zoom-controls button,
.flight-controls button {
  border: 2px solid rgba(247, 244, 255, 0.58);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 42%),
    rgba(5, 5, 8, 0.78);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.72), 0 0 12px rgba(124, 60, 255, 0.16);
  color: var(--text);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.quick-nav a {
  padding: 6px 7px;
  font-size: 0.54rem;
}

.zoom-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.flight-controls {
  position: absolute;
  left: auto;
  right: 14px;
  top: auto;
  bottom: 14px;
  pointer-events: auto;
}

.zoom-controls button {
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
}

.quick-nav a:hover,
.quick-nav a:focus-visible,
.zoom-controls button:hover,
.zoom-controls button:focus-visible,
.flight-controls button:hover,
.flight-controls button:focus-visible {
  background: linear-gradient(135deg, rgba(124, 60, 255, 0.92), rgba(27, 111, 214, 0.9));
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.72), 0 0 18px rgba(124, 60, 255, 0.32);
  transform: translate(1px, 1px);
  outline: none;
}

.player {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 10px rgba(248, 213, 107, 0.38)) drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.72));
  transform: translate(-50%, -50%);
  transform-origin: center;
  will-change: left, top, transform;
  z-index: 5;
  isolation: isolate;
}

.player.is-flying,
.player.is-taking-off,
.player.is-landing {
  z-index: 16;
}

.player.facing-left {
  transform: translate(-50%, -50%) scaleX(-1);
}

.pixel-bird {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: 64px;
  background: transparent;
  image-rendering: pixelated;
}

.target {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--candle);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(248, 213, 107, 0.62);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 120ms ease;
  pointer-events: none;
}

.target.visible {
  opacity: 1;
}

@media (max-width: 620px) {
  .readout {
    left: 10px;
    top: 10px;
    right: auto;
    bottom: auto;
    width: 126px;
  }

  .quick-nav {
    left: 10px;
    right: auto;
    bottom: 10px;
    top: auto;
    grid-template-columns: repeat(2, minmax(0, 52px));
    gap: 4px;
  }

  .quick-nav a {
    padding: 5px 3px;
    font-size: 0.48rem;
  }

  .zoom-controls {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .zoom-controls button {
    width: 38px;
    height: 38px;
  }

  .player {
    width: 42px;
    height: 42px;
  }
}




.start-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: #030306;
  color: var(--text);
  pointer-events: auto;
}

.start-menu[hidden] {
  display: none;
}

.start-menu.is-zooming-out {
  pointer-events: auto;
}

.intro-card {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  color: #fff;
  text-align: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 900ms ease;
}

.intro-card[hidden] {
  display: none;
}

.intro-card-copy {
  display: grid;
  justify-items: center;
  gap: 24px;
  transform: scale(1);
  transform-origin: center;
  opacity: 1;
}

.intro-card.is-thunder-zoom .intro-card-copy {
  animation: intro-thunder-zoom 1400ms cubic-bezier(0.14, 0.7, 0.18, 1) both;
}

.intro-card.is-ending {
  opacity: 0;
  pointer-events: none;
}

.intro-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 7vw, 3rem);
  font-weight: 900;
  line-height: 1.08;
  text-transform: uppercase;
}

.intro-subtitle {
  margin: 8px 0 18px;
  color: #fff;
  font-size: clamp(0.72rem, 3vw, 1rem);
  font-weight: 800;
  text-transform: uppercase;
}

.intro-credit {
  margin: 2px 0;
  color: #fff;
  font-size: clamp(0.58rem, 2.6vw, 0.84rem);
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.intro-subtitle:empty {
  display: none;
}

.intro-card button {
  min-width: 112px;
  min-height: 42px;
  border: 2px solid #fff;
  border-radius: 6px;
  background: #000;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.intro-card button[hidden] {
  display: none;
}

.intro-card button:hover,
.intro-card button:focus-visible {
  background: #fff;
  color: #000;
  outline: none;
}

.start-menu-art {
  min-height: 0;
  background-image: url("../assets/portraits/menu-display/paint-palette-animation-1.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
  animation: start-menu-painting 1100ms steps(1, end) infinite;
  transform: scale(1);
  transform-origin: center;
  filter: brightness(1);
}

.start-menu.is-zooming-out .start-menu-art {
  animation: start-menu-painting 1100ms steps(1, end) infinite, intro-menu-zoom-to-black 18950ms ease-in forwards;
}

.start-menu.is-zooming-out .start-menu-bar {
  animation: intro-menu-bar-fade 4200ms ease forwards;
}

.start-menu-bar {
  display: grid;
  grid-template-columns: minmax(160px, 0.72fr) minmax(220px, 1fr) minmax(220px, 0.82fr);
  align-items: center;
  gap: 16px;
  padding: 14px clamp(14px, 3vw, 32px);
  border-top: 3px solid rgba(247, 244, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(5, 5, 8, 0.14), rgba(5, 5, 8, 0.7)),
    url("../assets/portraits/menu-display/button-color.png") 0 0 / 73px 29px repeat;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(247, 244, 255, 0.18);
  text-transform: uppercase;
}

.start-menu-title span {
  display: block;
  margin-bottom: 5px;
  color: var(--candle);
  font-size: 0.58rem;
  font-weight: 900;
}

.start-menu h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.48rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(124, 60, 255, 0.7), 3px 3px 0 #000;
}

.start-menu p {
  margin: 0;
  color: #f7f4ff;
  font-size: 0.62rem;
  font-weight: 900;
}

.start-menu-tutorial {
  line-height: 1.5;
  text-shadow: 2px 2px 0 #000;
}

.start-menu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.warm-fire-button {
  justify-self: center;
  min-width: 220px;
}

.start-menu:not(.is-warmed) .start-menu-actions {
  display: none;
}

.start-menu.is-warmed .warm-fire-button {
  display: none;
}

.clear-save-button {
  opacity: 0.82;
}

.start-menu button {
  min-width: 104px;
  min-height: 42px;
  border: 2px solid rgba(247, 244, 255, 0.7);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 42%),
    rgba(5, 5, 8, 0.84);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.72), 0 0 14px rgba(124, 60, 255, 0.2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.start-menu button:hover,
.start-menu button:focus-visible {
  background: linear-gradient(135deg, rgba(124, 60, 255, 0.92), rgba(27, 111, 214, 0.9));
  outline: none;
}

@keyframes start-menu-painting {
  0% { background-image: url("../assets/portraits/menu-display/paint-palette-animation-1.png"); }
  20% { background-image: url("../assets/portraits/menu-display/paint-palette-animation-2.png"); }
  40% { background-image: url("../assets/portraits/menu-display/paint-palette-animation-3.png"); }
  60% { background-image: url("../assets/portraits/menu-display/paint-palette-animation-4.png"); }
  80%, 100% { background-image: url("../assets/portraits/menu-display/paint-palette-animation-5.png"); }
}

@keyframes intro-menu-zoom-to-black {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  42% {
    transform: scale(1.18);
    filter: brightness(0.86);
  }

  76% {
    transform: scale(2.35);
    filter: brightness(0.42);
  }

  100% {
    transform: scale(4.6);
    filter: brightness(0);
  }
}

@keyframes intro-menu-bar-fade {
  to {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes intro-thunder-zoom {
  0% {
    opacity: 0;
    transform: scale(0.78);
  }

  12% {
    opacity: 1;
    transform: scale(1.08);
  }

  38% {
    transform: scale(1.42);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  .start-menu {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .start-menu-art {
    background-size: contain;
  }

  .start-menu-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    text-align: center;
  }

  .start-menu-title span {
    font-size: 0.52rem;
  }

  .start-menu h2 {
    font-size: 1.25rem;
  }

  .start-menu-tutorial {
    font-size: 0.56rem;
  }

  .start-menu-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .warm-fire-button {
    width: 100%;
    min-width: 0;
  }

  .start-menu button {
    min-width: 0;
    min-height: 38px;
    padding: 0 6px;
    font-size: 0.58rem;
  }
}



.flight-controls button {
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.62rem;
}
@media (max-width: 620px) {
  .flight-controls {
    left: auto;
    right: 10px;
    top: auto;
    bottom: 10px;
  }

  .flight-controls button {
    min-width: 44px;
    height: 36px;
    padding: 0 6px;
    font-size: 0.52rem;
  }
}

#flight-toggle {
  border-color: rgba(248, 213, 107, 0.92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 44%),
    #f8d56b;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.72), 0 0 16px rgba(248, 213, 107, 0.38);
  color: #120f08;
}

#flight-toggle[aria-pressed="true"] {
  border-color: rgba(141, 197, 255, 0.92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 44%),
    #1b6fd6;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.72), 0 0 16px rgba(27, 111, 214, 0.44);
  color: #f7f4ff;
}



