/* ======================================
   NGÔI SAO THỜI TRANG – Reworked v2
   Clean · Mobile-first · Pastel pink
   ====================================== */

:root {
  --pink:      #e91e8c;
  --pink-lt:   #f472b6;
  --pink-bg:   #fff0f7;
  --pink-mid:  #ffd6ee;
  --pink-soft: #ffe8f4;
  --purple:    #8b5cf6;
  --purple-bg: #f5f0ff;
  --gold:      #f5c842;
  --gold-dk:   #c8972a;
  --green:     #00b14f;
  --peach:     #fff8f0;
  --cream:     #fdf8f2;
  --blue:      #1877f2;
  --txt:       #3d1f2f;
  --txt-m:     #7a4a60;
  --txt-l:     #b07a90;
  --r:         18px;
  --r-lg:      28px;
  --sh:        0 4px 20px rgba(233,30,140,.13);
  --sh-lg:     0 10px 40px rgba(233,30,140,.20);
  --t:         .3s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
html { margin-top: 0 !important; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--pink-bg);
  color: var(--txt);
  overscroll-behavior: none;
  overflow-x: hidden;
  min-height: 100dvh;
}

body.admin-bar #wpadminbar { display: none; }

/* ── APP SHELL ── */
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
}

@media (min-width: 480px) {
  #app { box-shadow: 0 0 80px rgba(233,30,140,.12); }
}

/* ── SCREENS ── */
.screen {
  position: absolute;
  inset: 0;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity var(--t), transform var(--t);
  pointer-events: none;
  background: var(--pink-bg);
}
.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  position: relative;
}
.screen.out {
  opacity: 0;
  transform: translateX(-40px);
  position: absolute;
  pointer-events: none;
}

/* ── TOP BAR ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--pink-mid);
}
.back {
  width: 36px; height: 36px;
  border: none;
  background: var(--pink-soft);
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--pink);
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.back:active { transform: scale(.92); }
.top-label {
  font-size: .85rem;
  font-weight: 800;
  color: var(--txt-m);
}

/* ── BUTTONS ── */
.btn-pri {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--pink) 0%, #c0176e 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(233,30,140,.35);
  transition: all .2s;
  text-decoration: none;
  letter-spacing: .02em;
}
.btn-pri:hover  { box-shadow: 0 8px 30px rgba(233,30,140,.45); transform: translateY(-1px); }
.btn-pri:active { transform: scale(.97); box-shadow: 0 3px 12px rgba(233,30,140,.3); }

.btn-sec {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  background: rgba(255,255,255,.85);
  color: var(--pink);
  border: 2px solid var(--pink-lt);
  border-radius: 50px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all .2s;
  letter-spacing: .01em;
}
.btn-sec:hover  { background: #fff; border-color: var(--pink); }
.btn-sec:active { transform: scale(.97); }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  color: var(--pink);
  border: 2px solid rgba(233,30,140,.3);
  border-radius: 50px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn-ghost:active { transform: scale(.97); }

/* ── OPENING SCREEN ── */
#s-open {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #fff0f7 0%, #ffd6ee 35%, #ffe8f4 65%, #fff8e1 100%);
}

.petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.open-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 24px 20px 32px;
  gap: 14px;
}

.brand-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(233,30,140,.2);
  border-radius: 50px;
  padding: 7px 18px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--pink);
  box-shadow: var(--sh);
}
.brand-chip span { color: var(--gold); font-size: .7rem; }

.hero-img-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.hero-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: float 4s ease-in-out infinite;
}
.hero-glow {
  position: absolute;
  inset: -12px;
  background: radial-gradient(ellipse at center, rgba(233,30,140,.15) 0%, transparent 70%);
  border-radius: var(--r-lg);
  pointer-events: none;
}

/* Sparkles */
.sp {
  position: absolute;
  font-size: 1rem;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(245,200,66,.8);
  animation: sparkle 2.5s ease-in-out infinite;
  pointer-events: none;
}
.sp-tl { top: 8%;  left: 4%;  animation-delay: 0s; }
.sp-tr { top: 12%; right: 4%; animation-delay: .7s; }
.sp-bl { bottom: 18%; left: 6%;  animation-delay: 1.4s; }
.sp-br { bottom: 22%; right: 5%; animation-delay: 2.1s; }

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes sparkle {
  0%,100% { opacity: .3; transform: scale(.8) rotate(0deg); }
  50%      { opacity: 1;  transform: scale(1.2) rotate(18deg); }
}

