@font-face {
  font-family: 'Luckiest Guy';
  src: url('assets/fonts/LuckiestGuy.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #3b2417;
  --ink-soft: #573623;
  --cream: #fff2d2;
  --cream-deep: #f4dda9;
  --paper: #fff7e4;
  --amber: #ffc63d;
  --amber-deep: #f49a1c;
  --orange: #ee7924;
  --red: #c94735;
  --red-deep: #812a22;
  --green: #76b94b;
  --sky: #7ed4f2;
  --shadow: rgba(35, 20, 11, 0.36);
  --stage-font: 'Nunito', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1216;
  color: var(--ink);
  font-family: var(--stage-font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body {
  cursor: default;
}

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

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 3px solid #ffe69a;
  outline-offset: 4px;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 28% 35%, rgba(56, 87, 93, 0.34), transparent 52%),
    radial-gradient(ellipse at 80% 75%, rgba(121, 73, 37, 0.24), transparent 48%),
    linear-gradient(150deg, #0c171b, #090f12 62%, #140f0c);
}

#viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 241, 204, 0.022) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(0deg, rgba(255, 241, 204, 0.015) 0 1px, transparent 1px 90px);
  opacity: 0.8;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 900px;
  overflow: hidden;
  transform-origin: top left;
  background: #7dcfe9;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.6);
  isolation: isolate;
}

.scene-canvas {
  position: absolute;
  inset: 0;
  width: 1600px;
  height: 900px;
  display: block;
  transition: opacity 0.35s ease;
}

#gameCanvas {
  cursor: grab;
  touch-action: none;
}

body.is-dragging #gameCanvas {
  cursor: grabbing;
}

.film-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.11;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 4;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  font-family: 'Luckiest Guy', var(--stage-font);
  letter-spacing: 1.2px;
  line-height: 1;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  transform-origin: center bottom;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.045);
}

.btn:active {
  transform: translateY(3px);
}

.btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-play {
  background: linear-gradient(180deg, #ffe47a 0%, #ffc53c 54%, #f0a01f 100%);
  color: #45250f;
  border-color: #3d2418;
  box-shadow:
    0 9px 0 #3d2418,
    0 14px 0 rgba(50, 28, 12, 0.18),
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 -5px 0 rgba(161, 85, 15, 0.28);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.btn-play:hover {
  box-shadow:
    0 11px 0 #3d2418,
    0 17px 0 rgba(50, 28, 12, 0.16),
    inset 0 3px 0 rgba(255, 255, 255, 0.6),
    inset 0 -5px 0 rgba(161, 85, 15, 0.24);
}

.btn-play:active {
  box-shadow:
    0 4px 0 #3d2418,
    inset 0 3px 0 rgba(255, 255, 255, 0.45);
}

.btn-wood {
  background: linear-gradient(180deg, #b97945 0%, #955a31 100%);
  color: #fff1cd;
  border-color: #3e2719;
  box-shadow:
    0 6px 0 #3e2719,
    inset 0 2px 0 rgba(255, 236, 201, 0.24),
    inset 0 -4px 0 rgba(47, 26, 13, 0.3);
  text-shadow: 0 2px 0 rgba(53, 28, 13, 0.55);
}

.btn-ghost {
  background: rgba(255, 246, 224, 0.93);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow:
    0 6px 0 var(--ink),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.btn-small {
  min-height: 54px;
  padding: 0 26px;
  font-size: 20px;
  border-width: 3px;
  border-radius: 14px;
}

.btn-play.btn-small {
  min-height: 56px;
}

.btn-compact {
  min-height: 50px;
  padding: 0 30px;
  font-size: 20px;
  border-width: 3px;
  box-shadow: 0 5px 0 #3d2418;
}

.btn-play-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #432515;
  color: #ffe06e;
  flex: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16);
}

.btn-play-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: currentColor;
  transform: translateX(2px);
}

.btn-play-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.btn-main {
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 32px;
  letter-spacing: 2px;
}

.btn-sub {
  font-family: var(--stage-font);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.6px;
  opacity: 0.72;
  text-transform: uppercase;
}

.round-button {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #fff8e6, #eed9ad);
  color: var(--ink);
  box-shadow:
    0 5px 0 rgba(56, 33, 18, 0.8),
    0 8px 16px rgba(0, 0, 0, 0.18),
    inset 0 2px 0 #fffdf3;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.round-button:hover {
  transform: translateY(-2px) rotate(-2deg);
  filter: brightness(1.04);
}

.round-button:active {
  transform: translateY(2px);
}

.round-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================================================================
   MENU
   ================================================================ */
.menu-screen {
  z-index: 5;
}

.menu-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(38, 22, 11, 0.55) 0%, rgba(42, 24, 12, 0.24) 38%, transparent 66%),
    linear-gradient(0deg, rgba(28, 17, 10, 0.56) 0%, transparent 26%),
    radial-gradient(ellipse at 22% 45%, rgba(42, 22, 10, 0.2), transparent 58%);
}

