/* ============================================================
   betto rewards public site v2
   Brand: #0362D4 royal blue + white on deep navy.
   Type: Sora. Calm, rounded, professional.
   ============================================================ */

:root {
  --brand: #0362D4;
  --brand-bright: #3D8DFF;
  --brand-soft: #A9CBFF;
  --ink: #F2F6FE;
  --ink-dim: #8DA2C6;
  --navy-0: #050B18;
  --navy-1: #081226;
  --navy-2: #0C1B38;
  --card: rgba(12, 27, 56, 0.6);
  --stroke: rgba(169, 203, 255, 0.12);
  --stroke-strong: rgba(61, 141, 255, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Sora', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--navy-0);
  color: var(--ink);
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(3, 98, 212, 0.45); color: #fff; }

/* ---------- animated background ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, var(--navy-1) 0%, var(--navy-0) 65%);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  will-change: transform;
}
.orb-a {
  width: 560px; height: 560px; top: -220px; right: -120px;
  background: radial-gradient(circle, rgba(3, 98, 212, 0.55), transparent 65%);
  animation: drift-a 18s ease-in-out infinite alternate;
}
.orb-b {
  width: 420px; height: 420px; bottom: -180px; left: -140px;
  background: radial-gradient(circle, rgba(3, 98, 212, 0.35), transparent 65%);
  animation: drift-b 22s ease-in-out infinite alternate;
}
.orb-c {
  width: 300px; height: 300px; top: 40%; left: 55%;
  background: radial-gradient(circle, rgba(61, 141, 255, 0.18), transparent 65%);
  animation: drift-c 26s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(-60px, 50px) scale(1.08); } }
@keyframes drift-b { to { transform: translate(70px, -40px) scale(1.12); } }
@keyframes drift-c { to { transform: translate(-80px, -60px) scale(0.92); } }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  width: min(1120px, 100%); margin: 0 auto;
  padding: clamp(18px, 4vw, 30px) clamp(18px, 5vw, 32px) 0;
}
.brand-logo { height: clamp(24px, 5vw, 32px); width: auto; }
.topbar-tag {
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--brand-soft); background: rgba(3, 98, 212, 0.16);
  border: 1px solid var(--stroke); border-radius: 100px; padding: 5px 12px;
  transform: translateY(2px);
}

/* ---------- screens ---------- */
#app {
  flex: 1;
  width: min(1120px, 100%); margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 32px);
}

.screen { display: none; }
.screen.is-active { display: block; animation: screenIn 0.6s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; animation: rise 0.8s var(--ease) forwards; }
.r1 { animation-delay: 0.05s; } .r2 { animation-delay: 0.16s; } .r3 { animation-delay: 0.28s; }
.r4 { animation-delay: 0.4s; } .r5 { animation-delay: 0.6s; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ---------- landing ---------- */
.landing-grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(36px, 6vw, 72px); align-items: center;
  padding: clamp(40px, 8vh, 96px) 0 clamp(48px, 9vh, 100px);
}

.hero-title {
  font-size: clamp(30px, 5.4vw, 58px);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.025em;
}
.grad {
  background: linear-gradient(92deg, #5EA4FF 0%, #3D8DFF 30%, #9CC4FF 55%, #3D8DFF 80%, #5EA4FF 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 6s ease-in-out infinite;
}
@keyframes gradShift { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.hero-sub {
  margin-top: 20px; max-width: 44ch;
  font-size: clamp(14.5px, 1.6vw, 16.5px); line-height: 1.75; color: var(--ink-dim);
}

.steps {
  list-style: none; margin-top: clamp(28px, 4vh, 44px);
  display: flex; flex-direction: column; gap: 14px;
}
.steps li {
  display: flex; align-items: center; gap: 14px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-dim);
}
.steps li span {
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  font-size: 12px; font-weight: 700; color: var(--brand-soft);
  background: rgba(3, 98, 212, 0.16); border: 1px solid var(--stroke); border-radius: 50%;
}

/* ---------- join card ---------- */
.join-card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: 22px;
  padding: clamp(26px, 4vw, 36px);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 32px 90px rgba(2, 7, 20, 0.65), inset 0 1px 0 rgba(169, 203, 255, 0.07);
}