.open-text { text-align: center; padding: 0 4px; }
.open-sub {
  font-size: .88rem;
  color: var(--txt-m);
  margin-bottom: 6px;
}
.open-h1 {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--txt);
}
.open-h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--pink), var(--gold-dk));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.open-ctas { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.fine { font-size: .72rem; color: var(--txt-l); text-align: center; }

/* ── FLOW HERO IMAGES ── */
.card-wrap {
  padding: 0 0 32px;
}
.flow-hero {
  width: 100%;
  height: 180px;
  overflow: hidden;
}
.flow-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* ── CARD ── */
.card {
  margin: -20px 16px 0;
  background: #fff;
  border-radius: var(--r-lg) var(--r-lg) var(--r) var(--r);
  padding: 24px 20px 24px;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card h2 { font-size: 1.3rem; font-weight: 900; }
.card-sub { font-size: .88rem; color: var(--txt-m); margin-top: -8px; }

/* ── FORM FIELDS ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--txt-m); }
.field small  { font-size: .72rem; color: var(--txt-l); }

.input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--pink-bg);
  border: 2px solid var(--pink-mid);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.input-box:focus-within { border-color: var(--pink); }
.input-ico { font-size: 1.1rem; flex-shrink: 0; }
.input-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--txt);
  outline: none;
  min-width: 0;
}
.input-box input::placeholder { color: var(--txt-l); font-weight: 400; }

/* ── SURVEY ── */
.survey-wrap {
  padding-bottom: 40px;
}
.survey-hero {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--pink-soft) 0%, var(--purple-bg) 100%);
}
.survey-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}
.survey-bubble {
  position: absolute;
  bottom: 14px;
  right: 12px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-radius: 14px 14px 4px 14px;
  padding: 8px 14px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--txt);
  box-shadow: var(--sh);
  max-width: 190px;
  line-height: 1.4;
}

.survey-card {
  margin: -18px 14px 0;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 24px 18px 24px;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.q-block { display: flex; flex-direction: column; gap: 10px; }
.q-label {
  font-size: .9rem;
  font-weight: 800;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--pink), #c0176e);
  color: #fff;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 900;
  flex-shrink: 0;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  background: var(--pink-bg);
  border: 2px solid var(--pink-mid);
  border-radius: 50px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: var(--txt-m);
  cursor: pointer;
  transition: all .18s;
  line-height: 1;
}
.chip:active { transform: scale(.95); }
.chip.sel {
  background: linear-gradient(135deg, var(--pink-soft), var(--pink-mid));
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 2px 10px rgba(233,30,140,.2);
}

.survey-submit { margin-top: 4px; }

/* ── REWARD ── */
.reward-wrap {
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reward-head { text-align: center; }
.reward-emoji {
  font-size: 3rem;
  animation: pop .6s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes pop {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}
.reward-head h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 8px 0 4px;
  line-height: 1.3;
}
.reward-head p { font-size: .88rem; color: var(--txt-m); }

.reward-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.reward-grid-2col {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.reward-grid-2col .r-card {
  padding: 14px 10px;
}
.qr-box-large {
  padding: 10px;
}
.qr-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.r-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.primary-r {
  border: 2.5px solid var(--green);
  box-shadow: 0 4px 20px rgba(0,177,79,.15);
}

.r-tag {
  font-size: .72rem;
  font-weight: 800;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .07em;
  width: 100%;
  text-align: center;
}
.grab-tag { color: var(--green); }

/* costume */
.costume-img-wrap {
  position: relative;
  width: 130px;
  height: 185px;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
}
.costume-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.costume-shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(255,180,220,.35));
}
.costume-img-wrap.locked img { filter: blur(3px) brightness(.7); }
.lock-veil {
  position: absolute;
  inset: 0;
  background: rgba(60,10,40,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
  color: #fff;
}
.lock-ico { font-size: 1.8rem; }
.lock-veil p { font-size: .72rem; font-weight: 700; line-height: 1.4; }

.r-card strong { font-size: .9rem; font-weight: 800; }
.r-note {
  font-size: .75rem;
  color: var(--txt-m);
  text-align: center;
  line-height: 1.5;
  background: var(--peach);
  border-radius: 10px;
  padding: 8px 12px;
  width: 100%;
}

/* grab qr */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fafafa;
  border-radius: var(--r);
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.grab-badge {
  font-size: .8rem;
  font-weight: 800;
  color: #1a1a1a;
}
.grab-green { color: var(--green); }

.code-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f0fff8, #dcf7ec);
  border: 2px dashed var(--green);
  border-radius: 12px;
  padding: 10px 14px;
  width: 100%;
  justify-content: center;
}
.code-text {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: .12em;
  font-family: monospace;
}
.copy-btn {
  padding: 5px 13px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.copy-btn:active { transform: scale(.93); }

/* fanpage */
.btn-fanpage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #1877f2, #0d6efd);
  color: #fff;
  border-radius: 50px;
  font-size: .95rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(24,119,242,.3);
  transition: all .2s;
}
.btn-fanpage:active { transform: scale(.97); }