.menu-top {
  position: absolute;
  top: 30px;
  left: 42px;
  right: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.edition-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(34, 21, 13, 0.47);
  border: 1px solid rgba(255, 237, 196, 0.28);
  color: rgba(255, 242, 213, 0.9);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 2px;
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.edition-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd15d;
  box-shadow: 0 0 0 3px rgba(255, 209, 93, 0.16);
}

.edition-sep {
  opacity: 0.4;
}

.audio-button {
  flex: none;
}

.audio-button .sound-slash {
  display: none;
}

.audio-button.is-muted .sound-wave {
  display: none;
}

.audio-button.is-muted .sound-slash {
  display: block;
  stroke: #a6352c;
}

.menu-hero {
  position: absolute;
  left: 88px;
  top: 142px;
  width: 840px;
  z-index: 2;
  animation: heroIn 0.7s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffe8b0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3.8px;
  text-shadow: 0 2px 3px rgba(54, 27, 11, 0.45);
  white-space: nowrap;
}

.kicker-line {
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 229, 169, 0.75));
  flex: none;
}

.kicker-line:last-child {
  background: linear-gradient(90deg, rgba(255, 229, 169, 0.75), transparent);
}

.logo {
  margin: 21px 0 0 -4px;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-weight: 400;
  line-height: 0.76;
  transform: rotate(-2.2deg);
  transform-origin: left center;
  filter: drop-shadow(0 13px 0 rgba(53, 26, 12, 0.22)) drop-shadow(0 22px 28px rgba(23, 10, 5, 0.24));
}

.logo span {
  display: block;
}

.logo-angry {
  padding-left: 8px;
  font-size: 70px;
  letter-spacing: 11px;
  color: #fff5db;
  -webkit-text-stroke: 9px #3a2115;
  paint-order: stroke fill;
  text-shadow:
    0 5px 0 #a6412e,
    0 9px 0 rgba(58, 33, 21, 0.2);
}

.logo-aviators {
  margin-top: 5px;
  font-size: 158px;
  letter-spacing: -5px;
  background: linear-gradient(180deg, #fff1a4 0%, #ffd24f 45%, #f6a11c 75%, #e77b13 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 10px #3a2115;
  paint-order: stroke fill;
  filter: drop-shadow(0 7px 0 rgba(255, 244, 203, 0.22)) drop-shadow(0 11px 0 #a94b21);
}

.tagline {
  margin: 33px 0 0 5px;
  max-width: 600px;
  color: #fff4d9;
  font-size: 22px;
  line-height: 1.46;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 6px rgba(44, 21, 9, 0.45);
}

.tagline em {
  color: #ffd36b;
  font-style: normal;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
  margin-top: 31px;
  margin-left: 4px;
}

#btnPlay {
  width: 388px;
  min-height: 80px;
  justify-content: flex-start;
  padding: 8px 25px;
  border-radius: 20px;
}

#btnPlay .btn-main {
  font-size: 36px;
  letter-spacing: 3px;
}

#btnPlay .btn-play-icon {
  width: 51px;
  height: 51px;
}

.menu-secondary {
  display: flex;
  gap: 14px;
}

.menu-secondary .btn svg {
  width: 19px;
  height: 19px;
}

.menu-save-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 25px 0 0 8px;
  color: rgba(255, 243, 215, 0.77);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(44, 21, 9, 0.5);
}

.star-strip {
  display: inline-flex;
  gap: 1px;
  color: #ffcf54;
  font-size: 15px;
  letter-spacing: -1px;
  text-shadow: 0 2px 0 rgba(67, 33, 14, 0.45);
}

.menu-footer {
  position: absolute;
  left: 49px;
  right: 49px;
  bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  color: rgba(255, 239, 208, 0.75);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.9px;
  text-shadow: 0 1px 3px rgba(45, 22, 10, 0.5);
}

.control-hint {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint-divider {
  width: 18px;
  height: 1px;
  background: rgba(255, 243, 213, 0.35);
  margin: 0 2px;
}

.mouse-glyph {
  width: 14px;
  height: 20px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 7px;
  position: relative;
  opacity: 0.9;
}

.mouse-glyph::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 5px;
  background: currentColor;
  border-radius: 2px;
  left: 50%;
  top: 3px;
  transform: translateX(-50%);
}

