:root {
  color-scheme: dark;
  --cream: #fff8de;
  --ink: #2b2038;
  --green: #70d94d;
  --green-dark: #3c9e35;
  --yellow: #ffd23f;
  --orange: #ff8b2c;
  --pink: #ff769d;
  --panel: rgba(35, 27, 49, 0.78);
  --panel-border: rgba(255, 255, 255, 0.2);
  --shadow: 0 14px 0 rgba(38, 27, 29, 0.25), 0 22px 42px rgba(20, 14, 33, 0.28);
  --soft-shadow: 0 8px 24px rgba(20, 14, 33, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  background: #63c9f5;
  color: var(--cream);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  font: inherit;
}

#app,
#scene,
#scene canvas,
#scene-shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#scene canvas {
  display: block;
  touch-action: none;
  outline: none;
}

#scene-shade {
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, transparent 25%, rgba(17, 13, 29, 0.22) 100%);
  opacity: 0.46;
  transition: opacity 320ms ease;
}

body.playing #scene-shade {
  opacity: 0;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 240ms ease, transform 240ms ease, visibility 0s linear 240ms;
}

.screen.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  transition-delay: 0s;
}

.start-card {
  margin: auto;
  width: min(90vw, 680px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-2vh);
  filter: drop-shadow(0 8px 20px rgba(22, 29, 32, 0.22));
}

.game-logo {
  margin: 0 0 clamp(28px, 5vh, 54px);
  text-align: center;
  line-height: 0.78;
  font-size: clamp(68px, 11vw, 126px);
  font-weight: 1000;
  letter-spacing: -0.075em;
  transform: rotate(-2deg);
  color: var(--yellow);
  -webkit-text-stroke: clamp(3px, 0.55vw, 8px) #482b42;
  paint-order: stroke fill;
  text-shadow: 0 10px 0 #e96a2e, 0 17px 0 rgba(55, 34, 42, 0.3);
}

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

.game-logo .logo-pigs {
  color: #ff688e;
  font-size: 1.08em;
}

.logo-snout {
  position: relative;
  display: inline-flex;
  width: 0.68em;
  height: 0.53em;
  margin: 0 0.02em;
  vertical-align: 0.04em;
  border: 0.055em solid #482b42;
  border-radius: 48% 48% 55% 55%;
  background: #ff9db5;
  box-shadow: inset 0 -0.07em 0 rgba(186, 52, 96, 0.3);
}

.logo-snout i {
  width: 0.09em;
  height: 0.14em;
  margin: auto;
  border-radius: 50%;
  background: #713f62;
}

.button {
  min-height: 52px;
  padding: 14px 26px 12px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  color: #fff;
  font-weight: 1000;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(48, 30, 39, 0.32), var(--soft-shadow);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
  touch-action: manipulation;
}

.button:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.025);
  filter: brightness(1.08) saturate(1.08);
}

.button:active:not(:disabled) {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 rgba(48, 30, 39, 0.36), 0 5px 12px rgba(20, 14, 33, 0.2);
}

.button:focus-visible,
.icon-button:focus-visible,
.map-card:focus-visible {
  outline: 4px solid #fff3a6;
  outline-offset: 4px;
}

