:root {
  --ink: #22252c;
  --paper: #f7fbf5;
  --panel: rgba(255, 250, 232, 0.9);
  --panel-strong: rgba(255, 249, 218, 0.96);
  --coral: #e95043;
  --coral-dark: #9b2e2a;
  --gold: #f5b825;
  --green: #75b86c;
  --blue: #2f74bf;
  --shadow: rgba(24, 20, 16, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  width: 100%;
}

body {
  align-items: center;
  background: #d8d1b2;
  color: var(--ink);
  display: flex;
  font-family: "Courier New", Courier, monospace;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
  padding: 0;
  touch-action: manipulation;
  overscroll-behavior: none;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  cursor: pointer;
}

body,
canvas,
button,
div {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.fullscreen-button {
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 0 3px 0 rgba(24, 20, 16, 0.35);
  color: #fff;
  display: block;
  font-size: clamp(0.68rem, 2.45svh, 0.92rem);
  font-weight: 900;
  line-height: 1;
  min-height: 30px;
  padding: 7px 10px;
  position: fixed;
  right: max(8px, env(safe-area-inset-right));
  text-transform: uppercase;
  top: max(8px, env(safe-area-inset-top));
  z-index: 3000;
}

.fullscreen-button:not(.fullscreen-button--in-app) {
  display: none;
}

.fullscreen-button--in-app {
  display: block;
  position: absolute;
  right: clamp(5px, 1.2vw, 10px);
  top: clamp(5px, 1.2vw, 10px);
  z-index: 1300;
}

body.is-fullscreen > .fullscreen-button {
  display: none;
}

body.is-fullscreen .fullscreen-button--in-app {
  display: block;
}

.fullscreen-button:active {
  box-shadow: 0 1px 0 rgba(24, 20, 16, 0.35);
  transform: translateY(3px);
}

.audio-button {
  background: #f5c84b;
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 0 3px 0 rgba(24, 20, 16, 0.28);
  color: var(--ink);
  display: block;
  font-size: clamp(0.66rem, 2.2svh, 0.86rem);
  font-weight: 900;
  line-height: 1;
  min-height: 30px;
  padding: 7px 10px;
  position: fixed;
  right: max(8px, env(safe-area-inset-right));
  text-transform: uppercase;
  top: max(50px, calc(env(safe-area-inset-top) + 42px));
  touch-action: manipulation;
  z-index: 3000;
}

.audio-button:not(.audio-button--in-app) {
  display: none;
}

.audio-button--in-app {
  display: block;
  position: absolute;
  right: clamp(5px, 1.2vw, 10px);
  top: clamp(42px, 7.2svh, 54px);
  z-index: 1300;
}

.audio-button:active {
  box-shadow: 0 1px 0 rgba(24, 20, 16, 0.28);
  transform: translateY(3px);
}

.audio-button.is-muted {
  background: #d8d1b2;
}

.language-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  left: 6px;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
}

.language-selector button {
  background: rgba(255, 250, 232, 0.92);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(24, 20, 16, 0.25);
  color: var(--ink);
  font-size: clamp(0.56rem, 2svh, 0.78rem);
  font-weight: 900;
  line-height: 1;
  min-height: 26px;
  padding: 5px 6px;
}

.language-selector button.is-active {
  background: var(--blue);
  color: #fff;
}

.version-badge {
  background: rgba(255, 250, 232, 0.9);
  border: 2px solid rgba(34, 37, 44, 0.65);
  border-radius: 6px;
  bottom: clamp(5px, 1.2vw, 10px);
  color: var(--ink);
  font-size: clamp(0.58rem, 1.8svh, 0.78rem);
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  pointer-events: none;
  position: absolute;
  right: clamp(5px, 1.2vw, 10px);
  z-index: 1300;
}

.orientation-lock {
  align-items: center;
  background: #f7fbf5;
  color: var(--ink);
  display: none;
  flex-direction: column;
  font-size: clamp(1.6rem, 8vw, 3rem);
  font-weight: 900;
  inset: 0;
  justify-content: center;
  line-height: 1.05;
  padding: 28px;
  position: fixed;
  text-align: center;
  text-transform: uppercase;
  z-index: 1000;
}

.orientation-lock span,
.orientation-lock small {
  display: block;
}

.orientation-lock small:not(.orientation-advice) {
  display: none;
}

.orientation-lock small {
  font-size: clamp(0.9rem, 4.2vw, 1.4rem);
  line-height: 1.12;
  margin-top: 16px;
  max-width: 580px;
  text-transform: none;
}

.fullscreen-hint {
  background: rgba(247, 251, 245, 0.96);
  border: 3px solid var(--ink);
  border-radius: 8px;
  bottom: max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 5px 0 rgba(24, 20, 16, 0.28);
  color: var(--ink);
  font-size: clamp(0.8rem, 2.8svh, 1.05rem);
  font-weight: 900;
  left: 50%;
  line-height: 1.1;
  max-width: min(560px, calc(100vw - 24px));
  padding: 10px 14px;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  z-index: 1200;
}

.fullscreen-hint[hidden] {
  display: none;
}

.app {
  aspect-ratio: 16 / 9;
  background: #d3ad70;
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 10px 0 var(--shadow);
  height: min(100dvh, calc(100dvw * 9 / 16));
  max-height: 576px;
  max-width: 1024px;
  overflow: hidden;
  position: relative;
  width: min(100dvw, calc(100dvh * 16 / 9));
}

.app:fullscreen {
  align-self: center;
  align-items: center;
  background: #171717;
  border-radius: 0;
  border-width: 0;
  box-shadow: none;
  display: flex;
  height: 100dvh;
  justify-content: center;
  max-height: none;
  max-width: none;
  width: 100dvw;
}

.app:-webkit-full-screen {
  align-items: center;
  background: #171717;
  border-radius: 0;
  border-width: 0;
  box-shadow: none;
  display: flex;
  height: 100dvh;
  justify-content: center;
  max-height: none;
  max-width: none;
  width: 100dvw;
}

html:fullscreen,
html:-webkit-full-screen {
  background: #171717;
  overflow: hidden;
}

html:fullscreen body,
html:-webkit-full-screen body,
body.is-fullscreen,
body.is-standalone {
  background: #171717;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  padding: 0;
  width: 100dvw;
}

html:fullscreen .app,
html:-webkit-full-screen .app,
body.is-fullscreen .app,
body.is-standalone .app {
  border-radius: 0;
  border-width: 0;
  box-shadow: none;
  height: min(100dvh, calc(100dvw * 9 / 16));
  max-height: none;
  max-width: none;
  width: min(100dvw, calc(100dvh * 16 / 9));
}

.app:fullscreen > .screen,
.app:fullscreen > .game-screen,
.app:-webkit-full-screen > .screen,
.app:-webkit-full-screen > .game-screen {
  height: min(100dvh, calc(100dvw * 9 / 16));
  inset: auto;
  left: 50%;
  max-height: none;
  max-width: none;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100dvw, calc(100dvh * 16 / 9));
}