.footer-credit {
  opacity: 0.74;
}

/* ================================================================
   LEVEL SELECT
   ================================================================ */
.level-screen {
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 211, 121, 0.1), transparent 50%),
    linear-gradient(180deg, rgba(14, 21, 24, 0.58), rgba(10, 16, 18, 0.76));
  backdrop-filter: blur(3px) saturate(0.92);
  animation: screenFade 0.25s ease both;
}

.level-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 237, 197, 0.12) 1px, transparent 1.5px);
  background-size: 32px 32px;
  opacity: 0.17;
  mask-image: linear-gradient(180deg, transparent 10%, black 35%, transparent 92%);
}

.level-header {
  position: absolute;
  top: 41px;
  left: 82px;
  right: 82px;
  display: flex;
  align-items: center;
  z-index: 2;
}

.back-button {
  position: relative;
  left: 0;
}

.level-heading {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}

.level-heading .kicker {
  justify-content: center;
  font-size: 11px;
  letter-spacing: 3.2px;
  color: rgba(255, 235, 190, 0.82);
}

.level-heading .kicker-line {
  width: 24px;
}

.level-heading h2 {
  margin: 6px 0 0;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 47px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #fff3d2;
  text-shadow:
    0 4px 0 #4b2a18,
    0 9px 18px rgba(0, 0, 0, 0.32);
}

.level-heading h2 span {
  color: #ffd257;
}

.total-stars {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid rgba(255, 238, 198, 0.26);
  border-radius: 999px;
  background: rgba(34, 23, 14, 0.5);
  color: #ffe6a0;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 25px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.total-stars .big-star {
  width: 22px;
  height: 22px;
  fill: #ffcf4d;
  stroke: #7d4e1c;
  stroke-width: 1.4;
}

.total-stars small {
  font-family: var(--stage-font);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 237, 198, 0.54);
  margin-left: -3px;
}

.level-grid {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: 1436px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 19px;
  z-index: 2;
}

.level-card {
  position: relative;
  height: 204px;
  overflow: hidden;
  border: 3px solid rgba(48, 30, 18, 0.9);
  border-radius: 17px;
  padding: 0;
  text-align: left;
  background: #567c86;
  box-shadow:
    0 8px 0 rgba(24, 14, 9, 0.5),
    0 13px 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.16s ease, filter 0.16s ease;
}

.level-card:not(.locked):hover {
  transform: translateY(-6px) rotate(-0.35deg);
  box-shadow:
    0 13px 0 rgba(24, 14, 9, 0.45),
    0 20px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.level-card:not(.locked):active {
  transform: translateY(-2px);
}

.level-card.locked {
  cursor: not-allowed;
  filter: saturate(0.62) brightness(0.78);
}

.card-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #67c9eb 0%, #b9ecf8 63%, #d8eec5 100%);
}

