:root {
  --ink: #14213d;
  --ink-soft: #52617c;
  --paper: rgba(255, 255, 255, 0.91);
  --paper-strong: #fffdf7;
  --blue: #3d87f5;
  --blue-dark: #245ebc;
  --yellow: #ffc928;
  --orange: #f07836;
  --pink: #f25f80;
  --shadow: 0 18px 45px rgba(17, 38, 78, 0.22);
  --soft-shadow: 0 8px 20px rgba(17, 38, 78, 0.16);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: #77c9ed;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 280px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
.map-card:focus-visible {
  outline: 4px solid rgba(255, 214, 56, 0.9);
  outline-offset: 3px;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  z-index: 0;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(15, 30, 65, 0.18) 100%);
}

.screen,
.modal-overlay,
.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.screen {
  transition: opacity 280ms ease, transform 280ms ease;
}

.screen.is-hidden,
.modal-overlay.is-hidden,
.loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.025);
}

.start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 24px 28px;
  text-align: center;
}

.title-badge {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 21px 30px 17px;
  border: 4px solid rgba(255, 255, 255, 0.83);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 45px rgba(31, 85, 143, 0.2);
  transform: rotate(-1.2deg);
}

.title-kicker,
.eyebrow {
  color: #fff8d9;
  font-size: clamp(0.6rem, 1.1vw, 0.78rem);
  font-weight: 900;
  letter-spacing: 0.19em;
  text-shadow: 0 2px 3px rgba(19, 51, 84, 0.28);
}

.title-badge h1 {
  position: relative;
  z-index: 1;
  margin: 4px 0 0;
  color: #fffdf5;
  font-size: clamp(3.3rem, 10vw, 8.1rem);
  font-weight: 1000;
  letter-spacing: -0.075em;
  line-height: 0.9;
  text-shadow:
    0 5px 0 #e65870,
    0 10px 0 rgba(114, 42, 64, 0.22),
    0 14px 24px rgba(30, 72, 119, 0.3);
}

.title-badge h1 span {
  color: #ffd33f;
  text-shadow:
    0 5px 0 #e68b22,
    0 10px 0 rgba(114, 42, 64, 0.22),
    0 14px 24px rgba(30, 72, 119, 0.3);
}

.title-pig-mark {
  position: absolute;
  right: -17px;
  bottom: -23px;
  width: 64px;
  height: 58px;
  border: 4px solid #c54562;
  border-radius: 48% 48% 45% 45%;
  background: #f47b93;
  box-shadow: 0 5px 0 #a93854, 0 9px 16px rgba(30, 72, 119, 0.28);
  transform: rotate(8deg);
}

.mark-ear {
  position: absolute;
  top: -16px;
  width: 20px;
  height: 22px;
  border: 3px solid #c54562;
  border-radius: 60% 35% 60% 35%;
  background: #f47b93;
}

.mark-ear.left {
  left: 5px;
  transform: rotate(-28deg);
}

.mark-ear.right {
  right: 5px;
  transform: rotate(28deg) scaleX(-1);
}

.mark-eye {
  position: absolute;
  top: 17px;
  width: 11px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
}

.mark-eye::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 5px;
  height: 6px;
  border-radius: 50%;
  background: #17213c;
}

.mark-eye.left {
  left: 13px;
}

.mark-eye.right {
  right: 13px;
}

.mark-snout {
  position: absolute;
  left: 18px;
  bottom: 8px;
  width: 27px;
  height: 16px;
  border-radius: 45%;
  background: #e85d78;
}

.mark-snout::before,
.mark-snout::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 5px;
  height: 6px;
  border-radius: 50%;
  background: #9c3650;
}

.mark-snout::before {
  left: 6px;
}

.mark-snout::after {
  right: 6px;
}

.primary-button,
.secondary-button,
.hud-button,
.round-button {
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease, background 130ms ease;
}

.primary-button {
  min-width: 190px;
  min-height: 62px;
  margin-top: 38px;
  padding: 12px 36px;
  border: 3px solid #fff5c5;
  border-radius: 21px;
  background: linear-gradient(180deg, #ffd94a, #f39a29);
  box-shadow: 0 7px 0 #bb6524, 0 14px 25px rgba(65, 54, 23, 0.28);
  color: #5b351c;
  font-size: 1.12rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.primary-button:hover {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-3px) scale(1.025);
  box-shadow: 0 10px 0 #bb6524, 0 18px 29px rgba(65, 54, 23, 0.28);
}

.primary-button:active,
.secondary-button:active,
.hud-button:active,
.round-button:active {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.compact-button {
  min-width: 126px;
  min-height: 49px;
  margin-top: 0;
  padding: 9px 20px;
  font-size: 0.9rem;
}

.start-footer {
  margin-top: 37px;
  color: rgba(255, 255, 255, 0.93);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-shadow: 0 2px 4px rgba(21, 64, 101, 0.35);
}

.map-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(18px, 4vh, 44px) clamp(18px, 6vw, 100px) 24px;
  overflow: auto;
}

.map-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  width: min(1100px, 100%);
  margin: 0 auto clamp(18px, 3vh, 34px);
}

