/* Badass Coffee Project pecsétkártya */

:root {
  --bg: #0e0b10;
  --bg-raised: #1a141d;
  --fg: #f8f1fa;
  --muted: #b7a6bd;
  --line: rgba(248, 241, 250, 0.14);
  --lilac: #e2aaef;
  --lilac-hi: #f0c9f8;
  --lilac-lo: #d79ae6;
  --ink: #2b2b2b;
  --ink-soft: rgba(43, 43, 43, 0.55);
  --on-lilac: #1c1420;
  --display: "Avenir Next Condensed", "Bahnschrift Condensed", "Roboto Condensed", sans-serif-condensed, "Arial Narrow", system-ui, sans-serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
  --ease-pop: cubic-bezier(0.2, 0.9, 0.3, 1.25);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --wire: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='14' viewBox='0 0 96 14'%3E%3Cg fill='none' stroke='%232b2b2b' stroke-linecap='round'%3E%3Cpath stroke-width='1.5' d='M0 7c5.3-4 10.7-4 16 0s10.7 4 16 0 10.7-4 16 0 10.7 4 16 0 10.7-4 16 0 10.7 4 16 0'/%3E%3Cpath stroke-width='1.5' d='M0 7c5.3 4 10.7 4 16 0s10.7-4 16 0 10.7 4 16 0 10.7-4 16 0 10.7 4 16 0 10.7-4 16 0'/%3E%3Cpath stroke-width='1.6' d='M42 1.5l12 11M54 1.5l-12 11'/%3E%3Cpath stroke-width='1.3' d='M45.5 3.5v7M48 3v8M50.5 3.5v7'/%3E%3C/g%3E%3C/svg%3E");
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--fg);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(120% 60% at 50% -15%, rgba(226, 170, 239, 0.3), transparent 62%),
    radial-gradient(90% 55% at 105% 108%, rgba(226, 170, 239, 0.14), transparent 60%);
}

body::after {
  background-image: var(--grain);
  opacity: 0.07;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible {
  outline: 3px solid var(--lilac);
  outline-offset: 3px;
}

.app {
  width: min(100%, 460px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Fejléc */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff, 0 10px 22px -6px rgba(0, 0, 0, 0.7);
  transform: rotate(-8deg);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(248, 241, 250, 0.04);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}

/* Számláló */

.hero {
  animation: rise 0.6s var(--ease-out) both;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 6px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(88px, 27vw, 116px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transform-origin: left bottom;
}

.count .of {
  color: var(--muted);
  font-size: 0.36em;
  letter-spacing: 0.02em;
}

.count.is-full #countNum {
  color: var(--lilac);
}

.count.is-bumping {
  animation: bump 0.45s var(--ease-pop);
}

.subline {
  min-height: 2.9em;
  margin: 12px 0 0;
  max-width: 30ch;
  font-size: 17px;
}

/* Kártya */

.card-wrap {
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, 0.6));
  will-change: transform;
}

.card-wrap.is-full {
  filter: drop-shadow(0 0 26px rgba(226, 170, 239, 0.55)) drop-shadow(0 20px 26px rgba(0, 0, 0, 0.6));
}

.card-wrap.is-shaking {
  animation: shake 0.42s ease-out;
}

.card-wrap.is-fresh {
  animation: fresh 0.6s var(--ease-out) both;
}

.card {
  --notch-y: calc(100% - 52px);
  position: relative;
  padding: 16px 16px 0;
  border-radius: 22px;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(165deg, #edc3f6 0%, #e2aaef 55%, #d89ee7 100%);
  -webkit-mask:
    radial-gradient(circle 12px at 0 var(--notch-y), transparent 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 12px at 100% var(--notch-y), transparent 97%, #000) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle 12px at 0 var(--notch-y), transparent 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 12px at 100% var(--notch-y), transparent 97%, #000) right / 51% 100% no-repeat;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  animation: rise 0.7s 0.06s var(--ease-out) both;
}

.card::before {
  content: "";
  position: absolute;
  top: -46px;
  right: -96px;
  width: 220px;
  height: 220px;
  background: url("img/mark.png") center / contain no-repeat;
  opacity: 0.06;
  transform: rotate(16deg);
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.14;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: block;
  width: 150px;
  height: auto;
  -webkit-user-drag: none;
}

.card-no {
  padding-top: 4px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: right;
  text-transform: uppercase;
}

.card-no b {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.06em;
}

.slots {
  --cols: 5;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 8px 6px;
  margin: 14px 0 18px;
  padding: 0;
  list-style: none;
}

.slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  touch-action: manipulation;
  transition: transform 0.12s ease;
}

.slot::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px dashed rgba(43, 43, 43, 0.32);
  border-radius: 50%;
  transition: opacity 0.2s, border-color 0.2s;
}