.level-card[data-theme='golden'] .card-sky {
  background: linear-gradient(180deg, #de7f58 0%, #f4bb77 52%, #f7dfa6 100%);
}

.level-card[data-theme='dusk'] .card-sky {
  background: linear-gradient(180deg, #4a3a72 0%, #a35e8b 55%, #e8a678 100%);
}

.level-card[data-theme='night'] .card-sky {
  background: linear-gradient(180deg, #14223d 0%, #2d4f6e 58%, #6f7f84 100%);
}

.card-sun {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  right: 58px;
  top: 21px;
  background: rgba(255, 247, 189, 0.88);
  box-shadow: 0 0 30px rgba(255, 233, 153, 0.5);
}

.level-card[data-theme='night'] .card-sun {
  width: 38px;
  height: 38px;
  right: 70px;
  top: 24px;
  background: #f0ecd3;
  box-shadow: 0 0 26px rgba(205, 226, 255, 0.4);
}

.card-cloud {
  position: absolute;
  height: 15px;
  width: 56px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
  filter: blur(0.2px);
}

.card-cloud::before,
.card-cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.card-cloud::before {
  width: 24px;
  height: 24px;
  left: 8px;
  bottom: 1px;
}

.card-cloud::after {
  width: 31px;
  height: 31px;
  left: 24px;
  bottom: 0;
}

.card-cloud.one {
  left: 39px;
  top: 40px;
  transform: scale(0.7);
  opacity: 0.5;
}

.card-cloud.two {
  left: 150px;
  top: 61px;
  transform: scale(0.45);
  opacity: 0.35;
}

.card-hill {
  position: absolute;
  left: -40px;
  right: -40px;
  bottom: 22px;
  height: 68px;
  border-radius: 50% 50% 0 0;
  background: rgba(86, 154, 83, 0.68);
}

.card-hill.b {
  left: 45%;
  right: -70px;
  bottom: 12px;
  height: 84px;
  background: rgba(61, 128, 72, 0.75);
}

.level-card[data-theme='golden'] .card-hill {
  background: rgba(132, 138, 68, 0.72);
}

.level-card[data-theme='golden'] .card-hill.b {
  background: rgba(103, 112, 55, 0.82);
}

.level-card[data-theme='dusk'] .card-hill {
  background: rgba(74, 67, 87, 0.74);
}

.level-card[data-theme='dusk'] .card-hill.b {
  background: rgba(54, 55, 65, 0.8);
}

.level-card[data-theme='night'] .card-hill {
  background: rgba(33, 58, 59, 0.9);
}

.level-card[data-theme='night'] .card-hill.b {
  background: rgba(23, 44, 46, 0.95);
}

.card-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(180deg, #6fa640 0%, #46702f 48%, #5a3e26 100%);
  border-top: 2px solid rgba(45, 76, 30, 0.35);
}

.level-card[data-theme='golden'] .card-ground {
  background: linear-gradient(180deg, #b09d48 0%, #7d7735 45%, #5d4228 100%);
}

.level-card[data-theme='dusk'] .card-ground {
  background: linear-gradient(180deg, #6e7f4c 0%, #495538 45%, #473427 100%);
}

.level-card[data-theme='night'] .card-ground {
  background: linear-gradient(180deg, #365b46 0%, #223b30 45%, #33271e 100%);
}

.level-thumb {
  position: absolute;
  right: 7px;
  bottom: 36px;
  width: 194px;
  height: 128px;
  pointer-events: none;
  filter: drop-shadow(0 4px 3px rgba(20, 18, 10, 0.2));
  z-index: 2;
}

.mini-fort {
  position: absolute;
  right: 38px;
  bottom: 34px;
  width: 147px;
  height: 107px;
  opacity: 0.94;
}

.mini-block {
  position: absolute;
  bottom: 0;
  background: linear-gradient(180deg, #bd8351, #84502d);
  border: 1.5px solid rgba(58, 33, 17, 0.85);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 229, 177, 0.3);
}

.mini-block.vertical {
  width: 11px;
  height: var(--h, 50px);
  left: var(--x, 10px);
}

.mini-block.horizontal {
  height: 9px;
  width: var(--w, 62px);
  left: var(--x, 10px);
  bottom: var(--b, 48px);
}

.mini-block.stone {
  background: linear-gradient(180deg, #b0b4ac, #737a74);
}

.mini-block.ice {
  background: linear-gradient(180deg, rgba(206, 247, 255, 0.92), rgba(116, 192, 220, 0.9));
  border-color: rgba(64, 118, 136, 0.9);
}

.mini-pig {
  position: absolute;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b7df77, #70a844 68%, #568334);
  border: 1.5px solid #364423;
  bottom: var(--b, 55px);
  left: var(--x, 60px);
  box-shadow: inset -2px -2px 0 rgba(54, 78, 31, 0.18);
}

.mini-pig::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 8px;
  border-radius: 50%;
  background: #91c557;
  border: 1px solid rgba(54, 68, 36, 0.6);
  left: 50%;
  top: 9px;
  transform: translateX(-50%);
}

.mini-pig::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #3c4a29;
  left: 6px;
  top: 7px;
  box-shadow: 9px 0 0 #3c4a29;
}

.card-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 22, 23, 0.18) 0%, transparent 31%),
    linear-gradient(0deg, rgba(18, 19, 15, 0.74) 0%, rgba(18, 19, 15, 0.22) 42%, transparent 63%);
}

.card-level {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 28px;
  color: rgba(255, 248, 226, 0.96);
  text-shadow: 0 2px 0 rgba(55, 28, 12, 0.55);
  letter-spacing: 0.5px;
  z-index: 3;
}

.card-name {
  position: absolute;
  left: 16px;
  bottom: 13px;
  right: 96px;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 22px;
  letter-spacing: 0.4px;
  line-height: 1.05;
  color: #fff4d7;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.58);
  z-index: 3;
}

.card-stars {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  gap: 2px;
  font-size: 20px;
  color: rgba(255, 243, 208, 0.24);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.card-stars .earned {
  color: #ffd35c;
  text-shadow: 0 1px 0 #71401c, 0 0 8px rgba(255, 206, 77, 0.3);
}

.card-rank {
  position: absolute;
  top: 14px;
  right: 15px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: rgba(255, 244, 212, 0.66);
  z-index: 3;
}

.level-card.is-next::after {
  content: 'UP NEXT';
  position: absolute;
  top: 44px;
  right: -29px;
  transform: rotate(36deg);
  width: 130px;
  text-align: center;
  padding: 4px 0;
  background: #d95133;
  color: #fff3d5;
  border-top: 1px solid rgba(255, 230, 180, 0.4);
  border-bottom: 1px solid rgba(60, 30, 15, 0.4);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
}

.card-lock {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(13, 18, 18, 0.14);
  color: #ffe8b3;
  z-index: 4;
}

.level-card.locked .card-lock {
  display: grid;
}

.card-lock svg {
  width: 48px;
  height: 48px;
  padding: 10px;
  border: 2px solid rgba(255, 237, 194, 0.36);
  border-radius: 13px;
  background: rgba(35, 27, 20, 0.6);
  color: #ffe8b3;
  stroke: currentColor;
  stroke-width: 1.2;
  fill: none;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.28));
  backdrop-filter: blur(2px);
}

.card-lock svg rect {
  fill: currentColor;
  stroke: none;
}

.level-footer {
  position: absolute;
  left: 82px;
  right: 82px;
  bottom: 19px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 236, 196, 0.5);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.level-legend {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-star {
  color: #ffce50;
  font-size: 13px;
}

/* ================================================================
   GAME HUD
   ================================================================ */
.game-screen {
  z-index: 5;
  pointer-events: none;
}

.game-screen::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 184px;
  background: linear-gradient(180deg, rgba(14, 24, 29, 0.24) 0%, rgba(14, 24, 29, 0.08) 42%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.game-screen::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 112px;
  background: linear-gradient(0deg, rgba(21, 23, 15, 0.24), transparent);
  z-index: 2;
  pointer-events: none;
}

.game-screen > * {
  pointer-events: auto;
}

#gameCanvas {
  pointer-events: auto;
}

.hud-top {
  position: absolute;
  top: 21px;
  left: 27px;
  right: 28px;
  display: flex;
  align-items: flex-start;
  z-index: 4;
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 13px;
}

.hud-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.hud-button {
  width: 49px;
  height: 49px;
  border-width: 2.5px;
  background: linear-gradient(180deg, rgba(255, 248, 228, 0.97), rgba(237, 216, 177, 0.96));
  box-shadow:
    0 4px 0 rgba(54, 33, 18, 0.82),
    0 7px 14px rgba(0, 0, 0, 0.14),
    inset 0 2px 0 #fffdf4;
}

.hud-button svg {
  width: 22px;
  height: 22px;
}

.level-chip {
  display: flex;
  flex-direction: column;
  gap: 0;
  color: #fff3d5;
  text-shadow: 0 2px 4px rgba(29, 20, 13, 0.65);
}

.level-chip span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.3px;
  opacity: 0.76;
}