body.is-fullscreen .app:fullscreen,
body.is-fullscreen .app:-webkit-full-screen {
  align-items: center;
  background: #171717;
  display: flex;
  height: 100dvh;
  justify-content: center;
  max-height: none;
  max-width: none;
  width: 100dvw;
}

.screen,
.game-screen,
.playfield {
  height: 100%;
  width: 100%;
}

.screen,
.game-screen {
  inset: 0;
  overflow: hidden;
  position: absolute;
}

.screen[hidden],
.game-screen[hidden] {
  display: none;
}

.game-screen {
  background: #171717;
  display: flex;
  flex-direction: column;
}

.screen {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 250, 220, 0.92), rgba(232, 195, 126, 0.92)),
    #ead39a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  text-align: center;
}

#start-screen {
  justify-content: flex-start;
  padding-bottom: clamp(8px, 2svh, 18px);
  padding-top: clamp(6px, 1.4svh, 14px);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.72rem, 6.6svh, 4.1rem);
  line-height: 0.92;
  text-transform: uppercase;
}

h1 span {
  color: #244b86;
  display: inline-block;
  font-size: 0.54em;
  line-height: 1.08;
  margin-top: 8px;
}

h2 {
  font-size: clamp(1.8rem, 7svh, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

h3 {
  font-size: clamp(1rem, 3.6svh, 1.35rem);
  line-height: 1;
  text-transform: uppercase;
}

.final-boar {
  display: block;
  height: clamp(82px, 26svh, 162px);
  margin-bottom: clamp(10px, 3svh, 24px);
  object-fit: contain;
  width: clamp(82px, 28svh, 174px);
}

.start-title-row {
  align-items: center;
  display: grid;
  gap: clamp(5px, 1.2vw, 14px);
  grid-template-columns: minmax(48px, 0.28fr) auto minmax(48px, 0.28fr);
  margin-top: clamp(2px, 0.5svh, 6px);
  max-width: min(760px, 90%);
  width: 100%;
}

.title-boar {
  display: block;
  height: clamp(54px, 16svh, 116px);
  justify-self: center;
  object-fit: contain;
  width: clamp(58px, 17svh, 124px);
}

.big-button,
.small-button {
  background: var(--coral);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 6px 0 var(--coral-dark);
  color: #fff;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.big-button {
  font-size: clamp(1.2rem, 5svh, 2rem);
  margin-top: clamp(7px, 2svh, 16px);
  min-height: clamp(44px, 9.2svh, 62px);
  padding: 10px 28px;
  width: min(310px, 58%);
}

.start-actions {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.4svh, 10px);
  margin-top: clamp(7px, 1.7svh, 14px);
  width: min(360px, 86%);
}

.start-actions .big-button {
  margin-top: 0;
  width: 100%;
}

.fullscreen-play-button {
  background: var(--blue);
  box-shadow: 0 6px 0 #184775;
  display: none !important;
  width: min(460px, 86%);
}

.rules-panel {
  background: rgba(255, 250, 232, 0.88);
  border: 2px solid rgba(34, 37, 44, 0.58);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  max-width: 100%;
  padding: clamp(6px, 1.5svh, 10px) clamp(8px, 2vw, 14px);
}

.objective-text {
  background: rgba(255, 250, 232, 0.74);
  border: 2px solid rgba(34, 37, 44, 0.42);
  border-radius: 8px;
  font-size: clamp(0.72rem, 2.4svh, 1rem);
  font-weight: 900;
  line-height: 1.1;
  margin-top: clamp(4px, 1svh, 8px);
  max-width: min(620px, 90%);
  padding: clamp(5px, 1.1svh, 8px) clamp(9px, 2vw, 14px);
  white-space: pre-line;
}

.opportunity-teaser {
  background: rgba(255, 233, 184, 0.86);
  border: 2px solid rgba(155, 90, 31, 0.55);
  border-radius: 8px;
  color: #6f3f16;
  font-size: clamp(0.7rem, 2.25svh, 0.94rem);
  font-weight: 900;
  line-height: 1.05;
  margin-top: clamp(4px, 0.9svh, 7px);
  max-width: min(560px, 86%);
  padding: clamp(4px, 0.9svh, 7px) clamp(8px, 1.8vw, 12px);
  text-align: center;
}

.start-info-grid {
  display: grid;
  gap: clamp(6px, 1.4svh, 10px);
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.72fr) minmax(0, 1fr);
  margin-top: clamp(5px, 1.2svh, 9px);
  max-width: min(860px, 94%);
  width: 100%;
}

.start-panel {
  align-content: start;
}

.rules-panel strong {
  color: #244b86;
  font-size: clamp(0.78rem, 2.6svh, 1rem);
  line-height: 1;
  text-transform: uppercase;
}

.rules-panel span {
  font-size: clamp(0.68rem, 2.2svh, 0.88rem);
  font-weight: 900;
  line-height: 1.05;
}

.home-acorns {
  background: rgba(255, 250, 232, 0.9);
  border: 2px solid rgba(34, 37, 44, 0.58);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 1px;
  max-width: 100%;
  padding: clamp(5px, 1.2svh, 8px) clamp(8px, 1.8vw, 12px);
  place-items: center;
}

.home-acorns strong {
  align-items: center;
  color: #9b5a1f;
  display: inline-flex;
  font-size: clamp(0.78rem, 2.5svh, 1rem);
  gap: 4px;
  justify-content: center;
  line-height: 1;
  text-transform: uppercase;
}

.home-acorns b {
  color: #9b5a1f;
  font-size: clamp(1.2rem, 5svh, 2.1rem);
  line-height: 0.95;
}

.home-acorns span {
  font-size: clamp(0.62rem, 2svh, 0.82rem);
  font-weight: 900;
  line-height: 1.05;
}

.small-button {
  font-size: clamp(0.82rem, 2.7svh, 1rem);
  min-height: 34px;
  padding: 7px 12px;
}

