/* =============================================================
   Waffle Tycoon - game-only styles.
   Loaded on top of the site's style.css, which supplies the
   design tokens (--bg, --surface, --accent, --ease, ...).
   ============================================================= */

.game { padding-block: clamp(1.25rem, 3vw, 2rem) 3rem; }

/* ---------- resource bar ------------------------------------ */
.hud {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.hud-main { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.hud-icon { font-size: 1.6rem; color: var(--accent); }
.hud-value {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hud-unit { font-size: 1rem; font-weight: 700; color: var(--muted); align-self: flex-end; padding-bottom: .28rem; }
.hud-sub { margin-top: .35rem; font-size: .92rem; color: var(--muted); }
.hud-sub span { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- layout ------------------------------------------ */
.game-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
}

/* The left column is its own grid, so sections stack in source order
   and no hand-counted grid rows can drift out of sync. */
.game-main {
  display: grid;
  gap: 1.25rem;
  align-content: start;
  min-width: 0;
}

.board {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.25rem) 1.25rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.board-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 700; }
.board-hint { margin-top: .3rem; font-size: .92rem; color: var(--muted); }

/* ---------- the waffle -------------------------------------- */
.waffle {
  position: relative;
  display: block;
  width: clamp(190px, 42vw, 290px);
  margin: 1.5rem 0 .25rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 28px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .12s var(--ease), filter .2s var(--ease);
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .3));
}
.waffle:hover { transform: scale(1.03); }
.waffle:active { transform: scale(.95); }
.waffle.chomp { animation: chomp .22s var(--ease); }
@keyframes chomp {
  40% { transform: scale(.92) rotate(-2deg); }
  70% { transform: scale(1.04) rotate(1.5deg); }
}
.waffle.done { animation: done .45s var(--ease); }
@keyframes done {
  30% { transform: scale(1.14) rotate(4deg); }
  60% { transform: scale(.96) rotate(-3deg); }
}

.waffle-art { width: 100%; height: auto; }

/* five stages, one attribute switch - no DOM rebuilding */
.wf-st { display: none; }
.waffle[data-stage="0"] .wf-0,
.waffle[data-stage="1"] .wf-1,
.waffle[data-stage="2"] .wf-2,
.waffle[data-stage="3"] .wf-3,
.waffle[data-stage="4"] .wf-4 { display: block; }