.level-chip strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1px;
  line-height: 1.12;
}

.score-plaque {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%) rotate(-0.6deg);
  min-width: 192px;
  padding: 7px 24px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 3px solid #3e2818;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 246, 220, 0.98), rgba(237, 214, 170, 0.97));
  box-shadow:
    0 5px 0 rgba(53, 32, 17, 0.85),
    0 10px 24px rgba(31, 22, 13, 0.2),
    inset 0 2px 0 #fffdf5;
}

.score-plaque::before,
.score-plaque::after {
  content: '';
  position: absolute;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b633e;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4);
}

.score-plaque::before {
  left: 11px;
}

.score-plaque::after {
  right: 11px;
}

.score-plaque span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2.7px;
  color: #8f6b43;
}

.score-plaque b {
  font-family: 'Luckiest Guy', var(--stage-font);
  font-weight: 400;
  font-size: 30px;
  line-height: 0.95;
  letter-spacing: 1.5px;
  color: #422819;
}

.toast {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translate(-50%, -8px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 17px 8px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 239, 202, 0.22);
  background: rgba(30, 23, 17, 0.66);
  color: #fff3d8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none !important;
  white-space: nowrap;
  z-index: 3;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4c84d;
  color: #4a2a16;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 14px;
  flex: none;
}

.flock-panel {
  position: absolute;
  left: 28px;
  bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 11px;
  border-radius: 999px;
  background: rgba(30, 22, 16, 0.68);
  border: 1px solid rgba(255, 236, 195, 0.2);
  color: #fff1cf;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(7px);
  z-index: 4;
}

