/* KFC Rewards — loyalty tap game.
 * Built on the official KFC identity: Rich Red #C41230 / digital red #E4002B,
 * Rich Black #261C02, warm beiges #F5D4B7 / #FFF1E2. Bright, clean, appetising. */

:root {
  --red: #e4002b;          /* digital primary red */
  --red-deep: #c41230;     /* Pantone 187 rich red */
  --red-dark: #9c0f24;
  --black: #261c02;        /* rich warm black */
  --ink: #2a2118;          /* body text */
  --ink-soft: #7a6a55;     /* secondary text */
  --ink-faint: #a8997f;
  --beige: #fff1e2;        /* light warm beige — page */
  --beige-2: #f5d4b7;      /* medium warm beige — accents */
  --beige-line: #eaddc8;
  --white: #ffffff;
  --card: #fffaf3;
  --gold: #f6b21b;
  --crisp: #d98a3a;
  --green: #3f9b46;
  --shadow-sm: 0 2px 8px rgba(38,28,2,.10);
  --shadow-md: 0 14px 40px rgba(38,28,2,.14);
  --shadow-lg: 0 24px 64px rgba(38,28,2,.20);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Anton", "Arial Narrow", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--ui);
  color: var(--ink);
  background: var(--beige);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 70% at 50% -10%, #fff8ef 0%, var(--beige) 55%),
    radial-gradient(80% 50% at 100% 100%, rgba(245,212,183,.6), transparent 60%);
}

.display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; }

/* ── KFC logo lockup ────────────────────────────────────────────────────── */
.kfc-logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.kfc-logo .mark { width: 40px; height: 40px; flex: none; }
.kfc-logo .word {
  font-family: var(--display); font-size: 30px; color: var(--red);
  letter-spacing: .04em; line-height: 1; -webkit-text-stroke: 0;
}
.kfc-logo .sep { width: 2px; height: 26px; background: var(--beige-line); border-radius: 2px; }
.kfc-logo .prog {
  font-family: var(--display); font-size: 16px; color: var(--black);
  letter-spacing: .14em; line-height: 1;
}

/* ── header ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 20px; background: var(--white);
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--beige-line);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.points-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--beige); border: 1.5px solid var(--beige-2);
  border-radius: 999px; padding: 7px 14px 7px 11px;
}
.points-pill .pp-ico { font-size: 18px; }
.points-pill .pp-val { font-family: var(--display); font-size: 20px; color: var(--red-deep); line-height: 1; }
.points-pill .pp-lbl { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.icon-btn {
  background: var(--beige); border: 1.5px solid var(--beige-2); color: var(--ink);
  font-size: 19px; width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  transition: background .15s var(--ease), transform .1s var(--ease);
}
.icon-btn:hover { background: var(--beige-2); }
.icon-btn:active { transform: scale(.95); }

/* sign-in chip */
.auth-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1.5px solid var(--beige-2); background: var(--beige);
  color: var(--ink); font-family: var(--ui); font-weight: 800; font-size: 13.5px; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.auth-chip:hover { background: var(--beige-2); }
