/* Super Cup — mobile-first artboard layout, scaled from the approved mockups.
   Mobile artboard: 1080×1920. Desktop artboard: 1920×1080. */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Manrope", "Manrope Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* unitless scale; also set by a tiny head script / resize handler */
  --art-scale: calc(100vw / 1080px);
  --card-bg: rgba(18, 14, 42, 0.922);
  --pink: #ff50dc;
  --blue: #46b4ff;
  --text: #ffffff;
  --sub: rgb(230, 232, 255);
  --date: rgb(240, 242, 255);
  --tap: rgb(236, 238, 255);
  --hint: rgb(168, 170, 210);
  --dash: rgba(140, 200, 255, 0.90);
  --well-bg: rgba(10, 10, 28, 0.78);
}

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

html, body {
  min-height: 100%;
  background: #16082e;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { overflow-x: hidden; overflow-y: auto; }

/* ---------- Stage + artboard (mobile default) ---------- */
.stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  height: calc(var(--art-h, 1920px) * var(--art-scale));
  overflow: hidden;
  background-color: rgb(65, 152, 255);
  background-image: url("../img/bg-mobile.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
}

.artboard {
  position: absolute;
  width: 1080px;
  height: var(--art-h, 1920px);
  min-height: 1920px;
  left: 50%;
  top: 0;
  margin-left: -540px;
  transform-origin: top center;
  transform: scale(var(--art-scale));
}

/* ---------- Logo ---------- */
.logo-wrap {
  position: absolute;
  /* 1.7× the first ORCF size: fills the band under the top stickers
     and above the card, ~74% of the 1080 artboard (near the 80% target)
     without colliding with the camera, star, or Let's go. */
  left: 142px;
  top: 358px;
  width: 797px;
  margin: 0;
  z-index: 3;
  line-height: 0;
}

.logo {
  display: block;
  width: 797px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* ---------- Stickers (mobile positions) ---------- */
.sticker {
  position: absolute;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  filter: drop-shadow(6px 10px 10px rgba(8, 4, 28, 0.45));
}

.sticker-letsgo    { left: 279px; top: 14px;  width: 522px; z-index: 2; }
.sticker-smile     { left: 23px;  top: 128px; width: 244px; z-index: 2; }
.sticker-star      { left: 844px; top: 119px; width: 212px; z-index: 2; }
.sticker-bow       { left: -18px; top: 1017px; width: 185px; z-index: 5; }
.sticker-heart     { left: 928px; top: 1023px; width: 173px; z-index: 5; }
.sticker-megaphone,
.sticker-ticket    { display: none; }

/* Card + bottom sticker row: a column starting at the approved card Y.
   When the card grows, the jumper / ODESA / heartpom row is pushed down
   and the page gets taller instead of the card covering the stickers. */
.lower {
  position: absolute;
  left: 0;
  top: 767px;
  width: 1080px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
}

.card-wrap {
  position: relative;
  left: auto;
  top: auto;
  width: 899px;
  min-height: 777px;
  height: auto;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex: 0 0 auto;
}

/* 1475 (sticker row top) − 1439 (empty card-wrap bottom) = 36px gap.
   Row height 445px makes the empty artboard exactly 1920:
   662 + 777 + 36 + 445 = 1920. */
.sticker-row-bottom {
  position: relative;
  width: 1080px;
  min-height: 445px;
  margin-top: 36px;
  flex: 0 0 auto;
  z-index: 2;
}

.sticker-row-bottom .sticker-jumper    { left: 25px;  top: 0;   width: 260px; z-index: 2; }
.sticker-row-bottom .sticker-odesa     { left: 339px; top: 33px; width: 402px; z-index: 2; }
.sticker-row-bottom .sticker-heartpom  { left: 772px; top: 13px; width: 305px; z-index: 2; }

.card {
  --body: 800;
  --s: calc(800 / 840);
  position: relative;
  width: 800px;
  padding: calc(32px * var(--s)) calc(32px * var(--s)) calc(28px * var(--s));
  border-radius: calc(36px * var(--s));
  background: var(--card-bg);
  text-align: center;
  isolation: isolate;
}

/* pink → blue neon glow (outside the glass) */
.card {
  box-shadow:
    -20px 0 38px 6px rgba(255, 80, 220, 0.58),
    20px 0 38px 6px rgba(70, 180, 255, 0.58),
    -8px 0 16px 2px rgba(255, 80, 220, 0.80),
    8px 0 16px 2px rgba(70, 180, 255, 0.80);
}
.card::after {
  content: "";
  position: absolute;
  inset: -34px;
  border-radius: calc(36px * var(--s) + 34px);
  padding: 34px;
  background: linear-gradient(90deg, rgba(255, 80, 220, 0.95), rgba(70, 180, 255, 0.95));
  filter: blur(18px);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
}

/* crisp gradient stroke */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2.7px;
  background: linear-gradient(90deg, #ff50dc, #46b4ff);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

.card-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(160, 140, 255, 0.13), transparent 48%);
  pointer-events: none;
  z-index: 0;
}

.headline,
.subtitle,
.date,
.zone { position: relative; z-index: 1; }

.headline {
  font-weight: 800;
  font-size: calc(52px * var(--s));
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow:
    0 0 10px rgba(255, 90, 230, 0.95),
    0 0 22px rgba(255, 90, 230, 0.70),
    0 0 14px rgba(80, 180, 255, 0.55),
    0 0 28px rgba(80, 180, 255, 0.30);
}

.subtitle {
  margin-top: calc(16px * var(--s));
  font-weight: 700;
  font-size: calc(30px * var(--s));
  line-height: 1.25;
  color: var(--sub);
}

/* ---------- Upload zone ---------- */
.zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(730px * var(--body) / 800);
  min-height: calc(410px * var(--body) / 800);
  height: calc(410px * var(--body) / 800);
  margin: calc(22px * var(--s)) auto 0;
  border-radius: calc(22px * var(--s));
  background: var(--well-bg);
  cursor: pointer;
  overflow: hidden;
}

