@font-face { font-family: "Gotham Pro"; src: url("/assets/fonts/gothampro.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gotham Pro"; src: url("/assets/fonts/gothampro_medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Gotham Pro"; src: url("/assets/fonts/gothampro_bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Gotham Pro"; src: url("/assets/fonts/gothampro_black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --night: #070830;
  --ink: #120f4a;
  --gold-1: #fff3c4;
  --gold-2: #f6c65a;
  --gold-3: #c9812a;
  --magenta: #e30b7b;
  --blue: #0c5ba8;
  --text: #f4f4ff;
  --muted: #b9bde8;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--night); color: var(--text); font: 500 16px/1.35 "Gotham Pro", system-ui, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 3px; border-radius: 8px; }

/* ---------- світ ---------- */

#viewport { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; background: var(--night); }
#viewport.dragging { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#world img.slice { position: absolute; display: block; pointer-events: none; -webkit-user-drag: none; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

/* ---------- станції ---------- */

.node { position: absolute; width: 190px; height: 190px; margin: -160px 0 0 -95px; display: block; }
.node.milestone { transform: scale(1.26); transform-origin: 50% 84%; }
.node.finale { transform: scale(1.5); transform-origin: 50% 84%; }

.node-gift { position: absolute; inset: 0; transition: transform .25s cubic-bezier(.3,1.6,.5,1); transform-origin: 50% 88%; }
.gift-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gift-lid { transform-box: view-box; transform-origin: 100px 90px; }

.node-num {
  position: absolute; left: 50%; top: 68%; width: 66px; height: 66px; margin: -33px 0 0 -33px;
  display: grid; place-items: center; border-radius: 50%;
  font: 900 36px/1 "Gotham Pro", sans-serif; letter-spacing: -1px; color: #fff;
  background: radial-gradient(circle at 34% 28%, #4a40b8 0, #1b1560 70%);
  box-shadow: 0 0 0 4px #f6c65a, 0 0 0 6px #7a4a18, 0 8px 12px rgba(5,5,40,.55);
  text-shadow: 0 2px 2px rgba(0,0,0,.5);
}

.node-badge {
  position: absolute; right: 26px; top: 30px; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; color: #1c1250;
  background: linear-gradient(160deg, var(--gold-1), var(--gold-2) 60%, var(--gold-3));
  box-shadow: 0 5px 10px rgba(5,5,40,.55);
}
.node-badge svg { width: 30px; height: 30px; }

.node.locked .gift-svg { filter: saturate(.62) brightness(.78); }
.node.past .gift-svg { filter: saturate(.3) brightness(1.08) opacity(.8); }
.node.past .node-num { background: #2a2f72; box-shadow: 0 0 0 4px #8d9ad8, 0 0 0 6px #3a4294; color: #c9d2f7; }
.node.past .node-badge { background: linear-gradient(160deg, #e6f3ff, #9dbcf0); color: #2b3a8c; }
.node.opened .gift-svg { filter: none; }
.node.opened .node-badge { background: linear-gradient(160deg, #84f5c0, #1fb97b); color: #06382a; }

.node.opened .gift-lid { transform: translate(-58px, -30px) rotate(-30deg); }
.gift-inner { opacity: 0; }
.node.opened .gift-inner, .stage.burst .gift-inner { opacity: 1; }

.node-glow { position: absolute; left: 50%; top: 78%; width: 300px; height: 190px; margin: -95px 0 0 -150px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,201,94,.75), rgba(255,201,94,0)); opacity: 0; pointer-events: none; }
.node.opened .node-glow { opacity: .6; }
.node.today .node-glow { opacity: 1; background: radial-gradient(closest-side, rgba(255,90,176,.95), rgba(255,201,94,.42) 55%, rgba(255,201,94,0)); animation: glow-pulse 1.7s ease-in-out infinite; }

.node-rays { position: absolute; left: 50%; top: 52%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; display: none; pointer-events: none; background: repeating-conic-gradient(rgba(255,231,168,.42) 0 12deg, rgba(255,231,168,0) 12deg 30deg); -webkit-mask: radial-gradient(closest-side, #000 22%, transparent 96%); mask: radial-gradient(closest-side, #000 22%, transparent 96%); animation: spin 16s linear infinite; }
.node.today .node-rays { display: block; }

.node.today { z-index: 5; }
.node.today .node-gift { animation: gift-bounce 1.7s cubic-bezier(.36,0,.3,1) infinite; }
.node.today .node-num { background: linear-gradient(150deg, #ff3a9b, #6a1ec7); box-shadow: 0 0 0 4px #fff3c4, 0 0 0 7px #f6c65a, 0 0 24px 6px rgba(255,90,176,.9); }

.node-tag {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); white-space: nowrap;
  font: 900 20px/1 "Gotham Pro", sans-serif; letter-spacing: .05em; text-transform: uppercase; color: #2a1800;
  padding: 9px 18px; border-radius: 30px; background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 6px 14px rgba(5,5,40,.6); display: none;
}
.node.today .node-tag { display: block; }

@media (hover: hover) {
  .node:hover .node-gift { transform: translateY(-14px) scale(1.07); }
  .node.today:hover .node-gift { animation-play-state: paused; }
}
.node.denied .node-gift { animation: gift-deny .42s linear; }

@keyframes gift-bounce { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-20px) scale(1.05, .97); } 70% { transform: translateY(2px) scale(.97, 1.03); } }
@keyframes gift-deny { 20% { transform: translateX(-9px) rotate(-4deg); } 45% { transform: translateX(8px) rotate(4deg); } 70% { transform: translateX(-5px) rotate(-2deg); } }
@keyframes glow-pulse { 50% { opacity: .55; transform: scale(1.14); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Фішка гравця */
.token { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; z-index: 8; }
.token-inner { width: 100%; height: 100%; animation: token-float 1.8s ease-in-out infinite; }
@keyframes token-float { 50% { transform: translateY(-16px); } }

/* ---------- живі орієнтири ---------- */

.lm { position: absolute; pointer-events: none; }
.lm-blades { width: 360px; height: 360px; margin: -180px 0 0 -180px; animation: spin 14s linear infinite; }
.lm-gondola { left: 0; top: 0; width: 66px; height: 74px; margin: 0; offset-rotate: 0deg; offset-anchor: 50% 0; animation: along 24s ease-in-out infinite alternate; }
.lm-skater { left: 0; top: 0; width: 42px; height: 62px; offset-anchor: 50% 100%; offset-rotate: 0deg; animation: along var(--dur, 30s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes along { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.lm-sleigh { left: 0; top: 230px; width: 340px; height: 120px; animation: sleigh 46s linear infinite; }
@keyframes sleigh { from { transform: translateX(-420px) translateY(50px); } to { transform: translateX(2200px) translateY(-40px); } }

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

.hud { position: fixed; z-index: 20; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 12px) clamp(12px, 2.4vw, 32px) 26px; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; background: linear-gradient(180deg, rgba(6,6,40,.82), rgba(6,6,40,0)); }
.hud > * { pointer-events: auto; }
.hud-logo img { display: block; height: clamp(30px, 4.6vw, 44px); width: auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,.45)); }

.hud-status {
  position: absolute; left: 50%; top: calc(var(--safe-t) + 12px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; padding: 8px 24px 9px; min-width: 210px;
  background: linear-gradient(180deg, rgba(40,30,120,.9), rgba(20,14,74,.9));
  border: 1.5px solid rgba(246,198,90,.75); border-radius: 18px;
  box-shadow: 0 8px 24px rgba(4,4,40,.55), inset 0 1px 0 rgba(255,255,255,.2);
}
.hud-label { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.hud-timer { font: 900 22px/1.15 "Gotham Pro", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }

.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-collected { height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; background: rgba(26,20,90,.85); border: 1.5px solid rgba(246,198,90,.55); color: var(--gold-1); }
.hud-collected { padding: 0 12px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

.go-today {
  position: fixed; z-index: 20; left: 50%; bottom: calc(var(--safe-b) + 22px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 40px; white-space: nowrap;
  font: 900 15px/1 "Gotham Pro", sans-serif; color: #2a1800;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 65%, #e7a437);
  box-shadow: 0 10px 28px rgba(4,4,40,.65), 0 0 0 2px rgba(255,255,255,.35) inset;
  animation: rise .35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 18px); } }

.preview-strip { position: fixed; z-index: 21; left: 50%; bottom: calc(var(--safe-b) + 84px); transform: translateX(-50%); padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; white-space: nowrap; color: #2a1800; background: #84f5c0; }

/* ---------- сцена відкриття ---------- */

.stage { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); overflow-y: auto; }
.stage-backdrop { position: fixed; inset: 0; background: radial-gradient(90% 75% at 50% 45%, rgba(66,26,132,.86), rgba(5,5,36,.96)); animation: fade .35s ease-out; }
@keyframes fade { from { opacity: 0; } }

.stage-rays { position: fixed; left: 50%; top: 45%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; border-radius: 50%; opacity: 0; transition: opacity .45s; pointer-events: none; background: repeating-conic-gradient(rgba(255,226,150,.11) 0 9deg, rgba(255,226,150,0) 9deg 24deg); -webkit-mask: radial-gradient(closest-side, #000 8%, transparent 70%); mask: radial-gradient(closest-side, #000 8%, transparent 70%); animation: spin 34s linear infinite; }
.stage.shake .stage-rays, .stage.burst .stage-rays, .stage.reveal .stage-rays { opacity: 1; }

.stage-gift { position: fixed; left: 50%; top: 45%; width: min(66vmin, 380px); height: min(66vmin, 380px); transform: translate(-50%, -50%) scale(.2); opacity: 0; transition: transform .5s cubic-bezier(.3,1.5,.5,1), opacity .25s; }
.stage.arrive .stage-gift, .stage.shake .stage-gift, .stage.burst .stage-gift { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.stage.shake .stage-gift .gift-svg { animation: shake 1s ease-in both; }
.stage.burst .gift-lid { transition: transform .6s cubic-bezier(.2,.8,.3,1), opacity .5s .2s; transform: translate(40px, -420px) rotate(68deg); opacity: 0; }
.stage.reveal .stage-gift { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
@keyframes shake {
  0% { transform: rotate(0); } 8% { transform: rotate(-4deg); } 16% { transform: rotate(4deg); } 24% { transform: rotate(0); }
  36% { transform: rotate(-7deg) scale(1.03); } 44% { transform: rotate(7deg) scale(1.03); } 52% { transform: rotate(0); }
  62% { transform: rotate(-11deg) scale(1.08); } 70% { transform: rotate(11deg) scale(1.08); } 78% { transform: rotate(-13deg) scale(1.12); } 86% { transform: rotate(13deg) scale(1.14); } 100% { transform: rotate(0) scale(1.2); }
}

.stage-flash { position: fixed; inset: 0; background: radial-gradient(circle at 50% 45%, #fff, #ffd98a 45%, rgba(255,120,190,0) 85%); opacity: 0; pointer-events: none; }
.stage.burst .stage-flash { animation: flash .75s ease-out; }
@keyframes flash { 12% { opacity: .95; } 100% { opacity: 0; } }

.card-holder { position: relative; z-index: 1; width: min(440px, 100%); margin: auto; perspective: 1400px; }

.card { position: relative; padding: 2px; border-radius: 28px; background: conic-gradient(from 210deg, var(--gold-1), var(--gold-3), #fff0b8, var(--magenta), var(--gold-2), #5e7bff, var(--gold-1)); box-shadow: 0 30px 80px rgba(2,2,30,.75), 0 0 70px rgba(246,120,190,.32); animation: card-in .75s cubic-bezier(.2,1.25,.4,1) both; }
@keyframes card-in { from { opacity: 0; transform: rotateX(62deg) translateY(90px) scale(.7); } }

.card-body { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 30px 24px 24px; border-radius: 26px; background: radial-gradient(130% 62% at 50% 0, #49309f 0, #221a70 52%, #120e4c 100%); }
.card-close { position: absolute; z-index: 3; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(10,8,56,.72); }
.card-close svg { width: 20px; height: 20px; }

.card-date { align-self: center; padding: 8px 18px; border-radius: 20px; font: 900 15px/1 "Gotham Pro", sans-serif; letter-spacing: .03em; color: #2a1800; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); }
.card-kicker { font-size: 14px; color: var(--muted); }

.card-product { position: relative; width: 100%; height: clamp(150px, 27vh, 230px); display: grid; place-items: center; }
.card-product::before { content: ""; position: absolute; left: 50%; top: 50%; width: 330px; height: 330px; margin: -165px 0 0 -165px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,108,190,.55), rgba(90,120,255,.22) 60%, transparent); }
.card-product img { position: relative; max-width: 72%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 18px 20px rgba(3,3,40,.65)); animation: product-float 3.6s ease-in-out infinite; }
@keyframes product-float { 50% { transform: translateY(-9px); } }

.card-title { margin: 0; font: 700 19px/1.25 "Gotham Pro", sans-serif; overflow-wrap: anywhere; }
.card-discount { font: 900 clamp(72px, 22vw, 104px)/1 "Gotham Pro", sans-serif; letter-spacing: -.02em; color: #ff3346; text-shadow: 0 6px 30px rgba(255,40,70,.45); }
.card-promo { font-size: 20px; }
.card-prices { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.card-oldrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.card-old { color: var(--muted); font-size: 16px; text-decoration: line-through; }
.card-saving { padding: 4px 10px; border-radius: 8px; font-size: 14px; font-weight: 900; color: #fff; background: linear-gradient(90deg, var(--magenta), #a31fc9); }
.card-new { font: 900 42px/1.1 "Gotham Pro", sans-serif; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 70%, #e7a437); -webkit-background-clip: text; background-clip: text; color: transparent; }

.cta { position: relative; overflow: hidden; display: block; width: 100%; padding: 19px 18px; border-radius: 16px; text-decoration: none; text-align: center; font: 900 16px/1.15 "Gotham Pro", sans-serif; color: #2a1800; background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 62%, #e7a437); box-shadow: 0 10px 24px rgba(240,170,60,.42), inset 0 2px 0 rgba(255,255,255,.65); }
.cta::after { content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 34%; transform: translateX(-160%) skewX(-18deg); background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.75) 50%, rgba(255,255,255,0) 100%); pointer-events: none; animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(420%) skewX(-18deg); } }
.cta.ghost { color: var(--text); background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.cta.ghost::after { display: none; }

.card-heading { margin: 0; font: 900 clamp(25px, 6vw, 31px)/1.1 "Gotham Pro", sans-serif; background: linear-gradient(180deg, #fff, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-sub { margin: 0; font-size: 17px; font-weight: 700; }
.card-text { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.card-notice { width: 100%; padding: 12px 14px; border-radius: 12px; font-weight: 700; color: #ffc0dc; background: rgba(227,11,123,.17); border: 1px solid rgba(255,110,185,.45); }
.card-art { width: 150px; height: 150px; }
.card-socials { display: flex; gap: 14px; justify-content: center; }
.card-socials a { display: block; width: 52px; height: 52px; }
.card-socials img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-draft { padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #06382a; background: #84f5c0; }

/* ---------- завантажувач ---------- */

.loader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: radial-gradient(90% 70% at 50% 42%, #3a1f92, #0a0a3a 72%); transition: opacity .7s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader img { width: min(230px, 62vw); height: auto; }
.loader-title { font: 900 clamp(26px, 6vw, 38px)/1.15 "Gotham Pro", sans-serif; background: linear-gradient(180deg, #fff, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loader-track { width: min(320px, 76vw); height: 12px; padding: 2px; border-radius: 12px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(246,198,90,.55); }
.loader-bar { height: 100%; width: 3%; border-radius: 8px; background: linear-gradient(90deg, var(--magenta), var(--gold-2)); box-shadow: 0 0 14px rgba(255,120,190,.9); transition: width .3s; }
.loader-text { color: var(--muted); font-size: 14px; }
.loader-retry { margin-top: 6px; }

/* ---------- мобільні екрани ---------- */

@media (max-width: 640px) {
  .hud { padding-top: calc(var(--safe-t) + 10px); }
  .hud-status { top: calc(var(--safe-t) + 60px); padding: 6px 16px 7px; min-width: 176px; }
  .hud-label { font-size: 11px; }
  .hud-timer { font-size: 18px; }
  .hud-collected { height: 40px; }
  .card-new { font-size: 36px; }
  .card-body { padding: 26px 18px 18px; gap: 10px; }
  .card-title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