/* ── DOWNLOAD SCREEN ── */
.dl-wrap {
  padding: 20px 18px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.dl-nikki {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-lg);
}
.dl-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}
.dl-nikki .sp { font-size: 1.1rem; }
.dl-nikki .sp-tl { top: 10px; left: 12px; }
.dl-nikki .sp-tr { top: 10px; right: 12px; }

.dl-h2 {
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.3;
}
.dl-sub {
  font-size: .82rem;
  color: var(--txt-m);
  text-align: center;
  line-height: 1.6;
}

.store-btns { display: flex; gap: 10px; width: 100%; }
.btn-store {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 10px;
  border-radius: var(--r);
  text-decoration: none;
  box-shadow: var(--sh);
  transition: all .2s;
}
.btn-store:active { transform: scale(.97); }
.btn-store div { display: flex; flex-direction: column; align-items: flex-start; }
.btn-store small { font-size: .62rem; color: rgba(255,255,255,.8); font-weight: 400; }
.btn-store strong { font-size: .88rem; color: #fff; font-weight: 800; }
.ios     { background: linear-gradient(135deg, #1a1a2e, #16213e); }
.android { background: linear-gradient(135deg, #0f3460, #1a237e); }

.qr-section { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-label { font-size: .8rem; color: var(--txt-m); font-weight: 600; }
.qr-frame {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--sh);
}

/* ── PETAL ── */
.petal {
  position: absolute;
  pointer-events: none;
  animation: petal-fall linear infinite;
  opacity: 0;
}
@keyframes petal-fall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: .8; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

/* ── CONFETTI ── */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}
.c-bit {
  position: absolute;
  border-radius: 2px;
  animation: c-fall linear forwards;
}
@keyframes c-fall {
  0%   { transform: translateY(-10px) rotate(0deg);     opacity: 1; }
  100% { transform: translateY(110vh) rotate(600deg);   opacity: 0; }
}

/* ── SURVEY SUBMIT DISABLED ── */
.survey-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── THANK YOU SCREEN ── */
.ty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px 24px 48px;
  gap: 28px;
  background: linear-gradient(165deg, #fff0f7 0%, #ffd6ee 40%, #ffe8f4 100%);
}
.ty-hero {
  position: relative;
  width: 100%;
  max-width: 300px;
}
.ty-img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: float 4s ease-in-out infinite;
}
.ty-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ty-emoji {
  font-size: 2.5rem;
  animation: pop .6s cubic-bezier(.34,1.56,.64,1) both;
}
.ty-text h2 {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.35;
  color: var(--txt);
}
.ty-text p {
  font-size: .9rem;
  color: var(--txt-m);
  line-height: 1.6;
}

/* ── GUIDE BOX ── */
.guide-box {
  width: 100%;
  background: linear-gradient(135deg, #fff8f0, #fff0f7);
  border: 1.5px solid var(--pink-mid);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guide-title {
  font-size: .85rem;
  font-weight: 800;
  color: var(--txt);
}
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--txt-m);
  line-height: 1.5;
  text-decoration: none;
}
.guide-step b { color: var(--txt); }
.guide-step em { font-style: normal; color: var(--txt-l); font-size: .75rem; }
a.guide-step b { color: var(--pink); text-decoration: underline; text-underline-offset: 2px; }
.guide-link {
  color: var(--pink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.step-icon { flex-shrink: 0; font-size: .9rem; margin-top: 1px; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: rgba(40,15,30,.9);
  color: #fff;
  padding: 11px 22px;
  border-radius: 50px;
  font-size: .88rem;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--pink-mid); border-radius: 2px; }

/* ── RESPONSIVE TWEAKS ── */
@media (max-height: 680px) {
  .hero-img { max-height: 220px; }
  .open-h1  { font-size: 1.45rem; }
  .survey-hero { height: 120px; }
  .flow-hero { height: 140px; }
}
