/* Tap Tap Tickle — dark + gold + brand pink. Mobile-first. */
:root {
  --bg0: #120817;
  --bg1: #1d0f28;
  --gold: #d4a24c;
  --gold-bright: #f0c674;
  --pink: #f24aa3;
  --pink-bright: #ff79c0;
  --text: #f4eefa;
  --muted: #b8a9c9;
  --card: #221531;
  --card-hi: #2e1d40;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%;
  /* The stocks backdrop is intentionally wider than a phone screen; clip the
     horizontal spill so it never creates a horizontal scroll that would
     off-centre the feet and cut off the shop rows. */
  overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 50% -10%, rgba(242,74,163,0.12), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(212,162,76,0.10), transparent 60%),
    var(--bg0);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  overscroll-behavior: none; user-select: none;
}
#app {
  max-width: 920px; margin: 0 auto; min-height: 100%;
  display: grid;
  grid-template-areas: "hud" "stage" "roster" "shop";
  grid-template-rows: auto 1fr auto auto;
  /* Pin the column to the container width (min 0) so a wide grid item can't
     blow the track past the viewport and drag the whole UI off-centre. */
  grid-template-columns: minmax(0, 1fr);
  gap: 8px; padding: 10px 12px 14px;
}

/* ── HUD ─────────────────────────────────────────── */
/* Above the stage so the tall stocks backdrop can't cover the score/rates/mute. */
#hud { grid-area: hud; text-align: center; position: relative; z-index: 2; }
.brand {
  font-weight: 800; letter-spacing: 0.14em; font-size: 13px;
  color: var(--muted); margin-bottom: 4px;
}
.brand-pink { color: var(--pink-bright); }
.score-num {
  font-size: clamp(40px, 11vw, 68px); font-weight: 800; line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 2px 18px rgba(212,162,76,0.35);
  font-variant-numeric: tabular-nums;
}
#giggles.bump { animation: bump 160ms ease; }
@keyframes bump { 0%{transform:scale(1);} 40%{transform:scale(1.07);} 100%{transform:scale(1);} }
.score-label {
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--pink); font-weight: 700; margin-top: 2px;
}
.rates { margin-top: 8px; display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--muted); }
.rate b { color: var(--gold); }
.rate-tap b { color: var(--pink-bright); }

/* ── Stage / tap target ──────────────────────────── */
#stage { grid-area: stage; display: grid; place-items: center; position: relative; min-height: 230px; }
/* Dungeon wall backdrop — sits behind the stocks/feet, filling the stage.
   Full-bleed width so the (wider) stocks always lands on wall, and a soft
   top/bottom fade so it melts into the HUD above and the shop below instead
   of reading as a hard rectangle. */
#wall-bg {
  position: absolute; top: -120px; bottom: 0; left: 50%;
  width: 100vw; transform: translateX(-50%);
  object-fit: cover; object-position: center top;
  z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 78%, transparent 100%);
}
/* Reactive Ticklee portrait — top-left. Three stacked layers (idle img + two
   muted laugh videos) cross-faded by a state class set from the tap/combo. */
#ticklee {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%); z-index: 4;
  width: min(22vw, 92px); aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 2px solid rgba(212,162,76,0.55); background: #1a1022;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5); pointer-events: none;
}
.tk-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 120ms ease;
}
#tk-idle { opacity: 1; }                                   /* idle by default */
#ticklee.laughing #tk-idle, #ticklee.frantic #tk-idle { opacity: 0; }
#ticklee.laughing #tk-laugh { opacity: 1; }
#ticklee.frantic #tk-frantic { opacity: 1; }
#tk-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-align: center;
  color: #fff; padding: 3px 2px 2px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
#tap-glow {
  position: absolute; top: 50%; left: 50%;
  width: min(70vw, 320px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,74,163,0.30), rgba(242,74,163,0) 65%);
  filter: blur(6px); pointer-events: none;
  animation: breathe 3.4s ease-in-out infinite;
}
@keyframes breathe {
  0%,100%{transform:translate(-50%,-50%) scale(0.92);opacity:0.7;}
  50%{transform:translate(-50%,-50%) scale(1.04);opacity:1;}
}