.slot-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  color: rgba(43, 43, 43, 0.38);
}

.slot-gift {
  width: 44%;
  height: 44%;
  color: rgba(43, 43, 43, 0.42);
}

.slot.is-next {
  cursor: pointer;
}

.slot.is-next::before {
  border-color: var(--ink);
  animation: pulse 1.6s ease-in-out infinite;
}

.slot.is-next .slot-num,
.slot.is-next .slot-gift {
  color: var(--ink);
}

.slot.is-next:active {
  transform: scale(0.92);
}

.slot.is-filled::before,
.slot.is-filled .slot-num,
.slot.is-filled .slot-gift {
  opacity: 0;
}

.mark {
  position: absolute;
  top: -4%;
  left: -4%;
  width: 108%;
  height: 108%;
  color: var(--ink);
  opacity: 0.92;
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg));
  pointer-events: none;
}

.mark.is-slamming {
  animation: slam 0.46s var(--ease-pop) both;
}

.splat {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
}

.card-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  margin: 0 -16px;
  padding: 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.card-foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -7px;
  height: 14px;
  background: var(--wire) left center / 96px 14px repeat-x;
  opacity: 0.85;
}

.card-foot b {
  color: var(--ink);
}

.foot-cup {
  width: 22px;
  height: 22px;
  color: var(--ink-soft);
}

.done {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 84%;
  color: var(--ink);
  opacity: 0;
  transform: translate(-50%, -46%) rotate(-9deg);
  pointer-events: none;
}

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

.done.is-on {
  opacity: 1;
}

.done.is-slamming {
  animation: slam-big 0.55s var(--ease-pop) both;
}

.done-small,
.done-big {
  font-family: var(--display);
  font-weight: 800;
  fill: currentColor;
}

.done-small {
  font-size: 17px;
  letter-spacing: 3px;
}

.done-big {
  font-size: 50px;
  letter-spacing: 1px;
}

/* Gombok */

.actions {
  animation: rise 0.7s 0.12s var(--ease-out) both;
}

.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 0 22px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--lilac-hi), var(--lilac-lo));
  color: var(--on-lilac);
  font-family: var(--display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 rgba(60, 20, 70, 0.22),
    0 16px 34px -12px rgba(226, 170, 239, 0.65);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cta:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(60, 20, 70, 0.22),
    0 8px 18px -10px rgba(226, 170, 239, 0.65);
}

.cta svg {
  flex: none;
  width: 30px;
  height: 30px;
  transition: transform 0.15s var(--ease-pop);
}

.cta:active svg {
  transform: translateY(3px) scaleY(0.9);
}

.cta-reward {
  background: linear-gradient(180deg, #ffffff, #efe2f3);
  animation: glow 2.2s ease-in-out infinite;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.btn-solid,
.btn-text {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
}

.btn-solid {
  background: var(--lilac);
  color: var(--on-lilac);
}

.btn-text {
  background: transparent;
  color: var(--muted);
}

/* Főképernyő ajánló */

.install {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px;
  border: 1.5px dashed rgba(226, 170, 239, 0.35);
  border-radius: 18px;
  background: rgba(226, 170, 239, 0.05);
  animation: rise 0.7s 0.2s var(--ease-out) both;
}

.install-icon {
  width: 30px;
  height: 30px;
  color: var(--lilac);
}

.install h2 {
  margin: 2px 0 4px;
  font-size: 16px;
}

.install p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.install p + p {
  margin-top: 6px;
}

.install-tip {
  font-size: 13px !important;
}

.inline-ico {
  width: 17px;
  height: 17px;
  vertical-align: -3px;
  color: var(--fg);
}

.install-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.install-row .btn-text {
  padding: 0 8px;
}

.install[data-kind="ios"] [data-android],
.install[data-kind="android"] [data-ios] {
  display: none;
}

/* Lábléc */

.foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.foot p {
  margin: 4px 0;
}

.foot b {
  color: var(--fg);
}

.warn {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(226, 170, 239, 0.14);
  color: #f3d9f9;
  font-size: 13px;
}

.noscript {
  margin: 24px;
  text-align: center;
}

/* Értesítés */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(calc(100% - 32px), 424px);
  min-height: 56px;
  padding: 8px 8px 8px 18px;
  border-radius: 16px;
  background: #f8f1fa;
  color: var(--on-lilac);
  font-weight: 600;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.7);
  visibility: hidden;
  transform: translate(-50%, calc(100% + 48px));
  transition: transform 0.35s var(--ease-out), visibility 0s 0.35s;
}