.flock-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  opacity: 0.62;
}

.bird-queue {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bird-token {
  --bird-color: #dc4a3d;
  --bird-dark: #9f2f28;
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, var(--bird-color), var(--bird-dark) 70%);
  border: 2px solid #3a2319;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2);
  flex: none;
}

.bird-token.has-portrait {
  background-color: #f8e6c3;
  background-repeat: no-repeat;
  background-position: 54% 48%;
  background-size: 152%;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(33, 20, 12, 0.25);
}

.bird-token.has-portrait::before,
.bird-token.has-portrait::after {
  display: none;
}

.bird-token::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 9px;
  border-radius: 50%;
  background: #fff9e9;
  top: 7px;
  left: 7px;
  box-shadow: 8px 0 0 #fff9e9;
}

.bird-token::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 5px;
  background: #f5a328;
  border: 1px solid #402415;
  top: 16px;
  left: 10px;
  clip-path: polygon(0 0, 100% 38%, 0 100%);
}

.bird-token[data-type='chuck'] {
  --bird-color: #ffe060;
  --bird-dark: #d9a21c;
  border-radius: 45% 45% 50% 50%;
}

.bird-token[data-type='bomb'] {
  --bird-color: #555867;
  --bird-dark: #25262f;
}

.bird-token[data-type='blues'] {
  --bird-color: #72d3f2;
  --bird-dark: #2b7da5;
  width: 27px;
  height: 27px;
}

.bird-token[data-type='blues']::before {
  top: 6px;
  left: 6px;
  width: 7px;
  height: 8px;
  box-shadow: 7px 0 0 #fff9e9;
}

.bird-token[data-type='blues']::after {
  top: 15px;
  left: 8px;
}

.bird-token.current {
  width: 40px;
  height: 40px;
  box-shadow:
    0 0 0 2px #ffd05b,
    0 0 0 4px rgba(57, 35, 20, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.24);
}

.bird-token.current::before {
  top: 9px;
  left: 9px;
}

.bird-token.current::after {
  top: 19px;
  left: 12px;
}

.pig-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 8px;
  margin-left: 1px;
  border-left: 1px solid rgba(255, 239, 201, 0.16);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.82;
}

.pig-counter::before {
  content: '';
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #a7d56b, #6ea543 70%);
  border: 1.5px solid #344521;
  box-shadow: inset -2px -1px 0 rgba(53, 76, 30, 0.18);
}

.ability-card {
  position: absolute;
  right: 28px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  padding: 10px 18px 10px 11px;
  border: 2.5px solid #3a2418;
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(255, 238, 200, 0.98), rgba(240, 194, 107, 0.97));
  color: #472816;
  box-shadow:
    0 6px 0 rgba(54, 31, 16, 0.82),
    0 10px 28px rgba(28, 19, 12, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
  z-index: 4;
  animation: abilityIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  text-align: left;
}

.ability-card::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 250, 218, 0.48), transparent 28%);
  animation: shimmer 3.2s linear infinite;
  pointer-events: none;
}

.ability-card:hover {
  filter: brightness(1.035);
  transform: translateY(-2px);
}

.ability-key {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 45px;
  height: 39px;
  padding: 0 8px;
  border-radius: 8px;
  background: #4b2b18;
  color: #ffe7a8;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 12px;
  letter-spacing: 1px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.15);
}

.ability-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
}

.ability-copy strong {
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.4px;
  line-height: 1.15;
}

.ability-copy small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  opacity: 0.65;
}

.ability-burst {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 247, 210, 0.7);
  filter: blur(1px);
}

.game-bottom-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 242, 215, 0.58);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  transition: opacity 0.4s ease;
  pointer-events: none !important;
}

.game-bottom-hint.faded {
  opacity: 0;
}

/* ================================================================
   MODALS
   ================================================================ */
.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(12, 15, 14, 0.64);
  backdrop-filter: blur(7px) saturate(0.82);
  animation: modalFade 0.2s ease both;
}

.modal-card {
  position: relative;
  width: 616px;
  padding: 42px 46px 34px;
  border: 4px solid #3b2418;
  border-radius: 27px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255, 255, 255, 0.8), transparent 38%),
    linear-gradient(145deg, #fff9e9 0%, #f8eac9 55%, #efdcb0 100%);
  box-shadow:
    0 15px 0 rgba(45, 26, 14, 0.8),
    0 32px 70px rgba(0, 0, 0, 0.4),
    inset 0 3px 0 rgba(255, 255, 255, 0.85);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  text-align: center;
}