.update-button {
  background: var(--blue);
  box-shadow: 0 4px 0 #184775;
  display: none;
  font-size: clamp(0.72rem, 2.4svh, 0.95rem);
  margin-top: clamp(8px, 2svh, 12px);
}

.secondary-button {
  background: #ffe9b8;
  box-shadow: 0 4px 0 #bc8c43;
  color: var(--ink);
}

.confirm-new-game {
  background: rgba(255, 250, 232, 0.94);
  border: 2px solid rgba(34, 37, 44, 0.66);
  border-radius: 8px;
  display: grid;
  gap: clamp(6px, 1.3svh, 10px);
  margin-top: clamp(6px, 1.4svh, 10px);
  max-width: min(520px, 88%);
  padding: clamp(8px, 1.6svh, 12px) clamp(10px, 2vw, 16px);
}

.confirm-new-game[hidden] {
  display: none;
}

.confirm-new-game p {
  font-size: clamp(0.76rem, 2.4svh, 0.96rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.confirm-actions .small-button {
  min-width: min(210px, 100%);
}

.big-button:active,
.small-button:active {
  box-shadow: 0 2px 0 var(--coral-dark);
  transform: translateY(4px);
}

.playfield {
  background: #c99a54;
  flex: 1 1 auto;
  height: auto;
  isolation: isolate;
  min-height: 0;
  position: relative;
}

.field-bg {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: fill;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.playfield::after {
  content: "";
  inset: 0;
  opacity: var(--forest-atmosphere-opacity, 0);
  pointer-events: none;
  position: absolute;
  transition: opacity 260ms ease, background 260ms ease;
  z-index: 8;
}

.forest-decor-layer {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 6;
}

.forest-decor {
  background: transparent;
  display: none;
  filter: saturate(1.12) contrast(1.08) drop-shadow(0 3px 3px rgba(24, 20, 16, 0.24));
  object-fit: contain;
  opacity: 0.94;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
}

.forest-decor--cassetta {
  left: 23%;
  top: 82%;
  width: clamp(68px, 14svh, 112px);
}

.forest-decor--carretto {
  left: 78%;
  top: 82%;
  width: clamp(76px, 16svh, 126px);
}

.forest-decor--orticello {
  left: 50%;
  top: 84%;
  width: clamp(104px, 22svh, 172px);
}

.forest-decor--insegna {
  left: 50%;
  top: 18%;
  width: clamp(70px, 15svh, 118px);
}

.forest-decor--cavallino {
  left: 10%;
  top: 79%;
  width: clamp(58px, 12svh, 98px);
}

.forest-decor--uccellini {
  left: 90%;
  top: 78%;
  width: clamp(58px, 12svh, 100px);
}

.playfield.forest-phase-2 {
  --forest-atmosphere-opacity: 0.08;
}

.playfield.forest-phase-2::after {
  background: rgba(108, 164, 122, 0.34);
}

.playfield.forest-phase-3 {
  --forest-atmosphere-opacity: 0.1;
}

.playfield.forest-phase-3::after {
  background: rgba(228, 158, 76, 0.28);
}

.playfield.forest-phase-4 {
  --forest-atmosphere-opacity: 0.1;
}

.playfield.forest-phase-4::after {
  background: rgba(97, 142, 182, 0.3);
}

.playfield.forest-phase-5 {
  --forest-atmosphere-opacity: 0.12;
}

.playfield.forest-phase-5::after {
  background: rgba(175, 92, 146, 0.24);
}

.playfield.forest-phase-6 {
  --forest-atmosphere-opacity: 0.14;
}

.playfield.forest-phase-6::after {
  background: rgba(232, 190, 78, 0.26);
}

.playfield.forest-phase-2 .forest-decor--cassetta,
.playfield.forest-phase-3 .forest-decor--cassetta,
.playfield.forest-phase-4 .forest-decor--cassetta,
.playfield.forest-phase-5 .forest-decor--cassetta,
.playfield.forest-phase-6 .forest-decor--cassetta {
  display: block;
}

.playfield.forest-phase-2 .forest-decor--carretto,
.playfield.forest-phase-2 .forest-decor--uccellini,
.playfield.forest-phase-3 .forest-decor--carretto,
.playfield.forest-phase-3 .forest-decor--uccellini,
.playfield.forest-phase-4 .forest-decor--carretto,
.playfield.forest-phase-4 .forest-decor--uccellini,
.playfield.forest-phase-5 .forest-decor--carretto,
.playfield.forest-phase-5 .forest-decor--uccellini,
.playfield.forest-phase-6 .forest-decor--carretto {
  display: block;
}

.playfield.forest-phase-3 .forest-decor--orticello,
.playfield.forest-phase-3 .forest-decor--cavallino,
.playfield.forest-phase-4 .forest-decor--orticello,
.playfield.forest-phase-4 .forest-decor--cavallino,
.playfield.forest-phase-5 .forest-decor--orticello,
.playfield.forest-phase-5 .forest-decor--cavallino,
.playfield.forest-phase-6 .forest-decor--orticello,
.playfield.forest-phase-6 .forest-decor--cavallino {
  display: block;
}

.playfield.forest-phase-4 .forest-decor--insegna,
.playfield.forest-phase-5 .forest-decor--insegna,
.playfield.forest-phase-6 .forest-decor--insegna,
.playfield.forest-phase-6 .forest-decor--uccellini {
  display: block;
}

.hud {
  display: grid;
  flex: 0 0 clamp(32px, 6svh, 42px);
  gap: clamp(3px, 0.65vw, 7px);
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(86px, 0.9fr) minmax(62px, 0.66fr);
  min-height: 0;
  padding: clamp(3px, 0.8svh, 5px) clamp(6px, 1vw, 10px);
  padding-right: clamp(132px, 20vw, 184px);
  position: relative;
  z-index: 40;
}

.hud-item {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 0 2px 0 var(--shadow);
  display: grid;
  min-height: 0;
  padding: 1px 4px;
  place-items: center;
}

.hud-item span {
  font-size: clamp(0.45rem, 1.7svh, 0.66rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.hud-item strong {
  font-size: clamp(0.76rem, 3svh, 1.1rem);
  line-height: 1;
}

.hud-item--level strong {
  color: #d41515;
  font-size: clamp(0.95rem, 4svh, 1.45rem);
  text-shadow: 2px 2px 0 #fff1b2;
}

.hud-item--acorns strong {
  color: #9b5a1f;
}

.acorn-label {
  align-items: center;
  display: inline-flex;
  gap: 3px;
  justify-content: center;
}

.acorn-icon {
  background: url("assets/ghianda.png") center / contain no-repeat;
  display: none;
  height: 1.05em;
  width: 1.05em;
}

body.has-acorn-asset .acorn-icon {
  display: inline-block;
}

body.has-acorn-asset .acorn-emoji {
  display: none;
}

.pause-button,
.nest-button,
.nest-button--pause {
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(24, 20, 16, 0.32);
  color: #fff;
  font-size: clamp(0.58rem, 2svh, 0.82rem);
  font-weight: 900;
  line-height: 1;
  min-height: 0;
  padding: 4px 6px;
  text-transform: uppercase;
  touch-action: manipulation;
  width: 100%;
}

.nest-button {
  background: #9b5a1f;
}

.nest-button--pause {
  background: #9b5a1f;
  width: min(300px, 100%);
}

.pause-button:active,
.nest-button:active,
.nest-button--pause:active {
  box-shadow: none;
  transform: translateY(2px);
}

.ostrich {
  display: block;
  filter: drop-shadow(0 4px 2px rgba(24, 20, 16, 0.26));
  height: clamp(82px, 18.5svh, 136px);
  object-fit: contain;
  opacity: 1;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -100%) rotate(var(--ostrich-rotate, 0deg)) scaleX(var(--ostrich-flip, 1));
  transform-origin: 50% 92%;
  width: clamp(58px, 13.8svh, 98px);
  z-index: 12;
}

.ostrich--tl {
  --ostrich-flip: -1;
  --ostrich-rotate: 20deg;
  left: 15.4%;
  top: 22.8%;
}

.ostrich--tr {
  --ostrich-rotate: -20deg;
  left: 84.6%;
  top: 22.8%;
}

.ostrich--bl {
  --ostrich-flip: -1;
  --ostrich-rotate: -18deg;
  left: 14.2%;
  top: 60.9%;
}

.ostrich--br {
  --ostrich-rotate: 18deg;
  left: 85.8%;
  top: 60.9%;
}

.touch-zone {
  background: transparent;
  border: 0;
  display: block;
  height: 50%;
  outline: 0;
  padding: 0;
  position: absolute;
  width: 50%;
  z-index: 35;
}

.touch-zone,
.touch-zone:active,
.touch-zone:focus,
.touch-zone:focus-visible,
.touch-zone:hover,
.control-zone,
.control-zone:active,
.control-zone:focus,
.control-zone:focus-visible,
.control-zone:hover {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: transparent !important;
  opacity: 0 !important;
  outline: none !important;
}

.touch-zone--tl {
  left: 0;
  top: 0;
}

.touch-zone--tr {
  right: 0;
  top: 0;
}

.touch-zone--bl {
  bottom: 0;
  left: 0;
}

.touch-zone--br {
  bottom: 0;
  right: 0;
}

.target {
  height: 1px;
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 1px;
}

.player {
  height: clamp(120px, 24svh, 140px);
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 61%;
  transform: translate(-50%, -50%);
  transition: transform 90ms ease;
  width: clamp(126px, 26svh, 150px);
  z-index: 28;
}

.player img {
  display: block;
  height: 100%;
  filter: none;
  object-fit: contain;
  opacity: 1;
  width: 100%;
}

.player.is-catching {
  transform: translate(-50%, -50%) scale(1.08);
}

.egg {
  --egg-rotation: 0rad;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    linear-gradient(150deg, #fffdf0, #f0d98f);
  border: 2px solid var(--ink);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 4px 0 rgba(34, 37, 44, 0.12);
  height: clamp(36px, 7.8svh, 45px);
  left: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%) rotate(var(--egg-rotation));
  transform-origin: center;
  width: clamp(30px, 6.2svh, 38px);
  will-change: left, top, transform;
  z-index: 34;
}

.egg img {
  display: none;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

body.use-png-assets .egg {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.use-png-assets .egg img {
  display: block;
}

.egg--bonus2 {
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    linear-gradient(150deg, #fffbe1, #ffc94f);
  box-shadow: 0 0 0 3px rgba(245, 184, 37, 0.55), 0 4px 0 rgba(34, 37, 44, 0.12);
}

.egg--bonus3 {
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    linear-gradient(150deg, #dff7ff, #8fe6ff);
  box-shadow: 0 0 0 3px rgba(47, 116, 191, 0.55), 0 4px 0 rgba(34, 37, 44, 0.12);
}

.egg--rotten {
  background:
    radial-gradient(circle at 32% 35%, #4d7c2f 0 10%, transparent 11%),
    linear-gradient(150deg, #cae58e, var(--green));
}

.egg.is-caught {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.45) rotate(var(--egg-rotation));
  transition: opacity 180ms ease, transform 180ms ease;
}

.egg.is-collecting {
  filter: drop-shadow(0 0 7px rgba(255, 243, 162, 0.78));
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.72) rotate(var(--egg-rotation));
  transition:
    left 220ms cubic-bezier(0.18, 0.86, 0.28, 1),
    top 220ms cubic-bezier(0.18, 0.86, 0.28, 1),
    transform 220ms ease;
  z-index: 46;
}

.egg.is-collecting.is-in-basket {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.58) rotate(var(--egg-rotation));
  transition:
    opacity 130ms ease 180ms,
    transform 300ms ease;
}

.egg.is-lost {
  opacity: 0;
  transform: translate(-50%, 30px) rotate(var(--egg-rotation));
  transition: opacity 260ms ease, transform 260ms ease;
}

.broken-egg {
  background:
    radial-gradient(ellipse at center, rgba(255, 246, 188, 0.98) 0 52%, transparent 53%),
    linear-gradient(150deg, #fffdf0, #e7c771);
  border: 2px solid var(--ink);
  border-radius: 48% 52% 28% 28%;
  height: clamp(38px, 8.5svh, 54px);
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%) scale(1);
  width: clamp(50px, 11svh, 70px);
  z-index: 23;
  animation: broken-egg-pop 520ms ease-out forwards;
}

.broken-egg img {
  display: none;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

body.has-broken-egg.use-png-assets .broken-egg {
  background: transparent;
  border: 0;
}

body.has-broken-egg.use-png-assets .broken-egg img {
  display: block;
}

@keyframes broken-egg-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.74);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
  }
}

.field-message {
  color: #fff4bc;
  font-size: clamp(1.35rem, 6svh, 3.4rem);
  font-weight: 900;
  left: 50%;
  line-height: 0.95;
  max-width: 82%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  text-align: center;
  text-shadow: 3px 3px 0 var(--ink);
  text-transform: uppercase;
  top: 45%;
  transform: translate(-50%, -50%);
  transition: opacity 120ms ease;
  white-space: pre-line;
  z-index: 60;
}

.field-message.is-visible {
  opacity: 1;
}

.field-message.is-level-message {
  animation: level-message-pop 1000ms ease-out forwards;
  color: #fff7b8;
  font-size: clamp(1.22rem, 5.9svh, 3.6rem);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow:
    4px 4px 0 var(--ink),
    0 0 18px rgba(255, 212, 90, 0.72);
}

.field-message.is-fireworks-message {
  animation: level-message-pop 900ms ease-out forwards;
  color: #dff7ff;
  font-size: clamp(1.35rem, 6.8svh, 3.6rem);
  text-shadow:
    3px 3px 0 var(--ink),
    0 0 16px rgba(255, 255, 255, 0.68);
}

.field-message.is-bonus-message {
  animation: level-message-pop 900ms ease-out forwards;
  color: #fff3a2;
  font-size: clamp(1.25rem, 5.8svh, 3rem);
}

.checkpoint-message {
  background: rgba(34, 37, 44, 0.74);
  border: 2px solid rgba(255, 250, 232, 0.52);
  border-radius: 999px;
  bottom: clamp(8px, 2svh, 14px);
  color: #fffbe4;
  font-size: clamp(0.68rem, 2.1svh, 0.9rem);
  font-weight: 900;
  left: 50%;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0;
  padding: 6px 11px;
  pointer-events: none;
  position: absolute;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 140ms ease;
  z-index: 65;
}

.checkpoint-message.is-visible {
  opacity: 1;
}

.checkpoint-message[hidden] {
  display: none;
}

.resume-summary {
  background: rgba(255, 250, 232, 0.94);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 6px 0 rgba(34, 37, 44, 0.32);
  color: var(--ink);
  display: grid;
  font-size: clamp(0.78rem, 2.7svh, 1.05rem);
  font-weight: 900;
  gap: 3px;
  left: 50%;
  line-height: 1.05;
  max-width: min(320px, 78%);
  opacity: 0;
  padding: clamp(8px, 1.6svh, 12px) clamp(10px, 2vw, 16px);
  pointer-events: none;
  position: absolute;
  text-align: left;
  top: 18%;
  transform: translateX(-50%);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: pre-line;
  z-index: 95;
}

.resume-summary.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(4px);
}

.resume-summary[hidden] {
  display: none;
}

.breath-overlay {
  align-content: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 247, 184, 0.34), rgba(27, 52, 38, 0.2) 58%, rgba(27, 52, 38, 0));
  color: #fff7b8;
  display: grid;
  gap: clamp(8px, 2svh, 16px);
  inset: 0;
  justify-items: center;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  text-align: center;
  text-shadow:
    4px 4px 0 var(--ink),
    0 0 18px rgba(255, 212, 90, 0.82);
  text-transform: uppercase;
  transform: scale(0.92);
  z-index: 65;
}

.breath-overlay strong,
.breath-overlay span {
  display: block;
  line-height: 0.95;
}

.breath-overlay strong {
  font-size: clamp(1.75rem, 8.8svh, 5rem);
}

.breath-overlay span {
  color: #b8ff8f;
  font-size: clamp(1.25rem, 6svh, 3.2rem);
}

.breath-overlay.is-visible {
  animation: breath-overlay-pop 3200ms ease-out forwards;
}

.breath-overlay--strong {
  background:
    radial-gradient(circle at 50% 45%, rgba(223, 247, 255, 0.4), rgba(47, 116, 191, 0.2) 58%, rgba(27, 52, 38, 0));
}

.playfield.is-breathing .field-bg {
  filter: brightness(1.04) saturate(1.05);
}

@keyframes breath-overlay-pop {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  14% {
    opacity: 1;
    transform: scale(1.04);
  }
  76% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.94);
  }
}