.auth-chip.is-on { background: #f2f4e6; border-color: #c9d49a; color: #3e4618; }
.auth-chip .ac-dot { width: 8px; height: 8px; border-radius: 50%; background: #6f9a3a; }

/* auth modal */
.auth-badge { font-size: 46px; line-height: 1; }
.auth-sub { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 8px 0 18px; }
.auth-sub b { color: var(--ink); }
.auth-opts { display: flex; flex-direction: column; gap: 12px; }
.btn.auth-zlef {
  background: #3e4618; box-shadow: 0 4px 0 #242a0e; display: inline-flex; align-items: center;
  justify-content: center; gap: 9px; width: 100%;
}
.btn.auth-zlef:hover:not(:disabled) { background: #4b5520; }
.btn.auth-zlef:active:not(:disabled) { box-shadow: 0 1px 0 #242a0e; }
.auth-zlef .azi { color: #bdce74; font-size: 16px; }
.auth-or {
  display: flex; align-items: center; gap: 12px; color: var(--ink-faint);
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--beige-line); }
.auth-kfc { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.auth-klabel { font-size: 13px; font-weight: 800; color: var(--ink); }
.auth-code {
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 22px; letter-spacing: .32em;
  text-align: center; text-transform: lowercase; padding: 12px; border-radius: 12px;
  border: 2px solid var(--beige-2); background: var(--white); color: var(--ink); width: 100%;
  transition: border-color .15s var(--ease);
}
.auth-code:focus { outline: none; border-color: var(--red); }
.auth-khint { font-size: 11.5px; color: var(--ink-soft); }
.auth-kerr { font-size: 12.5px; color: var(--red-deep); font-weight: 700; }
.auth-guest {
  background: none; border: none; color: var(--ink-soft); font-family: var(--ui);
  font-size: 13px; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; margin-top: 2px;
}
.auth-guest:hover { color: var(--ink); }
.auth-account { display: flex; flex-direction: column; gap: 14px; }
.auth-account p { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.auth-account b { color: var(--ink); }
@media (max-width: 560px) { .auth-chip { padding: 0 11px; } }

/* thin KFC stripe ribbon accent under header */
.ribbon {
  height: 8px;
  background: repeating-linear-gradient(115deg, var(--red) 0 22px, var(--white) 22px 44px);
  box-shadow: var(--shadow-sm);
}

/* ── layout ─────────────────────────────────────────────────────────────── */
.game {
  flex: 1; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 22px; max-width: 1120px; width: 100%; margin: 0 auto;
  padding: 24px 20px 30px; align-items: start;
}

/* ── clicker column ─────────────────────────────────────────────────────── */
.clicker {
  background: var(--card); border: 1px solid var(--beige-line);
  border-radius: 22px; box-shadow: var(--shadow-md);
  padding: 20px 18px 24px; text-align: center; position: sticky; top: 96px;
}
.tagline {
  font-family: var(--display); font-size: clamp(22px, 3.4vw, 30px);
  color: var(--black); line-height: 1.02; margin-bottom: 4px;
}
.tagline .hl { color: var(--red); }
.subline { font-size: 13.5px; color: var(--ink-soft); font-weight: 500; margin-bottom: 16px; }

.wallet { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.coin {
  flex: 1 1 0; min-width: 132px; border-radius: 16px; padding: 13px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1.5px solid var(--beige-line);
}
.coin--tender { background: var(--white); }
.coin--wing { background: linear-gradient(180deg, #fff3e4, #ffe6cd); border-color: var(--beige-2); }
.coin-val { font-family: var(--display); font-size: 32px; color: var(--ink); line-height: 1.02; }
.coin--tender .coin-val { color: var(--red-deep); }
.coin--wing .coin-val { color: var(--crisp); }
.coin-lbl { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }

.rates { margin: 13px 0 4px; font-size: 14.5px; font-weight: 700; color: var(--ink-soft); }
.rates b { color: var(--red-deep); font-weight: 800; }
.rates .dot { margin: 0 7px; opacity: .4; }

/* the bucket */
.bucket-stage { position: relative; padding: 10px 0 2px; }
.bucket-stage::before {
  content: ""; position: absolute; left: 50%; top: 52%; width: 78%; height: 62%;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(228,0,43,.10), transparent 68%); z-index: 0;
}
.bucket-btn {
  position: relative; z-index: 1; background: none; border: none; cursor: pointer; padding: 0;
  width: min(70vw, 290px); display: inline-block;
  filter: drop-shadow(0 16px 20px rgba(38,28,2,.22));
  transition: transform .09s var(--ease); animation: bob 4s ease-in-out infinite;
  touch-action: manipulation;
}
.bucket-btn img { width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.tap-hint {
  margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--red); text-transform: uppercase;
  letter-spacing: .08em; animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.boost-badges {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; pointer-events: none;
}
.boost-badge {
  background: var(--black); color: #fff; font-size: 12px; font-weight: 800;
  padding: 5px 11px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center;
  box-shadow: var(--shadow-sm); animation: dropIn .3s var(--ease);
}
.boost-badge .t { opacity: .8; font-variant-numeric: tabular-nums; }

.floats { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 4; }
.float {
  position: absolute; font-family: var(--display); font-size: 24px; color: var(--red);
  text-shadow: 0 1px 0 #fff, 0 3px 6px rgba(38,28,2,.18);
  animation: floatUp 1s var(--ease) forwards; white-space: nowrap;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.7); }
  18% { opacity: 1; transform: translateY(-12px) scale(1.12); }
  100% { opacity: 0; transform: translateY(-96px) scale(1); }
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── panel column ───────────────────────────────────────────────────────── */
.panel {
  background: var(--card); border: 1px solid var(--beige-line);
  border-radius: 22px; box-shadow: var(--shadow-md); overflow: hidden; min-height: 440px;
}
.tabs { display: flex; background: var(--white); border-bottom: 1px solid var(--beige-line); padding: 0 6px; gap: 2px; overflow-x: auto; }
.tab {
  flex: 1 0 auto; padding: 15px 12px; border: none; cursor: pointer; background: transparent;
  color: var(--ink-soft); font-family: var(--ui); font-size: 13.5px; font-weight: 800;
  letter-spacing: .01em; white-space: nowrap; border-bottom: 3px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--red); border-bottom-color: var(--red); }
.panel-hint { padding: 14px 18px 2px; font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.panel-body { padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 9px; }

/* shop item card */
.item {
  display: flex; align-items: center; gap: 13px; width: 100%; background: var(--white);
  border: 1.5px solid var(--beige-line); border-radius: 14px; padding: 12px 13px;
  cursor: pointer; text-align: left; position: relative;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), border-color .12s var(--ease);
}
.item:hover:not(.locked) { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--beige-2); }
.item:active:not(.locked) { transform: translateY(0); }
.item.locked { opacity: .5; cursor: not-allowed; }
.item.afford { border-color: var(--red); }
.item.afford::before {
  content: ""; position: absolute; left: -1.5px; top: 14px; bottom: 14px; width: 4px;
  background: var(--red); border-radius: 4px;
}
.item-ico {
  font-size: 28px; width: 50px; height: 50px; flex: none; display: grid; place-items: center;
  background: var(--beige); border-radius: 12px; border: 1px solid var(--beige-line);
}
.item-ico img { width: 34px; height: 34px; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 800; font-size: 15.5px; color: var(--ink); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item-count { font-size: 12.5px; color: var(--ink-soft); font-weight: 800; }
.item-desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.45; }
.item-right { text-align: right; flex: none; }
.item-cost { font-family: var(--display); font-size: 18px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; letter-spacing: .02em; }
.item-cost.tender { color: var(--red-deep); }
.item-cost.wing { color: var(--crisp); }
.item-cost.ok { color: var(--ink); }
.item-cost.dim { color: var(--ink-faint); }
.item-sub { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; margin-top: 1px; }
.tag { font-size: 10.5px; font-weight: 900; padding: 2px 7px; border-radius: 6px; background: var(--black); color: #fff; letter-spacing: .04em; text-transform: uppercase; }
.tag--owned { background: var(--green); }
.tag--active { background: var(--red); }
.tag--new { background: var(--gold); color: var(--black); }

/* ── rewards grid ───────────────────────────────────────────────────────── */
.rewards-grid { display: flex; flex-direction: column; gap: 10px; }
.reward {
  background: var(--white); border: 1.5px solid var(--beige-line); border-radius: 16px;
  padding: 14px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.reward:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.reward.claimed { border-color: var(--green); }
.reward-ico { font-size: 38px; line-height: 1; }
.reward-name { font-weight: 800; font-size: 14.5px; color: var(--ink); }
.reward-desc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.reward-cost { font-family: var(--display); font-size: 18px; color: var(--red-deep); }

/* Colonel Club tier rows (icon · choices · cost+button) */
.reward--tier {
  flex-direction: row; align-items: center; text-align: left; gap: 14px; padding: 14px 16px;
  border-left: 5px solid var(--red);
}
.reward--tier.claimed { border-left-color: var(--green); }
.reward--tier .reward-ico {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center;
  background: var(--beige); border-radius: 14px; font-size: 30px;
}
.reward--tier .reward-main { flex: 1; min-width: 0; }
.reward--tier .reward-name { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.reward--tier .reward-desc { margin-top: 4px; }
.reward--tier .reward-side { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 116px; }
.reward--tier .reward-cost { white-space: nowrap; text-align: center; }
.reward--tier .btn { padding: 9px 12px; font-size: 13.5px; min-height: 42px; }

/* prestige / buckets tab */
.prestige { padding: 6px 4px 8px; }
.prestige-card { background: var(--white); border: 1.5px solid var(--beige-line); border-radius: 18px; padding: 20px; text-align: center; }
.prestige-wing { font-size: 56px; line-height: 1; }
.prestige-card h3 { font-family: var(--display); font-size: 25px; color: var(--black); margin: 8px 0 12px; }
.prestige-card p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 7px 0; }
.prestige-card b { color: var(--ink); }
.prestige-stats { display: flex; gap: 10px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pstat { background: var(--beige); border: 1px solid var(--beige-line); border-radius: 12px; padding: 11px 16px; min-width: 124px; }
.pstat b { display: block; font-family: var(--display); font-size: 24px; color: var(--red-deep); }
.pstat span { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }

/* buttons */
.btn {
  border: none; cursor: pointer; font-family: var(--ui); font-weight: 800; font-size: 15px;
  padding: 13px 18px; border-radius: 12px; background: var(--red); color: #fff;
  box-shadow: 0 4px 0 var(--red-dark); transition: background .14s var(--ease), transform .08s var(--ease), box-shadow .08s var(--ease);
  min-height: 48px;
}
.btn:hover:not(:disabled) { background: var(--red-deep); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn--block { width: 100%; }
.btn--ghost { background: var(--white); color: var(--red-deep); border: 1.5px solid var(--beige-2); box-shadow: none; }
.btn--ghost:hover:not(:disabled) { background: var(--beige); }
.btn--green { background: var(--green); box-shadow: 0 4px 0 #2c7232; }
.btn--green:hover:not(:disabled) { background: #368a3c; }
.btn--danger { background: var(--white); color: var(--red-deep); border: 1.5px solid #e9c2c2; box-shadow: none; margin-top: 18px; }
.btn--danger:hover:not(:disabled) { background: #fff0f1; }

/* ── golden chicken ─────────────────────────────────────────────────────── */
.golden {
  position: fixed; z-index: 40; cursor: pointer; padding: 6px; background: none; border: none;
  filter: drop-shadow(0 0 16px var(--gold)) drop-shadow(0 8px 12px rgba(38,28,2,.35));
  animation: goldenWobble 1.1s ease-in-out infinite;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.golden img { width: 72px; height: 72px; }
@keyframes goldenWobble { 0%,100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }

/* ── toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--black); color: #fff; padding: 13px 20px; border-radius: 14px;
  font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow-lg); z-index: 60;
  opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease);
  max-width: 90vw; text-align: center; border: 2px solid var(--gold);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.foot {
  text-align: center; font-size: 11.5px; color: var(--ink-soft);
  padding: 14px 18px 22px; max-width: 760px; margin: 0 auto; line-height: 1.55;
}
.foot .poc {
  display: inline-block; background: var(--black); color: #fff; font-weight: 800;
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px; margin-bottom: 7px;
}

/* ── modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(38,28,2,.5); backdrop-filter: blur(3px); padding: 18px; animation: fade .2s var(--ease);
}
.modal-card {
  background: var(--card); border: 1px solid var(--beige-line); border-radius: 22px;
  padding: 26px; max-width: 420px; width: 100%; position: relative; box-shadow: var(--shadow-lg);
  animation: dropIn .25s var(--ease); text-align: center;
}
.modal-card h2 { font-family: var(--display); font-size: 26px; color: var(--red-deep); margin-bottom: 14px; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--beige-2); background: #fff; cursor: pointer; font-size: 15px; font-weight: 800; color: var(--ink);
}
.stats { display: flex; flex-direction: column; gap: 0; text-align: left; }
.stats div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--beige-line); }
.stats dt { color: var(--ink-soft); font-weight: 600; }
.stats dd { font-family: var(--display); font-size: 16px; color: var(--ink); }

/* reward coupon modal */
.coupon {
  background: var(--white); border: 2px dashed var(--red); border-radius: 16px;
  padding: 18px; margin: 8px 0 16px;
}
.coupon .c-ico { font-size: 46px; }
.coupon .c-name { font-weight: 800; font-size: 17px; margin: 4px 0; }
.coupon .c-code {
  font-family: var(--display); font-size: 26px; letter-spacing: .12em; color: var(--red-deep);
  background: var(--beige); border-radius: 10px; padding: 8px 12px; margin-top: 8px; display: inline-block;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════════════════
   JUICE — entrances, ambient motion, tap feedback, effects layer
   ════════════════════════════════════════════════════════════════════════ */

/* entrance: header / hero / panel slide up on load (staggered) */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.6) translateY(20px); } 60% { transform: scale(1.06) translateY(0); } 100% { opacity: 1; transform: scale(1); } }
.topbar { animation: fadeUp .5s var(--ease) both; }
.clicker { animation: fadeUp .6s var(--ease) .08s both; }
.panel { animation: fadeUp .6s var(--ease) .16s both; }
.tagline { animation: fadeUp .5s var(--ease) .24s both; }
.subline { animation: fadeUp .5s var(--ease) .3s both; }
.wallet { animation: fadeUp .5s var(--ease) .36s both; }
.bucket-btn { animation: popIn .7s var(--ease) .42s both, bob 4s ease-in-out 1.2s infinite; }

/* bucket: hover lift + glossy shine sweep + steam (no click squash/shrink) */
.bucket-btn { will-change: transform; }
.bucket-btn:hover { filter: drop-shadow(0 20px 26px rgba(38,28,2,.28)) brightness(1.04); }
@keyframes squash {
  0% { transform: scale(1); } 30% { transform: scale(1.14, .86); }
  55% { transform: scale(.93, 1.08); } 100% { transform: scale(1); }
}
.bucket-stage .shine {
  position: absolute; left: 50%; top: 52%; width: min(70vw,290px); height: 70%;
  transform: translate(-50%,-50%); pointer-events: none; z-index: 2; overflow: hidden;
  border-radius: 40px; mix-blend-mode: screen;
}
.bucket-stage .shine::after {
  content: ""; position: absolute; top: -20%; left: -60%; width: 40%; height: 140%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-18deg); animation: shine 5.5s var(--ease) 2s infinite;
}
@keyframes shine { 0% { left: -60%; } 22% { left: 130%; } 100% { left: 130%; } }

.steam { position: absolute; left: 50%; top: 16%; pointer-events: none; z-index: 0; }
.steam span {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.55), transparent 70%);
  filter: blur(3px); opacity: 0; animation: steam 3.4s ease-in-out infinite;
}
.steam span:nth-child(1) { left: -26px; animation-delay: 0s; }
.steam span:nth-child(2) { left: 0px; animation-delay: 1.1s; }
.steam span:nth-child(3) { left: 22px; animation-delay: 2.1s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  30% { opacity: .8; } 100% { opacity: 0; transform: translateY(-60px) scale(1.7); }
}

/* boost aura behind the bucket while a boost is running */
.bucket-stage .aura {
  position: absolute; left: 50%; top: 52%; width: 88%; height: 78%;
  transform: translate(-50%,-50%); border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(228,0,43,.22), transparent 66%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.bucket-stage.boosted .aura { opacity: 1; animation: auraPulse 1.3s ease-in-out infinite; }
@keyframes auraPulse { 0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .6; } 50% { transform: translate(-50%,-50%) scale(1.12); opacity: 1; } }

/* ambient drifting flavour particles behind the hero */
.ambient { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; border-radius: 22px; }
.ambient span {
  position: absolute; bottom: -30px; font-size: 20px; opacity: 0;
  animation: drift linear infinite;
}
@keyframes drift {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  10% { opacity: .35; } 90% { opacity: .35; }
  100% { opacity: 0; transform: translateY(-460px) rotate(120deg); }
}

/* counter / pill bump */
.bumping { animation: bumpK .32s var(--ease); }
@keyframes bumpK { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* tab + item entrance — only when the body is (re)built on a tab switch /
 * real content change, NOT on the per-second affordability refresh */
.panel-body.enter > * { animation: fadeUp .3s var(--ease) both; }
.panel-body.enter .rewards-grid > * { animation: fadeUp .3s var(--ease) both; }

/* ── fx overlay layer ────────────────────────────────────────────────────── */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx-p {
  position: fixed; transform: translate(-50%,-50%); will-change: transform, opacity;
  animation: fxp var(--dur,800ms) var(--ease) forwards; line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(38,28,2,.25));
}
@keyframes fxp {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.4) rotate(0); }
  15% { opacity: 1; transform: translate(-50%,-50%) scale(1.1) rotate(calc(var(--rot)*.2)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(.7) rotate(var(--rot)); }
}
.fx-t {
  position: fixed; transform: translate(-50%,-50%); will-change: transform, opacity; z-index: 71;
  animation: fxlaunch var(--dur,820ms) cubic-bezier(.3,.5,.55,1) forwards;
  filter: drop-shadow(0 3px 4px rgba(38,28,2,.3));
}
@keyframes fxlaunch {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.5); }
  12% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); }
  45% { transform: translate(calc(-50% + var(--tx)*.55), calc(-50% + var(--apex))) scale(1) rotate(calc(var(--rot)*.4)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--fall))) scale(.8) rotate(var(--rot)); }
}
.fx-ring {
  position: fixed; width: 30px; height: 30px; border-radius: 50%;
  border: 4px solid var(--red); transform: translate(-50%,-50%) scale(.3);
  animation: fxring .55s var(--ease) forwards;
}
@keyframes fxring {
  0% { opacity: .8; transform: translate(-50%,-50%) scale(.3); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(3.4); border-width: 1px; }
}
.fx-confetti {
  position: fixed; width: 9px; height: 13px; transform: translate(-50%,-50%);
  animation: fxcon var(--dur,1200ms) cubic-bezier(.2,.6,.5,1) forwards;
}
@keyframes fxcon {
  0% { opacity: 1; transform: translate(-50%,-50%) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--rot)); }
}
.fx-flash { position: fixed; inset: 0; animation: fxflash .6s var(--ease) forwards; }
@keyframes fxflash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .game { grid-template-columns: 1fr; gap: 18px; }
  .clicker { position: static; }
  .kfc-logo .prog { display: none; }
  .kfc-logo .sep { display: none; }
}
@media (max-width: 440px) {
  .points-pill .pp-lbl { display: none; }
  .rewards-grid { grid-template-columns: 1fr; }
  .coin-val { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