.modal-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(112, 77, 42, 0.16);
  border-radius: 20px;
  pointer-events: none;
}

.panel-ribbon {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.2deg);
  min-width: 210px;
  padding: 8px 24px 9px;
  background: linear-gradient(180deg, #df6545, #b83c2d);
  border: 3px solid #462518;
  border-radius: 8px;
  color: #fff2d3;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 19px;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(66, 28, 18, 0.45);
  box-shadow:
    0 5px 0 rgba(55, 28, 17, 0.75),
    0 10px 18px rgba(38, 20, 12, 0.24);
}

.panel-kicker {
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.8px;
  color: #a37c4e;
}

.modal-card h2 {
  margin: 7px 0 0;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-weight: 400;
  font-size: 61px;
  line-height: 0.96;
  letter-spacing: 1.5px;
  color: #4b2a16;
  text-shadow:
    0 3px 0 #f5d58e,
    0 6px 0 rgba(109, 65, 26, 0.1);
}

.pause-actions {
  margin-top: 29px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-panel {
  min-height: 66px;
  font-size: 21px;
  width: 100%;
}

.btn-panel .btn-main {
  font-size: 24px;
  letter-spacing: 1.5px;
}

.btn-panel .btn-sub {
  font-size: 10px;
}

.btn-panel.btn-wood,
.btn-panel.btn-ghost {
  padding: 0 16px;
  gap: 8px;
}

.panel-row {
  display: flex;
  gap: 12px;
}

.panel-row .btn {
  flex: 1;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: center;
  padding: 9px 17px;
  border: 2px solid rgba(63, 41, 24, 0.68);
  border-radius: 999px;
  color: #62452a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: rgba(255, 249, 233, 0.56);
  transition: background 0.15s ease;
}

.toggle-pill:hover {
  background: rgba(255, 252, 242, 0.92);
}

.toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #76b94b;
  box-shadow: 0 0 0 3px rgba(118, 185, 75, 0.15);
}

.toggle-pill.is-muted .toggle-dot {
  background: #ba6651;
  box-shadow: 0 0 0 3px rgba(186, 102, 81, 0.14);
}

.panel-footnote {
  margin: 20px 0 0;
  color: #a1835b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

kbd {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid rgba(75, 50, 30, 0.32);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 252, 241, 0.76);
  font-family: var(--stage-font);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #63472f;
}

/* How to play */
.how-card {
  width: 1010px;
  padding: 31px 38px 26px;
}

.how-card h2 {
  font-size: 54px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(66, 42, 24, 0.45);
  border-radius: 50%;
  color: #705235;
  background: rgba(255, 250, 237, 0.52);
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.modal-close:hover {
  background: #fff9e9;
  transform: rotate(5deg);
}

.modal-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 18px;
}

.how-step {
  position: relative;
  min-height: 187px;
  padding: 18px 18px 16px;
  border: 1.5px solid rgba(101, 68, 33, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.4), rgba(214, 184, 124, 0.11));
  text-align: left;
}

.step-num {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d7b476;
  color: #fff8e8;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.step-art {
  position: relative;
  display: block;
  width: 50px;
  height: 44px;
  margin-bottom: 11px;
}

.aim-art::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 37px;
  left: 19px;
  bottom: 0;
  border-radius: 5px;
  background: #8a5b32;
  border: 2px solid #4b2d19;
  transform: rotate(-4deg);
}

.aim-art::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 25px;
  left: 8px;
  bottom: 24px;
  border-top: 6px solid #8a5b32;
  border-left: 7px solid #8a5b32;
  border-right: 7px solid #8a5b32;
  border-radius: 50% 50% 0 0;
  transform: rotate(-3deg);
  filter: drop-shadow(0 2px 0 #4b2d19);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 70% 58%, 30% 58%, 0 100%);
}

.smash-art::before {
  content: '';
  position: absolute;
  width: 35px;
  height: 35px;
  left: 5px;
  bottom: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b7df77, #70a844 68%, #568334);
  border: 2px solid #354521;
  box-shadow: inset -3px -2px 0 rgba(54, 78, 31, 0.16);
}

.smash-art::after {
  content: '✦';
  position: absolute;
  right: 0;
  top: 3px;
  font-size: 27px;
  color: #e9a41f;
  text-shadow: 0 2px 0 #8a581d;
}

.power-art::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 1px;
  width: 29px;
  height: 39px;
  background: linear-gradient(180deg, #ffdd64, #f2a322);
  border: 2px solid #5d381a;
  clip-path: polygon(54% 0, 100% 0, 66% 40%, 95% 40%, 33% 100%, 46% 54%, 13% 54%);
  box-shadow: 0 3px 0 #5d381a;
  transform: rotate(4deg);
}