.button-primary {
  background: linear-gradient(#91ec55, #4fbd3a);
  text-shadow: 0 2px 0 #27752b;
}

.button-secondary {
  background: linear-gradient(#ffad48, #ee6b2e);
  text-shadow: 0 2px 0 #9e3f27;
}

.button-quiet {
  background: rgba(38, 30, 52, 0.72);
  box-shadow: 0 4px 0 rgba(18, 13, 30, 0.35), var(--soft-shadow);
}

.button-huge {
  min-width: min(340px, 74vw);
  min-height: 78px;
  padding: 15px 52px 12px;
  border-radius: 27px;
  font-size: clamp(26px, 4vw, 38px);
  box-shadow: 0 10px 0 #2f8d35, 0 20px 44px rgba(27, 46, 22, 0.35);
}

.button-huge:active {
  box-shadow: 0 3px 0 #2f8d35, 0 7px 16px rgba(27, 46, 22, 0.25) !important;
}

.button-small {
  min-height: 44px;
  padding: 10px 16px 8px;
  border-radius: 14px;
  font-size: 13px;
}

.button-wide {
  min-width: 230px;
  margin-top: 24px;
}

.glass-panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

#map-screen {
  display: block;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: linear-gradient(rgba(21, 17, 33, 0.16), rgba(21, 17, 33, 0.45));
}

.map-header {
  position: relative;
  width: min(1060px, 100%);
  min-height: 82px;
  margin: 0 auto 18px;
  padding: 10px 15px;
  border-radius: 23px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.map-heading {
  text-align: center;
}

.map-heading h2,
.result-panel h2,
.game-over-panel h2 {
  margin: 0;
  font-size: clamp(31px, 5vw, 52px);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: 0.025em;
  color: var(--yellow);
  text-shadow: 0 4px 0 #9b4b2d;
}

.map-heading p {
  margin: 6px 0 0;
  font-weight: 900;
  color: #ffe993;
}

.map-grid {
  width: min(1060px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 8px;
}

.map-card {
  position: relative;
  min-height: 214px;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-radius: 25px;
  background: #40354f;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 9px 0 rgba(35, 25, 39, 0.34), var(--soft-shadow);
  transition: transform 170ms ease, filter 170ms ease, box-shadow 170ms ease;
}

.map-card:not(.locked):hover {
  transform: translateY(-6px) rotate(-0.4deg);
  filter: brightness(1.07) saturate(1.06);
  box-shadow: 0 14px 0 rgba(35, 25, 39, 0.28), 0 24px 42px rgba(20, 14, 33, 0.3);
}

.map-card:active:not(.locked) {
  transform: translateY(3px) scale(0.985);
}

.map-thumb {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.map-thumb::before,
.map-thumb::after {
  content: "";
  position: absolute;
}

.map-thumb.farm {
  background: linear-gradient(#5ecbfa 0 56%, #75d54c 57%);
}

.map-thumb.farm::before {
  right: 7%;
  bottom: 25%;
  width: 23%;
  height: 32%;
  background: #d64c42;
  border: 7px solid #94352f;
  clip-path: polygon(50% 0, 100% 35%, 100% 100%, 0 100%, 0 35%);
}

.map-thumb.farm::after {
  left: 0;
  right: 0;
  bottom: 19%;
  height: 4px;
  background: repeating-linear-gradient(90deg, #825135 0 34px, transparent 34px 47px);
  box-shadow: 0 14px 0 rgba(85, 121, 43, 0.24);
}

.map-thumb.canyon {
  background: linear-gradient(#f39a62 0 58%, #c7773e 59%);
}

.map-thumb.canyon::before {
  right: 5%;
  bottom: 29%;
  width: 39%;
  height: 40%;
  border-radius: 48% 48% 5px 5px;
  background: #88452f;
  box-shadow: -180px 22px 0 #a95d36;
}

.map-thumb.canyon::after {
  left: 47%;
  bottom: 28%;
  width: 8px;
  height: 38px;
  border-radius: 6px;
  background: #456b3d;
  box-shadow: -8px 9px 0 -2px #456b3d, 9px 15px 0 -2px #456b3d;
}

.map-thumb.frozen {
  background: linear-gradient(#172f66 0 62%, #d9f5ff 63%);
}

.map-thumb.frozen::before {
  right: 10%;
  top: 12%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff6c7;
  box-shadow: 0 0 22px #cfebff;
}

.map-thumb.frozen::after {
  left: 14%;
  bottom: 25%;
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-bottom: 74px solid #174e4c;
  filter: drop-shadow(80px 9px 0 #164341) drop-shadow(165px 2px 0 #174e4c);
}

.map-thumb.volcano {
  background: linear-gradient(#671e2b 0 62%, #252128 63%);
}

.map-thumb.volcano::before {
  left: 6%;
  bottom: 27%;
  width: 44%;
  height: 53%;
  background: #211d23;
  clip-path: polygon(0 100%, 42% 0, 63% 44%, 77% 20%, 100% 100%);
  filter: drop-shadow(190px 20px 0 #18161a);
}

.map-thumb.volcano::after {
  left: 0;
  right: 0;
  bottom: 24%;
  height: 5px;
  background: #ff7b20;
  box-shadow: 0 0 13px #ff3b16, 90px -6px 11px #ff9e31;
}

.map-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 20px 16px;
  background: linear-gradient(transparent 22%, rgba(25, 19, 33, 0.15) 45%, rgba(28, 21, 38, 0.91) 77%);
}

.map-card h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 0 rgba(24, 17, 30, 0.5);
}

.map-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: #ffeeb0;
  font-size: 14px;
  font-weight: 900;
}

.card-stars {
  font-size: 23px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.25);
}

.card-stars .earned {
  color: var(--yellow);
  filter: drop-shadow(0 2px 0 #a55f21);
}

.map-card.locked {
  cursor: not-allowed;
  filter: grayscale(0.75) brightness(0.56);
  border-color: rgba(255, 255, 255, 0.22);
}

.lock-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: rgba(32, 25, 39, 0.76);
  font-size: 27px;
  box-shadow: var(--soft-shadow);
}

.game-screen {
  pointer-events: none !important;
}

.game-screen.active .hud,
.game-screen.active .hud button {
  pointer-events: auto;
}

.hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: start;
  gap: 12px;
}

.hud-left,
.score-panel,
.pigs-panel {
  min-height: 65px;
  border-radius: 18px;
}

.hud-left {
  justify-self: start;
  display: flex;
  align-items: center;
  padding: 8px 15px 8px 9px;
  gap: 11px;
}

.hud-buttons {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 47px;
  height: 47px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: linear-gradient(#ffad48, #e9692e);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 2px 0 #913823;
  box-shadow: 0 4px 0 rgba(79, 38, 30, 0.52);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.icon-button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.icon-button:active {
  transform: translateY(3px) scale(0.94);
}

.level-label {
  font-size: 12px;
  line-height: 1.18;
  letter-spacing: 0.08em;
  color: #ffd982;
}

.level-label strong {
  color: #fff;
  font-size: 15px;
  white-space: nowrap;
}

.score-panel {
  min-width: 177px;
  padding: 8px 22px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-panel span,
.pigs-panel > span {
  color: #ffd982;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.score-panel strong {
  margin-top: 4px;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  transition: transform 150ms ease, color 150ms ease;
}

.score-panel strong.bump {
  color: var(--yellow);
  transform: scale(1.19) rotate(-2deg);
}

.pigs-panel {
  justify-self: end;
  min-width: 185px;
  padding: 8px 13px;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto 1fr;
  align-items: center;
  column-gap: 8px;
}

.pigs-panel > strong {
  justify-self: end;
  font-size: 19px;
}

.pig-icons {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.mini-pig {
  position: relative;
  width: 23px;
  height: 18px;
  border: 2px solid #5e2e4b;
  border-radius: 48%;
  background: #ff7fa4;
  box-shadow: inset 0 -3px 0 rgba(190, 57, 100, 0.28);
}

.mini-pig::before,
.mini-pig::after {
  content: "";
  position: absolute;
}

.mini-pig::before {
  left: 4px;
  top: -6px;
  width: 5px;
  height: 7px;
  border: 2px solid #5e2e4b;
  border-radius: 70% 20%;
  background: #ff91af;
  transform: rotate(-20deg);
  box-shadow: 9px 2px 0 -1px #ff91af;
}

.mini-pig::after {
  left: 6px;
  bottom: 1px;
  width: 8px;
  height: 5px;
  border-radius: 50%;
  background: #ffb3c5;
  border: 1px solid #763b59;
}

.aim-hint {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  padding: 10px 18px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 99px;
  background: rgba(31, 25, 42, 0.67);
  color: #fff4bd;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: var(--soft-shadow);
  transform: translateX(-50%);
  animation: hint-bob 1.8s ease-in-out infinite;
  transition: opacity 300ms ease;
}

.aim-hint.hidden {
  opacity: 0;
  animation: none;
}

#score-popups {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.score-popup {
  position: absolute;
  z-index: 20;
  color: #fff5a1;
  font-weight: 1000;
  font-size: clamp(18px, 2.5vw, 28px);
  text-shadow: 0 3px 0 #693b32, 0 0 8px rgba(255, 178, 47, 0.7);
  animation: score-float 950ms ease-out forwards;
}

.modal-screen {
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(19, 13, 29, 0.58);
}

.result-panel,
.game-over-panel {
  width: min(590px, 95vw);
  padding: clamp(23px, 4vw, 38px);
  border-radius: 31px;
  text-align: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.result-panel.failed h2 {
  color: #ff9e86;
  text-shadow: 0 4px 0 #7c3434;
}

.result-stars {
  min-height: 90px;
  margin: 14px 0 4px;
  display: flex;
  justify-content: center;
  gap: clamp(7px, 2vw, 16px);
  font-size: clamp(53px, 10vw, 78px);
  line-height: 1;
}

.result-stars span {
  color: rgba(255, 255, 255, 0.15);
  filter: drop-shadow(0 5px 0 rgba(20, 15, 25, 0.3));
  transform: scale(0.2) rotate(-40deg);
  opacity: 0;
}

.result-stars span.show {
  animation: star-in 560ms cubic-bezier(0.18, 1.45, 0.38, 1) forwards;
}

.result-stars span.earned {
  color: var(--yellow);
  text-shadow: 0 4px 0 #b26424;
}

.result-stats {
  margin: 8px auto 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  background: rgba(19, 14, 28, 0.29);
}

.result-stat {
  padding: 13px 10px;
}

.result-stat:nth-child(odd) {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.result-stat span,
.final-summary span {
  display: block;
  color: #ffc973;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-stat strong,
.final-summary strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(21px, 4vw, 29px);
  font-variant-numeric: tabular-nums;
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.result-actions .button {
  min-width: 142px;
  flex: 1 1 140px;
}

.final-kicker {
  margin: 0 0 8px;
  color: #ffba72;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.18em;
}

.game-over-panel h2 {
  font-size: clamp(52px, 10vw, 91px);
  color: #ff7f5d;
  text-shadow: 0 6px 0 #7d3131;
}

.final-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 22px 0 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.final-summary > div {
  padding: 14px 8px;
  background: rgba(18, 13, 25, 0.4);
}

.final-stars {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: center;
  gap: 9px 18px;
}

.final-star-group {
  display: flex;
  gap: 3px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(15, 11, 22, 0.27);
  color: rgba(255, 255, 255, 0.16);
  font-size: clamp(20px, 4vw, 28px);
}

.final-star-group .earned {
  color: var(--yellow);
  text-shadow: 0 2px 0 #9d5823;
}

#rotate-hint {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: none;
  padding: 8px 13px;
  border-radius: 30px;
  background: rgba(28, 21, 37, 0.82);
  color: #fff2b1;
  font-size: 12px;
  font-weight: 900;
  transform: translateX(-50%);
  pointer-events: none;
}

.loading {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  visibility: hidden;
  opacity: 0;
  background: #5fc8ef;
  color: #fff9d8;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.16em;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.loading.active {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.loading-pig {
  position: relative;
  width: 75px;
  height: 67px;
  border: 5px solid #633652;
  border-radius: 50%;
  background: #ff7fa1;
  box-shadow: inset 0 -9px 0 rgba(181, 53, 93, 0.23), 0 9px 0 rgba(38, 54, 61, 0.13);
  animation: loading-hop 800ms ease-in-out infinite alternate;
}

.loading-pig::before {
  content: "";
  position: absolute;
  left: 17px;
  bottom: 12px;
  width: 32px;
  height: 21px;
  border: 3px solid #713a59;
  border-radius: 50%;
  background: #ffadc0;
}

.loading-pig::after {
  content: "•  •";
  position: absolute;
  left: 23px;
  bottom: 10px;
  color: #713a59;
  font-size: 18px;
  letter-spacing: 7px;
}

.loading-pig i {
  position: absolute;
  top: 16px;
  width: 13px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 -5px 0 #efedf4;
}

.loading-pig i:first-child { left: 18px; }
.loading-pig i:last-child { right: 18px; }

.error-message {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 20px;
  display: none;
  width: min(620px, calc(100vw - 32px));
  padding: 15px 18px;
  border-radius: 14px;
  background: #8e2e3a;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.error-message.visible {
  display: block;
}

@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -5px); }
}

@keyframes score-float {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -65px) scale(0.92); }
}

@keyframes star-in {
  0% { opacity: 0; transform: scale(0.2) rotate(-45deg); }
  58% { opacity: 1; transform: scale(1.25) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes loading-hop {
  to { transform: translateY(-10px) rotate(4deg); }
}

@media (max-width: 760px) {
  .map-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .map-header {
    grid-template-columns: auto 1fr;
  }

  .header-spacer {
    display: none;
  }

  .map-heading h2 {
    font-size: 29px;
  }

  .hud {
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
  }

  .hud-left,
  .score-panel,
  .pigs-panel {
    min-height: 56px;
    border-radius: 15px;
  }

  .hud-left {
    padding: 6px;
  }

  .hud-buttons {
    gap: 4px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 21px;
  }

  .level-label {
    display: none;
  }

  .score-panel {
    min-width: 123px;
    padding: 7px 12px 5px;
  }

  .score-panel strong {
    font-size: 23px;
  }

  .pigs-panel {
    min-width: 106px;
    padding: 6px 8px;
  }

  .pig-icons {
    gap: 2px;
  }

  .mini-pig {
    width: 18px;
    height: 15px;
  }

  .mini-pig::before,
  .mini-pig::after {
    display: none;
  }

  .result-panel,
  .game-over-panel {
    max-height: 94vh;
    overflow-y: auto;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .game-logo {
    font-size: clamp(55px, 15vh, 87px);
    margin-bottom: 26px;
  }

  .button-huge {
    min-height: 60px;
    font-size: 26px;
  }

  #map-screen {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .map-header {
    min-height: 57px;
    margin-bottom: 10px;
  }

  .map-heading h2 {
    font-size: 27px;
  }

  .map-heading p {
    margin-top: 2px;
    font-size: 12px;
  }

  .map-grid {
    gap: 10px;
  }

  .map-card {
    min-height: 145px;
  }

  .map-card-overlay {
    padding: 11px 15px 9px;
    background: linear-gradient(transparent 15%, rgba(28, 21, 38, 0.93) 73%);
  }

  .map-card h3 {
    font-size: 20px;
  }

  .card-stars {
    font-size: 18px;
  }

  .hud {
    top: 7px;
  }

  .aim-hint {
    bottom: 9px;
  }

  .result-panel,
  .game-over-panel {
    width: min(680px, 94vw);
    padding: 17px 25px;
  }

  .result-panel h2 {
    font-size: 34px;
  }

  .result-stars {
    min-height: 58px;
    margin: 8px 0 0;
    font-size: 52px;
  }

  .result-stats {
    margin: 5px auto 12px;
  }

  .result-stat {
    padding: 8px;
  }

  .result-actions .button {
    min-height: 43px;
    padding: 9px 16px 7px;
  }

  .game-over-panel h2 {
    font-size: 56px;
  }

  .final-summary {
    margin: 12px 0 8px;
  }

  .button-wide {
    margin-top: 10px;
  }
}

@media (orientation: portrait) and (max-width: 620px) {
  #rotate-hint {
    display: block;
  }

  body:not(.playing) #rotate-hint {
    display: none;
  }

  .aim-hint {
    bottom: 58px;
  }
}

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