.join-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.join-sub { font-size: 13px; color: var(--ink-dim); margin: 6px 0 24px; }

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-dim); margin-bottom: 7px;
}
.field input {
  width: 100%; padding: 14px 16px;
  font-family: var(--font); font-size: 15px; color: var(--ink);
  background: rgba(5, 11, 24, 0.6);
  border: 1px solid var(--stroke); border-radius: 13px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
}
.field input::placeholder { color: rgba(141, 162, 198, 0.45); }
.field input:focus {
  border-color: var(--brand-bright);
  background: rgba(5, 11, 24, 0.85);
  box-shadow: 0 0 0 4px rgba(3, 98, 212, 0.18);
}

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error { color: #FF8585; font-size: 13px; min-height: 19px; margin-bottom: 8px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 52px; padding: 15px 20px; cursor: pointer;
  font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; background: linear-gradient(180deg, #2B7FE8, var(--brand));
  border: none; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(3, 98, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.18s var(--ease), box-shadow 0.25s, filter 0.2s;
}
.btn-primary svg { transition: transform 0.2s var(--ease); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(3, 98, 212, 0.55); filter: brightness(1.06); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; transform: none; }

.join-fine { margin-top: 16px; font-size: 11.5px; color: var(--ink-dim); text-align: center; }

/* ---------- tasks ---------- */
.screen-tasks.is-active {
  max-width: 620px; margin: 0 auto;
  padding: clamp(36px, 7vh, 72px) 0 clamp(60px, 9vh, 100px);
}

.tasks-step { font-size: 13px; font-weight: 600; color: var(--brand-soft); }
.tasks-title {
  font-size: clamp(24px, 4.5vw, 34px); font-weight: 800; letter-spacing: -0.02em;
  margin: 6px 0 22px;
}

.progress-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.progress-track {
  flex: 1; height: 6px; border-radius: 100px; overflow: hidden;
  background: rgba(169, 203, 255, 0.1);
}
.progress-fill {
  height: 100%; width: 0; border-radius: 100px;
  background: linear-gradient(90deg, var(--brand), var(--brand-bright));
  box-shadow: 0 0 14px rgba(61, 141, 255, 0.6);
  transition: width 0.7s var(--ease);
}
.progress-label {
  font-size: 12.5px; font-weight: 700; color: var(--brand-soft);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

.task-list { display: flex; flex-direction: column; gap: 12px; }

.task-card {
  display: flex; align-items: center; gap: 15px;
  border: 1px solid var(--stroke); border-radius: 18px;
  padding: clamp(14px, 2.5vw, 18px) clamp(14px, 2.5vw, 20px);
  background: var(--card);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
  animation: rise 0.55s var(--ease) both;
}
.task-card.locked { opacity: 0.38; }
.task-card.current {
  border-color: var(--stroke-strong);
  box-shadow: 0 0 0 4px rgba(3, 98, 212, 0.12), 0 20px 48px rgba(2, 7, 20, 0.55);
}
.task-card.done { border-color: rgba(61, 141, 255, 0.22); }

.task-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(5, 11, 24, 0.65); border: 1px solid var(--stroke);
}
.task-icon svg { width: 20px; height: 20px; }

.task-meta { flex: 1; min-width: 0; }
.task-platform { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand-soft); text-transform: uppercase; }
.task-label {
  font-size: 14.5px; font-weight: 600; margin-top: 3px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.task-action { flex-shrink: 0; display: grid; place-items: center; min-width: 52px; }

.btn-follow {
  font-family: var(--font); font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; background: linear-gradient(180deg, #2B7FE8, var(--brand));
  border: none; border-radius: 100px; padding: 12px 22px; min-height: 44px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(3, 98, 212, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.18s var(--ease), box-shadow 0.25s, filter 0.2s;
}
.btn-follow:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(3, 98, 212, 0.5); filter: brightness(1.06); }
.btn-follow:active { transform: scale(0.98); }

.task-lock { display: grid; place-items: center; color: var(--ink-dim); opacity: 0.8; }

.task-check {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(61, 141, 255, 0.15); color: var(--brand-bright);
  border: 1px solid rgba(61, 141, 255, 0.35);
  animation: checkPop 0.45s var(--ease) both;
}
@keyframes checkPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* countdown ring */
.countdown { position: relative; width: 50px; height: 50px; }
.countdown svg { transform: rotate(-90deg); display: block; }
.countdown .ring-bg { fill: none; stroke: rgba(169, 203, 255, 0.13); stroke-width: 4; }
.countdown .ring-fg {
  fill: none; stroke: var(--brand-bright); stroke-width: 4; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(61, 141, 255, 0.7));
  transition: stroke-dashoffset 1s linear;
}
.countdown .count-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 700; color: var(--brand-soft);
  font-variant-numeric: tabular-nums;
}

.tasks-error { text-align: center; margin-top: 16px; }

.btn-claim-wrap { margin-top: 26px; }
.btn-claim-wrap .btn-primary { animation: rise 0.55s var(--ease) both; }

/* ---------- reveal ---------- */
.screen-reveal.is-active {
  padding: clamp(60px, 12vh, 110px) 0 clamp(70px, 12vh, 120px);
  text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.reveal-kicker { font-size: 13px; font-weight: 600; color: var(--brand-soft); }
.reveal-title {
  font-size: clamp(26px, 5vw, 42px); font-weight: 800; letter-spacing: -0.02em;
  margin: 10px 0 clamp(28px, 5vh, 44px);
}

.ticket {
  width: min(440px, 100%); border-radius: 22px; overflow: hidden;
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 40px 100px rgba(3, 98, 212, 0.3);
  animation: ticketPop 0.8s cubic-bezier(0.34, 1.4, 0.64, 1) both 0.15s;
}
@keyframes ticketPop { from { opacity: 0; transform: scale(0.88) translateY(26px); } to { opacity: 1; transform: none; } }

.ticket-top {
  background: linear-gradient(135deg, #2B7FE8, var(--brand) 70%);
  padding: clamp(22px, 4vw, 30px) clamp(20px, 4vw, 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ticket-logo { height: clamp(20px, 4vw, 25px); }
.ticket-amount { font-size: clamp(12px, 2.6vw, 13.5px); font-weight: 700; color: #fff; }

.ticket-tear { height: 0; border-top: 2px dashed rgba(169, 203, 255, 0.3); background: var(--navy-2); position: relative; }
.ticket-tear::before, .ticket-tear::after {
  content: ''; position: absolute; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy-0);
}
.ticket-tear::before { left: -11px; }
.ticket-tear::after { right: -11px; }

.ticket-bottom {
  background: var(--navy-2); padding: clamp(24px, 4.5vw, 32px) clamp(20px, 4vw, 28px);
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.ticket-code {
  font-family: var(--font); font-size: clamp(19px, 4.6vw, 26px); font-weight: 800;
  letter-spacing: 0.08em; color: #fff;
  text-shadow: 0 0 24px rgba(61, 141, 255, 0.7);
  word-break: break-all;
}
.btn-copy {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: var(--brand-soft); background: transparent; cursor: pointer;
  border: 1px solid rgba(61, 141, 255, 0.4); border-radius: 100px;
  padding: 12px 28px; min-height: 44px;
  transition: all 0.2s;
}
.btn-copy:hover { background: rgba(3, 98, 212, 0.18); color: #fff; }
.btn-copy:active { transform: scale(0.98); }

.reveal-fine { margin-top: 24px; font-size: 12.5px; color: var(--ink-dim); }

/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; opacity: 0.85;
  animation: fall linear both;
}
@keyframes fall { to { transform: translateY(110vh) rotate(680deg); opacity: 0.3; } }

/* ---------- footer ---------- */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 26px clamp(18px, 5vw, 32px) calc(30px + env(safe-area-inset-bottom));
  color: var(--ink-dim); font-size: 12.5px;
}
.foot-icon { height: 16px; opacity: 0.55; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .landing-grid { grid-template-columns: 1fr; gap: 36px; padding-top: clamp(28px, 6vh, 48px); }
  .hero-sub { max-width: none; }
  .steps { gap: 12px; }
  .orb-a { width: 380px; height: 380px; right: -160px; }
  .orb-b { width: 300px; height: 300px; left: -160px; }
  .orb-c { display: none; }
}

@media (max-width: 520px) {
  .hero-title br { display: none; }
  .join-card { border-radius: 18px; }
  .field input { font-size: 16px; } /* prevents iOS zoom-on-focus */
  .task-card { gap: 12px; }
  .task-icon { flex-basis: 40px; width: 40px; height: 40px; border-radius: 11px; }
  .task-icon svg { width: 18px; height: 18px; }
  .btn-follow { padding: 11px 18px; }
  .task-action { min-width: 46px; }
  .countdown { width: 46px; height: 46px; }
  .countdown svg { width: 46px; height: 46px; }
  .ticket { border-radius: 18px; }
}

@media (max-width: 360px) {
  .task-label { font-size: 13.5px; }
  .btn-follow { font-size: 12.5px; padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .task-card, .screen.is-active { opacity: 1; }
}
