:root {
  --pink: #f65c86;
  --pink-dark: #d94171;
  --teal: #1bb7b7;
  --teal-dark: #087f84;
  --cream: #fff8eb;
  --chocolate: #5a2d25;
  --ink: #362326;
  --muted: #735c62;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(90, 45, 37, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(246, 92, 134, .13), transparent 28rem),
    radial-gradient(circle at 90% 20%, rgba(27, 183, 183, .12), transparent 30rem),
    linear-gradient(180deg, #fffaf3 0%, #fff 56%, #fff7f3 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: radial-gradient(rgba(90,45,37,.22) .6px, transparent .6px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
  z-index: -2;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.page-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(90px);
  opacity: .2;
  pointer-events: none;
  z-index: -1;
}
.page-glow-one { background: var(--pink); top: 18vh; left: -180px; }
.page-glow-two { background: var(--teal); top: 48vh; right: -190px; }

.app-return-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: min(580px, calc(100% - 24px));
  margin: 10px auto 0;
  min-height: 58px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  text-align: left;
  background: linear-gradient(135deg, rgba(83,35,31,.97), rgba(204,51,100,.96));
  box-shadow: 0 16px 38px rgba(90,45,37,.24), inset 0 0 0 1px rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
}
.app-return-bar strong, .app-return-bar small { display: block; }
.app-return-bar strong { font-size: .88rem; line-height: 1.1; letter-spacing: .01em; }
.app-return-bar small { margin-top: 4px; color: rgba(255,255,255,.73); font-size: .62rem; font-weight: 750; }
.app-return-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,.17);
  font-size: 1.25rem;
  font-weight: 900;
}
.app-return-bar:hover { filter: brightness(1.04); }
.app-return-bar:focus-visible { outline: 4px solid rgba(27,183,183,.42); outline-offset: 3px; }

.site-header {
  width: min(1180px, calc(100% - 34px));
  margin: 0 auto;
  padding: 20px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand img { width: 142px; height: auto; display: block; }
.brandplay-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  letter-spacing: .02em;
}
.brandplay-mark span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; }
.brandplay-mark strong { color: var(--teal-dark); font-size: 1.08rem; margin-top: 5px; }

.page-shell { width: min(1100px, calc(100% - 28px)); margin: 0 auto; }
.intro { text-align: center; max-width: 780px; margin: 24px auto 26px; }
.eyebrow {
  display: inline-flex;
  color: var(--teal-dark);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.intro h1 {
  margin: 8px 0 10px;
  font-size: clamp(3.1rem, 8vw, 6.6rem);
  line-height: .88;
  letter-spacing: -.07em;
  color: var(--chocolate);
  text-shadow: 0 7px 0 rgba(255,255,255,.95);
}
.intro h1 span { color: var(--pink); position: relative; }
.intro h1 span::after {
  content: "";
  position: absolute;
  left: 8%; right: 5%; bottom: -.08em;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  transform: rotate(-2deg);
}
.intro p { margin: 18px auto 0; max-width: 650px; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.18rem); line-height: 1.65; }

.game-card {
  width: min(560px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(90,45,37,.1);
  border-radius: var(--radius-xl);
  padding: 12px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.25fr auto;
  gap: 6px;
  padding: 5px 4px 10px;
  align-items: center;
}
.hud-item {
  min-width: 0;
  text-align: center;
  padding: 7px 4px;
  border-radius: 14px;
  background: #fff7f8;
}
.hud-item span { display: block; font-size: .6rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.hud-item strong { display: block; margin-top: 2px; font-size: 1.25rem; line-height: 1; }
.hud-target { background: #effdfc; }
.hud-target strong { color: var(--teal-dark); }
.hud-lives strong { color: var(--pink); letter-spacing: .02em; font-size: 1rem; }
.sound-button {
  width: 42px; height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--chocolate);
  color: white;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 7px 14px rgba(90,45,37,.2);
}
.sound-button[aria-pressed="true"] { opacity: .48; }

.progress-track { height: 8px; background: #f4e8e8; border-radius: 999px; overflow: hidden; margin: 0 4px 10px; }
.progress-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--teal), var(--pink)); border-radius: inherit; transition: width .2s ease; }