@keyframes level-message-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
}

.fireworks {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 58;
}

.floating-score {
  animation: floating-score-rise 760ms ease-out forwards;
  color: #fff3a2;
  font-size: clamp(1.2rem, 5svh, 2.45rem);
  font-weight: 900;
  left: 0;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 3px 3px 0 var(--ink);
  top: 0;
  transform: translate(-50%, -50%);
  z-index: 66;
}

.floating-score--penalty {
  color: #ff5a48;
}

@keyframes floating-score-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.78);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -135%) scale(0.9);
  }
}

.basket-flash {
  animation: basket-flash-pop 420ms ease-out forwards;
  border: 3px solid #fff3a2;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(34, 37, 44, 0.48),
    0 0 16px rgba(255, 243, 162, 0.88);
  height: clamp(38px, 8.5svh, 58px);
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%) scale(0.45);
  width: clamp(38px, 8.5svh, 58px);
  z-index: 65;
}

.basket-flash--penalty {
  border-color: #ff5a48;
  box-shadow:
    0 0 0 2px rgba(34, 37, 44, 0.48),
    0 0 16px rgba(255, 90, 72, 0.78);
}

@keyframes basket-flash-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.46);
  }
}

.debug-alignment-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 120;
}

.debug-marker,
.debug-basket,
.debug-line {
  position: absolute;
}