/* One pair of feet — heel-anchored so toes animate without the foot jumping. */
#feet-pair {
  position: relative; display: flex; gap: var(--foot-gap, min(3vw, 16px));
  align-items: flex-end; justify-content: center;
}
/* Wooden foot-stocks behind the feet. Anchored to the feet-pair box (which is
   exactly the feet bounds), centred, and pushed down so its two holes sit at
   the heel/ankle line — the feet rise out of the cepo instead of floating.
   Width tracks the foot height unit so the ~45%-apart holes register on the
   two foot centres across viewport sizes. Behind the feet; never interactive. */
#stocks-bg {
  position: absolute; left: 50%; bottom: -42%;
  width: min(82vh, 540px); height: auto;
  transform: translateX(-52.2%);   /* holes' midpoint is at 52.2% of the art, not 50% */
  z-index: 0; pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.55));
}
.foot-btn {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  display: grid; place-items: end center;    /* rest + reaction share ONE cell, exactly overlapped */
  line-height: 0;
  position: relative; z-index: 1;            /* feet sit in front of the stocks */
}
.foot-img {
  /* Base height × the current girl's per-girl scale (see the data-girl block).
     Feet are bottom-aligned (flex-end), so scaling keeps the heel seated in the
     cepo hole and only changes how high the toes rise — the cepo stays fixed. */
  height: calc(min(46vh, 300px) * var(--foot-scale, 1)); width: auto; display: block;
  grid-area: 1 / 1;                           /* both poses stack in the same grid cell */
  margin-bottom: var(--foot-dy, 0px);         /* fine heel-seat nudge per girl */
  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.55));
  transform-origin: 50% 88%;                  /* pivot near the heel */
  transform: rotate(var(--foot-rot, 0deg));
  transition: transform 130ms ease;
}
/* ── Per-girl feet tuning ─────────────────────────────────
   The cepo is one fixed size; each girl's foot art has its own proportions and
   intended size (Steph biggest → Nora smallest; Helen the most-marked arches).
   --foot-scale sizes her feet, --foot-gap spaces the pair onto the two holes,
   --foot-dy seats the heel. Defaults (Selene/Chloe/Sabrina) = 1 / no nudge.
   These are intentionally conservative — tune the numbers live on staging. */
#feet-pair[data-girl="julie"]  { --foot-scale: 0.98; }
#feet-pair[data-girl="nora"]   { --foot-scale: 0.93; }
#feet-pair[data-girl="amanda"] { --foot-scale: 0.99; }
#feet-pair[data-girl="helen"]  { --foot-scale: 1.03; }
#feet-pair[data-girl="steph"]  { --foot-scale: 1.07; --foot-gap: min(2.6vw, 14px); }
/* Nat is now the cast's biggest (owner-canon US 10, above Steph's 9½) — a
   notch over Steph's scale, same widened gap. Jen (US 8½) reads fine at the
   default 1. */
#feet-pair[data-girl="nat"]    { --foot-scale: 1.09; --foot-gap: min(2.6vw, 14px); }
/* The resting pose is the in-flow layer that sizes the button; the reaction
   pose is stacked exactly over it and toggled by opacity. The rest layer's src
   never changes during play, so returning to reposo is a clean cross-fade
   instead of an SVG re-raster blank. */
/* Cross-fade inversely: only ONE pose is fully opaque at a time, so the resting
   foot never shows behind the reaction. Both layers stay rasterized (opacity, not
   src swaps), so the return to reposo is a clean dissolve with no re-raster blank. */