.power-art::after {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 1px;
  width: 43px;
  height: 10px;
  border-top: 2px dashed rgba(141, 102, 55, 0.45);
  border-radius: 50%;
}

.how-step h3 {
  margin: 0 0 4px;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 20px;
  letter-spacing: 0.5px;
  color: #4e2e1a;
}

.how-step p {
  margin: 0;
  color: #76583b;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 600;
}

.bird-guide-heading {
  margin-top: 17px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.4px;
  color: #a37c4e;
  text-align: left;
}

.bird-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 7px;
}

.bird-chip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 250, 238, 0.55);
  border: 1px solid rgba(110, 75, 40, 0.13);
  text-align: left;
}

.chip-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--chip-color, #dc4a3d);
  border: 2px solid #3b2419;
  flex: none;
  box-shadow: inset -3px -2px 0 rgba(69, 31, 18, 0.18);
}

.chip-avatar::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 9px;
  background: #fff9e9;
  border-radius: 50%;
  left: 6px;
  top: 7px;
  box-shadow: 7px 0 0 #fff9e9;
}

.chip-avatar::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 5px;
  background: #f5a328;
  border: 1px solid #3d2918;
  top: 16px;
  left: 10px;
  clip-path: polygon(0 0, 100% 38%, 0 100%);
}

.chip-avatar.has-portrait {
  background-color: #f8e6c3;
  background-repeat: no-repeat;
  background-position: 53% 47%;
  background-size: 165%;
}

.chip-avatar.has-portrait::before,
.chip-avatar.has-portrait::after {
  display: none;
}

.chip-copy strong {
  display: block;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: #4e2e1a;
  line-height: 1.1;
}

.chip-copy small {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  line-height: 1.3;
  font-weight: 700;
  color: #866846;
}

.how-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid rgba(110, 75, 40, 0.16);
  color: #977653;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
}

/* Result */
.result-card {
  width: 650px;
  padding-bottom: 31px;
}

.result-card h2 {
  font-size: 55px;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 9px;
}

.result-star {
  display: inline-block;
  font-size: 61px;
  line-height: 1;
  color: rgba(126, 92, 52, 0.16);
  -webkit-text-stroke: 2px rgba(101, 64, 30, 0.22);
  filter: drop-shadow(0 3px 0 rgba(91, 55, 23, 0.12));
  transform: scale(0.72) rotate(-8deg);
  opacity: 0.66;
}

.result-star.earned {
  color: #ffca43;
  -webkit-text-stroke: 2px #8a4e1b;
  filter: drop-shadow(0 4px 0 #a86824) drop-shadow(0 0 12px rgba(255, 209, 83, 0.4));
  animation: starPop 0.48s cubic-bezier(0.16, 1.4, 0.3, 1) both;
}

.result-star.earned:nth-child(2) {
  animation-delay: 0.13s;
}

.result-star.earned:nth-child(3) {
  animation-delay: 0.26s;
}

.result-message {
  max-width: 430px;
  margin: 0 auto 17px;
  color: #7e6041;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.result-scoreboard {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  margin: 0 auto 21px;
  border: 2px solid rgba(75, 48, 25, 0.55);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(74, 48, 27, 0.88);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.result-score {
  padding: 10px 8px 9px;
  color: #fff0cd;
  border-right: 1px solid rgba(255, 233, 193, 0.16);
}

.result-score:last-child {
  border-right: none;
}

.result-score span {
  display: block;
  font-size: 8px;
  letter-spacing: 1.8px;
  font-weight: 800;
  color: rgba(255, 232, 190, 0.55);
}

.result-score b {
  display: block;
  margin-top: 1px;
  font-family: 'Luckiest Guy', var(--stage-font);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 1px;
  line-height: 1;
  color: #ffd15b;
}

.result-score.best b {
  color: #fff1c4;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.result-card .panel-row .btn {
  min-height: 55px;
  font-size: 17px;
}

.result-card.loss .panel-ribbon {
  background: linear-gradient(180deg, #887c68, #635b4c);
}

.result-star.lost {
  opacity: 0.36;
}

.noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #162026;
  color: #fff3d6;
  font-size: 24px;
  z-index: 50;
}

/* ================================================================
   ANIMATION
   ================================================================ */
@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes screenFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94) rotate(-0.7deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes starPop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-25deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.13) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(-3deg);
  }
}

@keyframes abilityIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmer {
  to {
    transform: rotate(360deg);
  }
}

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