.zone.is-filled {
  height: auto;
  justify-content: flex-start;
}

/* After success with no preview: keep a comfortable zone and stack the
   celebration (dino + thanks + button) from the top, not over the bar. */
.zone.is-filled.is-done {
  height: auto;
  min-height: calc(410px * var(--body) / 800);
  justify-content: flex-start;
}
.zone.is-filled.is-done .zone-files {
  justify-content: flex-start;
  flex: 1 1 auto;
}
/* Empty success fallback (no dino, e.g. reduced-motion after reset) */
.zone.is-filled:not(.is-uploading):not(.is-done):not(:has(.thumb)) {
  height: calc(410px * var(--body) / 800);
  justify-content: center;
}
.zone.is-filled:not(.is-uploading):not(.is-done):not(:has(.thumb)) .zone-files {
  justify-content: center;
  flex: 1 1 auto;
}

/* diagonal dashed border, matching the mockup hatch */
.zone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: calc(2.4px * var(--s));
  background: repeating-linear-gradient(
    135deg,
    rgba(140, 200, 255, 0.92) 0 calc(11px * var(--s)),
    transparent calc(11px * var(--s)) calc(20px * var(--s))
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.zone:focus-visible {
  outline: 3px solid rgba(70, 180, 255, 0.85);
  outline-offset: 4px;
}

.zone-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--s));
  padding: calc(12px * var(--s));
}

.cam-icon {
  width: calc(110px * var(--s));
  height: auto;
  color: rgb(230, 235, 255);
  margin-bottom: calc(8px * var(--s));
  display: block;
}

.zone-tap {
  font-weight: 700;
  font-size: calc(26px * var(--s));
  color: var(--tap);
  line-height: 1.2;
}

.zone-hint {
  font-weight: 500;
  font-size: calc(18px * var(--s));
  color: var(--hint);
  line-height: 1.2;
}

.zone-files {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(20px * var(--s)) calc(22px * var(--s)) calc(36px * var(--s));
  gap: calc(16px * var(--s));
  z-index: 1;
}

.zone-files[hidden],
.zone-idle[hidden],
.status[hidden],
.progress[hidden] { display: none !important; }

.thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: calc(12px * var(--s));
  width: 100%;
  flex: 0 0 auto;
  overflow: visible;
}

.thumbs:empty { display: none; }

.thumb {
  position: relative;
  width: calc(320px * var(--s));
  height: calc(320px * var(--s));
  border-radius: calc(16px * var(--s));
  overflow: hidden;
  flex: 0 0 auto;
  background: #0a0a1c;
  box-shadow: 0 0 0 2px rgba(180, 200, 255, 0.25);
}

/* Smaller preview while the dino needs vertical room above the bar */
.zone.is-uploading .thumb {
  width: calc(160px * var(--s));
  height: calc(160px * var(--s));
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: calc(44px * var(--s));
  height: calc(44px * var(--s));
  border: 0;
  border-radius: 50%;
  background: rgba(12, 8, 28, 0.78);
  color: #fff;
  font-size: calc(28px * var(--s));
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(10px * var(--s));
  justify-content: center;
  width: 100%;
  flex: 0 0 auto;
  /* A little extra air above the buttons, in every filled state */
  margin-top: calc(20px * var(--s));
}

.btn-upload,
.btn-ghost {
  font-family: inherit;
  font-weight: 700;
  font-size: calc(32px * var(--s));
  line-height: 1.15;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: calc(14px * var(--s)) calc(28px * var(--s));
}

.btn-upload {
  color: #fff;
  background: linear-gradient(90deg, #ff4cd8, #5aa8ff);
  box-shadow: 0 0 16px rgba(255, 80, 220, 0.45);
}

.btn-upload:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-ghost {
  color: var(--tap);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(180, 200, 255, 0.45);
}

.progress {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Keep the label (and therefore the buttons below) clear of the dino */
  gap: calc(14px * var(--s));
}

/* Official 44x47 T-rex in a 52x59 padded frame, 4 frames across */
.dino-sky {
  --dino-n: 3;
  --dino-w: calc(52px * var(--dino-n));
  --dino-h: calc(59px * var(--dino-n));
  position: relative;
  width: 100%;
  /* Full dino height + jump clearance so nothing is clipped */
  height: calc(var(--dino-h) + 52px);
  overflow: visible;
  pointer-events: none;
}

.dino-pos {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--dino-w);
  height: var(--dino-h);
  will-change: left;
}

