/* Minimart – коледни късмети 2026 */
@font-face {
  font-family: "Manrope";
  src: url("manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Brand book 2023 + colours sampled from the Christmas card */
  --navy: #00394a;      /* Minimart Deep Green */
  --ink: #052f42;       /* card headline */
  --green: #8dc63f;     /* Minimart Light Green */
  --red: #e72b3e;       /* card frame, baubles */
  --red-dark: #cf2032;  /* gift; AA-safe red for text */
  --cream: #fffeec;     /* garland, hat fur */
  --gold: #f5cb05;      /* star */
  --cw: min(calc(100vw - 36px), 420px);   /* card width */
  --stripe: clamp(44px, 12vw, 66px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--navy);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  background-color: var(--navy);
  background-image: linear-gradient(90deg, var(--navy) 50%, var(--green) 50%);
  background-size: calc(var(--stripe) * 2) 100%;
  background-position: calc(50% + var(--stripe) / 2) 0;
}

.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--cw) * .13 + 18px) 18px calc(18px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

/* ---------- card ---------- */
.card {
  position: relative;
  width: var(--cw);
  background: #fff;
  border: 3px solid var(--red);
  border-radius: 28px;
  padding: 26px 18px 22px;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0, 25, 33, .12), 0 22px 44px -12px rgba(0, 20, 28, .55);
}

.logo {
  display: block;
  width: 42%;
  height: auto;
  margin: 0 auto 14px;
}

.title {
  margin: 0 auto;
  max-width: 13.5em;
  font-size: clamp(22px, 6.4vw, 27px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.012em;
  color: var(--ink);
  text-wrap: balance;
}

/* ---------- scratch area ---------- */
.scratch {
  position: relative;
  isolation: isolate;
  margin-top: 18px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(141, 198, 63, .55), 0 8px 18px -8px rgba(0, 57, 74, .35);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Before the foil is painted, show a flat foil so the fortune never flashes. */
.scratch:not(.is-ready) {
  background: linear-gradient(135deg, #c3c5c8, #eceef0 30%, #bfc1c4 55%, #e3e5e7 80%, #b9bbbe);
}
.scratch:not(.is-ready) .fortune { visibility: hidden; }

.fortune {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 212px;
  padding: 24px 20px 26px;
  outline: none;
}
.fortune:focus-visible { box-shadow: inset 0 0 0 3px var(--gold); border-radius: 18px; }

.fortune__stars { width: 64px; height: auto; flex: none; }

.fortune__text {
  margin: 0;
  font-size: clamp(18px, 5.3vw, 22px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.005em;
  color: var(--ink);
  text-wrap: balance;
}

.foil {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: pointer;
  transition: opacity .6s ease;
}
.foil.is-static { cursor: default; touch-action: auto; }
.foil.is-gone { opacity: 0; pointer-events: none; }

/* light sweep across untouched foil */
.scratch.is-foil::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .6) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: sheen 3.6s ease-in-out 1.2s infinite;
}
.scratch.is-touched::after, .scratch.is-done::after { display: none; }

@keyframes sheen {
  0% { transform: translateX(-130%); }
  40%, 100% { transform: translateX(130%); }
}

.fortune.is-pop .fortune__text { animation: pop .7s cubic-bezier(.2, 1.5, .4, 1) both; }
.fortune.is-pop .fortune__stars { animation: pop .7s .08s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes pop {
  from { transform: scale(.9); }
  to { transform: scale(1); }
}

.noscript {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  background: var(--cream);
  font-weight: 600;
}

/* ---------- below the card ---------- */
.below {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 112px;        /* room for the post-reveal lines, so nothing jumps on reveal */
  margin-top: 16px;
  padding: 0 calc(var(--cw) * .12);
}

.line {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--red-dark);
  text-wrap: balance;
}

.note {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[hidden] { display: none; }

.btn--ghost {
  background: #fff;
  color: var(--navy);
  border: 2px solid rgba(0, 57, 74, .22);
}
.btn--ghost:hover { border-color: var(--navy); }

.btn--primary {
  margin-top: 8px;
  background: var(--navy);
  color: #fff;
  border: 0;
}
.btn--primary:hover { background: #00495e; }

/* ---------- decorations (mirror the paper card) ---------- */
.deco {
  position: absolute;
  z-index: 5;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 5px rgba(0, 30, 40, .28));
}
.deco--hat  { width: calc(var(--cw) * .34);  top: calc(var(--cw) * -.125); right: calc(var(--cw) * -.04); transform: rotate(9deg); }
.deco--cane { width: calc(var(--cw) * .1);   top: calc(var(--cw) * -.075); left: calc(var(--cw) * -.03); transform: rotate(-14deg); }
.deco--tree { width: calc(var(--cw) * .215); bottom: calc(var(--cw) * -.045); left: calc(var(--cw) * -.04); transform: rotate(-4deg); }
.deco--gift { width: calc(var(--cw) * .195); bottom: calc(var(--cw) * -.04); right: calc(var(--cw) * -.035); transform: rotate(5deg); }

/* ---------- footer, test tag ---------- */
.foot { margin-top: calc(var(--cw) * .09 + 10px); }
.foot a {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(0, 57, 74, .92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
}
.foot a:hover { text-decoration: underline; }
.foot a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.test-tag {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  z-index: 20;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 700px) {
  .card { border-radius: 32px; padding: 30px 26px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .scratch.is-foil::after { display: none; }
  .foil { transition: none; }
  .fortune.is-pop .fortune__text, .fortune.is-pop .fortune__stars { animation: none; }
  .btn { transition: none; }
}
