:root {
  --bg: #0a0a0a;
  --lime: #b8f000;
  --ink: #111;
  --cream: #f7f2e8;
  --red: #e23b2f;
  --blue: #1a6fd4;
  --green: #2db84b;
  --yellow: #f5c518;
  --panel: #1a1a1a;
  --font-display: "Bangers", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 20%, #1a2a0a 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, #0f1a2a 0%, transparent 45%),
    var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  overflow-x: hidden;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: min(90vw, 640px);
}

.hint-banner {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.6vw, 1.65rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
  background: var(--lime);
  border: 3px solid #000;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  box-shadow: 4px 4px 0 #000;
}

.badge-stage {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  user-select: none;
}

.badge-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: none;
}

.badge-stage.is-busy .hotspot {
  pointer-events: none;
}

.hotspot {
  position: absolute;
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.hotspot:hover,
.hotspot:focus,
.hotspot:focus-visible,
.hotspot:active {
  outline: none;
  border: none;
  background: transparent;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--panel);
  border: 3px solid var(--lime);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 8px 8px 0 #000;
  text-align: center;
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 0.04em;
  color: var(--lime);
  margin-bottom: 0.6rem;
  line-height: 1.1;
}

.modal-body {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 1.25rem;
  color: var(--cream);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 1.35rem;
  border-radius: 10px;
  border: 3px solid #000;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000;
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.btn-play,
.btn-yes {
  background: var(--lime);
  color: var(--ink);
}

.btn-cancel,
.btn-no {
  background: #333;
  color: var(--cream);
}

.btn-yes.is-fleeing {
  position: fixed;
  z-index: 60;
  transition: left 0.12s ease, top 0.12s ease;
}

.btn-yes.is-parked {
  position: relative;
  z-index: 5;
  align-self: center;
  margin-top: 0.15rem;
}

.btn-yes.is-frozen {
  transition: none;
}

.btn-yes.is-roast {
  background: var(--red);
  color: #fff;
  cursor: pointer;
  max-width: min(90vw, 360px);
  white-space: normal;
  line-height: 1.15;
  padding: 0.75rem 1.25rem;
}

.game-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.game-panel {
  background: var(--panel);
  border: 3px solid var(--lime);
  border-radius: 16px;
  padding: 1.25rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 8px 8px 0 #000;
  position: relative;
}

.game-panel h2 {
  font-family: var(--font-display);
  color: var(--lime);
  letter-spacing: 0.04em;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.game-panel .hint {
  text-align: center;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.game-arena {
  position: relative;
  width: 100%;
  height: min(50vh, 360px);
  background:
    repeating-linear-gradient(
      45deg,
      #141414,
      #141414 12px,
      #181818 12px,
      #181818 24px
    );
  border: 3px solid #000;
  border-radius: 12px;
  overflow: hidden;
}

.progress-bar {
  height: 12px;
  background: #333;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #000;
  margin-top: 0.75rem;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--lime);
  transition: width 0.05s linear;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  max-width: min(90vw, 420px);
  text-align: center;
}

/* Powerstache */
.stache-target {
  position: absolute;
  width: 88px;
  height: 44px;
  margin-left: -44px;
  margin-top: -22px;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(2px 2px 0 #000);
}

.stache-target svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sparkle {
  position: absolute;
  pointer-events: none;
  font-size: 1.5rem;
  animation: pop 0.7s ease forwards;
}

@keyframes pop {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6) translateY(-30px); opacity: 0; }
}

/* Clippy */
.clippy {
  position: absolute;
  width: 64px;
  height: 64px;
  margin-left: -32px;
  margin-top: -32px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  transition: left 0.05s linear, top 0.05s linear;
  filter: drop-shadow(2px 2px 0 #000);
}

.clippy svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Windows panes */
.windows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.win-pane {
  aspect-ratio: 1;
  border: 3px solid #000;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  font-size: 0;
}

.win-pane.done {
  opacity: 0.45;
  transform: scale(0.95);
  pointer-events: none;
}

.win-pane.wrong {
  animation: shake 0.35s ease;
}

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

.stamp-result {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  margin-top: 1rem;
  letter-spacing: 0.06em;
  transform: rotate(-6deg);
}

.stamp-result.fail {
  color: var(--red);
}

.stamp-result.win {
  color: var(--lime);
}

/* Promo sliding puzzle */
.puzzle-board {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  background: #000;
  border: 3px solid #000;
  border-radius: 10px;
  overflow: hidden;
  touch-action: manipulation;
}

.puzzle-tile {
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background-repeat: no-repeat;
  background-origin: border-box;
  position: relative;
  min-width: 0;
  min-height: 0;
}

.puzzle-tile.empty {
  background: #222 !important;
  cursor: default;
  pointer-events: none;
}

.puzzle-tile:not(.empty):active {
  filter: brightness(1.08);
}

.difficulty-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* Paint */
.paint-wrap {
  position: relative;
}

.paint-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid #000;
  border-radius: 12px;
  background: #1c2a0a;
  touch-action: none;
  cursor: crosshair;
}

.paint-tools {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #000;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
}

.swatch.active {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

/* Stare — gaze lock */
.stare-arena {
  position: relative;
  height: min(48vh, 340px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  background: #0e0e0e;
  border: 3px solid #000;
  border-radius: 12px;
  touch-action: none;
  overflow: hidden;
  cursor: crosshair;
}

.stare-target {
  position: absolute;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid #000;
  box-shadow: 0 0 0 4px rgba(184, 240, 0, 0.25);
  pointer-events: none;
  z-index: 2;
  transition: left 0.35s ease, top 0.35s ease;
}

.stare-target::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #111;
}

.stare-lock {
  color: var(--lime);
}

.eye {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #f5f0e6;
  border: 4px solid #000;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.08);
}

.eye.blink {
  animation: blink 0.25s ease;
}

@keyframes blink {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.08); }
}

.pupil {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1a1a;
  left: 50%;
  top: 50%;
  margin-left: -14px;
  margin-top: -14px;
  transition: transform 0.05s linear;
}

.pupil::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  top: 5px;
  left: 6px;
}

.game-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: var(--cream);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}

.game-close:hover {
  opacity: 1;
}

@media (max-width: 480px) {
  .modal,
  .game-panel {
    padding: 1rem;
  }

  .stare-arena {
    gap: 1.25rem;
  }

  .eye {
    width: 68px;
    height: 68px;
  }
}