.map-header h2 {
  margin: 3px 0 0;
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 1000;
  letter-spacing: -0.06em;
  line-height: 0.9;
  text-shadow: 0 4px 0 rgba(45, 91, 145, 0.3), 0 7px 14px rgba(16, 44, 75, 0.24);
}

.round-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--soft-shadow);
  color: var(--blue-dark);
  font-size: 1.65rem;
  font-weight: 900;
}

.round-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.total-stars {
  align-self: center;
  padding: 11px 15px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 15px;
  background: rgba(15, 52, 92, 0.26);
  color: #fff;
  font-size: clamp(0.72rem, 1.8vw, 0.92rem);
  font-weight: 900;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.star-glyph {
  color: var(--yellow);
  font-size: 1.3em;
  text-shadow: 0 1px 2px #9b691c;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(13px, 2.2vw, 25px);
  width: min(1100px, 100%);
  margin: 0 auto;
}

.map-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(135px, 0.75fr) 1fr;
  min-height: 190px;
  overflow: hidden;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.map-card:not(.locked):hover {
  transform: translateY(-7px) rotate(-0.4deg);
  box-shadow: 0 24px 47px rgba(17, 38, 78, 0.3);
}

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

.map-card.locked {
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.map-thumb {
  position: relative;
  min-height: 190px;
  overflow: hidden;
}

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

.thumb-label {
  position: absolute;
  left: 13px;
  bottom: 10px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.32);
}

.theme-sunny {
  background: linear-gradient(180deg, #68cbf1 0 58%, #70c75f 59%);
}

.theme-sunny::before {
  left: 19px;
  top: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffd94b;
  box-shadow: 0 0 0 8px rgba(255, 217, 75, 0.18), 0 0 22px rgba(255, 214, 66, 0.5);
}

.theme-sunny::after {
  right: -15px;
  bottom: 28px;
  width: 135px;
  height: 70px;
  border-radius: 70% 70% 0 0;
  background: #5ba552;
  box-shadow: -72px 15px 0 -5px #80ce68;
}

.theme-canyon {
  background: linear-gradient(180deg, #e99170 0 58%, #b66a3c 59%);
}

.theme-canyon::before {
  left: -15px;
  bottom: 34px;
  width: 140px;
  height: 92px;
  background: #9f563b;
  clip-path: polygon(0 100%, 14% 46%, 28% 63%, 44% 10%, 58% 54%, 75% 25%, 100% 100%);
}

.theme-canyon::after {
  right: 17px;
  top: 28px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffd575;
  box-shadow: 0 0 23px rgba(255, 192, 93, 0.7);
}

.theme-frozen {
  background: linear-gradient(180deg, #172c66 0 59%, #cbe9f5 60%);
}

.theme-frozen::before {
  right: 22px;
  top: 20px;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: #e9f8ff;
  box-shadow: 0 0 0 8px rgba(173, 218, 255, 0.14), 0 0 18px #aee8ff;
}

.theme-frozen::after {
  left: 15px;
  bottom: 27px;
  width: 35px;
  height: 65px;
  background: #1d5278;
  clip-path: polygon(50% 0, 100% 38%, 74% 38%, 94% 66%, 66% 66%, 83% 100%, 17% 100%, 34% 66%, 6% 66%, 26% 38%, 0 38%);
  box-shadow: 62px 10px 0 #245e87, 123px -1px 0 #1c4d78;
}

.theme-volcanic {
  background: linear-gradient(180deg, #4a1928 0 57%, #221b27 58%);
}

.theme-volcanic::before {
  left: -13px;
  bottom: 35px;
  width: 165px;
  height: 100px;
  background: #17151f;
  clip-path: polygon(0 100%, 22% 33%, 36% 58%, 54% 8%, 68% 54%, 84% 28%, 100% 100%);
}

.theme-volcanic::after {
  right: 20px;
  bottom: 25px;
  width: 10px;
  height: 115px;
  border-radius: 50%;
  background: #ff8a31;
  box-shadow: 0 0 17px #ff6c22, -43px 45px 0 -4px #eb5a22;
  transform: rotate(14deg);
}

.map-card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 17px 18px 15px;
}

.map-number {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.map-card h3 {
  margin: 3px 0 12px;
  color: var(--ink);
  font-size: clamp(1.02rem, 2vw, 1.34rem);
  font-weight: 1000;
  letter-spacing: -0.035em;
  line-height: 1;
}

.card-score {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.card-score strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.card-stars,
.result-stars {
  display: flex;
  gap: 5px;
}

.card-stars {
  margin-top: 10px;
}

.star {
  color: #c9d0db;
  font-size: 1.3rem;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(34, 48, 76, 0.1);
}

.star.is-earned {
  color: var(--yellow);
  text-shadow: 0 2px 2px #b77b26;
}

.lock-icon {
  position: absolute;
  right: 15px;
  top: 13px;
  z-index: 3;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: rgba(20, 33, 61, 0.72);
  color: #fff;
  font-size: 1rem;
}

.map-tip {
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 0 2px 4px rgba(19, 46, 79, 0.3);
}

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

.game-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 15px 18px;
}

.hud-panel {
  border: 2px solid rgba(255, 255, 255, 0.64);
  border-radius: 17px;
  background: rgba(20, 40, 71, 0.49);
  box-shadow: 0 7px 18px rgba(10, 23, 48, 0.17);
  color: #fff;
  backdrop-filter: blur(7px);
}

.hud-left {
  justify-self: start;
  padding: 8px 11px 9px;
}

.hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hud-button {
  min-height: 29px;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font-size: 0.61rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  pointer-events: auto;
}

.hud-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.level-label {
  max-width: 260px;
  margin-top: 8px;
  overflow: hidden;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-panel {
  display: flex;
  min-width: 156px;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  padding: 8px 20px 9px;
  transform: rotate(-1deg);
}

.hud-caption {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.63rem;
  font-weight: 1000;
  letter-spacing: 0.16em;
}

.score-panel strong {
  margin-top: 1px;
  color: #fff5a8;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 1000;
  letter-spacing: 0.03em;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(20, 32, 62, 0.45);
}

.pigs-panel {
  justify-self: end;
  min-width: 135px;
  padding: 8px 11px 9px;
}

.pigs-panel .hud-caption {
  display: block;
  text-align: right;
}

.pigs-panel .hud-caption strong {
  color: #fff;
  font-size: 0.86rem;
}

.pig-icons {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 6px;
}

.pig-icon {
  position: relative;
  width: 19px;
  height: 16px;
  border: 2px solid #b7375d;
  border-radius: 50%;
  background: #f47791;
  box-shadow: 0 2px 0 #8e2d4c;
}

.pig-icon::before,
.pig-icon::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 6px;
  height: 6px;
  border: 1px solid #b7375d;
  border-radius: 50% 50% 30% 30%;
  background: #f47791;
}

.pig-icon::before {
  left: 1px;
}

.pig-icon::after {
  right: 1px;
}

.pig-icon.is-used {
  filter: grayscale(1);
  opacity: 0.23;
  box-shadow: none;
}

.aim-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: rgba(15, 37, 65, 0.38);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 260ms ease, transform 260ms ease;
}

.aim-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.orientation-hint {
  position: absolute;
  right: 17px;
  bottom: 16px;
  display: none;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(20, 40, 71, 0.4);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.modal-overlay {
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 21, 43, 0.62);
  backdrop-filter: blur(3px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.result-panel,
.game-over-panel {
  width: min(480px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 3px solid rgba(255, 255, 255, 0.93);
  border-radius: 29px;
  background: var(--paper-strong);
  box-shadow: 0 28px 75px rgba(5, 14, 34, 0.4);
  text-align: center;
}

.result-ribbon {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 8px;
  background: #dff3ff;
  color: #3a76aa;
  font-size: 0.61rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.result-panel h2,
.game-over-panel h2 {
  margin: 12px 0 12px;
  color: var(--blue);
  font-size: clamp(2rem, 7vw, 3.45rem);
  font-weight: 1000;
  letter-spacing: -0.075em;
  line-height: 0.95;
  text-shadow: 0 3px 0 #c3ddfa;
}

.result-stars {
  justify-content: center;
  gap: 12px;
  min-height: 40px;
  margin: 4px 0 16px;
}

.result-stars .star {
  font-size: 2.3rem;
  transform: scale(0.7);
  opacity: 0;
  animation: star-pop 420ms cubic-bezier(0.17, 0.89, 0.32, 1.3) forwards;
}

.result-stars .star:nth-child(2) {
  animation-delay: 180ms;
}

.result-stars .star:nth-child(3) {
  animation-delay: 360ms;
}

@keyframes star-pop {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-25deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.15) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.result-stats,
.final-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 auto 21px;
}

.result-stats > div,
.final-stats > div {
  padding: 9px 5px;
  border-radius: 13px;
  background: #edf5ff;
}

.result-stats span,
.final-stats span {
  display: block;
  color: #6f7e99;
  font-size: 0.54rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.result-stats strong,
.final-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(0.88rem, 3.4vw, 1.17rem);
  font-weight: 1000;
}

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

.secondary-button {
  min-height: 49px;
  padding: 9px 15px;
  border: 2px solid #c5d5ed;
  border-radius: 14px;
  background: #eef5ff;
  box-shadow: 0 4px 0 #c3d1e4;
  color: #385270;
  font-size: 0.69rem;
  font-weight: 1000;
  letter-spacing: 0.09em;
}

.secondary-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.game-over-panel {
  width: min(540px, 100%);
  background: linear-gradient(145deg, #fffdf7, #eff7ff);
}

.game-over-panel .eyebrow {
  color: #de7441;
  text-shadow: none;
}

.game-over-panel h2 {
  margin-top: 9px;
  color: #e45154;
  font-size: clamp(2.9rem, 10vw, 5rem);
  text-shadow: 0 4px 0 #f8c2a6;
}

.game-over-subtitle {
  margin: 0 auto 20px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.final-stats {
  grid-template-columns: repeat(2, 1fr);
  max-width: 310px;
}

.final-star-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 310px;
  margin: 5px auto 25px;
}

.final-star-group {
  display: flex;
  justify-content: center;
  gap: 1px;
  padding: 7px 4px;
  border-radius: 10px;
  background: rgba(211, 230, 250, 0.55);
}

.final-star-group .star {
  font-size: 1.12rem;
}

.game-over-panel .primary-button {
  margin-top: 0;
}

#fx-ui {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.score-pop {
  position: absolute;
  color: #fff5a1;
  font-size: 1rem;
  font-weight: 1000;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 #8e5b25, 0 3px 8px rgba(12, 22, 42, 0.38);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.loading-screen {
  display: grid;
  place-items: center;
  gap: 12px;
  background: #76c9eb;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 1000;
  letter-spacing: 0.18em;
  transition: opacity 360ms ease;
}

.loading-pig {
  position: relative;
  width: 54px;
  height: 45px;
  border: 4px solid #c54462;
  border-radius: 50%;
  background: #f47b93;
  box-shadow: 0 5px 0 #a43853;
  animation: loading-bounce 700ms ease-in-out infinite alternate;
}

.loading-pig::before {
  content: "••";
  position: absolute;
  left: 15px;
  bottom: 6px;
  color: #a53b57;
  font-size: 1rem;
  letter-spacing: 8px;
}

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

@media (max-width: 760px) {
  .map-screen {
    padding-inline: 14px;
  }

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

  .total-stars {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: -5px;
  }

  .map-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .map-card {
    min-height: 155px;
    grid-template-columns: 0.8fr 1.2fr;
  }

  .map-thumb {
    min-height: 155px;
  }

  .game-hud {
    grid-template-columns: 1fr auto;
    gap: 7px;
    padding: 9px;
  }

  .score-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    min-width: 125px;
    padding: 6px 13px 7px;
  }

  .score-panel strong {
    font-size: 1.35rem;
  }

  .pigs-panel {
    min-width: 112px;
  }

  .hud-left {
    padding: 6px 7px 7px;
  }

  .hud-button {
    min-height: 27px;
    padding-inline: 7px;
    font-size: 0.54rem;
  }

  .level-label {
    max-width: 190px;
    margin-top: 5px;
    font-size: 0.56rem;
  }

  .aim-hint {
    bottom: 17px;
    font-size: 0.54rem;
  }
}

@media (max-width: 440px) {
  .title-badge {
    padding-inline: 19px;
  }

  .title-badge h1 {
    font-size: clamp(2.6rem, 14vw, 4.2rem);
  }

  .title-pig-mark {
    right: -14px;
    width: 52px;
    height: 47px;
  }

  .map-card-content {
    padding: 12px 12px 11px;
  }

  .map-card h3 {
    margin-bottom: 8px;
    font-size: 0.95rem;
  }

  .result-stats {
    gap: 5px;
  }

  .result-stats span {
    font-size: 0.47rem;
  }

  .result-stats strong {
    font-size: 0.79rem;
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  .orientation-hint {
    display: block;
  }
}

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