.foot-img.foot-rest  { transition: transform 130ms ease, opacity 130ms ease; }
.foot-img.foot-react { opacity: 0; transition: transform 130ms ease, opacity 130ms ease; }
.foot-btn.poke .foot-img.foot-rest  { opacity: 0; }
.foot-btn.poke .foot-img.foot-react { opacity: 1; }
/* The source SVG is one foot; mirror the LEFT so the pair reads naturally. */
.foot-btn[data-side="left"] .foot-img { transform: scaleX(-1) rotate(var(--foot-rot, 0deg)); }
/* poke: a quick squish on the tapped foot, layered over the rotation var */
.foot-btn.poke .foot-img { animation: poke 200ms cubic-bezier(0.3,1.4,0.5,1); }
.foot-btn[data-side="left"].poke .foot-img { animation: poke-r 200ms cubic-bezier(0.3,1.4,0.5,1); }
@keyframes poke {
  0%{transform:scale(1) rotate(var(--foot-rot,0deg));}
  35%{transform:scale(0.9) rotate(var(--foot-rot,0deg));}
  65%{transform:scale(1.05) rotate(var(--foot-rot,0deg));}
  100%{transform:scale(1) rotate(var(--foot-rot,0deg));}
}
@keyframes poke-r {
  0%{transform:scaleX(-1) scale(1) rotate(var(--foot-rot,0deg));}
  35%{transform:scaleX(-1) scale(0.9) rotate(var(--foot-rot,0deg));}
  65%{transform:scaleX(-1) scale(1.05) rotate(var(--foot-rot,0deg));}
  100%{transform:scaleX(-1) scale(1) rotate(var(--foot-rot,0deg));}
}
#tap-hint {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); letter-spacing: 0.08em;
  background: rgba(0,0,0,0.3); padding: 3px 10px; border-radius: 999px;
  animation: hintpulse 1.6s ease-in-out infinite;
}
#tap-hint.gone { display: none; }
@keyframes hintpulse { 0%,100%{opacity:0.5;} 50%{opacity:1;} }

/* ── Floating FX ─────────────────────────────────── */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.fx-num {
  position: fixed; font-weight: 800; font-size: 20px; color: var(--pink-bright);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6); will-change: transform, opacity;
  animation: floatup 850ms ease-out forwards;
}
@keyframes floatup {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
  18% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); }
  100% { transform: translate(-50%, -90px) scale(1); opacity: 0; }
}

/* ── Shop ────────────────────────────────────────── */
#shop { grid-area: shop; }

/* ── Ticklee switch animation ────────────────────────────
   A big portrait of the newly-picked girl flies into the header slot; the slot
   pulses on landing; her feet fade in on the cepo. */
