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

:root {
  --primary:  #1480c1;
  --primary2: #0f6aa3;
  --teal:     #72c3be;
  --teal2:    #5ab0ab;
  --dark:     #0d2a3d;
  --mid:      #163a52;
  --light:    rgba(255,255,255,0.08);
  --border:   rgba(255,255,255,0.15);
  --text:     #f0f4f8;
  --muted:    #a8bfcf;
  --error:    #F55050;
  --green:    #34d399;
  --radius:   16px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height for mobile browsers */
  background: linear-gradient(160deg, #0d2a3d 0%, #163a52 55%, #0f4a6e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 20px 16px;
  overflow-x: hidden;
}

/* ── Logo ── */
.logo-wrap {
  margin-bottom: 16px;
  text-align: center;
  width: 100%;
  max-width: 420px;
}

.logo-wrap img {
  height: auto;
  max-height: 50px;
  max-width: 60vw;
  width: auto;
  filter: brightness(0) invert(1);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ── Shared card section ── */
.card-section {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeUp 0.4s ease;
  backdrop-filter: blur(8px);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-icon { font-size: 2.2rem; margin-bottom: 10px; }

h1 {
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--teal), #a8deda);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

h2 {
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 6px;
}

.subtitle { color: var(--muted); margin-bottom: 20px; font-size: 0.9rem; line-height: 1.5; }
.subtitle-note { font-size: 0.8rem; color: #7a9db4; }

/* ── Forms ── */
.form-group { text-align: left; margin-bottom: 12px; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.req { color: var(--teal); }

.form-group input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(114,195,190,0.25);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 16px; /* prevents iOS zoom on focus */
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus { border-color: var(--teal); }
.readonly-input { opacity: 0.6; cursor: default; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}

.error-msg { color: var(--error); font-size: 0.85rem; min-height: 20px; margin-bottom: 6px; }

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 0.8; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(90deg, var(--primary), var(--primary2)); color: #fff; margin-top: 6px; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--muted); margin-top: 8px; }
.btn-redeem  { background: linear-gradient(90deg, var(--teal), var(--teal2)); color: #fff; margin-top: 20px; }

/* ── Instagram step ── */
.ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  margin-bottom: 14px;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.ig-btn:hover { opacity: 0.88; }
.ig-hint { color: var(--muted); font-size: 0.82rem; margin-bottom: 18px; }

/* ── Scratch card ── */
#scratch-section { max-width: 380px; }
#scratch-section h2 { color: var(--teal); margin-bottom: 4px; }

.card-wrapper {
  position: relative;
  display: block;           /* block so it fills width */
  width: 100%;
  max-width: 320px;
  margin: 14px auto 8px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  cursor: crosshair;
  aspect-ratio: 320 / 210;
}

#prize-reveal {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary2) 0%, var(--primary) 50%, var(--teal2) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#prize-icon { font-size: clamp(2rem, 8vw, 3rem); }
#prize-name { font-size: clamp(0.95rem, 3.5vw, 1.2rem); font-weight: 700; color: #fff; padding: 0 10px; }
#prize-sub  { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

#scratch-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  touch-action: none;
}

.scratch-hint { color: var(--muted); font-size: 0.82rem; min-height: 18px; margin-top: 4px; }

/* ── Result ── */
#result-section { max-width: 420px; }

.result-box {
  background: var(--light);
  border: 2px solid rgba(114,195,190,0.3);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
}

.result-icon  { font-size: clamp(2.8rem, 10vw, 3.8rem); margin-bottom: 10px; }
.result-title { font-size: clamp(1.15rem, 5vw, 1.5rem); font-weight: 800; color: var(--teal); margin-bottom: 8px; }
.result-desc  { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

/* ── Promo code ── */
.promo-code-box {
  margin-top: 18px;
  background: rgba(114,195,190,0.08);
  border: 1.5px dashed rgba(114,195,190,0.45);
  border-radius: 12px;
  padding: 14px;
}

.promo-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em; }

.promo-code {
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--teal);
  font-family: 'Courier New', monospace;
  margin-bottom: 6px;
  word-break: break-all;
}

.promo-note { font-size: 0.78rem; color: var(--muted); }

/* ── Redeem ── */
#redeem-code-input {
  width: 140px;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid rgba(114,195,190,0.3);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1.8rem;
  letter-spacing: 0.3em;
  text-align: center;
  outline: none;
  margin: 4px auto;
  display: block;
}

#redeem-code-input:focus { border-color: var(--teal); }

.redeem-prompt { color: var(--muted); font-size: 0.88rem; margin-bottom: 12px; margin-top: 16px; }

.redeemed-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(52,211,153,0.12);
  border: 1.5px solid rgba(52,211,153,0.3);
  color: var(--green);
  border-radius: 99px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 20px;
  flex-direction: column;
}

.redeemed-date { font-size: 0.75rem; font-weight: 400; color: #5eead4; }

/* ── Confetti canvas ── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ── Small phones (< 380px) ── */
@media (max-width: 380px) {
  body { padding: 16px 12px; }
  .card-section { padding: 22px 16px; }
  .logo-wrap img { max-height: 40px; }
  .section-icon { font-size: 1.8rem; }
}
