/* Светлая тема (reboot 2026-10, docs/REBOOT-PLAN.md п.1): тёплый бежевый фон
   стиль-кадра вместо тёмного Kolejowa-лофта, HUD — белые карточки с мягкими
   тенями и скруглениями (Hay Day/Township-ощущение), акцент — терракота
   Norm. Сцена (Pixi) прозрачная — фон страницы виден вокруг комнаты.
   Отступ сверху учитывает кнопки Telegram в fullscreen (--tg-content-safe-*). */

:root {
  --bg: #ece2d2;
  --bg-raised: #fffaf3;
  --bg-raised-2: #f6ebdd;
  --accent: #e07a5f;
  --accent-dim: #c8644a;
  --gold: #f4b63f;
  --text: #4a2f22;
  --text-dim: #8c7262;
  --border: #ead9c6;
  --danger: #d9534f;
  --ok: #6fb37a;
  --shadow: 0 3px 0 rgba(150, 105, 70, 0.18), 0 6px 16px rgba(120, 80, 50, 0.14);
  --safe-top: calc(var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(120% 70% at 50% 38%, #fff6ea 0%, #f1e5d4 55%, #e5d3bd 100%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
  user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

#scene {
  position: absolute;
  inset: 0;
}

#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- gate (no Telegram, no ?dev) ---------- */

.gs-gate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

.gs-gate h1 {
  color: var(--accent);
  margin: 0;
}

.gs-gate p {
  color: var(--text-dim);
  max-width: 320px;
  line-height: 1.5;
}

/* ---------- HUD ---------- */

.gs-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 8px) 10px 8px;
  pointer-events: none;
}

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

.gs-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-raised);
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.gs-pill.gs-pulse {
  animation: gs-pulse 0.32s ease-out;
}

@keyframes gs-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
    background: #fff1c9;
  }
  100% {
    transform: scale(1);
  }
}

.gs-hud-spacer {
  flex: 1;
}

.gs-level-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 160px;
}

.gs-level-badge {
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  padding: 3px 8px;
  min-width: 20px;
  text-align: center;
}

.gs-xp-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-raised);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  border-radius: 999px;
  overflow: hidden;
}