.debug-marker {
  border: 2px solid #fff;
  border-radius: 50%;
  height: 10px;
  transform: translate(-50%, -50%);
  width: 10px;
}

.debug-marker--platform {
  background: #2f74bf;
}

.debug-marker--spawn {
  background: #f5b825;
}

.debug-marker--ostrich {
  background: #75b86c;
}

.debug-basket {
  border: 2px solid #ff5a48;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.debug-line {
  background: rgba(255, 90, 72, 0.9);
  height: 2px;
  transform-origin: 0 50%;
}

.firework-spark {
  background: var(--spark-color, #fff);
  border-radius: 50%;
  height: var(--spark-size, 7px);
  left: var(--spark-x, 50%);
  position: absolute;
  top: var(--spark-y, 50%);
  transform: translate(-50%, -50%) scale(0.4);
  width: var(--spark-size, 7px);
  animation: firework-pop var(--spark-duration, 940ms) ease-out forwards;
}

@keyframes firework-pop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--spark-dx, 0px)), calc(-50% + var(--spark-dy, 0px)))
      scale(0.1);
  }
}

.playfield.is-shaking {
  animation: shake 180ms steps(2, end) 2;
}

.pause-panel {
  align-items: center;
  background: rgba(24, 20, 16, 0.54);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  pointer-events: auto;
  position: absolute;
  z-index: 90;
}