.canvas-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 23 / 34;
  max-height: min(680px, 72vh);
  overflow: hidden;
  border-radius: 25px;
  background: #ffe6ed;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(90,45,37,.08);
}
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
#gameCanvas:focus-visible { box-shadow: inset 0 0 0 4px rgba(27,183,183,.65); border-radius: inherit; }

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255,249,244,.74);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.025);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.game-overlay.is-visible { opacity: 1; visibility: visible; transform: scale(1); }
.overlay-panel {
  width: min(100%, 410px);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 32px);
  background: rgba(255,255,255,.96);
  box-shadow: 0 24px 65px rgba(90,45,37,.2);
  text-align: center;
  border: 1px solid rgba(90,45,37,.08);
}
.overlay-panel h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1; letter-spacing: -.04em; margin: 10px 0 12px; }
.overlay-panel p { color: var(--muted); line-height: 1.5; }
.mini-badge {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e9fbfa;
  color: var(--teal-dark);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .64rem;
}
.how-to-grid { display: grid; gap: 10px; margin: 20px 0 14px; }
.how-to {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 17px;
  font-size: .88rem;
  font-weight: 700;
}
.how-to.good { background: #effdf9; }
.how-to.bad { background: #fff1f2; }
.how-to-icon { position: relative; width: 42px; height: 42px; }
.cupcake-icon::before {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 20px;
  background: repeating-linear-gradient(90deg, #f7b33b 0 5px, #f8c95d 5px 10px);
  clip-path: polygon(8% 0, 92% 0, 78% 100%, 22% 100%);
}
.cupcake-icon::after {
  content: ""; position: absolute; width: 30px; height: 23px; left: 6px; top: 2px;
  background: var(--pink); border-radius: 55% 55% 44% 44%; box-shadow: 8px -2px 0 -4px #fff, -7px 2px 0 -4px #fff;
}
.egg-icon::before { content: ""; position: absolute; inset: 4px 7px; background: white; border: 2px solid #e5d3c5; border-radius: 58% 52% 55% 48%; transform: rotate(10deg); }
.egg-icon::after { content: ""; position: absolute; width: 14px; height: 14px; left: 14px; top: 14px; border-radius: 50%; background: #ffba2e; box-shadow: 0 2px 5px rgba(150,80,0,.2); }
.control-note { font-size: .78rem; margin: 12px 0 16px; }
.primary-button, .secondary-button, .primary-link {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.primary-button, .primary-link { background: linear-gradient(135deg, var(--pink), #ff7b9f); color: white; box-shadow: 0 12px 24px rgba(246,92,134,.3); }
.primary-button:hover, .primary-link:hover, .secondary-button:hover { transform: translateY(-2px); }
.primary-button:active, .primary-link:active, .secondary-button:active { transform: translateY(0) scale(.99); }
.primary-button:disabled { opacity: .58; cursor: wait; }
.play-button span, .play-button small { display: block; }
.play-button small { margin-top: 4px; font-size: .7rem; font-weight: 700; opacity: .88; }
.secondary-button { background: #f5eceb; color: var(--chocolate); margin-top: 10px; }
.saved-reward-button { width: 100%; margin-top: 11px; border: 1px solid rgba(27,183,183,.35); border-radius: 14px; padding: 11px; background: #effdfc; color: var(--teal-dark); font-weight: 900; cursor: pointer; }
.saved-reward-button[hidden] { display: none; }
.best-score { margin-top: 13px; font-size: .76rem; color: var(--muted); }
.best-score strong { color: var(--chocolate); }
.compact-panel { max-width: 340px; }
.pause-symbol { width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; color: white; background: var(--teal); font-weight: 900; font-size: 1.6rem; }
.result-panel { max-width: 380px; }
.result-art { font-size: 4.2rem; filter: drop-shadow(0 8px 10px rgba(90,45,37,.18)); animation: floaty 2s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(3deg); } }
.final-score-card { margin: 15px 0; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, #fff4f7, #effdfc); }
.final-score-card span, .final-score-card small { display: block; color: var(--muted); }
.final-score-card span { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.final-score-card strong { display: block; font-size: 3rem; line-height: 1; margin: 4px 0; color: var(--chocolate); }
.final-score-card small { font-size: .72rem; }
.reward-button[hidden] { display: none; }
.result-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 15px; font-size: .74rem; font-weight: 800; }
.result-links a { color: var(--teal-dark); text-underline-offset: 3px; }
.game-tip { padding: 11px 10px 3px; text-align: center; font-size: .78rem; color: var(--muted); min-height: 31px; }

.reward-card, .promo-card {
  margin: 30px auto 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.reward-card {
  max-width: 880px;
  padding: clamp(24px, 5vw, 40px);
  color: white;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(22px, 5vw, 40px);
  align-items: center;
  position: relative;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.reward-card.is-locked { background: linear-gradient(125deg, #5a2d25, #743c31); }
.reward-card.is-unlocked { background: linear-gradient(125deg, #4c2035, #96345a 62%, #087f84 130%); border: 1px solid rgba(255,255,255,.18); }
.reward-card.is-expired { background: linear-gradient(125deg, #5c5351, #766966); }
.reward-card::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; right: -120px; top: -160px; background: rgba(255,255,255,.06); pointer-events: none; }
.reward-stamp {
  width: 170px; height: 170px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: var(--cream); color: var(--chocolate); border: 8px double var(--pink); transform: rotate(-5deg); box-shadow: 0 15px 25px rgba(0,0,0,.2);
}
.is-unlocked .reward-stamp { border-color: #ffd16f; animation: reward-pop .55s ease both; }
.is-expired .reward-stamp { filter: grayscale(1); opacity: .72; }
@keyframes reward-pop { 0% { transform: scale(.82) rotate(-9deg); } 70% { transform: scale(1.05) rotate(-3deg); } 100% { transform: scale(1) rotate(-5deg); } }
.reward-stamp span { font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
.reward-stamp strong { display: block; font-size: 2.2rem; line-height: .95; color: var(--pink); }
.reward-state-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reward-score-status { font-size: .7rem; font-weight: 900; color: rgba(255,255,255,.76); }
.reward-copy .eyebrow { color: #86ebe5; }
.reward-copy h2 { font-size: clamp(1.75rem, 4vw, 2.7rem); line-height: 1.05; letter-spacing: -.04em; margin: 8px 0 12px; }
.reward-copy > p { margin: 0; color: rgba(255,255,255,.78); line-height: 1.65; font-size: .9rem; }
.reward-progress { height: 10px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.14); }
.reward-progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #ffd16f, var(--pink)); transition: width .3s ease; }
.earned-offer { margin-top: 17px; padding: 15px 16px; border-radius: 18px; background: rgba(255,250,229,.98); color: var(--chocolate); text-align: center; line-height: 1.4; font-weight: 950; box-shadow: inset 0 0 0 1px rgba(90,45,37,.1); }
.reward-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 14px 0 0; padding: 0; list-style: none; color: rgba(255,255,255,.8); font-size: .74rem; line-height: 1.4; font-weight: 760; }
.reward-rules li::before { content: "✓"; margin-right: 7px; color: #86ebe5; font-weight: 900; }
.reward-expiry { margin-top: 13px !important; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.23); text-align: center; font-size: .74rem !important; font-weight: 850; }
.reward-card-action { width: 100%; margin-top: 14px; }
.reward-card-action[hidden], .earned-offer[hidden], .reward-rules[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.promo-card {
  max-width: 960px;
  padding: clamp(26px, 6vw, 54px);
  background:
    linear-gradient(90deg, rgba(255,255,255,.97), rgba(255,255,255,.9)),
    url("assets/cupcake-wall.jpg") center / cover;
  border: 1px solid rgba(90,45,37,.08);
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 34px;
  align-items: center;
}
.promo-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.04; letter-spacing: -.045em; margin: 8px 0 12px; }
.promo-card p { color: var(--muted); line-height: 1.65; margin: 0; }
.promo-actions { display: grid; gap: 13px; justify-items: stretch; }
.text-link { text-align: center; color: var(--teal-dark); font-weight: 900; font-size: .88rem; text-decoration: none; }

footer { text-align: center; padding: 52px 20px max(34px, env(safe-area-inset-bottom)); color: var(--muted); }
footer img { width: 108px; opacity: .95; }
footer p { margin: 8px 0; font-size: .82rem; }
footer span { font-size: .7rem; }
footer a { color: var(--teal-dark); font-weight: 800; }

.reward-dialog, .reward-pass-dialog {
  width: min(92vw, 510px);
  border: 0;
  border-radius: 28px;
  padding: clamp(24px, 5vw, 36px);
  box-shadow: 0 30px 90px rgba(60,30,30,.35);
  color: var(--ink);
}
.reward-dialog::backdrop, .reward-pass-dialog::backdrop { background: rgba(54,35,38,.62); backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f3e8e8; color: var(--chocolate); font-size: 1.55rem; cursor: pointer; }
.dialog-badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #e9fbfa; color: var(--teal-dark); font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.reward-dialog h2 { margin: 10px 36px 8px 0; font-size: clamp(1.8rem, 6vw, 2.7rem); line-height: 1; letter-spacing: -.04em; }
.reward-dialog > p { color: var(--muted); line-height: 1.55; }
.reward-dialog form { display: grid; gap: 13px; margin-top: 20px; }
.reward-dialog label > span { display: block; margin: 0 0 6px 3px; font-size: .75rem; font-weight: 900; color: var(--chocolate); }
.reward-dialog input[type="text"], .reward-dialog input[type="tel"], .reward-dialog input[type="email"] {
  width: 100%; border: 1px solid #ead8d6; background: #fffafa; border-radius: 14px; padding: 13px 14px; outline: none;
}
.reward-dialog input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(27,183,183,.12); }
.consent-row { display: grid !important; grid-template-columns: auto 1fr; align-items: start; gap: 9px; padding: 10px; border-radius: 13px; background: #fff7ed; }
.consent-row input { margin-top: 3px; }
.consent-row span { margin: 0 !important; font-size: .72rem !important; line-height: 1.45; color: var(--muted) !important; }
.form-status { min-height: 18px; margin: 0; font-size: .77rem; font-weight: 800; color: var(--teal-dark); }

.live-pass { position: relative; overflow: hidden; border-radius: 24px; padding: 24px; background: linear-gradient(145deg, #fff7e9, #fff, #eafdfb); border: 2px solid var(--pink); text-align: center; box-shadow: inset 0 0 0 6px rgba(255,255,255,.85); }
.pass-shimmer { position: absolute; inset: -80% -40%; background: linear-gradient(115deg, transparent 43%, rgba(255,255,255,.75) 50%, transparent 57%); animation: shimmer 3s linear infinite; pointer-events: none; }
@keyframes shimmer { from { transform: translateX(-35%) rotate(8deg); } to { transform: translateX(35%) rotate(8deg); } }
.live-pass img { width: 120px; position: relative; z-index: 1; }
.pass-label { margin-top: 6px; font-size: .66rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--teal-dark); }
.live-pass h2 { margin: 8px 0 5px; font-size: clamp(2rem, 8vw, 3rem); line-height: .93; letter-spacing: -.05em; color: var(--pink-dark); }
.live-pass > p { margin: 0 0 18px; font-weight: 900; color: var(--chocolate); }
.claim-row { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px dashed #dfc7c4; text-align: left; font-size: .8rem; }
.claim-row span { color: var(--muted); }
.claim-row strong { color: var(--chocolate); text-align: right; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; margin: 17px 0 12px; padding: 7px 10px; border-radius: 999px; background: #e8fff0; color: #167943; font-size: .65rem; font-weight: 900; letter-spacing: .08em; }
.live-indicator i { width: 8px; height: 8px; border-radius: 50%; background: #20b764; box-shadow: 0 0 0 5px rgba(32,183,100,.13); animation: pulse 1.3s ease infinite; }
@keyframes pulse { 50% { transform: scale(.75); opacity: .55; } }
.live-pass small { display: block; color: var(--muted); line-height: 1.45; }
.full-width { display: block; width: 100%; margin-top: 12px; }

@media (max-width: 720px) {
  .site-header { padding-top: 12px; }
  .brand img { width: 112px; }
  .brandplay-mark strong { font-size: .95rem; }
  .intro { margin-top: 12px; }
  .intro h1 { font-size: clamp(3.15rem, 18vw, 5.2rem); }
  .game-card { padding: 8px; border-radius: 26px; }
  .hud { grid-template-columns: repeat(4, 1fr) auto; gap: 4px; }
  .hud-item { padding: 6px 2px; }
  .hud-item strong { font-size: 1.05rem; }
  .hud-item span { font-size: .52rem; }
  .sound-button { width: 36px; height: 36px; border-radius: 12px; }
  .canvas-shell { max-height: none; }
  .reward-card, .promo-card { grid-template-columns: 1fr; }
  .reward-stamp { width: 145px; height: 145px; margin: 0 auto; }
  .reward-copy { text-align: center; }
  .reward-state-line { display: grid; justify-content: center; }
  .reward-rules { grid-template-columns: 1fr; text-align: left; }
  .promo-card { gap: 24px; }
}

@media (max-width: 390px) {
  .page-shell { width: min(100% - 14px, 1100px); }
  .intro p { padding: 0 8px; }
  .overlay-panel { padding: 20px 16px; }
  .how-to { font-size: .8rem; }
  .control-note { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