.toast.is-visible {
  visibility: visible;
  transform: translate(-50%, 0);
  transition: transform 0.35s var(--ease-out);
}

.toast button {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(226, 170, 239, 0.45);
  color: #5e2470;
  font-weight: 700;
}

/* Alsó lapok */

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.sheet[open] {
  animation: sheet-up 0.34s var(--ease-out) both;
}

.sheet::backdrop {
  background: rgba(8, 5, 10, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.sheet-body {
  padding: 14px 22px calc(env(safe-area-inset-bottom, 0px) + 22px);
}

.grabber {
  width: 42px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 3px;
  background: rgba(248, 241, 250, 0.22);
}

.sheet h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sheet p {
  margin: 0 0 14px;
  color: var(--muted);
}

.sheet .cta {
  margin-top: 6px;
  font-size: 21px;
}

.sheet .btn-text {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.reward-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.disc {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--lilac-hi), var(--lilac-lo));
  color: var(--on-lilac);
  box-shadow: 0 10px 26px -8px rgba(226, 170, 239, 0.6);
}

.disc svg {
  width: 34px;
  height: 34px;
}

.reward-count {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4cd06a;
  animation: live 1.4s ease-out infinite;
}

.steps {
  margin: 6px 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 12px 0 12px 44px;
  border-bottom: 1px solid var(--line);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--lilac);
  color: var(--on-lilac);
  font-family: var(--display);
  font-weight: 800;
}

.note {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(248, 241, 250, 0.05);
}

.note h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.note p {
  margin: 0 0 8px;
  font-size: 14px;
}

.note p:last-child {
  margin-bottom: 0;
}

html:not(.is-ios) [data-ios-only],
html.is-ios [data-android-only] {
  display: none;
}

/* Konfetti */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  margin: -6px 0 0 -6px;
}

.confetti .heart {
  width: 12px;
  height: 11px;
  clip-path: path("M6 10.6 1.3 6A3 3 0 0 1 6 2.3 3 3 0 0 1 10.7 6Z");
}

/* Animációk */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fresh {
  from {
    opacity: 0;
    transform: translateX(46px) rotate(6deg);
  }
  to {
    opacity: 1;
    transform: rotate(-1.2deg);
  }
}

@keyframes shake {
  0% {
    transform: rotate(-1.2deg);
  }
  20% {
    transform: translateY(4px) rotate(-1.9deg) scale(0.992);
  }
  45% {
    transform: translateY(-2px) rotate(-0.6deg);
  }
  70% {
    transform: translateY(1px) rotate(-1.4deg);
  }
  100% {
    transform: rotate(-1.2deg);
  }
}

@keyframes slam {
  0% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(calc(var(--r) + 18deg)) scale(2.4);
  }
  55% {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.88);
  }
  78% {
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1.05);
  }
  100% {
    opacity: 0.92;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1);
  }
}

@keyframes slam-big {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%) rotate(-2deg) scale(2);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -46%) rotate(-9deg) scale(0.93);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -46%) rotate(-9deg) scale(1);
  }
}

@keyframes bump {
  40% {
    transform: scale(1.12);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.9);
    opacity: 0.55;
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      inset 0 -4px 0 rgba(60, 20, 70, 0.14),
      0 16px 34px -12px rgba(226, 170, 239, 0.55);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      inset 0 -4px 0 rgba(60, 20, 70, 0.14),
      0 0 0 4px rgba(226, 170, 239, 0.35),
      0 18px 46px -8px rgba(226, 170, 239, 0.9);
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

@keyframes live {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 208, 106, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(76, 208, 106, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