.pause-panel[hidden] {
  display: none;
}

.pause-card {
  align-items: center;
  background: rgba(255, 250, 232, 0.96);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(24, 20, 16, 0.38);
  display: grid;
  gap: clamp(8px, 2svh, 14px);
  justify-items: center;
  max-width: min(420px, 86%);
  padding: clamp(14px, 4svh, 28px);
  text-align: center;
}

.pause-card h2 {
  color: #244b86;
  font-size: clamp(2rem, 9svh, 4.8rem);
  text-shadow: 3px 3px 0 #fff1b2;
}

.pause-card .big-button,
.pause-card .small-button {
  margin-top: 0;
  width: min(300px, 100%);
}

.nest-panel {
  align-items: center;
  background: rgba(24, 20, 16, 0.68);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  pointer-events: auto;
  position: fixed;
  z-index: 10020;
}

.nest-panel[hidden] {
  display: none;
}

.nest-card {
  background: rgba(255, 250, 232, 0.98);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(24, 20, 16, 0.38);
  display: grid;
  gap: clamp(8px, 1.4svh, 14px);
  max-height: min(90dvh, 720px);
  max-width: min(980px, calc(100dvw - 18px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(9px, 1.8svh, 18px);
  scrollbar-width: thin;
  width: 100%;
}

.nest-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.nest-header h2 {
  color: #6f3f16;
  font-size: clamp(1.25rem, 4.6svh, 2.45rem);
  line-height: 1;
  text-shadow: 2px 2px 0 #fff1b2;
}

.nest-summary {
  align-items: center;
  background: rgba(255, 241, 178, 0.9);
  border: 3px solid rgba(34, 37, 44, 0.72);
  border-radius: 7px;
  display: flex;
  font-weight: 900;
  gap: 10px;
  justify-content: center;
  padding: 8px 10px;
  text-align: center;
  text-transform: uppercase;
}

.nest-summary strong {
  color: #9b5a1f;
  font-size: clamp(1.45rem, 5svh, 2.45rem);
  line-height: 1;
}

.nest-summary--net strong {
  color: #244b86;
}

.net-worth-note {
  background: rgba(255, 250, 232, 0.78);
  border: 2px dashed rgba(34, 37, 44, 0.48);
  border-radius: 6px;
  color: #3d3328;
  font-size: clamp(0.66rem, 1.85svh, 0.9rem);
  font-weight: 900;
  line-height: 1.16;
  padding: 7px 9px;
  text-align: center;
}

.nest-grid {
  display: grid;
  gap: clamp(8px, 1.4vw, 14px);
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
}

.nest-section {
  background: rgba(247, 251, 245, 0.82);
  border: 3px solid rgba(34, 37, 44, 0.72);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 8px;
}

.nest-section h3 {
  color: #244b86;
  font-size: clamp(0.78rem, 2.2svh, 1.05rem);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.nest-list {
  display: grid;
  gap: 8px;
}

.nest-empty,
.nest-row {
  background: rgba(255, 250, 232, 0.9);
  border: 2px solid rgba(34, 37, 44, 0.42);
  border-radius: 6px;
  font-size: clamp(0.68rem, 1.9svh, 0.9rem);
  font-weight: 900;
  line-height: 1.08;
  padding: 7px;
}

.nest-list--compact .nest-row {
  font-size: clamp(0.78rem, 2.25svh, 1.05rem);
}

.nest-asset {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(54px, 0.38fr) minmax(0, 1fr);
}

.nest-asset img {
  border: 2px solid rgba(34, 37, 44, 0.52);
  border-radius: 7px;
  box-shadow: 0 3px 0 rgba(24, 20, 16, 0.22);
  display: block;
  max-height: 112px;
  object-fit: contain;
  width: 100%;
}

.nest-asset-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nest-asset-title {
  color: #6f3f16;
  font-size: clamp(0.84rem, 2.4svh, 1.1rem);
  line-height: 1;
}

.nest-asset-meta {
  display: grid;
  gap: 2px;
}

.nest-sell-button {
  justify-self: start;
  min-height: 34px;
  min-width: 112px;
  padding: 7px 10px;
}

.nest-feedback {
  color: #b70f0f;
  font-size: clamp(0.74rem, 2.2svh, 0.96rem);
  font-weight: 900;
  min-height: 1em;
  text-align: center;
}

.forest-freedom {
  background: linear-gradient(180deg, rgba(247, 251, 245, 0.95), rgba(255, 241, 178, 0.9));
  border: 3px solid rgba(34, 37, 44, 0.78);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  padding: 9px;
  text-align: center;
}

.forest-freedom h3 {
  color: #2f6f30;
  font-size: clamp(0.92rem, 2.7svh, 1.26rem);
  line-height: 1;
  text-transform: uppercase;
}

.freedom-meter {
  background: rgba(24, 20, 16, 0.22);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(24, 20, 16, 0.22);
  height: clamp(18px, 3.3svh, 28px);
  overflow: hidden;
  width: 100%;
}

.freedom-meter span {
  background: linear-gradient(90deg, #5fba47, #f0c44b);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
  display: block;
  height: 100%;
  transition: width 220ms ease;
  width: 0%;
}

.freedom-percent {
  color: #2f6f30;
  font-size: clamp(1.55rem, 5.6svh, 2.7rem);
  line-height: 1;
  text-shadow: 2px 2px 0 #fff1b2;
}

.freedom-economics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.freedom-economics span {
  background: rgba(255, 250, 232, 0.9);
  border: 2px solid rgba(34, 37, 44, 0.45);
  border-radius: 6px;
  font-size: clamp(0.72rem, 2.1svh, 0.98rem);
  font-weight: 900;
  padding: 7px;
}

.freedom-economics strong {
  color: #244b86;
  font-size: clamp(1.05rem, 3.3svh, 1.48rem);
}

.freedom-message {
  color: #6f3f16;
  font-size: clamp(0.72rem, 2.05svh, 0.96rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
  white-space: pre-line;
}

.freedom-message.is-complete {
  color: #2f6f30;
}

.opportunity-panel {
  align-items: center;
  background: rgba(24, 20, 16, 0.68);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  pointer-events: auto;
  position: fixed;
  z-index: 10000;
}

.opportunity-panel[hidden] {
  display: none;
}

.opportunity-card {
  background: rgba(255, 250, 232, 0.97);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 0 rgba(24, 20, 16, 0.38);
  display: grid;
  gap: clamp(6px, 1.35svh, 12px);
  max-height: min(90dvh, 720px);
  max-width: min(930px, calc(100dvw - 18px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(8px, 1.9svh, 16px);
  scrollbar-width: thin;
  text-align: center;
  width: 100%;
}

.opportunity-copy {
  display: grid;
  gap: 2px;
}

.opportunity-copy h2 {
  color: #244b86;
  font-size: clamp(1.1rem, 4.6svh, 2.6rem);
  line-height: 1;
  text-shadow: 2px 2px 0 #fff1b2;
}

.opportunity-copy p {
  font-size: clamp(0.72rem, 2.5svh, 1.05rem);
  font-weight: 900;
  line-height: 1;
}

.opportunity-deck {
  display: grid;
  gap: clamp(5px, 1.1vw, 12px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-items: center;
}

.opportunity-pick {
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  max-width: 118px;
  padding: 0;
  width: 100%;
}

.opportunity-pick img,
.opportunity-detail img {
  border: 2px solid rgba(34, 37, 44, 0.72);
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(24, 20, 16, 0.28);
  display: block;
  height: auto;
  width: 100%;
}

.opportunity-pick.is-picked {
  transform: translateY(-4px);
}

.opportunity-pick.is-disabled {
  cursor: default;
  opacity: 0.45;
}

.opportunity-detail {
  align-items: center;
  display: grid;
  gap: clamp(8px, 1.6vw, 16px);
  grid-template-columns: minmax(84px, 0.32fr) minmax(0, 1fr);
  margin: 0 auto;
  max-width: min(760px, 100%);
  min-height: 0;
  text-align: left;
}

.opportunity-detail[hidden],
.opportunity-actions[hidden],
.opportunity-secondary-actions[hidden] {
  display: none;
}

.opportunity-detail img {
  max-height: min(34dvh, 220px);
  object-fit: contain;
}

.opportunity-detail-copy {
  display: grid;
  gap: clamp(4px, 1svh, 8px);
  min-width: 0;
}

.opportunity-detail-copy h3 {
  color: #6f3f16;
  font-size: clamp(0.98rem, 3.2svh, 1.65rem);
  line-height: 1;
}

.opportunity-detail-copy p {
  font-size: clamp(0.68rem, 2.25svh, 0.96rem);
  font-weight: 900;
  line-height: 1.13;
  margin: 0;
}

.opportunity-status {
  color: #b70f0f;
  min-height: 1em;
}

.opportunity-actions {
  background: rgba(255, 250, 232, 0.98);
  border-top: 2px solid rgba(34, 37, 44, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 2px;
  padding-top: 8px;
  position: sticky;
  bottom: -1px;
  z-index: 2;
}

.opportunity-actions .small-button {
  min-width: min(150px, 100%);
}

@media (max-height: 430px) and (orientation: landscape) {
  .nest-panel {
    align-items: flex-start;
    padding: 5px max(6px, env(safe-area-inset-right)) 5px max(6px, env(safe-area-inset-left));
  }

  .nest-card {
    gap: 5px;
    max-height: calc(100dvh - 10px);
    padding: 6px;
  }

  .nest-header h2 {
    font-size: clamp(1rem, 5.2svh, 1.5rem);
  }

  .nest-summary {
    padding: 5px 7px;
  }

  .net-worth-note {
    padding: 5px 7px;
  }

  .forest-freedom {
    gap: 5px;
    padding: 6px;
  }

  .freedom-economics {
    gap: 5px;
  }

  .freedom-economics span {
    padding: 5px;
  }

  .nest-grid {
    gap: 6px;
  }

  .nest-section {
    gap: 5px;
    padding: 5px;
  }

  .nest-asset {
    gap: 5px;
    grid-template-columns: minmax(42px, 0.28fr) minmax(0, 1fr);
  }

  .nest-asset img {
    max-height: 72px;
  }

  .opportunity-panel {
    align-items: flex-start;
    padding: 5px max(6px, env(safe-area-inset-right)) 5px max(6px, env(safe-area-inset-left));
  }

  .opportunity-card {
    gap: 4px;
    max-height: calc(100dvh - 10px);
    padding: 6px;
  }

  .opportunity-copy h2 {
    font-size: clamp(0.96rem, 5.4svh, 1.4rem);
  }

  .opportunity-copy p {
    font-size: clamp(0.64rem, 3.3svh, 0.82rem);
  }

  .opportunity-pick {
    max-width: 68px;
  }

  .opportunity-detail {
    gap: 6px;
    grid-template-columns: minmax(56px, 0.24fr) minmax(0, 1fr);
  }

  .opportunity-detail img {
    max-height: 28dvh;
  }

  .opportunity-detail-copy {
    gap: 3px;
  }

  .opportunity-detail-copy h3 {
    font-size: clamp(0.86rem, 4.4svh, 1.12rem);
  }

  .opportunity-detail-copy p {
    font-size: clamp(0.6rem, 3.1svh, 0.76rem);
    line-height: 1.04;
  }

  .opportunity-actions {
    gap: 6px;
    padding-top: 5px;
  }

  .opportunity-actions .small-button {
    min-height: 34px;
    min-width: min(128px, 100%);
    padding: 7px 9px;
  }
}

@media (max-width: 720px) {
  .hud {
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(76px, 0.82fr) minmax(56px, 0.62fr);
  }

  .nest-panel {
    align-items: flex-start;
    padding: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left));
  }

  .nest-card {
    border-width: 3px;
    max-height: calc(100dvh - 12px);
    padding: 7px;
  }

  .nest-grid {
    grid-template-columns: 1fr;
  }

  .nest-header {
    align-items: start;
  }

  .nest-header .small-button {
    min-width: 86px;
  }

  .nest-asset {
    grid-template-columns: minmax(50px, 0.3fr) minmax(0, 1fr);
  }

  .nest-asset img {
    max-height: 86px;
  }

  .freedom-economics {
    grid-template-columns: 1fr;
  }

  .opportunity-panel {
    align-items: flex-start;
    padding: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left));
  }

  .opportunity-card {
    border-width: 3px;
    gap: 5px;
    max-height: calc(100dvh - 12px);
    padding: 7px;
  }

  .opportunity-deck {
    gap: 5px;
  }

  .opportunity-pick {
    max-width: 74px;
  }

  .opportunity-detail {
    align-items: start;
    gap: 7px;
    grid-template-columns: minmax(58px, 0.28fr) minmax(0, 1fr);
  }

  .opportunity-detail img {
    max-height: min(30dvh, 135px);
  }

  .opportunity-actions {
    justify-content: stretch;
  }

  .opportunity-actions .small-button {
    flex: 1 1 130px;
    min-height: 38px;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.end-screen {
  align-items: stretch;
  display: grid;
  gap: clamp(10px, 1.8vw, 22px);
  grid-template-columns: 1fr 0.9fr;
  padding: clamp(12px, 2.4vw, 28px);
  text-align: left;
}

.end-main,
.end-side {
  min-height: 0;
}

.end-main {
  align-items: center;
  display: grid;
  gap: clamp(10px, 2vw, 18px);
  grid-template-columns: minmax(96px, 0.5fr) 1fr;
}

.end-main .final-boar {
  height: min(36svh, 190px);
  margin: 0;
  width: 100%;
}

.end-copy {
  display: grid;
  gap: clamp(4px, 1.2svh, 8px);
}

.end-copy p,
.share-line,
.tagline {
  font-size: clamp(0.78rem, 2.8svh, 1.15rem);
  font-weight: 900;
  line-height: 1.08;
}

.end-narrative {
  background: rgba(255, 250, 232, 0.78);
  border: 2px solid rgba(34, 37, 44, 0.42);
  border-radius: 8px;
  padding: clamp(5px, 1.2svh, 8px) clamp(7px, 1.4vw, 11px);
  white-space: pre-line;
}

.tagline {
  color: #244b86;
}

.end-side {
  display: grid;
  gap: clamp(6px, 1.5svh, 12px);
  grid-template-rows: auto 1fr auto;
}

.score-form,
.leaderboard {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--shadow);
  padding: clamp(6px, 1.4svh, 10px);
}

.score-form[hidden] {
  display: none;
}

.score-form label {
  display: block;
  font-size: clamp(0.72rem, 2.2svh, 0.95rem);
  font-weight: 900;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.score-form-row {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr auto;
}

.score-form input {
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-size: clamp(0.78rem, 2.4svh, 1rem);
  min-height: 34px;
  min-width: 0;
  padding: 6px 8px;
  width: 100%;
}

.leaderboard {
  display: grid;
  gap: 5px;
  min-height: 0;
}

.record-badge {
  color: #b70f0f;
  font-size: clamp(0.88rem, 2.8svh, 1.15rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.record-badge[hidden] {
  display: none;
}

.leaderboard-list {
  display: grid;
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-list li {
  background: var(--panel-strong);
  border: 2px solid rgba(34, 37, 44, 0.46);
  border-radius: 6px;
  font-size: clamp(0.7rem, 2.2svh, 0.92rem);
  font-weight: 900;
  line-height: 1.05;
  padding: 4px 6px;
}

.leaderboard-row {
  align-items: baseline;
  display: grid;
  gap: 6px;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  font-variant-numeric: tabular-nums;
  justify-self: end;
}

.replay-button {
  justify-self: stretch;
  margin: 0;
  width: 100%;
}

@media (max-aspect-ratio: 13 / 12) and (max-width: 860px) {
  .orientation-lock {
    display: flex;
  }

  .app {
    visibility: hidden;
  }
}

@media (max-width: 920px), (max-height: 520px) {
  body {
    padding: 0;
  }

  .fullscreen-button {
    display: block;
  }

  #play-button {
    min-height: clamp(42px, 9svh, 54px);
  }

  .app {
    border-width: 0;
    border-radius: 0;
    box-shadow: none;
    height: min(100dvh, calc(100dvw * 9 / 16));
    max-height: none;
    max-width: none;
    width: min(100dvw, calc(100dvh * 16 / 9));
  }
}

@media (max-width: 640px) {
  .start-info-grid {
    grid-template-columns: 1fr;
    max-width: min(420px, 88%);
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  .app {
    border-width: 0;
  }

  .hud-item {
    min-height: 0;
    padding: 1px 3px;
  }

  .hud {
    flex-basis: clamp(30px, 6svh, 38px);
    gap: 3px;
  }

  .hud-item span,
  .pause-button {
    font-size: clamp(0.44rem, 1.75svh, 0.62rem);
  }

  .objective-text {
    font-size: clamp(0.6rem, 2svh, 0.78rem);
    line-height: 1.05;
    margin-top: 5px;
    padding: 5px 8px;
  }

  #start-screen {
    padding-top: 4px;
  }

  .start-title-row {
    gap: 5px;
    max-width: 82%;
  }

  .title-boar {
    height: clamp(42px, 13svh, 72px);
    width: clamp(46px, 14svh, 78px);
  }

  #start-title {
    font-size: clamp(1.35rem, 5.5svh, 2.7rem);
  }

  #start-title span {
    margin-top: 4px;
  }

  .start-info-grid {
    gap: 5px;
    margin-top: 5px;
    max-width: 92%;
  }

  .rules-panel {
    margin-top: 5px;
    padding: 5px 8px;
  }

  .rules-panel strong {
    font-size: clamp(0.58rem, 2svh, 0.76rem);
  }

  .rules-panel span,
  .home-acorns span {
    font-size: clamp(0.52rem, 1.75svh, 0.68rem);
  }

  .home-acorns {
    margin-top: 5px;
    max-width: 82%;
    padding: 4px 7px;
  }

  .home-acorns strong {
    font-size: clamp(0.62rem, 2.05svh, 0.82rem);
  }

  .home-acorns b {
    font-size: clamp(1rem, 4svh, 1.45rem);
  }

  .big-button {
    margin-top: clamp(7px, 2svh, 14px);
    min-height: clamp(40px, 8.6svh, 50px);
    padding: 8px 24px;
  }

  .player {
    height: clamp(120px, 27svh, 140px);
    width: clamp(126px, 29svh, 150px);
  }

  .ostrich {
    height: clamp(72px, 18svh, 104px);
    width: clamp(50px, 13svh, 76px);
  }

  .egg {
    height: clamp(40px, 9svh, 48px);
    width: clamp(33px, 7svh, 40px);
  }

  .end-screen {
    gap: 10px;
    padding: 10px;
  }
}