.dino {
  display: block;
  width: var(--dino-w);
  height: var(--dino-h);
  background-image: url("../img/dino-sprites.png");
  background-repeat: no-repeat;
  background-size: calc(var(--dino-w) * 4) var(--dino-h);
  background-position: 0 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

.dino.is-run {
  animation: dino-trot 0.2s steps(2) infinite;
}

.dino.is-jump {
  background-position: calc(var(--dino-w) * -2) 0;
  animation: dino-hop 0.45s ease-out;
}

.dino.is-happy {
  background-position: calc(var(--dino-w) * -3) 0;
  animation: none;
}

@keyframes dino-trot {
  from { background-position: 0 0; }
  to   { background-position: calc(var(--dino-w) * -2) 0; }
}

@keyframes dino-hop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-48px); }
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(80, 90, 140, 0.45);
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4cd8, #5aa8ff);
  transition: width 0.2s ease;
}

.progress-label {
  margin-top: 0;
  font-weight: 600;
  font-size: calc(22px * var(--s));
  color: var(--sub);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .dino.is-run,
  .dino.is-jump {
    animation: none;
  }
  .progress-bar {
    transition: none;
  }
}

.status {
  position: static;
  display: block;
  width: 100%;
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: calc(36px * var(--s));
  line-height: 1.35;
  padding: calc(4px * var(--s)) calc(8px * var(--s));
  z-index: auto;
  pointer-events: none;
}

.status-ok { color: #f4e8ff; text-shadow: 0 0 16px rgba(200, 120, 255, 0.55); }
.status-err { color: #ffd0e0; }
.status-note { color: var(--sub); font-size: calc(22px * var(--s)); }

.date {
  margin-top: calc(18px * var(--s));
  font-weight: 700;
  font-size: calc(34px * var(--s));
  color: var(--date);
  letter-spacing: 0.01em;
}

/* ---------- Desktop (1920 artboard, like supercup_desktop_mockup) ---------- */
@media (min-width: 800px) {
  :root { --art-scale: calc(100vw / 1920px); }

  .stage {
    height: max(100dvh, calc(var(--art-h, 1080px) * var(--art-scale)));
    background-color: rgb(86, 150, 255);
    background-image: url("../img/bg-desktop.webp");
    background-position: center top;
    background-size: 100% auto;
  }

  .artboard {
    width: 1920px;
    height: var(--art-h, 1080px);
    min-height: 1080px;
    left: 50%;
    top: 0;
    margin-left: -960px;
    margin-top: 0;
    transform-origin: top center;
    transform: scale(var(--art-scale));
  }

  .logo-wrap { left: 518px; top: 36px; width: 884px; }
  .logo { width: 884px; }

  .sticker-bow,
  .sticker-heart { display: none; }

  .sticker-megaphone,
  .sticker-ticket { display: block; }

  .sticker-smile     { left: 78px;   top: 24px;  width: 244px; }
  .sticker-star      { left: 1636px; top: 6px;   width: 208px; }
  .sticker-jumper,
  .sticker-row-bottom .sticker-jumper    { left: 48px;   top: 279px; width: 255px; }
  .sticker-odesa,
  .sticker-row-bottom .sticker-odesa     { left: 1548px; top: 246px; width: 344px; }
  .sticker-megaphone { left: 56px;   top: 601px; width: 288px; }
  .sticker-letsgo    { left: 1489px; top: 609px; width: 352px; }
  .sticker-heartpom,
  .sticker-row-bottom .sticker-heartpom  { left: 291px;  top: 816px; width: 278px; }
  .sticker-ticket    { left: 1503px; top: 881px; width: 314px; }

  /* Unwrap the mobile column so side stickers stay on the 1920 artboard */
  .lower,
  .sticker-row-bottom {
    display: contents;
  }

  .card-wrap {
    position: absolute;
    left: 668px;
    top: 486px;
    width: 584px;
    min-height: 505px;
    height: auto;
  }

  .card {
    --body: 520;
    --s: calc(520 / 840);
    width: 520px;
  }

  .thumb {
    width: calc(260px * var(--s));
    height: calc(260px * var(--s));
  }
  .zone.is-uploading .thumb {
    width: calc(120px * var(--s));
    height: calc(120px * var(--s));
  }
  .dino-sky {
    --dino-n: 2.5;
  }
}

/* Very wide: don't upscale past the 1920 artboard */
@media (min-width: 1920px) {
  :root { --art-scale: 1; }
  .stage {
    height: 100dvh;
    background-size: 1920px auto;
    background-position: center top;
  }
  .artboard {
    transform: scale(1);
  }
}