.tk-fly {
  position: fixed; z-index: 150; border-radius: 16px; object-fit: cover;
  transform-origin: top left; pointer-events: none; opacity: 1;
  border: 2px solid var(--gold);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65), 0 0 0 4px rgba(212, 162, 76, 0.25);
  transition: transform 620ms cubic-bezier(0.5, 0, 0.2, 1), opacity 620ms ease;
}
#ticklee.tk-land { animation: tkLand 460ms cubic-bezier(0.3, 1.35, 0.5, 1); }
@keyframes tkLand {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.foot-img.feet-fade { animation: feetFade 460ms ease both; }
@keyframes feetFade { from { opacity: 0; } to { opacity: 1; } }

/* ── Active roster: recruited Ticklers under the cepo ───── */
#roster {
  grid-area: roster;
  display: flex; flex-direction: column; gap: 4px;
  padding: 2px 4px; min-height: 0;
}
#roster.empty { display: none; }
.roster-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); opacity: 0.85; padding-left: 2px;
}
.roster-row {
  display: flex; gap: 10px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px; scrollbar-width: none; min-height: 0;
}
.roster-row::-webkit-scrollbar { display: none; }
.roster-card {
  position: relative; flex: 0 0 auto; width: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  animation: rosterPop 260ms cubic-bezier(0.34, 1.4, 0.5, 1) both;
}
.roster-card img {
  width: 52px; height: 52px; border-radius: 12px; object-fit: cover;
  border: 1px solid rgba(212, 162, 76, 0.45); background: var(--card);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
.roster-count {
  position: absolute; top: -5px; right: -2px;
  background: var(--pink); color: #2a0a1e; font-weight: 800; font-size: 11px;
  line-height: 1; padding: 3px 6px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.roster-name {
  font-size: 10px; color: var(--muted); font-weight: 700;
  max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@keyframes rosterPop {
  from { opacity: 0; transform: translateY(8px) scale(0.85); }
  to   { opacity: 1; transform: none; }
}
.shop-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.shop-tab {
  flex: 1; appearance: none; border: 1px solid rgba(212,162,76,0.2);
  background: var(--card); color: var(--muted); font: inherit; font-weight: 700;
  font-size: 13px; letter-spacing: 0.06em; padding: 9px; border-radius: 11px; cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
}
.shop-tab.active { background: var(--gold); color: #1a1206; border-color: var(--gold); }
.shop-list { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; padding-right: 2px; }
.shop-list.hidden { display: none; }
.shop-list::-webkit-scrollbar { width: 5px; }
.shop-list::-webkit-scrollbar-thumb { background: rgba(212,162,76,0.3); border-radius: 3px; }

.item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 13px; cursor: pointer; position: relative; overflow: hidden;
  color: var(--text); font-family: inherit;
  /* Keep each row at its natural height — the shop-list is a max-height flex
     column, and without this the rows shrink to fit and clip the portraits. */
  flex-shrink: 0;
  transition: transform 90ms ease, border-color 140ms, background 140ms;
}
.item.affordable { border-color: rgba(242,74,163,0.5); background: var(--card-hi); }
.item.affordable:hover { transform: translateY(-1px); }
.item.locked { opacity: 0.55; }
.item:active.affordable { transform: scale(0.985); }
.item-icon {
  flex: 0 0 auto; width: 80px; height: 80px; border-radius: 12px; overflow: hidden;
  background: #1a1022; display: grid; place-items: center; position: relative;
  border: 2px solid transparent;
}
.item-icon img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.item-icon.tool img { object-fit: contain; padding: 6px; }
/* Voice picker: an owned ticklee's portrait is tappable to make her laugh. */
.item.owned .item-icon[data-voice] { cursor: pointer; }
.item.owned .item-icon[data-voice]:hover { border-color: rgba(255,110,199,0.55); }
.voice-badge {
  position: absolute; bottom: -1px; right: -1px; font-size: 11px; line-height: 1;
  background: var(--gold); color: #1a1206; border-radius: 999px; padding: 2px 3px;
  display: none;
}
.item.voice-active .item-icon { border-color: var(--gold); box-shadow: 0 0 12px rgba(232,182,90,0.5); }
.item.voice-active .voice-badge { display: block; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.item-owned { font-size: 12px; color: var(--gold); font-weight: 800; background: rgba(212,162,76,0.14); padding: 1px 7px; border-radius: 999px; }
.shoe-size { font-size: 11px; font-weight: 800; color: var(--pink-bright); background: rgba(242,74,163,0.16); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-quote {
  font-size: 12.5px; font-style: italic; color: var(--pink-bright);
  margin-top: 5px; opacity: 0.9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Ticklees tab — pick/unlock who you tickle; the active pick is highlighted. */
.ticklee-pick.active {
  border-color: var(--gold); background: var(--card-hi);
  box-shadow: 0 0 12px rgba(232,182,90,0.4);
}
.ticklee-pick.locked .item-icon img { filter: grayscale(0.4) brightness(0.82); }
.ticklee-pick.locked.affordable .item-icon img { filter: none; }
.tk-now { color: var(--gold-bright); font-weight: 800; }
.tk-tap { color: var(--muted); font-weight: 700; font-size: 11px; }
.item-cost {
  flex: 0 0 auto; text-align: right; font-weight: 800; font-size: 14px;
  color: var(--gold-bright);
}
.item.cant .item-cost { color: #8b7a5a; }
.item-cost small { display: block; font-size: 9px; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; text-transform: uppercase; }

/* ── Desktop: shop to the side ───────────────────── */
@media (min-width: 760px) {
  #app {
    grid-template-areas: "hud hud" "stage shop" "roster shop";
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto 1fr auto;
    align-items: start; height: 100%; padding: 16px 20px;
  }
  #stage { min-height: 0; }
  /* On desktop the stage is a column, so the wall fills it (not the viewport). */
  #wall-bg { width: 100%; left: 0; transform: none; }
  .shop-list { max-height: calc(100vh - 180px); }
}

/* ── Juice pass (audio/combo/toast/welcome-back) ─────────── */
#mute {
  background: none; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 4px 8px; cursor: pointer;
  font-size: 15px; line-height: 1;
}
#mute:hover { border-color: rgba(255,255,255,0.45); }
/* Leaderboard widget — top-right corner of the HUD, mirroring the Ticklee
   portrait on the left. Compact card with the current #1; opens the board. */
#lb-cta {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 4;
  width: min(30vw, 132px); padding: 7px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center;
  background: linear-gradient(135deg, rgba(212,162,76,0.18), rgba(242,74,163,0.14));
  border: 1px solid rgba(212,162,76,0.5); border-radius: 12px;
  color: var(--text); font: inherit; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: transform 90ms ease, border-color 140ms;
}
#lb-cta:hover { border-color: var(--gold); }
#lb-cta:active { transform: translateY(-50%) scale(0.97); }
.lbc-label { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.lbc-name { max-width: 100%; font-size: 12px; font-weight: 800; color: var(--gold-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbc-score { font-size: 10px; color: var(--muted); }
.lbc-score:empty { display: none; }

/* ── Leaderboard modal ───────────────────────────────────── */
#leaderboard {
  position: fixed; inset: 0; z-index: 180;
  display: none; align-items: center; justify-content: center;
  background: rgba(8,5,12,0.86); backdrop-filter: blur(5px); padding: 18px;
}
#leaderboard.show { display: flex; }
.lb-card {
  position: relative; width: 100%; max-width: 400px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: #1d1524; border: 1px solid rgba(212,162,76,0.45);
  border-radius: 20px; padding: 22px 18px 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.65); animation: wb-in 240ms ease;
}
.lb-card h2 { margin: 0 0 14px; font-size: 21px; color: #f6ecdf; text-align: center; }
.lb-close {
  position: absolute; top: 12px; right: 14px; width: 32px; height: 32px;
  border: 0; border-radius: 999px; background: rgba(255,255,255,0.1);
  color: #f6ecdf; font-size: 20px; line-height: 1; cursor: pointer;
}
.lb-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.lb-tab {
  flex: 1; appearance: none; border: 1px solid rgba(212,162,76,0.2);
  background: var(--card); color: var(--muted); font: inherit; font-weight: 700;
  font-size: 13px; padding: 8px; border-radius: 10px; cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
}
.lb-tab.active { background: var(--gold); color: #1a1206; border-color: var(--gold); }
.lb-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; min-height: 80px; }
.lb-list::-webkit-scrollbar { width: 5px; }
.lb-list::-webkit-scrollbar-thumb { background: rgba(212,162,76,0.3); border-radius: 3px; }
.lb-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: var(--card); border: 1px solid rgba(255,255,255,0.05); border-radius: 11px;
}
.lb-row.you { border-color: var(--pink); background: var(--card-hi); }
.lb-rank { flex: 0 0 28px; text-align: center; font-weight: 800; font-size: 14px; color: var(--gold); }
.lb-row:nth-child(1) .lb-rank { color: #ffd700; }
.lb-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #2a1a3a; border: 1px solid rgba(212,162,76,0.3); }
.lb-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row.you .lb-name::after { content: ' (you)'; color: var(--pink-bright); font-weight: 600; }
.lb-score { flex: 0 0 auto; font-weight: 800; font-size: 13px; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.lb-empty, .lb-loading { text-align: center; color: var(--muted); font-size: 14px; padding: 22px 0; }
.lb-me {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(212,162,76,0.2);
  text-align: center; font-size: 13px; color: rgba(246,236,223,0.75); min-height: 18px;
}
.lb-me b { color: var(--gold-bright); }

#autotap {
  background: none; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 4px 9px; cursor: pointer;
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; line-height: 1;
  color: var(--muted); transition: color .15s, border-color .15s, box-shadow .15s, background .15s;
}
#autotap:hover { border-color: rgba(255,255,255,0.45); }
#autotap.on {
  color: #1a1206;
  background: linear-gradient(180deg, var(--gold-bright), var(--pink));
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(242, 74, 163, 0.55);
}

#combo {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-weight: 900; font-size: 26px; letter-spacing: 0.04em;
  color: #ffd166; text-shadow: 0 2px 10px rgba(255, 110, 199, 0.55);
  opacity: 0; pointer-events: none; z-index: 5;
  transition: opacity 160ms ease;
}
#combo.show { opacity: 1; }
#combo.pop { animation: combo-pop 180ms ease; }
@keyframes combo-pop {
  from { transform: translateX(-50%) scale(1.35); }
  to   { transform: translateX(-50%) scale(1); }
}
#stage { position: relative; }

.fx-emoji {
  position: fixed; z-index: 60; pointer-events: none;
  font-size: 30px;
  animation: fx-emoji-rise 1.05s ease-out forwards;
}
@keyframes fx-emoji-rise {
  from { opacity: 1; transform: translateY(0) scale(0.7) rotate(-8deg); }
  60%  { opacity: 1; transform: translateY(-60px) scale(1.15) rotate(8deg); }
  to   { opacity: 0; transform: translateY(-110px) scale(1) rotate(-4deg); }
}
/* the owned tool jabbing at the tapped foot */
.fx-tool {
  position: fixed; z-index: 55; pointer-events: none;
  width: 52px; height: 52px; object-fit: contain;
  filter: drop-shadow(0 4px 9px rgba(0,0,0,0.55));
  transform-origin: 50% 80%;
  animation: tool-jab 480ms cubic-bezier(0.3,1.3,0.5,1) forwards;
}
@keyframes tool-jab {
  0%   { opacity: 0; transform: translateY(-16px) rotate(var(--tool-rot,0deg)) scale(0.65); }
  28%  { opacity: 1; transform: translateY(4px)   rotate(var(--tool-rot,0deg)) scale(1.12); }
  55%  { opacity: 1; transform: translateY(-2px)  rotate(var(--tool-rot,0deg)) scale(1); }
  100% { opacity: 0; transform: translateY(-22px) rotate(var(--tool-rot,0deg)) scale(0.9); }
}

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  z-index: 90; pointer-events: none;
  background: #241d2b; color: #f6ecdf;
  border: 1px solid rgba(255, 110, 199, 0.45);
  border-radius: 999px; padding: 10px 20px;
  font-weight: 700; font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 200ms ease, transform 200ms ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#welcome-back {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 5, 12, 0.8); backdrop-filter: blur(4px);
  padding: 20px;
}
#welcome-back.show { display: flex; }
.wb-card {
  width: 100%; max-width: 330px; text-align: center;
  background: #1d1524; border: 1px solid rgba(255, 110, 199, 0.4);
  border-radius: 22px; padding: 26px 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  animation: wb-in 240ms ease;
}
@keyframes wb-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.wb-emoji { font-size: 40px; }
.wb-card h2 { margin: 8px 0 4px; font-size: 20px; color: #f6ecdf; }
.wb-card p { margin: 0 0 12px; font-size: 14px; color: rgba(246, 236, 223, 0.65); }
.wb-amount {
  font-size: 38px; font-weight: 900; color: #ff6ec7;
  text-shadow: 0 2px 14px rgba(255, 110, 199, 0.4);
}
.wb-label { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(246, 236, 223, 0.5); margin-bottom: 18px; }
#wb-collect {
  width: 100%; padding: 13px; border: 0; border-radius: 14px;
  background: #ff6ec7; color: #2a0a1e;
  font-size: 17px; font-weight: 800; cursor: pointer;
  transition: transform 120ms ease;
}
#wb-collect:active { transform: scale(0.97); }

/* ── Login / subscribe gate ──────────────────────────────── */
#ttt-gate {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 5, 12, 0.86); backdrop-filter: blur(5px);
  padding: 20px;
}
#ttt-gate.show { display: flex; }
.gate-card {
  position: relative;
  width: 100%; max-width: 360px; text-align: center;
  background: #1d1524; border: 1px solid rgba(212, 162, 76, 0.45);
  border-radius: 22px; padding: 30px 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  animation: wb-in 240ms ease;
}
.gate-emoji { font-size: 42px; }
.gate-card h2 { margin: 10px 0 6px; font-size: 22px; color: #f6ecdf; }
.gate-card p { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: rgba(246, 236, 223, 0.7); }
.gate-actions { display: flex; flex-direction: column; gap: 10px; }
.gate-btn {
  display: block; width: 100%; padding: 13px; border-radius: 14px;
  font-size: 16px; font-weight: 800; text-decoration: none;
  transition: transform 120ms ease, filter 120ms ease;
}
.gate-btn:active { transform: scale(0.97); }
.gate-btn:hover { filter: brightness(1.08); }
.gate-btn-patreon { background: #f24aa3; color: #2a0a1e; }
.gate-btn-afdian  { background: #2e1d40; color: #f0c674; border: 1px solid rgba(212, 162, 76, 0.5); }
.gate-close {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); color: #f6ecdf;
  font-size: 22px; line-height: 1; cursor: pointer;
}

/* Subscriber-locked shop rows: visible (collection goal) but not buyable. */
.item.sub-locked { opacity: 0.6; }
.item.sub-locked .item-icon { filter: grayscale(0.6); }
.item.sub-locked .item-cost { color: var(--gold); }

/* ── Coming-soon teasers (Leah, until her voice is picked — Nat + Jen went
   live 2026-07-11) ────────────────────────────────────────────────────────
   Dimmed, non-interactive shop rows; the icon is a dimmed styled initial
   because the cast portrait doesn't exist yet. Flipping a girl's `comingSoon`
   flag in game.js swaps her to a live card — no CSS change needed at launch
   (her optional #feet-pair[data-girl] scale tuning is a separate, additive
   line once her feet art exists). */
.item.coming-soon { opacity: 0.55; cursor: default; pointer-events: none; }
.item.coming-soon .item-name { color: var(--muted); }
.cs-icon {
  background:
    radial-gradient(80% 80% at 50% 18%, rgba(242,74,163,0.16), transparent 70%),
    #171021;
  border: 2px dashed rgba(212,162,76,0.35);
}
.cs-icon span {
  font-size: 36px; font-weight: 800; line-height: 1;
  color: rgba(184,169,201,0.6);
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.cs-chip {
  display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); white-space: nowrap;
  background: rgba(212,162,76,0.12); border: 1px dashed rgba(212,162,76,0.5);
  padding: 4px 8px; border-radius: 999px;
}

/* ── Entrance animation ──────────────────────────────────
   The scene assembles on load: wall fades in, the HUD drops, the stocks
   settle, the feet DROP into the stocks (with a little lock-in bounce), and
   the shop rises. All `both` fill so nothing flashes before its delay. */
@keyframes wallIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hudDrop {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes stocksSettle {
  /* keep the -52.2% X-centring throughout; only opacity/scale/Y move */
  from { opacity: 0; transform: translateX(-52.2%) translateY(-12px) scale(0.975); }
  to   { opacity: 1; transform: translateX(-52.2%) translateY(0)     scale(1); }
}
@keyframes footDrop {
  0%   { opacity: 0; transform: translateY(-72px); }
  60%  { opacity: 1; transform: translateY(10px); }   /* overshoot = lock-in */
  80%  { transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes shopRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

#wall-bg   { animation: wallIn 700ms ease both; }
#hud       { animation: hudDrop 550ms cubic-bezier(0.2,0.8,0.3,1) both; }
#stocks-bg { animation: stocksSettle 600ms cubic-bezier(0.2,0.8,0.3,1) 140ms both; }
.foot-btn  { animation: footDrop 700ms cubic-bezier(0.34,1.32,0.5,1) 360ms both; }
.foot-btn[data-side="right"] { animation-delay: 470ms; }   /* slight L→R stagger */
#shop      { animation: shopRise 600ms cubic-bezier(0.2,0.8,0.3,1) 260ms both; }

@media (prefers-reduced-motion: reduce) {
  #wall-bg, #hud, #stocks-bg, .foot-btn, #shop { animation: none; }
}