.gs-xp-fill {
  height: 100%;
  background: linear-gradient(to right, #f0a35e, var(--accent));
  transition: width 0.25s ease;
}

.gs-icon-btn {
  background: var(--bg-raised);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.gs-icon-btn:active {
  background: var(--bg-raised-2);
}

/* M5: "something new in the guest book" dot */
.gs-icon-btn.gs-dot {
  position: relative;
}

.gs-icon-btn.gs-dot::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
}

/* ---------- M3 shift pill + M7 calendar chip (live strip above the tab bar) ---------- */

.gs-live-strip {
  position: absolute;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  z-index: 19;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.gs-live-pill {
  pointer-events: auto;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-raised);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.gs-live-pill.hidden {
  display: none;
}

.gs-shift-pill.active {
  background: var(--accent);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.gs-shift-pill.gs-pulse {
  animation: gs-pulse 0.32s ease-out;
}

/* the goal is reached: the pill turns gold until the timer runs out */
.gs-shift-pill.active.gs-shift-gold {
  background: #d9a52a;
}

.gs-shift-pill.urgent {
  animation: gs-shift-urgent 0.5s ease-in-out infinite alternate;
}

@keyframes gs-shift-urgent {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.gs-cal-chip {
  font-size: 12px;
  font-weight: 700;
}

.gs-shift-explain {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.gs-shift-tiers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.gs-shift-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 8px 0;
}

.gs-shift-medal {
  font-size: 56px;
  line-height: 1;
}

/* ---------- M5 guest book ---------- */

.gs-book-bar {
  width: 90px;
}

.gs-book-set {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gs-book-set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gs-book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.gs-book-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 4px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}

.gs-book-tile:active,
.gs-book-tile-open {
  background: var(--bg-raised-2);
  border-color: var(--accent);
}

.gs-book-img {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.gs-book-tile-locked .gs-book-img {
  filter: brightness(0) saturate(0);
  opacity: 0.22;
}

.gs-book-tile-locked .gs-book-name {
  color: var(--text-dim);
}

.gs-book-name {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.gs-book-lore {
  background: var(--bg-raised-2);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gs-book-lore.hidden {
  display: none;
}

.gs-book-lore-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}

/* ---------- FTUE v2: guided-hand tutorial overlay (web/src/tutorial.ts) ----------
   Owner decision 12.07 (docs/DESIGN.md §7): explicit step-by-step guidance
   with a real input-blocking spotlight, replacing the old "no arrows" v1
   dim-only banner. Z-index 500 sits above everything, including modals (50)
   and their own backdrop, so a modal-choice step's ring/hand still show. */

.gs-tut-root {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}

/* Input-blocking + dimming band. In "spotlight"/"flourish" mode up to 4 of
   these tile the screen around the target hole (or 1 full-screen band with
   no hole in "flourish" mode) — each one's own pointer-events:auto is enough
   to swallow clicks/taps without a JS handler (the browser hit-tests the
   topmost element under the pointer; nothing behind a covering div is
   reachable). The target rect itself simply has no band over it, so taps
   there fall straight through to the real game underneath. */
.gs-tut-band {
  position: fixed;
  background: rgba(74, 47, 34, 0.18);
  pointer-events: auto;
}

.gs-tut-ring {
  position: fixed;
  pointer-events: none;
  border: 2px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(224, 122, 95, 0.18);
  animation: gs-tut-pulse 1.1s ease-in-out infinite;
}

@keyframes gs-tut-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(224, 122, 95, 0.55);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(224, 122, 95, 0);
  }
}

.gs-tut-hand {
  position: fixed;
  pointer-events: none;
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(74, 47, 34, 0.45));
  animation: gs-tut-hand-nudge 0.85s ease-in-out infinite;
}

@keyframes gs-tut-hand-nudge {
  0%,
  100% {
    transform: rotate(var(--gs-tut-hand-rot, -35deg)) translate(0, 0);
  }
  50% {
    transform: rotate(var(--gs-tut-hand-rot, -35deg)) translate(-6px, -6px);
  }
}

.gs-tut-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  z-index: 501;
  pointer-events: none;
  background: var(--bg-raised);
  border: 2px solid #fff;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--shadow);
}

.gs-tut-card {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(74, 47, 34, 0.45);
}

.gs-tut-card-body {
  max-width: 340px;
  background: var(--bg-raised);
  border: 3px solid #fff;
  border-radius: 24px;
  padding: 22px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 6px 0 rgba(150, 105, 70, 0.2), 0 16px 40px rgba(120, 80, 50, 0.25);
}

.gs-tut-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.gs-tut-card-text {
  font-size: 14px;
  line-height: 1.5;
}

.gs-tut-popup {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 501;
  pointer-events: none;
  background: var(--bg-raised);
  border: 3px solid #fff;
  border-radius: 22px;
  padding: 18px 22px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 0 rgba(150, 105, 70, 0.2), 0 16px 40px rgba(120, 80, 50, 0.25);
  animation: gs-tut-pop-in 0.25s ease-out;
}

@keyframes gs-tut-pop-in {
  from {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

[data-ftue-highlight] {
  position: relative;
}

/* ---------- Goals chip (post-FTUE, content/goals.ts) ---------- */

.gs-goal-chip {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(var(--safe-top) + 58px);
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-raised);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.gs-goal-chip.hidden {
  display: none;
}

.gs-goal-chip-icon {
  font-size: 16px;
}

.gs-goal-chip-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gs-goal-chip-text {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-goal-chip-bar {
  height: 5px;
  background: var(--bg-raised-2);
  border-radius: 999px;
  overflow: hidden;
}

.gs-goal-chip-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* ---------- tab bar ---------- */

.gs-tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
}

.gs-tab {
  flex: 1;
  background: var(--bg-raised);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 2px 5px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gs-tab-emoji {
  font-size: 20px;
}

.gs-tab.active {
  color: #fff;
  background: var(--accent);
}

/* ---------- modal ---------- */

.gs-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(74, 47, 34, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gs-modal-backdrop.hidden {
  display: none;
}

.gs-modal {
  width: 100%;
  max-width: 480px;
  max-height: 78vh;
  background: var(--bg-raised);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 3px solid #fff;
  border-bottom: none;
  box-shadow: 0 -8px 30px rgba(120, 80, 50, 0.2);
  padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gs-modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
}

.gs-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.gs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.gs-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Item icon (Task 6.4 §5): real assets/sprites/item_<id>.png in place of the
   emoji/color-dot placeholders across warehouse, supply/recipe modals and
   journal contract cards. Falls back to .gs-swatch (color dot) on <img>
   error — see itemIcon() in ui.ts. */
.gs-item-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--bg-raised);
  border-radius: 6px;
  padding: 2px;
}

.gs-item-icon-sm {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: -3px;
  margin-right: 3px;
}

.gs-contract-services {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.gs-row-title {
  font-weight: 600;
  font-size: 13px;
}

.gs-row-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.gs-row-main {
  flex: 1;
  min-width: 0;
}

.gs-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--accent-dim);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.gs-btn:active {
  background: var(--accent-dim);
}

.gs-btn:disabled {
  background: var(--border);
  color: var(--text-dim);
  cursor: default;
}

.gs-btn-secondary {
  background: var(--bg-raised-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.gs-contract-pair {
  display: flex;
  gap: 8px;
}

.gs-contract-card {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- M2 booking tablet (journal) ---------- */

.gs-tablet-quip {
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
  padding: 2px 4px;
}

.gs-tablet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gs-booking {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}

.gs-booking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gs-booking-reward {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-dim);
}

.gs-booking-cooldown {
  padding: 2px 6px;
}

.gs-progressbar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.gs-progressbar-fill {
  height: 100%;
  background: var(--ok);
}

.gs-week-days {
  display: flex;
  gap: 4px;
}

.gs-week-day {
  flex: 1;
  height: 22px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-dim);
}

.gs-week-day.done {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}

.gs-week-day.today {
  border-color: var(--accent);
  color: var(--accent);
}

.gs-color-swatches {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 6px 0 2px;
}

.gs-color-swatch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.gs-empty {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 18px 0;
}

/* ---------- toasts ---------- */

.gs-toast-root {
  position: absolute;
  top: calc(var(--safe-top) + 100px);
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.gs-toast {
  background: var(--bg-raised-2);
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: gs-toast-in 0.2s ease-out, gs-toast-out 0.3s ease-in 2.2s forwards;
}

@keyframes gs-toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gs-toast-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ---------- photo mode ---------- */

.gs-photo-preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.gs-photo-actions {
  display: flex;
  gap: 8px;
}

/* ---------- door guest card (reboot п.4, web/src/door.ts) ---------- */

.gs-door {
  position: fixed;
  inset: 0;
  z-index: 600;
}

.gs-door-card {
  position: fixed;
  left: 12px;
  right: 12px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-raised);
  border: 3px solid #fff;
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(150, 105, 70, 0.2), 0 16px 40px rgba(120, 80, 50, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: gs-tut-pop-in-plain 0.22s ease-out;
}

.gs-door-card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(var(--tail-x, 50%) - 25px);
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top-color: #fff;
  pointer-events: none;
}

@keyframes gs-tut-pop-in-plain {
  from {
    transform: scale(0.85) translateY(10px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.gs-door-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

.gs-door-emoji {
  font-size: 24px;
}

.gs-door-text {
  font-size: 14px;
  line-height: 1.45;
}

.gs-door-choices {
  display: flex;
  gap: 8px;
}

.gs-door-btn {
  flex: 1;
  white-space: normal;
  padding: 10px 10px;
  font-size: 13px;
  line-height: 1.25;
}

.gs-door-btn-b {
  background: #7fb6a4;
  box-shadow: 0 3px 0 #5d9481;
}

.gs-door-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gs-chip {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
  background: var(--bg-raised-2);
}

.gs-chip-good {
  background: #e6f4e2;
  color: #3f7d43;
}

.gs-chip-bad {
  background: #fbe3dd;
  color: #b2442b;
}

.gs-chip-boost {
  background: #fff0cf;
  color: #a2620c;
}

/* Reboot п.6: level-5 "the real Norm is here" card */
.gs-promo {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(74, 47, 34, 0.35);
  animation: gs-fade-in 0.25s ease-out;
}
.gs-promo-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  background: var(--bg-raised);
  border-radius: 24px;
  padding: 28px 22px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gs-promo-logo {
  display: block;
  width: min(190px, 58%);
  height: auto;
  margin: 0 auto 2px;
  position: relative;
  z-index: 1;
}
.gs-promo-confetti {
  position: absolute;
  top: -52px;
  right: -44px;
  width: 104px;
  height: 104px;
  object-fit: contain;
  pointer-events: none;
  transform: rotate(12deg);
  animation: gs-promo-confetti-pop 0.6s cubic-bezier(.2, .9, .3, 1.25) both;
}
.gs-promo-title {
  font-weight: 800;
  font-size: 19px;
  line-height: 1.25;
  color: var(--accent-dim);
}
.gs-promo-text {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
}
.gs-promo-code {
  border: 2px dashed var(--accent);
  background: #fff6ee;
  border-radius: 14px;
  padding: 10px;
  font-size: 15px;
  color: var(--text-dim);
  cursor: pointer;
}
.gs-promo-code b {
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
}
.gs-promo-cta {
  width: 100%;
  font-size: 17px;
  padding: 14px;
}
.gs-promo-later {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px;
  cursor: pointer;
}
@keyframes gs-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes gs-promo-confetti-pop {
  from { opacity: 0; transform: rotate(2deg) scale(0.45); }
  to { opacity: 1; transform: rotate(12deg) scale(1); }
}
.gs-real-price {
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--accent-dim);
  font-weight: 700;
}

/* ---------- stage 4 juice (docs/GAME-JUICE-AND-MECHANICS.md) ---------- */

/* M1: promo teaser at the right end of the goal chip, from level 1 (the
   HUD row has no spare width on a 360 px phone). */
.gs-promo-teaser {
  flex: none;
  padding-left: 10px;
  border-left: 1.5px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  white-space: pre;
  color: var(--accent-dim);
}
.gs-promo-teaser:empty {
  display: none;
}

/* J4: level-up card — never blocks taps (pointer-events: none) */
.gs-levelup {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  background: rgba(74, 47, 34, 0.18);
  animation: gs-fade-in 0.2s ease-out;
}
.gs-levelup-card {
  width: min(320px, 100%);
  background: var(--bg-raised);
  border: 3px solid #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  text-align: center;
  animation: gs-levelup-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gs-levelup-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.gs-levelup-num {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  margin: 2px 0 8px;
}
.gs-levelup-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.gs-levelup-item {
  font-size: 15px;
  font-weight: 800;
  margin: 2px 0;
}
.gs-levelup-teaser {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-raised-2);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-dim);
}
.gs-levelup-out {
  opacity: 0;
  transition: opacity 0.2s ease-in;
}
@keyframes gs-levelup-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* J12: buttons answer the press with a spring */
.gs-btn,
.gs-icon-btn,
.gs-tab {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gs-btn:active,
.gs-icon-btn:active,
.gs-tab:active {
  transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
  .gs-levelup,
  .gs-levelup-card,
  .gs-pill.gs-pulse {
    animation: none;
  }
  .gs-btn,
  .gs-icon-btn,
  .gs-tab {
    transition: none;
  }
}