.stage-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- bite pips --------------------------------------- */
.bites { display: flex; gap: .5rem; margin-top: .9rem; list-style: none; padding: 0; }
.bites li {
  width: 34px;
  height: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.bites li.on {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-color: transparent;
  transform: scaleY(1.35);
}

/* ---------- floating "+1" ----------------------------------- */
.float-layer { position: absolute; inset: 0; pointer-events: none; }
.float {
  position: absolute;
  left: 50%;
  top: 22%;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  white-space: nowrap;
  animation: float-up .9s ease-out forwards;
}
@keyframes float-up {
  from { opacity: 0; transform: translate(-50%, 6px) scale(.85); }
  25%  { opacity: 1; transform: translate(-50%, -8px) scale(1.05); }
  to   { opacity: 0; transform: translate(-50%, -64px) scale(1); }
}

/* ---------- side panel -------------------------------------- */
.panel { display: grid; gap: 1rem; }
.panel-block {
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.panel-title {
  margin-bottom: .7rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-note { font-size: .86rem; line-height: 1.45; color: var(--muted); }

.stats { display: grid; gap: .45rem; }
.stats > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.stats dt { color: var(--muted); }
.stats dd { font-weight: 700; font-variant-numeric: tabular-nums; }

.opt-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .7rem; }
.btn-sm { padding: .5rem .85rem; font-size: .86rem; border-radius: var(--r-sm); }
.btn-danger:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger.armed { border-color: var(--accent); color: var(--accent); }

/* ---------- responsive -------------------------------------- */
@media (max-width: 860px) {
  .game-grid { grid-template-columns: 1fr; }
  .panel { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .waffle, .waffle:hover, .waffle:active { transform: none; }
}

/* ---------- welcome back banner ----------------------------- */
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  font-size: .95rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  animation: welcome-in .35s var(--ease);
}
.welcome b { color: var(--accent); font-variant-numeric: tabular-nums; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- kitchen line ------------------------------------ */
.kitchen {
  width: min(100%, 340px);
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.kitchen-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .45rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.kitchen-rate b { color: var(--text); font-variant-numeric: tabular-nums; }
.kitchen-bar {
  height: 10px;
  overflow: hidden;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.kitchen-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 999px;
  transition: width .1s linear;
}
.kitchen-note { margin-top: .5rem; font-size: .8rem; line-height: 1.4; color: var(--muted); }

/* ---------- shop -------------------------------------------- */
.shop { display: grid; gap: .55rem; list-style: none; padding: 0; margin: 0; }

.up {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .2rem .6rem;
  align-items: center;
  padding: .65rem .75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .18s var(--ease);
}
.up.affordable { border-color: var(--border-strong); }

.up-head { display: flex; align-items: baseline; gap: .45rem; }
.up-name { font-weight: 700; font-size: .95rem; }
.up-lvl {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;          /* "Lv 25" must never break in two */
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.up-effect { grid-column: 1; font-size: .78rem; color: var(--muted); }

.up-buy {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 74px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.up-buy[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.up-buy .icon { font-size: .9em; }

.up-wall {
  grid-column: 1 / -1;
  margin-top: .35rem;
  padding-top: .4rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--accent);
  border-top: 1px dashed var(--border);
}
.up-wall .icon { font-size: 1rem; }

/* a levelled-out upgrade sitting at the wall */
.up.walled { border-color: var(--accent); }

/* ---------- saying no ----------------------------------------
   A blocked control keeps its click so it can answer. It looks
   unavailable, it refuses the press, and it shakes while it does. */
.is-off {
  opacity: .45;
  cursor: not-allowed;
  filter: saturate(.4);
}
.nope { animation: nope .34s cubic-bezier(.36, .07, .19, .97); }
@keyframes nope {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.deny-tip {
  position: fixed;
  z-index: 900;
  padding: .28rem .6rem;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: #b3202c;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  /* left/top are set in pixels by the script; this only centres the
     box on that point, so the drift animation can use `translate`
     without fighting it. */
  transform: translateX(-50%);
}
.deny-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: #b3202c;
}
/* flipped under the control when the top edge is in the way */
.deny-tip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #b3202c;
}

.deny-tip.show { animation: tip 1.4s var(--ease) forwards; }
@keyframes tip {
  0%   { opacity: 0; translate: 0 6px; }
  12%  { opacity: 1; translate: 0 0; }
  78%  { opacity: 1; translate: 0 0; }
  100% { opacity: 0; translate: 0 -7px; }
}

/* ---------- rarity palette ----------------------------------
   Six steps, walked deliberately around the colour wheel so two
   neighbouring tiers are never close enough to be confused. */
.r-common    { --rc: #cfd3da; }
.r-uncommon  { --rc: #6ddf7f; }
.r-rare      { --rc: #59b0ff; }
.r-epic      { --rc: #c07bff; }
.r-legendary { --rc: #ffd45e; }
.r-mythic    { --rc: #ff5fa2; }
.r-secret    { --rc: #3ef0c8; }

/* ---------- mystery boxes ----------------------------------- */
.boxes-block { margin-top: 0; }
.boxes {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  width: 100%;
  margin-top: 1.25rem;
}

.box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: 1rem .75rem .85rem;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.box:hover { transform: translateY(-3px); border-color: var(--bt); box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }

.box-t1 { --bt: #c98a4b; }
.box-t2 { --bt: #b9c2cf; }
.box-t3 { --bt: #ffd45e; }
.box-t4 { --bt: #7ee8ff; }
.box-t5 { --bt: #a06bff; }
/* the Tin: dull metal, so nothing about it promises anything */
.box-t6 { --bt: #8d97a4; }
.box-t6 .box-name::after { content: " ?"; color: var(--muted); }

.box-art { width: 44px; height: 44px; color: var(--bt); fill: currentColor; }
.box-name { font-weight: 700; font-size: 1rem; }
.box-desc { font-size: .78rem; line-height: 1.35; color: var(--muted); }

/* Six tiers do not fit on one line in a narrow card, and a tier a
   box cannot even produce is noise - so only the real chances are
   printed, three to a row. */
.box-odds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .22rem;
  width: 100%;
  margin-top: .5rem;
}
.box-odds span {
  padding: .18rem .1rem;
  font-size: .66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #16131b;
  background: var(--rc);
  border-radius: 5px;
}

.box-buy { display: flex; gap: .35rem; width: 100%; margin-top: .6rem; }
.box-buy .btn { flex: 1; justify-content: center; padding-inline: .5rem; font-variant-numeric: tabular-nums; }
.box-buy .btn[disabled] { opacity: .45; cursor: not-allowed; }
.box-buy .icon { font-size: .9em; }
.box-x10 { font-size: .78rem; }

.pity-note {
  width: 100%;
  margin-top: 1rem;
  padding-top: .8rem;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.pity-note b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- inventory --------------------------------------- */
.panel-count {
  float: right;
  font-size: .8rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.inv { display: grid; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.inv li {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .55rem;
  font-size: .88rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rc);
  border-radius: var(--r-sm);
}
.inv .icon { font-size: 1.15rem; color: var(--rc); flex: none; }
.inv .inv-n { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-empty { font-size: .84rem; color: var(--muted); }

/* ---------- reveal ------------------------------------------ */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(6, 5, 10, .76);
  backdrop-filter: blur(5px);
  animation: rv-fade .2s ease;
}
@keyframes rv-fade { from { opacity: 0; } }

.reveal-card {
  /* --rc comes from the rarity class the JS sets on this element.
     Declaring a default here would out-cascade .r-legendary and co.,
     since both are single-class selectors - so the fallback lives in
     the var() calls instead. */
  position: relative;
  width: min(320px, 100%);
  padding: 1.5rem 1.4rem 1.2rem;
  overflow: hidden;
  text-align: center;
  background: var(--bg-soft);
  border: 2px solid var(--rc, #cfd3da);
  border-radius: var(--r-lg);
  box-shadow: 0 0 40px -8px var(--rc, #cfd3da), 0 24px 60px rgba(0, 0, 0, .55);
  animation: rv-pop .42s cubic-bezier(.2, .9, .3, 1.35);
}
@keyframes rv-pop {
  from { opacity: 0; transform: scale(.7) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}

/* a light sweep across the card, transform only */
.reveal-card::after {
  content: "";
  position: absolute;
  inset: -60%;
  background: linear-gradient(70deg, transparent 42%, rgba(255, 255, 255, .3) 50%, transparent 58%);
  animation: rv-sheen 2.4s linear infinite;
  pointer-events: none;
}
@keyframes rv-sheen { from { transform: translateX(-45%); } to { transform: translateX(45%); } }

.reveal-rarity {
  display: inline-block;
  padding: .15rem .6rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #16131b;
  background: var(--rc);
  border-radius: 999px;
}
.reveal-art { width: 92px; height: 92px; margin: 1rem auto .6rem; color: var(--rc); fill: currentColor; }
.reveal-name { font-size: 1.25rem; font-weight: 700; }
.reveal-count { margin-top: .2rem; font-size: .88rem; color: var(--muted); }
.reveal-pity { margin-top: .5rem; font-size: .8rem; font-weight: 700; color: var(--rc); }
.reveal-actions { display: flex; gap: .5rem; justify-content: center; margin-top: 1.1rem; }

/* the Suspicious Tin's bedside manner */
.reveal-mock {
  margin-top: .9rem;
  padding-top: .8rem;
  font-size: .92rem;
  font-style: italic;
  line-height: 1.45;
  border-top: 1px dashed var(--border);
}
.reveal-tally {
  margin-top: .35rem;
  font-size: .74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.reveal-syrup {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .7rem;
  padding: .2rem .6rem;
  font-size: .82rem;
  font-weight: 700;
  color: #16131b;
  background: #f0b429;
  border-radius: 999px;
}
.reveal-syrup .icon { font-size: 1em; fill: currentColor; }

/* the top tiers get a little more theatre */
.reveal-card.r-legendary,
.reveal-card.r-mythic,
.reveal-card.r-secret { animation: rv-pop .42s cubic-bezier(.2,.9,.3,1.35), rv-glow 1.6s ease-in-out infinite .42s; }
/* and the Secret gets the whole stage */
.reveal-card.r-secret { border-width: 3px; }
.reveal-card.r-secret .reveal-art { animation: rv-float 2.6s ease-in-out infinite; }
@keyframes rv-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-8px) rotate(4deg); }
}
@keyframes rv-glow {
  0%, 100% { box-shadow: 0 0 40px -8px var(--rc), 0 24px 60px rgba(0, 0, 0, .55); }
  50%      { box-shadow: 0 0 64px 0 var(--rc), 0 24px 60px rgba(0, 0, 0, .55); }
}

/* ---------- the roulette -------------------------------------
   One strip, one transform, one CSS transition. The browser hands
   that to the compositor, so a four-second spin costs no main
   thread work at all - the ticks are queued on the audio clock in
   advance for the same reason. */
.reveal-stage { display: grid; place-items: center; width: min(580px, 100%); }

/* A grid item defaults to min-width: auto, which means "never smaller
   than my content". The strip is forty tiles long, so without this the
   window stretches to several thousand pixels and takes the whole
   dialog off-screen with it. */
.reveal-stage > * { min-width: 0; max-width: 100%; }

.roulette { width: 100%; text-align: center; }
.rl-title {
  margin-bottom: .7rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.rl-window {
  position: relative;
  overflow: hidden;
  padding: 9px 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 46px rgba(0, 0, 0, .5);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.rl-strip { display: flex; gap: 10px; will-change: transform; }
.rl-tile {
  flex: none;
  width: 92px;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--rc, #cfd3da);
  border-radius: var(--r-sm);
}
/* the tiles worth stopping on glow from the bottom edge up */
.rl-tile.r-epic,
.rl-tile.r-legendary,
.rl-tile.r-mythic { box-shadow: inset 0 -22px 26px -20px var(--rc); }
.rl-tile .icon { font-size: 2rem; color: var(--rc, #cfd3da); fill: currentColor; }
.rl-tile span { font-size: .6rem; line-height: 1.2; color: var(--muted); }
.rl-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
#rl-skip { margin-top: .9rem; }

/* ---------- ten pulls at once -------------------------------- */
.multi {
  width: 100%;
  padding: 1.35rem 1.25rem 1.15rem;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  animation: rv-pop .32s cubic-bezier(.2, .9, .3, 1.35);
}
.multi-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.multi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.multi-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .55rem .3rem .45rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--rc);
  border-radius: var(--r-sm);
  opacity: 0;
  animation: mg-in .3s var(--ease) forwards;
}
.multi-grid li.hi { box-shadow: 0 0 16px -3px var(--rc); }
.multi-grid .icon { font-size: 1.5rem; color: var(--rc); fill: currentColor; }
.multi-grid span { font-size: .58rem; line-height: 1.2; color: var(--muted); }
@keyframes mg-in {
  from { opacity: 0; transform: translateY(9px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 520px) {
  .multi-grid { grid-template-columns: repeat(4, 1fr); }
  .rl-tile { width: 74px; height: 96px; }
}

/* ---------- loadout ----------------------------------------- */
.bench { align-items: stretch; text-align: left; }
.bench .board-title, .bench .board-hint { text-align: center; }

.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin: 1.25rem 0 0;
}
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .9rem .5rem;
  min-height: 104px;
  justify-content: center;
  font: inherit;
  color: inherit;
  text-align: center;
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.slot:hover { border-color: var(--accent); }
.slot.filled { border-style: solid; border-color: var(--rc); background: var(--surface-hover); }
.slot .icon { font-size: 1.7rem; color: var(--rc, var(--muted)); fill: currentColor; }
.slot-name { font-size: .78rem; font-weight: 700; line-height: 1.2; }
.slot-hint { font-size: .72rem; color: var(--muted); }
.slot.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .7rem;
  padding: .7rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.pick {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .6rem;
  font: inherit;
  font-size: .82rem;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rc);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.pick:hover { background: var(--surface-hover); }
.pick .icon { color: var(--rc); fill: currentColor; }
.pick-n {
  margin-left: .1rem;
  padding: 0 .3rem;
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 4px;
}
.picker-empty { font-size: .84rem; color: var(--muted); }

/* ---------- topping index ------------------------------------ */
.index-block { align-items: stretch; }
.index-block .board-title, .index-block .board-hint { text-align: center; }

.tsearch {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: min(420px, 100%);
  margin: 1.25rem auto 0;
  padding: .1rem .7rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color .18s var(--ease);
}
.tsearch:focus-within { border-color: var(--accent); }
.tsearch .icon { font-size: 1.1rem; color: var(--muted); flex: none; }
.tsearch input {
  flex: 1;
  min-width: 0;
  padding: .55rem 0;
  font: inherit;
  font-size: .9rem;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
}
.tsearch input::-webkit-search-cancel-button { cursor: pointer; }
.tsearch-count {
  flex: none;
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.tsearch-empty { margin-top: 1rem; font-size: .88rem; color: var(--muted); text-align: center; }
.ti[hidden] { display: none; }

.tindex {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  width: 100%;
}
.ti {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .7rem .75rem .75rem;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rc);
  border-radius: var(--r-md);
  /* not owned yet: present, but clearly not yours */
  opacity: .62;
}
.ti.owned { opacity: 1; }
.ti.ti-locked .icon { color: var(--muted); }

.ti-head { display: flex; align-items: center; gap: .55rem; }
.ti-head .icon { font-size: 1.6rem; color: var(--rc); fill: currentColor; flex: none; }
.ti-head > div { min-width: 0; }
.ti-name { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.ti-rarity {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rc);
}
.ti-have {
  margin-left: auto;
  padding: .1rem .45rem;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ti-bonus { font-size: .82rem; font-weight: 700; }
.ti-where { display: flex; flex-wrap: wrap; gap: .25rem; }
.ti-src {
  padding: .12rem .4rem;
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ti-src b { color: var(--text); font-weight: 700; }
.ti-craft { font-size: .74rem; line-height: 1.4; color: var(--muted); }
.ti-sets { font-size: .74rem; line-height: 1.45; color: var(--muted); }
.ti-sets b { color: var(--text); }

/* ---------- set bonuses ------------------------------------- */
.syn-block { width: 100%; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.syn { display: grid; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.syn li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .45rem .6rem;
  font-size: .84rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  opacity: .55;
}
.syn li.on { opacity: 1; border-color: var(--accent); background: var(--surface-hover); }
.syn-name { font-weight: 700; }
.syn-desc { color: var(--muted); font-size: .78rem; }
.syn-mult { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- crafting ---------------------------------------- */
.craft { display: grid; gap: .55rem; list-style: none; padding: 0; margin: 1.25rem 0 0; width: 100%; }
.rec {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem .7rem;
  align-items: center;
  padding: .65rem .75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rc);
  border-radius: var(--r-md);
}
.rec.locked { border-left-color: var(--border); opacity: .7; }
.rec-name { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .95rem; }
.rec-name .icon { color: var(--rc); fill: currentColor; font-size: 1.2rem; }
.rec-in { grid-column: 1; display: flex; flex-wrap: wrap; gap: .3rem; font-size: .78rem; color: var(--muted); }
.rec-in span.short { color: var(--accent); }
.rec-btn { grid-column: 2; grid-row: 1 / span 2; }

.book-btn { margin-top: .9rem; align-self: center; }
.book-btn b { font-variant-numeric: tabular-nums; }

/* ---------- toasts (minecraft style) ------------------------- */
.toasts {
  position: fixed;
  top: 5.2rem;
  right: 1rem;
  z-index: 450;
  display: grid;
  gap: .5rem;
  justify-items: end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: min(300px, calc(100vw - 2rem));
  padding: .7rem .85rem;
  color: #f5f5f7;
  background: rgba(18, 16, 24, .96);
  border: 1px solid var(--rc, #cfd3da);
  border-radius: var(--r-md);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  animation: toast-in .45s cubic-bezier(.2, .9, .3, 1.2),
             toast-out .4s ease 3.8s forwards;
}
@keyframes toast-in  { from { opacity: 0; transform: translateX(115%); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(115%); } }

.toast .icon { font-size: 1.9rem; color: var(--rc, #cfd3da); fill: currentColor; flex: none; }
.toast-title { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rc, #cfd3da); }
.toast-text { font-size: .92rem; font-weight: 700; line-height: 1.25; }

@media (max-width: 860px) {
  .toasts { top: auto; bottom: 1rem; right: .75rem; }
}

/* ---------- buy amount switch -------------------------------- */
.buymode { display: flex; gap: .25rem; margin-bottom: .7rem; }
.bm {
  flex: 1;
  padding: .3rem .2rem;
  font: 700 .78rem/1 "Roboto Condensed", system-ui, sans-serif;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.bm:hover { color: var(--text); }
.bm.on { color: var(--on-accent); background: var(--accent); border-color: transparent; }

.up-count { font-size: .72rem; opacity: .8; }

/* ---------- save transfer ------------------------------------ */
.transfer { margin-bottom: .7rem; }
.transfer-label {
  display: block;
  margin-bottom: .3rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.transfer-box {
  width: 100%;
  padding: .5rem;
  font: 400 .74rem/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
  word-break: break-all;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  resize: vertical;
}
.transfer-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Animations off? Then the "+1" simply stands still instead of
   vanishing, so the feedback is not lost. */
@media (prefers-reduced-motion: reduce) {
  .float { animation: none; opacity: 1; transform: translate(-50%, -20px); }
}

/* the kitchen bar needs to host its own floating numbers */
.kitchen-bar { position: relative; }
.kitchen-bar .float-layer { top: auto; bottom: 100%; height: 0; }
.kitchen-bar .float { top: auto; bottom: 0; font-size: 1.05rem; }

/* =============================================================
   Golden Syrup, the banner, quests and achievements
   ============================================================= */

.hud-syrup {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .5rem;
  padding: .2rem .7rem;
  font-size: .84rem;
  color: #16131b;
  background: #f0b429;
  border-radius: 999px;
}
.hud-syrup .icon { font-size: 1em; fill: currentColor; }
.hud-syrup b { font-variant-numeric: tabular-nums; }

/* ---------- the banner --------------------------------------- */
.banner-block { align-items: stretch; }
.banner-block .board-title, .banner-block .board-hint { text-align: center; }

.banner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  margin-top: 1.25rem;
  padding: 1.1rem;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rc, #ff5fa2);
  border-radius: var(--r-md);
}
.banner-art {
  display: grid;
  place-items: center;
  flex: none;
  width: 84px;
  height: 84px;
  color: var(--rc);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 30px -10px var(--rc);
}
.banner-art .icon { font-size: 2.6rem; fill: currentColor; }
.banner-body { min-width: 0; }
.banner-eyebrow {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rc);
}
.banner-name { margin-top: .15rem; font-size: 1.3rem; }
.banner-line { margin-top: .25rem; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.banner-bonus { margin-top: .4rem; font-size: .88rem; font-weight: 700; }
.banner-timer { margin-top: .35rem; font-size: .78rem; color: var(--muted); }
.banner-timer b { color: var(--text); font-variant-numeric: tabular-nums; }

.pity-wrap { width: 100%; margin-top: 1rem; }
.pity-bar {
  height: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.pity-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s var(--ease);
}
.pity-fill.soft { background: linear-gradient(90deg, var(--accent), #ff5fa2); }
.pity-line { margin-top: .5rem; font-size: .8rem; line-height: 1.5; color: var(--muted); }
.pity-line b { color: var(--text); font-variant-numeric: tabular-nums; }

.banner-buy { display: flex; gap: .5rem; justify-content: center; width: 100%; margin-top: 1rem; }
.banner-buy .btn { font-variant-numeric: tabular-nums; }
.banner-buy .icon { font-size: 1em; }

/* ---------- melting ------------------------------------------ */
.inv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.melt-one {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.melt-one:hover { color: #f0b429; border-color: #f0b429; }
.melt-one .icon { font-size: .95rem; fill: currentColor; }
.inv li .inv-n { margin-left: .45rem; }
.inv li .melt-one + .inv-n { margin-left: .45rem; }
.inv li:not(:has(.melt-one)) .inv-n { margin-left: auto; }

.melt-all { width: 100%; margin-top: .6rem; justify-content: center; }
.melt-all.armed { color: #16131b; background: #f0b429; border-color: #f0b429; }

/* ---------- daily quests ------------------------------------- */
.quests { display: grid; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.quest {
  padding: .55rem .6rem .6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.quest.ready { border-color: #f0b429; }
.quest.got { opacity: .6; }
.quest-head { display: flex; align-items: baseline; gap: .5rem; }
.quest-text { font-size: .84rem; line-height: 1.3; }
.quest-n {
  margin-left: auto;
  font-size: .74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.quest-bar {
  height: 4px;
  margin: .45rem 0 .5rem;
  overflow: hidden;
  background: var(--bg);
  border-radius: 999px;
}
.quest-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s var(--ease);
}
.quest-claim { width: 100%; justify-content: center; }
.quest-claim .icon { font-size: 1em; }
.quest-got {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
}
.quest-got .icon { font-size: .95rem; color: #4caf50; fill: currentColor; }

/* ---------- achievements ------------------------------------- */
.ach-block { align-items: stretch; }
.ach-block .board-title, .ach-block .board-hint { text-align: center; }
.ach-count {
  font-size: .8rem;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ach {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  width: 100%;
}
.achv {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .65rem;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  opacity: .55;
}
.achv.got { opacity: 1; border-color: #f0b429; }
.achv > .icon { font-size: 1.4rem; flex: none; color: var(--muted); fill: currentColor; }
.achv.got > .icon { color: #f0b429; }
.achv > div { min-width: 0; flex: 1; }
.achv-name { font-size: .88rem; font-weight: 700; }
.achv-desc { font-size: .74rem; line-height: 1.35; color: var(--muted); }
.achv-pay {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  flex: none;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f0b429;
}
.achv-pay .icon { font-size: .9rem; fill: currentColor; }

/* =============================================================
   Foldable sections and the first-run tour
   ============================================================= */

.fold { width: 100%; }
.fold-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: .1rem;
  list-style: none;
  cursor: pointer;
  border-radius: var(--r-sm);
  -webkit-user-select: none;
  user-select: none;
}
.fold-head::-webkit-details-marker { display: none; }
.fold-head:hover .fold-chevron { color: var(--accent); }
.fold-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.fold-hint {
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fold-chevron {
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.fold[open] .fold-chevron { transform: rotate(180deg); }
.fold-body { padding-top: .2rem; }

/* ---------- the tour ----------------------------------------- */
.tut {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 400;
  width: min(440px, calc(100% - 1.5rem));
  padding: 1rem 1.1rem 1.1rem;
  text-align: left;
  /* --surface is a translucent tint meant to sit on the page, so a
     floating panel needs the opaque token instead - otherwise the
     text underneath reads straight through it. */
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  transform: translateX(-50%);
  animation: tut-in .3s var(--ease);
}
@keyframes tut-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.tut-count {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.tut-title { margin-top: .2rem; font-size: 1.15rem; font-weight: 700; }
.tut-text { margin-top: .35rem; font-size: .9rem; line-height: 1.5; color: var(--muted); }

.tut-dots { display: flex; gap: .3rem; margin: .9rem 0 .8rem; }
.tut-dots span {
  width: 6px;
  height: 6px;
  background: var(--border-strong);
  border-radius: 999px;
  transition: width .2s var(--ease), background-color .2s var(--ease);
}
.tut-dots span.on { width: 18px; background: var(--accent); }

.tut-actions { display: flex; gap: .5rem; }
.tut-actions [data-tut="next"] { margin-left: auto; }

/* the ring around whatever the current step is talking about */
.tut-spot {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
  border-radius: var(--r-md);
  animation: tut-ring 1.9s ease-in-out infinite;
}
@keyframes tut-ring {
  0%, 100% { outline-offset: 6px; }
  50%      { outline-offset: 12px; }
}

/* ---------- bonuses shown wherever a topping appears --------- */
.reveal-bonus {
  margin-top: .3rem;
  font-size: .84rem;
  font-weight: 700;
  color: var(--rc);
}
.slot-bonus {
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--rc);
}
.pick-bonus {
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
}
.mg-bonus {
  font-size: .54rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--rc);
}

/* ---------- a toast you can follow --------------------------- */
.toast-go { cursor: pointer; }
.toast-go:hover, .toast-go:focus-visible { border-color: var(--rc); outline: none; }
.toast-go::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--rc);
  opacity: 0;
  transition: opacity .15s var(--ease);
}
.toast-go:hover::after { opacity: .5; }

/* what the toast takes you to, briefly lit up */
.flash { animation: flash 2.2s var(--ease); }
@keyframes flash {
  0%, 70% { box-shadow: 0 0 0 3px var(--accent); }
  100%    { box-shadow: 0 0 0 3px transparent; }
}

/* ---------- redeem a code ------------------------------------ */
.code-row { margin-bottom: .8rem; }
.code-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.code-in { display: flex; gap: .4rem; }
.code-in input {
  flex: 1;
  min-width: 0;
  padding: .5rem .6rem;
  font: inherit;
  font-size: .84rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: inherit;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.code-in input:focus { outline: none; border-color: var(--accent); }
