/* =====================================================================
   BONZUMA — STYLES
   Loud, neon, slightly unhinged. Mobile-first, then it gets bigger.
   ===================================================================== */

/* ---------- design tokens ---------- */
:root {
  --bg:        #0d0221;
  --bg-2:      #160734;
  --panel:     #1d0a44;
  --panel-2:   #25105a;
  --ink:       #f6f0ff;
  --ink-dim:   #b9a7e0;

  --pink:   #ff2e93;
  --cyan:   #00f0ff;
  --lime:   #c6ff00;
  --yellow: #ffd400;
  --purple: #9b5cff;
  --orange: #ff6b35;

  --glow-1: #2a0e63;
  --glow-2: #3a0ca3;

  --display: 'Bangers', 'Arial Black', Impact, system-ui, sans-serif;
  --heavy:   'Archivo Black', system-ui, -apple-system, sans-serif;
  --body:    'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --ring: 0 0 0 3px rgba(0,240,255,.35);
  --shadow-pop: 6px 6px 0 #0d0221;
  --maxw: 1180px;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: radial-gradient(1200px 800px at 15% -10%, var(--glow-1) 0%, transparent 55%),
              radial-gradient(1000px 700px at 110% 10%, var(--glow-2) 0%, transparent 50%),
              var(--bg);
  overflow-x: hidden;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* fx layer */
#fxCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; /* above cabinet + shop so bursts show */
}

/* ---------- buttons ---------- */
.bz-btn {
  border: 3px solid #0d0221;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--heavy);
  font-size: .82rem;
  letter-spacing: .02em;
  padding: .7em 1.1em;
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  white-space: nowrap;
}
.bz-btn:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #0d0221; filter: brightness(1.08); }
.bz-btn:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 #0d0221; }
.bz-btn-pop   { background: linear-gradient(135deg, var(--pink), var(--purple)); }
.bz-btn-lime  { background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; }
.bz-btn-ghost { background: transparent; }

.bz-icon-btn {
  border: 3px solid #0d0221;
  background: var(--panel);
  border-radius: 12px;
  width: 44px; height: 44px;
  font-size: 1.1rem;
  display: grid; place-items: center;
  box-shadow: var(--shadow-pop);
  transition: transform .08s ease, box-shadow .08s ease;
}
.bz-icon-btn:hover { transform: translate(-2px,-2px); }
.bz-icon-btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 #0d0221; }
.bz-icon-btn.is-on { background: linear-gradient(135deg, var(--cyan), var(--purple)); }

/* ---------- header ---------- */
.bz-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem clamp(.8rem, 3vw, 1.6rem);
  background: rgba(13,2,33,.72);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #2a124f;
  flex-wrap: wrap;
}
.bz-logo { display: flex; align-items: center; gap: .5rem; }
.bz-logo-mascot { width: 42px; height: 42px; filter: drop-shadow(2px 3px 0 #0d0221); transition: transform .3s ease; }
.bz-logo:hover .bz-logo-mascot { transform: rotate(-12deg) scale(1.08); }
.bz-logo-text {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: .04em;
  background: linear-gradient(92deg, var(--pink), var(--yellow), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(255,46,147,.25);
}
.bz-nav { display: none; gap: 1.1rem; margin-left: auto; font-weight: 700; }
.bz-nav a { color: var(--ink-dim); position: relative; padding: .2rem 0; transition: color .15s; }
.bz-nav a::after {
  content: ''; position: absolute; left: 0; bottom: -3px; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--pink), var(--cyan)); transition: width .2s;
}
.bz-nav a:hover { color: var(--ink); } .bz-nav a:hover::after { width: 100%; }
.bz-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ---------- ticker ---------- */
.bz-ticker {
  display: flex; align-items: stretch;
  background: var(--yellow); color: #1a0033;
  border-bottom: 4px solid #0d0221;
  font-weight: 700; overflow: hidden;
}
.bz-ticker-label {
  background: var(--pink); color: #fff; font-family: var(--heavy);
  padding: .5rem .9rem; display: flex; align-items: center;
  white-space: nowrap; border-right: 4px solid #0d0221; letter-spacing: .03em;
}
.bz-ticker-viewport { overflow: hidden; flex: 1; display: flex; align-items: center; }
.bz-ticker-track {
  display: flex; gap: 3rem; white-space: nowrap; padding-left: 100%;
  animation: ticker 38s linear infinite;
}
.bz-ticker:hover .bz-ticker-track { animation-play-state: paused; }
.bz-ticker-track span { padding: .5rem 0; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- hero ---------- */
.bz-hero { position: relative; padding: clamp(2.2rem, 7vw, 5rem) 1rem 2.5rem; text-align: center; overflow: hidden; }
.bz-hero-blobs { position: absolute; inset: 0; z-index: 0; filter: blur(40px); opacity: .6; }
.bz-hero-blobs .blob { position: absolute; width: 360px; height: 360px; border-radius: 50%; mix-blend-mode: screen; }
.blob.b1 { background: var(--pink);   top: -80px; left: -60px; animation: float1 12s ease-in-out infinite; }
.blob.b2 { background: var(--cyan);   top: 20px; right: -80px; animation: float2 15s ease-in-out infinite; }
.blob.b3 { background: var(--purple); bottom: -140px; left: 40%; animation: float1 18s ease-in-out infinite reverse; }
@keyframes float1 { 0%,100%{ transform: translate(0,0) scale(1); } 50%{ transform: translate(30px,-30px) scale(1.15); } }
@keyframes float2 { 0%,100%{ transform: translate(0,0) scale(1); } 50%{ transform: translate(-40px,20px) scale(1.1); } }

.bz-hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.bz-eyebrow {
  display: inline-block; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); font-size: .8rem; margin: 0 0 .4rem;
  background: rgba(0,240,255,.08); padding: .3rem .8rem; border-radius: 999px; border: 1px solid rgba(0,240,255,.25);
}
.bz-hero-title {
  font-family: var(--display);
  font-size: clamp(3.4rem, 16vw, 8.5rem);
  line-height: .9; margin: .2rem 0;
  letter-spacing: .02em;
  background: linear-gradient(92deg, var(--pink) 0%, var(--yellow) 45%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; text-shadow: 0 8px 40px rgba(255,46,147,.3);
}
/* glitch */
.bz-hero-title::before, .bz-hero-title::after {
  content: attr(data-glitch); position: absolute; inset: 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .0;
}
.bz-hero-title.glitching::before { opacity:.85; background: var(--cyan); -webkit-background-clip:text; background-clip:text; animation: glitchA .3s steps(2) infinite; }
.bz-hero-title.glitching::after  { opacity:.85; background: var(--pink); -webkit-background-clip:text; background-clip:text; animation: glitchB .3s steps(2) infinite; }
@keyframes glitchA { 0%{transform:translate(0,0)} 50%{transform:translate(-4px,2px)} 100%{transform:translate(3px,-2px)} }
@keyframes glitchB { 0%{transform:translate(0,0)} 50%{transform:translate(4px,-2px)} 100%{transform:translate(-3px,2px)} }

.bz-hero-sub { font-size: clamp(1rem, 2.6vw, 1.3rem); color: var(--ink-dim); max-width: 620px; margin: .6rem auto 1.6rem; }
.bz-hero-sub strong { color: var(--yellow); }

/* headline generator */
.bz-headline-gen {
  display: flex; flex-direction: column; gap: .7rem; align-items: stretch;
  max-width: 560px; margin: 0 auto 1.6rem;
}
.bz-headline-out {
  background: var(--panel); border: 3px solid #0d0221; border-radius: 16px;
  padding: 1rem 1.1rem; min-height: 64px; display: flex; align-items: center; justify-content: center;
  font-family: var(--heavy); font-size: clamp(.95rem, 2.5vw, 1.15rem); text-align: center;
  box-shadow: var(--shadow-pop); transition: transform .1s ease;
}
.bz-headline-out.pop { animation: pop .35s ease; }
@keyframes pop { 0%{ transform: scale(.96); } 50%{ transform: scale(1.03); } 100%{ transform: scale(1); } }

/* bonzometer */
.bz-meter { max-width: 560px; margin: 0 auto; text-align: left; }
.bz-meter-top { display: flex; justify-content: space-between; font-family: var(--heavy); font-size: .8rem; letter-spacing: .05em; margin-bottom: .35rem; }
.bz-meter-bar { height: 18px; background: #0d0221; border: 3px solid #0d0221; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 2px #2a124f; }
.bz-meter-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--yellow), var(--orange), var(--pink));
  background-size: 300% 100%; transition: width .4s cubic-bezier(.2,.9,.2,1);
  animation: meterShift 4s linear infinite;
}
@keyframes meterShift { from{ background-position: 0 0; } to{ background-position: 300% 0; } }
.bz-meter-hint { font-size: .8rem; color: var(--ink-dim); margin-top: .4rem; }

/* ---------- sections ---------- */
.bz-section { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 3vw, 1.6rem); }
.bz-section-alt { background: linear-gradient(180deg, rgba(255,46,147,.05), rgba(0,240,255,.04)); border-radius: 28px; }
.bz-section-head { text-align: center; margin-bottom: 1.8rem; }
.bz-section-title {
  font-family: var(--display); font-size: clamp(2.2rem, 7vw, 4rem); margin: 0; letter-spacing: .03em;
  text-shadow: 4px 4px 0 #0d0221;
}
.bz-section-desc { color: var(--ink-dim); margin: .3rem auto 0; max-width: 560px; }

/* ---------- feed controls ---------- */
.bz-feed-controls { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.bz-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.bz-filter {
  border: 3px solid #0d0221; background: var(--panel); color: var(--ink-dim);
  font-weight: 700; font-size: .85rem; padding: .5em .95em; border-radius: 999px;
  transition: transform .08s, background .15s, color .15s; box-shadow: 3px 3px 0 #0d0221;
}
.bz-filter:hover { transform: translateY(-2px); color: var(--ink); }
.bz-filter.is-active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.bz-search {
  flex: 1; min-width: 200px; max-width: 320px;
  border: 3px solid #0d0221; background: var(--panel); color: var(--ink);
  padding: .6em 1em; border-radius: 999px; font-size: .9rem; font-family: var(--body);
}
.bz-search::placeholder { color: var(--ink-dim); }

/* ---------- feed grid ---------- */
.bz-feed { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.bz-card {
  position: relative; border: 3px solid #0d0221; border-radius: 20px; overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
  animation: cardIn .4s both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.bz-card:hover { transform: translate(-3px,-3px) rotate(-.4deg); box-shadow: 10px 10px 0 #0d0221; }
.bz-card-visual {
  height: 150px; display: grid; place-items: center; position: relative;
  font-size: 4.4rem; filter: drop-shadow(3px 4px 0 rgba(0,0,0,.35));
}
.bz-card-visual::after { content:''; position:absolute; inset:0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 60%); }
.bz-card-badge {
  position: absolute; top: .7rem; left: .7rem; z-index: 2;
  font-family: var(--heavy); font-size: .62rem; letter-spacing: .08em;
  background: #0d0221; color: #fff; padding: .32em .6em; border-radius: 8px;
}
.bz-card-hot {
  position: absolute; top: .7rem; right: .7rem; z-index: 2;
  background: var(--yellow); color: #1a0033; font-family: var(--heavy); font-size: .6rem;
  padding: .3em .55em; border-radius: 8px; animation: hotpulse 1.4s ease-in-out infinite;
}
@keyframes hotpulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.12); } }
.bz-card-body { padding: 1rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.bz-card-title { font-family: var(--heavy); font-size: 1.02rem; line-height: 1.2; margin: 0; }
.bz-card-blurb { color: var(--ink-dim); font-size: .9rem; margin: 0; flex: 1; }
.bz-card-tag { font-size: .72rem; color: var(--cyan); font-weight: 700; }
.bz-card-foot { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.bz-react {
  border: 2px solid #0d0221; background: var(--bg-2); color: var(--ink);
  border-radius: 999px; padding: .28em .6em; font-size: .82rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: .25rem; transition: transform .08s, background .15s;
}
.bz-react:hover { transform: scale(1.12); }
.bz-react.is-picked { background: linear-gradient(135deg, var(--pink), var(--purple)); border-color: var(--pink); }
.bz-react .cnt { font-variant-numeric: tabular-nums; font-size: .76rem; color: var(--ink-dim); }
.bz-react.is-picked .cnt { color: #fff; }
.bz-share { margin-left: auto; border: 2px solid #0d0221; background: var(--cyan); color: #06212a; border-radius: 999px; padding: .28em .7em; font-weight: 800; font-size: .8rem; }
.bz-share:hover { filter: brightness(1.1); transform: scale(1.05); }

.bz-empty { text-align: center; color: var(--ink-dim); padding: 2rem; font-size: 1.05rem; }

/* ---------- rankings ---------- */
.bz-ranking { list-style: none; counter-reset: rank; padding: 0; margin: 0; max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: .6rem; }
.bz-rank-item {
  counter-increment: rank;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: .8rem;
  background: var(--panel); border: 3px solid #0d0221; border-radius: 16px; padding: .7rem .9rem;
  box-shadow: 4px 4px 0 #0d0221; transition: transform .25s cubic-bezier(.2,.9,.2,1), background .2s;
}
.bz-rank-item::before {
  content: counter(rank); font-family: var(--display); font-size: 1.7rem; width: 1.7ch; text-align: center;
  background: linear-gradient(135deg, var(--yellow), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bz-rank-item:nth-child(1)::before { font-size: 2.2rem; }
.bz-rank-emoji { font-size: 1.6rem; }
.bz-rank-name { font-weight: 700; font-size: .95rem; }
.bz-rank-votes { display: flex; align-items: center; gap: .5rem; }
.bz-rank-count { font-family: var(--heavy); font-size: .95rem; min-width: 4.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.bz-vote {
  border: 2px solid #0d0221; background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f;
  border-radius: 10px; width: 40px; height: 40px; font-size: 1.1rem; font-weight: 900;
  box-shadow: 2px 2px 0 #0d0221; transition: transform .08s;
}
.bz-vote:hover { transform: translateY(-2px); }
.bz-vote:active { transform: translateY(2px); box-shadow: 0 0 0 #0d0221; }
.bz-vote.just-voted { animation: pop .4s ease; }
.bz-ranking-note { text-align: center; color: var(--ink-dim); margin-top: 1.2rem; font-size: .85rem; }

/* ---------- meme lab ---------- */
.bz-meme-lab { display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-items: start; }
.bz-meme-stage { display: flex; flex-direction: column; gap: .9rem; align-items: center; }
#memeCanvas {
  width: 100%; max-width: 420px; aspect-ratio: 1/1; height: auto;
  border: 4px solid #0d0221; border-radius: 18px; box-shadow: var(--shadow-pop); background: #1a0a3a;
}
.bz-meme-buttons { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.bz-meme-controls { display: flex; flex-direction: column; gap: .9rem; }
.bz-field { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; font-size: .82rem; color: var(--ink-dim); }
.bz-field input[type=text], .bz-field input[type=email] {
  border: 3px solid #0d0221; background: var(--panel); color: var(--ink);
  padding: .6em .8em; border-radius: 12px; font-family: var(--body); font-size: .95rem;
}
.bz-field-label { font-weight: 700; font-size: .82rem; color: var(--ink-dim); }
.bz-meme-templates { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.bz-meme-template {
  border: 3px solid #0d0221; border-radius: 12px; aspect-ratio: 1/1; font-size: 1.7rem;
  display: grid; place-items: center; box-shadow: 2px 2px 0 #0d0221; transition: transform .08s;
}
.bz-meme-template:hover { transform: translateY(-3px) scale(1.04); }
.bz-meme-template.is-active { outline: 3px solid var(--cyan); outline-offset: 2px; }
.bz-upload input[type=file] { font-size: .82rem; color: var(--ink-dim); }
.bz-upload input[type=file]::file-selector-button {
  border: 2px solid #0d0221; background: var(--cyan); color: #06212a; font-weight: 800;
  border-radius: 8px; padding: .4em .7em; margin-right: .6rem; cursor: pointer;
}

/* ---------- finds spotlight ---------- */
.bz-finds { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.bz-find {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center;
  background: var(--panel); border: 3px solid #0d0221; border-radius: 18px; padding: 1rem;
  box-shadow: 4px 4px 0 #0d0221; transition: transform .12s;
}
.bz-find:hover { transform: translateX(4px); }
.bz-find-emoji { font-size: 2.6rem; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 14px; }
.bz-find h3 { margin: 0 0 .25rem; font-family: var(--heavy); font-size: 1rem; }
.bz-find p { margin: 0; color: var(--ink-dim); font-size: .88rem; }

/* ---------- footer ---------- */
.bz-footer { margin-top: 3rem; }
.bz-footer-cta {
  text-align: center; padding: clamp(2.4rem,6vw,4rem) 1.2rem;
  background: linear-gradient(135deg, var(--pink), var(--purple) 60%, var(--cyan));
  border-top: 4px solid #0d0221; border-bottom: 4px solid #0d0221;
}
.bz-footer-title { font-family: var(--display); font-size: clamp(1.9rem,6vw,3.4rem); margin: 0 0 .3rem; text-shadow: 3px 3px 0 #0d0221; }
.bz-footer-cta p { margin: 0 auto; max-width: 480px; font-weight: 500; }
.bz-newsletter { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin: 1.2rem auto 0; max-width: 480px; }
.bz-newsletter input {
  flex: 1; min-width: 200px; border: 3px solid #0d0221; border-radius: 12px;
  padding: .7em 1em; font-family: var(--body); font-size: .95rem; background: #fff; color: #1a0033;
}
.bz-newsletter-msg { font-weight: 700; min-height: 1.4em; margin: .8rem 0 0; }
.bz-footer-bottom { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 2rem 1.2rem 3rem; }
.bz-footer-logo { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-size: 1.6rem; }
.bz-footer-logo img { width: 36px; height: 36px; }
.bz-footer-fine { color: var(--ink-dim); font-size: .8rem; max-width: 560px; margin: 0; }
.bz-footer-egg { font-size: .78rem; color: var(--cyan); cursor: help; user-select: none; }

/* ---------- toast ---------- */
.bz-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%);
  background: #0d0221; color: #fff; border: 3px solid var(--cyan);
  padding: .8em 1.2em; border-radius: 14px; font-weight: 700; z-index: 9500;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .35s cubic-bezier(.2,.9,.2,1); max-width: 90vw;
}
.bz-toast.show { transform: translate(-50%, 0); }

/* ---------- CHAOS MODE ---------- */
body.chaos { animation: hueShift 6s linear infinite; }
@keyframes hueShift { from{ filter: hue-rotate(0deg); } to{ filter: hue-rotate(360deg); } }
body.chaos .bz-card:hover { transform: translate(-4px,-4px) rotate(-2deg) scale(1.02); }
body.chaos .bz-hero-title { animation: wobble 1.2s ease-in-out infinite; }
body.chaos .bz-logo-mascot { animation: spin 3s linear infinite; }
@keyframes wobble { 0%,100%{ transform: rotate(-2deg); } 50%{ transform: rotate(2deg); } }
@keyframes spin { from{ transform: rotate(0); } to{ transform: rotate(360deg); } }

/* spin-on-click helper for the logo easter egg */
.spin-once { animation: spin 0.6s ease; }

/* ---------- responsive ---------- */
@media (min-width: 620px) {
  .bz-feed { grid-template-columns: repeat(2, 1fr); }
  .bz-finds { grid-template-columns: repeat(2, 1fr); }
  .bz-headline-gen { flex-direction: row; }
  .bz-headline-out { flex: 1; }
}
@media (min-width: 900px) {
  .bz-nav { display: flex; }
  .bz-actions { margin-left: 0; }
  .bz-feed { grid-template-columns: repeat(3, 1fr); }
  .bz-meme-lab { grid-template-columns: 1fr 1fr; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .bz-ticker-track { animation: none; padding-left: 0; }
}

/* =====================================================================
   FUNKY / WONKY LAYER  —  extra chaos bolted on top
   ===================================================================== */
:root {
  --funk:   'Shrikhand', 'Bangers', 'Arial Black', cursive;
  --marker: 'Permanent Marker', 'Comic Sans MS', 'Bangers', cursive;
}

/* ---- animated rainbow text everywhere it counts ---- */
@keyframes rainbowText { from { background-position: 0 50%; } to { background-position: 300% 50%; } }
.bz-logo-text, .bz-hero-title { background-size: 300% 100%; animation: rainbowText 9s linear infinite; }

/* ---- drifting polka-dot backdrop ---- */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.055) 2px, transparent 2px);
  background-size: 36px 36px; animation: dotDrift 28s linear infinite;
}
@keyframes dotDrift { from { background-position: 0 0; } to { background-position: 36px 72px; } }

/* ---- marker-font flair ---- */
.bz-eyebrow, .bz-card-tag, .bz-ticker-label, .bz-card-badge { font-family: var(--marker); }
.bz-footer-title { font-family: var(--funk); letter-spacing: .01em; }

/* ---- wonky section titles: rainbow + tilt + sticker underline ---- */
.bz-section-title {
  background: linear-gradient(92deg, var(--pink), var(--yellow), var(--lime), var(--cyan), var(--purple), var(--pink));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  display: inline-block; transform: rotate(-1.6deg);
  animation: rainbowText 8s linear infinite;
}
.bz-section-title::after {
  content: ''; display: block; height: 7px; margin-top: .14em; border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 14px, var(--cyan) 14px 28px);
  transform: rotate(.5deg); -webkit-text-fill-color: initial;
}

/* ---- bouncier, slightly-tilted buttons ---- */
.bz-btn { transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .12s ease, filter .15s ease; }
.bz-btn:hover { transform: translate(-2px,-3px) rotate(-1.5deg); box-shadow: 9px 9px 0 #0d0221; filter: brightness(1.08); }
.bz-btn:active { transform: translate(3px,3px) rotate(0deg); box-shadow: 2px 2px 0 #0d0221; }
.bz-btn-pop  { transform: rotate(-1deg); }
.bz-btn-lime { transform: rotate(1.2deg); }

/* ---- wonky tilted cards with a bouncy straighten on hover ---- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.97) rotate(var(--tilt,0deg)); }
  to   { opacity: 1; transform: rotate(var(--tilt,0deg)); }
}
.bz-card {
  transform: rotate(var(--tilt, 0deg));
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  animation: cardIn .45s backwards;
  border-width: 4px;
}
.bz-card:hover { transform: rotate(0deg) translate(-2px,-7px) scale(1.03); box-shadow: 12px 12px 0 #0d0221; z-index: 3; }
.bz-card-badge { transform: rotate(-4deg); letter-spacing: .02em; }
.bz-card-hot   { transform: rotate(6deg); }
.bz-card-sticker {
  position: absolute; top: .7rem; right: .7rem; z-index: 4;
  font-family: var(--marker); font-size: .72rem; color: #0d0221;
  background: var(--lime); border: 2px solid #0d0221; padding: .12em .5em;
  border-radius: 7px; transform: rotate(var(--srot, 8deg)); pointer-events: none;
  box-shadow: 2px 2px 0 rgba(0,0,0,.45);
}

/* ---- scattered doodle layer (kept BEHIND content) ---- */
.bz-section { position: relative; isolation: isolate; }
.bz-section > * { position: relative; z-index: 1; }
.bz-doodles { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.doodle {
  position: absolute; opacity: .5; line-height: 1;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.3));
  transform: rotate(var(--r, 0deg));
  animation: doodleFloat var(--dur, 7s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes doodleFloat {
  0%,100% { transform: rotate(var(--r,0deg)) translateY(0); }
  50%     { transform: rotate(calc(var(--r,0deg) + 8deg)) translateY(-14px); }
}

/* ---- mid-page emoji parade ---- */
.bz-parade { overflow: hidden; background: #0d0221; border-top: 4px solid var(--pink); border-bottom: 4px solid var(--cyan); }
.bz-parade-track {
  display: inline-block; white-space: nowrap; font-size: 1.7rem; letter-spacing: .3rem;
  padding: .55rem 0; will-change: transform; animation: parade 28s linear infinite;
}
@keyframes parade { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- "Ask Bonzo" floating wisdom widget ---- */
.bz-bonzo {
  position: fixed; left: 16px; bottom: 16px; z-index: 9400;
  display: flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #1a0033; border: 3px solid #0d0221; border-radius: 999px;
  padding: .35rem .9rem .35rem .45rem; font-family: var(--marker); font-size: .98rem;
  box-shadow: var(--shadow-pop); animation: bonzoBob 3s ease-in-out infinite;
}
.bz-bonzo img { width: 34px; height: 34px; }
.bz-bonzo:hover { transform: scale(1.07) rotate(-3deg); animation-play-state: paused; }
@keyframes bonzoBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
.bz-bonzo-bubble {
  position: fixed; left: 16px; bottom: 80px; z-index: 9400; max-width: min(320px, 78vw);
  background: #fff; color: #1a0033; border: 3px solid #0d0221; border-radius: 16px;
  padding: .8rem 1rem; font-weight: 700; font-family: var(--body); line-height: 1.4;
  box-shadow: var(--shadow-pop);
}
.bz-bonzo-bubble::after {
  content: ''; position: absolute; left: 30px; bottom: -15px; width: 0; height: 0;
  border: 12px solid transparent; border-top-color: #0d0221;
}
.bz-bonzo-bubble.show { animation: pop .35s ease; }
.bz-bonzo-bubble[hidden] { display: none; }

/* ---- crank chaos mode even harder ---- */
body.chaos .bz-card { animation: cardWonk 1.8s ease-in-out infinite; }
@keyframes cardWonk {
  0%,100% { transform: rotate(var(--tilt,0deg)); }
  50%     { transform: rotate(calc(var(--tilt,0deg) * -2.2)) scale(1.01); }
}
body.chaos .doodle { animation-duration: 1.4s; opacity: .85; }
body.chaos .bz-section-title { animation: titleWonk .5s ease-in-out infinite, rainbowText 3s linear infinite; }
@keyframes titleWonk { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) skew(-4deg); } }
body.chaos .bz-parade-track { animation-duration: 9s; }

@media (max-width: 420px) {
  .bz-bonzo span { display: none; }
  .bz-bonzo { padding: .35rem; }
}

/* =====================================================================
   ARCADE LAYER  —  game grid, cabinet overlay, and the games themselves
   ===================================================================== */

/* logo "ARCADE" tag + hero CTA */
.bz-logo-tag { font-family: var(--marker); font-size: .7rem; color: #0d0221; background: var(--lime); border: 2px solid #0d0221; border-radius: 6px; padding: .05em .4em; transform: rotate(4deg); }
.bz-hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin: 0 auto 1.6rem; }

/* ---------- game grid ---------- */
.bz-arcade-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.bz-game-card {
  position: relative; border: 4px solid #0d0221; border-radius: 18px; overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-pop); cursor: pointer; text-align: left;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  animation: cardPop .4s backwards;
}
@keyframes cardPop { from { opacity: 0; transform: translateY(14px) scale(.96) rotate(var(--tilt,0deg)); } to { opacity: 1; transform: rotate(var(--tilt,0deg)); } }
.bz-game-card:hover, .bz-game-card:focus-visible { transform: rotate(0) translate(-2px,-6px) scale(1.03); box-shadow: 12px 12px 0 #0d0221; z-index: 2; }
.bz-game-visual { height: 116px; display: grid; place-items: center; position: relative; }
.bz-game-visual::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.28), transparent 60%); }
.bz-game-emoji { font-size: 3.6rem; filter: drop-shadow(2px 4px 0 rgba(0,0,0,.35)); }
.bz-game-cat { position: absolute; top: .6rem; left: .6rem; font-family: var(--marker); font-size: .62rem; letter-spacing: .04em; background: #0d0221; color: #fff; padding: .26em .55em; border-radius: 7px; text-transform: uppercase; transform: rotate(-3deg); }
.bz-game-sticker { position: absolute; top: .6rem; right: .6rem; font-family: var(--marker); font-size: .66rem; color: #0d0221; background: var(--yellow); border: 2px solid #0d0221; padding: .12em .45em; border-radius: 7px; transform: rotate(7deg); }
.bz-game-body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.bz-game-title { font-family: var(--heavy); font-size: 1.05rem; margin: 0; }
.bz-game-desc { color: var(--ink-dim); font-size: .85rem; margin: 0; min-height: 2.4em; }
.bz-game-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .3rem; }
.bz-game-best { font-size: .76rem; font-weight: 700; color: var(--cyan); }
.bz-game-play { font-family: var(--heavy); font-size: .72rem; background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; padding: .35em .7em; border-radius: 999px; border: 2px solid #0d0221; }

/* ---------- how it works ---------- */
.bz-how { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 900px; margin: 0 auto; }
.bz-how-step { background: var(--panel); border: 3px solid #0d0221; border-radius: 18px; padding: 1.2rem; box-shadow: 4px 4px 0 #0d0221; position: relative; }
.bz-how-num { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--purple)); font-family: var(--display); font-size: 1.5rem; color: #fff; border: 3px solid #0d0221; margin-bottom: .5rem; }
.bz-how-step h3 { margin: 0 0 .3rem; font-family: var(--heavy); }
.bz-how-step p { margin: 0; color: var(--ink-dim); font-size: .9rem; }

/* ---------- cabinet overlay ---------- */
body.cab-open { overflow: hidden; }
.bz-cabinet { position: fixed; inset: 0; z-index: 9600; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(9,2,24,.88); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-cabinet[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.bz-cabinet-box { width: min(96vw, 640px); max-height: 94vh; display: flex; flex-direction: column; background: var(--bg-2); border: 4px solid var(--cyan); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: cabPop .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes cabPop { from { transform: scale(.9) translateY(10px); opacity: .4; } to { transform: none; opacity: 1; } }
.bz-cabinet-bar { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; background: #0d0221; border-bottom: 3px solid #2a124f; flex-wrap: wrap; }
.bz-cabinet-title { font-family: var(--funk); font-size: 1.15rem; flex: 1; min-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-cabinet-stat { font-family: var(--marker); font-size: .72rem; color: var(--ink-dim); letter-spacing: .03em; }
.bz-cabinet-stat b { color: var(--lime); font-size: .95rem; }
.bz-cabinet-btn { width: 38px; height: 38px; border-radius: 10px; border: 2px solid #2a124f; background: var(--panel); color: #fff; font-size: 1.1rem; box-shadow: 2px 2px 0 #000; transition: transform .1s; }
.bz-cabinet-btn:hover { transform: translateY(-2px); }
.bz-cabinet-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #000; }
.bz-cabinet-stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 1rem; min-height: 320px; }
.bz-cabinet-howto { margin: 0; padding: .6rem .9rem; font-size: .78rem; color: var(--ink-dim); background: #0d0221; border-top: 3px solid #2a124f; text-align: center; }
.bz-game-canvas { max-width: 100%; max-height: 64vh; height: auto; border: 3px solid #0d0221; border-radius: 12px; background: #160734; touch-action: none; image-rendering: auto; }

/* ---------- shared game UI ---------- */
.g-wrap { display: flex; flex-direction: column; align-items: center; gap: .8rem; width: 100%; }
.g-row { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: center; }
.g-msg { font-weight: 700; text-align: center; min-height: 1.4em; color: var(--ink); }
.g-btn { font-family: var(--heavy); font-size: .82rem; border: 3px solid #0d0221; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; padding: .6em 1em; border-radius: 12px; box-shadow: 4px 4px 0 #0d0221; transition: transform .12s, box-shadow .12s; }
.g-btn:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #0d0221; }
.g-btn:active:not(:disabled) { transform: translate(2px,2px); box-shadow: 1px 1px 0 #0d0221; }
.g-btn:disabled { opacity: .45; cursor: not-allowed; }
.g-board { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 6px; width: min(92vw, 380px); }
.g-cell { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #0d0221; border-radius: 8px; background: var(--panel-2); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; transition: transform .08s, background .12s; }
.g-cell:hover { transform: scale(1.05); }
.g-cell.big { font-size: 1.9rem; font-family: var(--heavy); }

/* memory cards */
.g-card { aspect-ratio: 1; border: 3px solid #0d0221; border-radius: 12px; background: linear-gradient(135deg, var(--purple), var(--pink)); color: rgba(255,255,255,.55); font-size: 1.8rem; display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.g-card.is-face { background: var(--bg-2); color: #fff; transform: rotateY(0); }
.g-card.is-done { background: linear-gradient(135deg, var(--lime), #00b36b); }

/* 2048 */
.g2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(92vw, 360px); aspect-ratio: 1; background: #0d0221; border: 3px solid #0d0221; border-radius: 12px; padding: 8px; touch-action: none; }
.g2048-cell { display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.05); font-family: var(--heavy); font-size: clamp(1rem, 5vw, 1.7rem); color: #fff; }
.g2048-cell[data-v="2"] { background: #3b2b66; } .g2048-cell[data-v="4"] { background: #4b2f8a; }
.g2048-cell[data-v="8"] { background: #ff8a3d; color: #1a0033; } .g2048-cell[data-v="16"] { background: #ff6b35; color: #1a0033; }
.g2048-cell[data-v="32"] { background: #ff4d6d; } .g2048-cell[data-v="64"] { background: #ff2e93; }
.g2048-cell[data-v="128"] { background: #c64bff; font-size: clamp(.9rem,4.4vw,1.5rem); } .g2048-cell[data-v="256"] { background: #9b5cff; font-size: clamp(.9rem,4.4vw,1.5rem); }
.g2048-cell[data-v="512"] { background: #5c7cff; font-size: clamp(.9rem,4.4vw,1.5rem); } .g2048-cell[data-v="1024"] { background: #00c2ff; color: #002; font-size: clamp(.8rem,4vw,1.3rem); }
.g2048-cell[data-v="2048"] { background: #00f0ff; color: #002; box-shadow: 0 0 18px var(--cyan); font-size: clamp(.8rem,4vw,1.3rem); }

/* minesweeper */
.g-board.mines { width: min(94vw, 400px); gap: 3px; }
.mines .g-cell { background: #2a155e; border-radius: 5px; font-size: .95rem; }
.mines .g-cell.is-rev { background: #160734; cursor: default; }
.mines .g-cell.is-mine { background: #ff2e93; }

/* tic-tac-toe */
.g-board.ttt { width: min(80vw, 300px); gap: 8px; }
.ttt .g-cell.is-X { color: var(--cyan); } .ttt .g-cell.is-O { color: var(--pink); }

/* simon */
.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(80vw, 300px); }
.simon-pad { aspect-ratio: 1; border: 4px solid #0d0221; border-radius: 16px; cursor: pointer; transition: filter .1s; }
.simon-pad:active { filter: brightness(1.4); }

/* sliding puzzle */
.g-board.slide { width: min(80vw, 320px); gap: 6px; }
.slide .g-cell { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.slide .g-cell.is-blank { background: transparent; border-style: dashed; cursor: default; }

/* connect four */
.c4 { display: flex; gap: 5px; background: #1a0a4a; padding: 8px; border: 3px solid #0d0221; border-radius: 14px; }
.c4-col { display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.c4-col:hover { background: rgba(255,255,255,.06); border-radius: 8px; }
.c4-cell { width: min(9vw, 42px); aspect-ratio: 1; border-radius: 50%; background: #0d0221; }
.c4-cell.p1 { background: radial-gradient(circle at 35% 30%, #ff7ab0, #ff2e93); }
.c4-cell.p2 { background: radial-gradient(circle at 35% 30%, #ffe680, #ffd400); }

/* lights out */
.g-board.lights { width: min(80vw, 320px); }
.lights .g-cell.light { background: #1a0a44; }
.lights .g-cell.light.is-on { background: radial-gradient(circle at 40% 35%, #fff6a0, var(--yellow)); box-shadow: 0 0 14px rgba(255,212,0,.6); }

/* color match */
.g-board.colormatch { width: min(86vw, 360px); gap: 8px; }
.cm-cell { aspect-ratio: 1; border: 2px solid rgba(0,0,0,.4); border-radius: 10px; cursor: pointer; }
.cm-cell:hover { transform: scale(1.04); }

/* reaction */
.reaction { width: min(92vw, 420px); height: 240px; border: 4px solid #0d0221; border-radius: 18px; font-family: var(--heavy); font-size: 1.6rem; color: #fff; cursor: pointer; background: #3a0ca3; transition: background .1s; }
.reaction.wait { background: #ff6b35; } .reaction.go { background: #00b36b; } .reaction.early { background: #9b2226; } .reaction.result { background: #5c3bb0; }

/* aim trainer */
.aim { position: relative; width: min(92vw, 420px); height: 320px; border: 4px solid #0d0221; border-radius: 16px; background: #120433; overflow: hidden; touch-action: none; }
.aim-dot { position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; background: radial-gradient(circle at 35% 30%, #ff9ed4, var(--pink)); cursor: pointer; }

/* whack-a-bonzo */
.whack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(86vw, 360px); }
.whack-hole { aspect-ratio: 1; border: 4px solid #0d0221; border-radius: 50%; background: #1a0a44; font-size: 2.2rem; display: grid; place-items: center; cursor: pointer; overflow: hidden; box-shadow: inset 0 -10px 0 rgba(0,0,0,.35); }
.whack-hole.up { background: radial-gradient(circle at 50% 30%, #2a155e, #120433); }

/* rps */
.rps-disp { font-size: 2.6rem; min-height: 1.4em; }
.rps-btn { font-size: .95rem; padding: .7em 1.1em; text-transform: capitalize; }

/* higher / lower */
.hilo-card { font-family: var(--display); font-size: 4rem; width: 140px; height: 180px; display: grid; place-items: center; background: var(--bg-2); border: 4px solid #0d0221; border-radius: 16px; box-shadow: var(--shadow-pop); }

/* clicker */
.clicker-count { font-family: var(--heavy); font-size: 1.6rem; }
.clicker-btn { font-size: 5rem; width: 150px; height: 150px; border-radius: 50%; border: 5px solid #0d0221; background: radial-gradient(circle at 38% 32%, #fff3a0, var(--yellow)); box-shadow: var(--shadow-pop); cursor: pointer; transition: transform .07s; }
.clicker-btn:active { transform: scale(.92); }

/* typing */
.typing-target { font-size: 1.1rem; line-height: 1.7; letter-spacing: .02em; max-width: 460px; text-align: center; padding: .4rem; }
.typing-target span.ok { color: var(--lime); } .typing-target span.bad { color: #fff; background: var(--pink); border-radius: 3px; }
.typing-input { width: min(92vw, 460px); border: 3px solid #0d0221; background: var(--panel); color: #fff; padding: .7em 1em; border-radius: 12px; font-family: var(--body); font-size: 1rem; }

/* slots */
.slots { display: flex; gap: 10px; }
.slots-reel { width: 76px; height: 90px; display: grid; place-items: center; font-size: 2.6rem; background: #0d0221; border: 4px solid var(--yellow); border-radius: 12px; }

/* pig dice */
.pig { font-family: var(--heavy); font-size: 1.4rem; text-align: center; line-height: 1.5; }
.pig-turn { font-family: var(--body); font-size: .9rem; color: var(--cyan); }

/* bonzle (word guess) */
.bonzle { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: min(82vw, 300px); }
.bonzle-tile { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #3a2a5e; border-radius: 6px; font-family: var(--heavy); font-size: 1.4rem; color: #fff; text-transform: uppercase; }
.bonzle-tile.correct { background: #00b36b; border-color: #00b36b; } .bonzle-tile.present { background: #d9a400; border-color: #d9a400; } .bonzle-tile.absent { background: #2a1850; border-color: #2a1850; }
.bonzle-kb { display: flex; flex-direction: column; gap: 5px; width: min(96vw, 460px); }
.bonzle-kb-row { display: flex; gap: 4px; justify-content: center; }
.bonzle-key { flex: 1; max-width: 40px; padding: .7em .2em; border: 2px solid #0d0221; border-radius: 7px; background: var(--panel-2); color: #fff; font-weight: 800; font-size: .85rem; cursor: pointer; }
.bonzle-key.wide { max-width: 56px; }
.bonzle-key.k-correct { background: #00b36b; } .bonzle-key.k-present { background: #d9a400; } .bonzle-key.k-absent { background: #1a0d33; color: #6a5a8a; }

@media (min-width: 620px) {
  .bz-arcade-grid { grid-template-columns: repeat(2, 1fr); }
  .bz-how { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 920px) {
  .bz-arcade-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =====================================================================
   ECONOMY LAYER  —  coin HUD, popups, shop, screen shake & extra juice
   ===================================================================== */

/* coin HUD in the header */
.bz-coin-hud {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--heavy); font-size: .85rem; color: var(--yellow);
  background: #0d0221; border: 3px solid var(--yellow); border-radius: 999px;
  padding: .35em .8em; box-shadow: 3px 3px 0 #0d0221; transition: transform .1s;
}
.bz-coin-hud b { color: #fff; font-variant-numeric: tabular-nums; }
.bz-coin-hud:hover { transform: translateY(-2px) scale(1.04); }
.bz-coin-hud:active { transform: translateY(1px); }

/* coin stat inside the cabinet bar */
.bz-cabinet-stat.coins b { color: var(--yellow); }

/* floating "+N 🪙" popup */
.coin-pop {
  position: absolute; top: 48px; z-index: 5; pointer-events: none;
  font-family: var(--heavy); font-size: 1.1rem; color: var(--yellow);
  text-shadow: 2px 2px 0 #0d0221; animation: coinFloat 1.1s ease-out forwards;
}
@keyframes coinFloat { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }

/* screen shake (applied to game canvas) */
.g-shake { animation: gshake .3s ease; }
@keyframes gshake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(calc(var(--shk, 6px) * -1), var(--shk, 6px)); }
  40% { transform: translate(var(--shk, 6px), calc(var(--shk, 6px) * -1)); }
  60% { transform: translate(calc(var(--shk, 6px) * -.6), 0); }
  80% { transform: translate(var(--shk, 6px), var(--shk, 6px)); }
}

/* make the cabinet box a positioning context for popups */
.bz-cabinet-box { position: relative; }

/* ---------- shop overlay ---------- */
.bz-shop { position: fixed; inset: 0; z-index: 9600; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(9,2,24,.88); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-shop[hidden] { display: none; }
.bz-shop-box { width: min(96vw, 620px); max-height: 92vh; display: flex; flex-direction: column; background: var(--bg-2); border: 4px solid var(--yellow); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: cabPop .3s cubic-bezier(.34,1.56,.64,1); }
.bz-shop-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; background: #0d0221; border-bottom: 3px solid #2a124f; }
.bz-shop-title { font-family: var(--funk); font-size: 1.2rem; flex: 1; }
.bz-shop-coins { font-family: var(--heavy); color: var(--yellow); }
.bz-shop-coins b { color: #fff; }
.bz-shop-tabs { display: flex; gap: .5rem; padding: .7rem .9rem 0; }
.shop-tab { flex: 1; font-family: var(--heavy); font-size: .8rem; border: 3px solid #0d0221; background: var(--panel); color: var(--ink-dim); padding: .6em; border-radius: 12px 12px 0 0; box-shadow: 2px 2px 0 #0d0221; }
.shop-tab.is-active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.bz-shop-body { flex: 1; overflow: auto; display: grid; grid-template-columns: 1fr; gap: .7rem; padding: .9rem; }
.shop-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; background: var(--panel); border: 3px solid #0d0221; border-radius: 14px; padding: .7rem .8rem; box-shadow: 3px 3px 0 #0d0221; }
.shop-card.is-equipped { border-color: var(--lime); box-shadow: 3px 3px 0 #0d0221, 0 0 14px rgba(198,255,0,.35); }
.shop-emoji { font-size: 2.4rem; width: 58px; height: 58px; display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), var(--pink)); border: 3px solid #0d0221; border-radius: 14px; }
.shop-info h4 { margin: 0; font-family: var(--heavy); font-size: .98rem; }
.shop-lvl { font-family: var(--marker); font-size: .72rem; color: var(--cyan); }
.shop-info p { margin: .1rem 0 0; color: var(--ink-dim); font-size: .8rem; }
.shop-buy { font-family: var(--heavy); font-size: .78rem; border: 3px solid #0d0221; background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; padding: .55em .85em; border-radius: 10px; box-shadow: 3px 3px 0 #0d0221; white-space: nowrap; transition: transform .1s; }
.shop-buy:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 #0d0221; }
.shop-buy:active:not(:disabled) { transform: translate(2px,2px); box-shadow: 1px 1px 0 #0d0221; }
.shop-buy:disabled { opacity: .55; cursor: not-allowed; }
.shop-buy.is-equipped { background: var(--lime); }
.bz-shop-foot { margin: 0; padding: .6rem .9rem; font-size: .76rem; color: var(--ink-dim); text-align: center; background: #0d0221; border-top: 3px solid #2a124f; }

/* ---------- extra polish: glows + tile pops ---------- */
.bz-game-canvas { box-shadow: 0 0 0 3px #0d0221, 0 10px 30px rgba(0,0,0,.4), 0 0 24px rgba(0,240,255,.12); }
.g2048-cell[data-v] { animation: tilePop .18s ease; }
@keyframes tilePop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.g-card.is-face { animation: tilePop .2s ease; }
.bonzle-tile.correct, .bonzle-tile.present, .bonzle-tile.absent { animation: tileFlip .35s ease; }
@keyframes tileFlip { 0% { transform: rotateX(-90deg); } 100% { transform: rotateX(0); } }
.cm-cell { box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.whack-hole.up { animation: molePop .15s ease; }
@keyframes molePop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
.slots-reel { box-shadow: inset 0 0 14px rgba(255,212,0,.35); }

@media (min-width: 620px) {
  .bz-shop-body { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   BOOT / LOADING SCREEN + GAME TITLE SCREENS
   ===================================================================== */
.boot { position: fixed; inset: 0; z-index: 11000; display: grid; place-items: center; background: radial-gradient(1000px 700px at 50% 30%, #2a0e63, #0d0221 70%); transition: opacity .5s ease, visibility .5s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { text-align: center; }
.boot-mascot { width: 96px; height: 96px; filter: drop-shadow(3px 4px 0 #000); animation: bootBob 1.2s ease-in-out infinite; }
@keyframes bootBob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
.boot-title { font-family: var(--display); font-size: clamp(3rem, 12vw, 5rem); line-height: .9; margin-top: .4rem; background: linear-gradient(92deg, var(--pink), var(--yellow), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-sub { font-family: var(--marker); letter-spacing: .35em; color: var(--cyan); margin-bottom: 1.2rem; }
.boot-bar { width: min(70vw, 320px); height: 16px; border: 3px solid #0d0221; border-radius: 999px; background: #0d0221; margin: 0 auto; overflow: hidden; box-shadow: inset 0 0 0 2px #2a124f; }
.boot-bar-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime), var(--yellow), var(--pink)); transition: width .15s ease; }
.boot-msg { margin-top: .7rem; font-weight: 700; color: var(--ink-dim); font-size: .85rem; min-height: 1.2em; }

.bz-title { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; padding: .5rem; max-width: 460px; margin: 0 auto; animation: cabPop .3s ease; }
.bz-title-emoji { font-size: 5rem; filter: drop-shadow(3px 5px 0 rgba(0,0,0,.4)); animation: titleBob 1.6s ease-in-out infinite; }
@keyframes titleBob { 0%,100% { transform: translateY(0) rotate(-3deg) scale(1); } 50% { transform: translateY(-10px) rotate(3deg) scale(1.05); } }
.bz-title-name { font-family: var(--funk); font-size: 2rem; margin: 0; }
.bz-title-cat { font-family: var(--marker); color: var(--cyan); margin: 0; font-size: .8rem; letter-spacing: .05em; }
.bz-title-desc { color: var(--ink-dim); margin: .2rem 0; font-size: .92rem; }
.bz-title-best { font-weight: 700; color: var(--yellow); margin: .1rem 0; }
.bz-title-pick { font-family: var(--marker); color: var(--ink-dim); margin: .4rem 0 0; font-size: .78rem; letter-spacing: .08em; }
.bz-title-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; }
.bz-title-mode { display: flex; flex-direction: column; gap: .15rem; border: 3px solid #0d0221; background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff; border-radius: 12px; padding: .6em; box-shadow: 3px 3px 0 #0d0221; transition: transform .1s; font-family: var(--heavy); font-size: .82rem; }
.bz-title-mode span { font-family: var(--body); font-weight: 500; font-size: .7rem; color: rgba(255,255,255,.85); }
.bz-title-mode:hover { transform: translateY(-2px); }
.bz-title-start { font-family: var(--display); font-size: 1.6rem; letter-spacing: .04em; border: 4px solid #0d0221; background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; border-radius: 14px; padding: .4em 1.4em; box-shadow: var(--shadow-pop); animation: startPulse 1.2s ease-in-out infinite; margin-top: .3rem; }
@keyframes startPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.bz-title-start:hover { filter: brightness(1.08); }
.bz-title-howto { color: var(--ink-dim); font-size: .76rem; margin: .4rem 0 0; }

/* achievements wall (shop tab) */
.shop-ach-head { grid-column: 1 / -1; margin: 0 0 .1rem; text-align: center; font-family: var(--heavy); color: var(--yellow); }
.shop-card.ach.is-locked { opacity: .68; }
.shop-card.ach.is-done { border-color: var(--lime); box-shadow: 3px 3px 0 #0d0221, 0 0 12px rgba(198,255,0,.3); }
.ach-reward { font-family: var(--heavy); font-size: .8rem; color: var(--yellow); white-space: nowrap; }
.shop-card.ach.is-done .ach-reward { color: var(--lime); font-size: 1.1rem; }

/* match-3 */
.g-board.crush { width: min(90vw, 384px); gap: 3px; }
.crush-cell { aspect-ratio: 1; border: 2px solid #0d0221; border-radius: 8px; background: #1d0a44; font-size: 1.4rem; display: grid; place-items: center; cursor: pointer; transition: transform .08s; }
.crush-cell:hover { transform: scale(1.06); }
.crush-cell.sel { outline: 3px solid var(--cyan); outline-offset: -2px; transform: scale(1.08); }

/* sudoku */
.sudoku { display: grid; grid-template-columns: repeat(9, 1fr); width: min(92vw, 360px); aspect-ratio: 1; background: #0d0221; border: 3px solid #0d0221; border-radius: 8px; overflow: hidden; }
.su-cell { aspect-ratio: 1; border: 1px solid #2a155e; background: #160734; color: var(--cyan); font-weight: 800; font-size: clamp(.8rem, 3.5vw, 1.1rem); cursor: pointer; }
.su-cell.fixed { color: #fff; background: #1d0a44; cursor: default; }
.su-cell.sel { background: #3a2a6e; }
.su-cell.bad { color: #ff5db1; background: #4a1030; }
.su-cell.br { border-right: 3px solid #6a4fd0; }
.su-cell.bb { border-bottom: 3px solid #6a4fd0; }
.sudoku-pad { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: min(94vw, 400px); }
.su-key { padding: .6em .1em; border: 2px solid #0d0221; border-radius: 8px; background: var(--panel-2); color: #fff; font-weight: 800; cursor: pointer; }
.su-key:hover { background: var(--purple); }
.su-key.wide { grid-column: span 1; }

/* mastermind */
.mm-board { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow: auto; }
.mm-row { display: flex; align-items: center; gap: 4px; }
.mm-current { display: flex; gap: 6px; margin: .3rem 0; }
.mm-slot { font-size: 1.4rem; width: 1.4em; text-align: center; }
.mm-peg { font-size: .7rem; letter-spacing: -2px; margin-left: 6px; color: #fff; }

/* nim */
.nim-rows { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.nim-row { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; min-height: 1.6rem; }
.nim-coin { font-size: 1.5rem; background: none; border: none; cursor: pointer; transition: transform .08s; padding: 0; }
.nim-coin:hover { transform: scale(1.2) translateY(-3px); }

/* playing cards */
.bj-hand { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 54px; }
.pcard { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 42px; height: 60px; padding: 0 6px; background: #fff; color: #181018; border: 2px solid #0d0221; border-radius: 8px; font-weight: 800; font-size: 1rem; cursor: pointer; }
.pcard.red { color: #c41e3a; }
.pcard.back { background: #3a2a6e; color: #c6a7ff; }
.pcard.held { outline: 3px solid var(--cyan); }
.pcard.held b { font-size: .52rem; color: #06212a; background: var(--cyan); border-radius: 3px; padding: 0 3px; margin-top: 2px; }
.scratch-cell { aspect-ratio: 1; border: 2px solid #0d0221; border-radius: 8px; background: linear-gradient(135deg, #9b8ad6, #6a5a9a); font-size: 1.5rem; display: grid; place-items: center; cursor: pointer; }
.scratch-cell.rev { background: #160734; }

/* puzzle-2 bits */
.anagram-word { font-family: var(--display); font-size: 2.6rem; letter-spacing: .3rem; }
.hangman-art { font-size: 3.6rem; }
.hangman-word { font-family: var(--heavy); font-size: 1.6rem; letter-spacing: .25rem; min-height: 1.6rem; }
.mathblitz-q { font-family: var(--heavy); font-size: 2rem; }
.nummem-show { font-family: var(--display); font-size: 3rem; min-height: 3.2rem; letter-spacing: .2rem; }
.mg-cell { aspect-ratio: 1; border: 3px solid #0d0221; border-radius: 12px; background: #1d0a44; cursor: pointer; transition: background .1s; }
.mg-cell.lit { background: var(--lime); box-shadow: 0 0 16px var(--lime); }
.bc-log { display: flex; flex-direction: column; gap: 3px; max-height: 170px; overflow: auto; }
.bc-row { font-size: 1rem; font-weight: 700; }
.g-cell.is-found { background: #00b36b; }
.g-cell.sel { outline: 3px solid var(--cyan); }
.stroop-word { font-family: var(--display); font-size: 3.2rem; letter-spacing: .1rem; }
.g-btn.held-die { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* =====================================================================
   MOBILE / TOUCH EXPERIENCE
   ===================================================================== */
* { -webkit-tap-highlight-color: transparent; }
html, body { overscroll-behavior: none; }
button, a, .bz-filter, .bz-game-card, label { touch-action: manipulation; }
.bz-cabinet, .bz-shop, .bz-pad, #cabStage, .bz-cabinet-bar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bz-game-canvas, .g2048, .g-board.mines { touch-action: none; }

/* ---- on-screen touch controls (D-pad + action buttons) ---- */
.bz-pad { display: none; }
@media (hover: none) and (pointer: coarse) { .bz-pad:not([hidden]) { display: flex; } }
.bz-pad { justify-content: space-between; align-items: center; gap: .7rem; padding: .5rem .7rem calc(.5rem + env(safe-area-inset-bottom, 0px)); background: #0d0221; border-top: 3px solid #2a124f; touch-action: none; }
.bz-dpad { display: grid; grid-template-columns: repeat(3, 47px); grid-template-rows: repeat(3, 47px); gap: 5px; }
.bz-dpad.lr { display: flex; gap: 14px; }
.bz-dbtn { width: 47px; height: 47px; border: 2px solid #0d0221; background: var(--panel-2); color: #fff; border-radius: 12px; font-size: 1.25rem; display: grid; place-items: center; box-shadow: 2px 2px 0 #000; touch-action: none; }
.bz-dpad:not(.lr) .d-up { grid-area: 1 / 2; } .bz-dpad:not(.lr) .d-left { grid-area: 2 / 1; }
.bz-dpad:not(.lr) .d-right { grid-area: 2 / 3; } .bz-dpad:not(.lr) .d-down { grid-area: 3 / 2; }
.bz-dhub { grid-area: 2 / 2; border-radius: 50%; background: rgba(255,255,255,.07); align-self: center; justify-self: center; width: 18px; height: 18px; }
.bz-dpad.lr .bz-dbtn { width: 74px; height: 58px; }
.bz-abtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.bz-abtn { min-width: 64px; height: 58px; padding: 0 14px; border: 2px solid #0d0221; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; border-radius: 14px; font-family: var(--heavy); font-size: .85rem; box-shadow: 2px 2px 0 #000; touch-action: none; }
.bz-dbtn.act, .bz-abtn.act { filter: brightness(1.55); transform: scale(.92); }

/* stage fills available height so canvases scale up on phones */
.bz-cabinet-stage { flex: 1 1 auto; min-height: 0; }

/* ---- phone layout (≤600px): fullscreen cabinet, denser grid ---- */
@media (max-width: 600px) {
  .bz-arcade-grid { grid-template-columns: repeat(2, 1fr) !important; gap: .7rem; }
  .bz-game-desc { display: none; }
  .bz-game-visual { height: 96px; } .bz-game-emoji { font-size: 3rem; }
  .bz-game-title { font-size: .92rem; }
  .bz-section { padding: 1.6rem .7rem; }
  .bz-section-title { font-size: clamp(1.9rem, 9vw, 3rem); }

  .bz-header { padding: calc(.45rem + env(safe-area-inset-top, 0px)) .6rem .45rem; gap: .45rem; }
  .bz-actions { gap: .35rem; margin-left: auto; }
  .bz-actions .bz-btn-pop { font-size: 0; padding: .55em .7em; }
  .bz-actions .bz-btn-pop::after { content: '🎲'; font-size: 1.15rem; }
  .bz-coin-hud { padding: .35em .6em; }

  .bz-cabinet { padding: 0; }
  .bz-cabinet-box { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border-width: 0; }
  .bz-cabinet-bar { padding: calc(.45rem + env(safe-area-inset-top, 0px)) .6rem .45rem; gap: .4rem; }
  .bz-cabinet-title { font-size: 1rem; }
  .bz-cabinet-stat { font-size: .64rem; }
  .bz-cabinet-stage { padding: .45rem; }
  .bz-cabinet-howto { display: none; }
  .bz-game-canvas { max-width: 100%; max-height: 100%; }

  .bz-shop { padding: 0; }
  .bz-shop-box { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .bz-shop-body { padding: .7rem calc(.7rem + env(safe-area-inset-bottom, 0px)); }

  .bz-hero { padding: 1.6rem .8rem 1.2rem; }
  .bz-bonzo { left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* slightly bigger touch targets on coarse pointers */
@media (pointer: coarse) {
  .bz-filter { padding: .55em 1em; font-size: .9rem; }
  .su-key, .bonzle-key { min-height: 38px; }
}

/* =====================================================================
   PROGRESSION — level chip, quests, themes, crate, profile, daily bonus
   ===================================================================== */
/* ---- header level chip ---- */
.bz-level-chip { display: flex; align-items: center; gap: .4rem; padding: .3em .55em .3em .4em; border: 3px solid #0d0221; border-radius: 999px; background: var(--panel); box-shadow: 2px 2px 0 #0d0221; cursor: pointer; transition: transform .1s; }
.bz-level-chip:hover { transform: translateY(-2px); }
.bz-level-chip:active { transform: translateY(1px); }
.bz-level-num { display: grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .25em; font-family: var(--heavy); font-size: .78rem; color: #0d0221; background: linear-gradient(135deg, var(--lime), var(--cyan)); border-radius: 999px; }
.bz-level-bar { width: 54px; height: 8px; border-radius: 999px; background: #0d0221; overflow: hidden; }
.bz-level-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lime), var(--cyan)); transition: width .4s ease; }

/* ---- claim notification dots ---- */
.bz-coin-hud { position: relative; }
.bz-claim-dot, .tab-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--pink); border: 2px solid #0d0221; box-shadow: 0 0 8px var(--pink); }
.bz-claim-dot[hidden], .tab-dot[hidden] { display: none; }
.bz-claim-dot { position: absolute; top: -4px; right: -4px; animation: dotPulse 1.2s ease-in-out infinite; }
.tab-dot { display: inline-block; vertical-align: middle; margin-left: .15em; animation: dotPulse 1.2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .7; } }

/* ---- shop tabs: scrollable strip (7 tabs); emoji-only on phones ---- */
.bz-shop-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.bz-shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab { flex: 0 0 auto; white-space: nowrap; }
.shop-tab .tab-ico { margin-right: .25em; }
@media (max-width: 600px) {
  .bz-shop-tabs { gap: .25rem; }
  .shop-tab { flex: 1 1 auto; padding: .6em .15em; font-size: .68rem; min-width: 0; }
  .shop-tab .tab-label { display: none; }
  .shop-tab .tab-ico { margin: 0; font-size: 1.3rem; }
}

/* ---- shop body layouts ---- */
.bz-shop-body:not(.is-grid) { display: flex; flex-direction: column; }
.bz-shop-body.is-grid { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .bz-shop-body.is-grid { grid-template-columns: 1fr; } }

/* ---- section heads ---- */
.shop-section-head { margin: .2rem 0 .1rem; font-family: var(--heavy); font-size: .95rem; color: var(--cyan); }
.shop-section-sub { font-family: var(--body); font-weight: 500; font-size: .72rem; color: var(--ink-dim); margin-left: .3em; }

/* ---- quests ---- */
.quest-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; background: var(--panel); border: 3px solid #0d0221; border-radius: 14px; padding: .6rem .7rem; box-shadow: 3px 3px 0 #0d0221; }
.quest-card.is-done { border-color: var(--lime); }
.quest-icon { font-size: 1.7rem; width: 44px; height: 44px; display: grid; place-items: center; background: #0d0221; border-radius: 11px; }
.quest-mid { min-width: 0; }
.quest-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.quest-text { font-family: var(--heavy); font-size: .82rem; }
.quest-prog { font-size: .72rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quest-bar { height: 9px; margin-top: .35rem; border-radius: 999px; background: #0d0221; overflow: hidden; }
.quest-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--cyan)); border-radius: 999px; transition: width .4s ease; }
.quest-bar.big { height: 13px; }
.quest-reward { font-family: var(--heavy); font-size: .78rem; color: var(--yellow); white-space: nowrap; }
.quest-reward.done { color: var(--lime); font-size: 1.1rem; }
.quest-claim { font-family: var(--heavy); font-size: .74rem; border: 3px solid #0d0221; background: linear-gradient(135deg, var(--yellow), var(--orange)); color: #2a1500; padding: .5em .7em; border-radius: 10px; box-shadow: 3px 3px 0 #0d0221; white-space: nowrap; animation: claimGlow 1.4s ease-in-out infinite; }
@keyframes claimGlow { 0%, 100% { box-shadow: 3px 3px 0 #0d0221, 0 0 0 rgba(255,212,0,0); } 50% { box-shadow: 3px 3px 0 #0d0221, 0 0 14px rgba(255,212,0,.6); } }
.quest-claim-login { width: 100%; font-family: var(--heavy); font-size: .85rem; border: 3px solid #0d0221; background: linear-gradient(135deg, var(--lime), var(--cyan)); color: #06210f; padding: .7em; border-radius: 12px; box-shadow: 3px 3px 0 #0d0221; margin-bottom: .3rem; animation: claimGlow 1.4s ease-in-out infinite; }
.quest-login-done { margin: 0 0 .3rem; font-size: .78rem; color: var(--ink-dim); text-align: center; }

/* ---- themes ---- */
.theme-card .theme-sw { display: flex; width: 58px; height: 58px; border: 3px solid #0d0221; border-radius: 14px; overflow: hidden; }
.theme-sw > span { flex: 1; }

/* ---- mystery crate ---- */
.crate-hero { text-align: center; padding: 1rem .8rem 1.4rem; }
.crate-box { font-size: 5rem; line-height: 1; filter: drop-shadow(0 8px 20px rgba(255,46,147,.45)); animation: crateBob 2.4s ease-in-out infinite; }
.crate-box.pop { animation: cratePop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes crateBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes cratePop { 0% { transform: scale(.6) rotate(-12deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1); } }
.crate-hero h3 { font-family: var(--funk); font-size: 1.6rem; margin: .4rem 0 .2rem; }
.crate-desc { color: var(--ink-dim); font-size: .85rem; max-width: 34ch; margin: .2rem auto 1rem; }
.crate-result { margin: .9rem 0 0; font-family: var(--heavy); color: var(--lime); min-height: 1.2em; }

/* ---- profile ---- */
.prof-card { display: flex; gap: .9rem; align-items: center; background: var(--panel); border: 3px solid #0d0221; border-radius: 16px; padding: .9rem; box-shadow: 3px 3px 0 #0d0221; margin-bottom: .8rem; }
.prof-avatar { font-size: 3rem; width: 72px; height: 72px; display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), var(--pink)); border: 3px solid #0d0221; border-radius: 16px; flex: 0 0 auto; }
.prof-head { flex: 1; min-width: 0; }
.prof-lvl { font-family: var(--funk); font-size: 1.4rem; }
.prof-xp { font-size: .72rem; color: var(--ink-dim); margin-top: .3rem; }
.prof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.prof-stat { display: flex; flex-direction: column; align-items: center; gap: .1rem; background: var(--panel); border: 3px solid #0d0221; border-radius: 12px; padding: .6rem .3rem; box-shadow: 2px 2px 0 #0d0221; text-align: center; }
.prof-ico { font-size: 1.3rem; }
.prof-stat b { font-family: var(--heavy); font-size: .95rem; color: var(--lime); }
.prof-stat small { font-size: .62rem; color: var(--ink-dim); }

/* ---- daily bonus modal ---- */
.bz-daily { position: fixed; inset: 0; z-index: 9700; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(9,2,24,.9); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-daily[hidden] { display: none; }
.bz-daily-box { width: min(94vw, 440px); text-align: center; background: var(--bg-2); border: 4px solid var(--yellow); border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.6); padding: 1.6rem 1.3rem; animation: cabPop .35s cubic-bezier(.34,1.56,.64,1); }
.bz-daily-burst { font-size: 3.6rem; animation: crateBob 2.2s ease-in-out infinite; }
.bz-daily-title { font-family: var(--funk); font-size: 2.1rem; margin: .2rem 0 0; color: var(--yellow); }
.bz-daily-sub { color: var(--ink-dim); margin: .2rem 0 1rem; }
.bz-daily-track { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
.daily-day { flex: 1 1 0; min-width: 40px; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .45rem .2rem; border: 2px solid #0d0221; border-radius: 10px; background: var(--panel); }
.daily-day small { font-size: .6rem; color: var(--ink-dim); }
.daily-day b { font-size: .66rem; }
.daily-day.is-past { opacity: .5; }
.daily-day.is-cur { border-color: var(--lime); background: linear-gradient(135deg, var(--pink), var(--purple)); box-shadow: 0 0 14px rgba(198,255,0,.4); transform: scale(1.08); }
.daily-day.is-cur small, .daily-day.is-cur b { color: #fff; }
.bz-daily-claim { width: 100%; font-size: 1.05rem; padding: .8em; }
.bz-daily-streak { margin: .7rem 0 0; font-size: .8rem; color: var(--ink-dim); }

@media (max-width: 600px) { .bz-level-bar { width: 42px; } }
@media (max-width: 400px) { .bz-level-bar { display: none; } .bz-level-chip { padding: .3em .45em; } }

/* =====================================================================
   UNLOCKABLE THEMES — recolor the whole arcade via CSS custom properties
   ===================================================================== */
html[data-theme="midnight"] {
  --bg: #050d22; --bg-2: #0a1838; --panel: #102a5c; --panel-2: #16367a; --ink: #eaf2ff; --ink-dim: #9fb6e0;
  --pink: #3aa0ff; --cyan: #00e5ff; --lime: #36e0c0; --yellow: #8fd0ff; --purple: #6a5cff; --orange: #3a7bff;
  --glow-1: #0e2a6b; --glow-2: #0a3a8a;
}
html[data-theme="vapor"] {
  --bg: #1a0b2e; --bg-2: #241141; --panel: #311a5c; --panel-2: #3d2270; --ink: #fdeaff; --ink-dim: #c6a7e0;
  --pink: #ff6ad5; --cyan: #26d9d9; --lime: #8c7bff; --yellow: #ffd36e; --purple: #b06aff; --orange: #ff8fab;
  --glow-1: #5a2a8a; --glow-2: #2a6a8a;
}
html[data-theme="matrix"] {
  --bg: #020a05; --bg-2: #04140b; --panel: #073018; --panel-2: #0a3d20; --ink: #d6ffe0; --ink-dim: #7fc79a;
  --pink: #00ff66; --cyan: #0aff9d; --lime: #6cff00; --yellow: #aaffaa; --purple: #00b36b; --orange: #00d957;
  --glow-1: #073a1f; --glow-2: #0a5c30;
}
html[data-theme="sunset"] {
  --bg: #1f0a10; --bg-2: #2e0f14; --panel: #4a141a; --panel-2: #5c1a14; --ink: #fff1e6; --ink-dim: #e0b29a;
  --pink: #ff5a3c; --cyan: #ffb03a; --lime: #ffd400; --yellow: #ff7a00; --purple: #ff2e6a; --orange: #ff8a3a;
  --glow-1: #6e1a1a; --glow-2: #8a3a0a;
}
html[data-theme="candy"] {
  --bg: #2a1430; --bg-2: #371a40; --panel: #4a2458; --panel-2: #5c2e6e; --ink: #fff0fb; --ink-dim: #d8b8e0;
  --pink: #ff8fcf; --cyan: #7ed7ff; --lime: #b6ff7e; --yellow: #ffe27a; --purple: #c6a7ff; --orange: #ff9fb0;
  --glow-1: #6a2a6e; --glow-2: #4a3a8a;
}
html[data-theme="noir"] {
  --bg: #0c0c10; --bg-2: #141420; --panel: #1e1e2c; --panel-2: #28283a; --ink: #f4f4ff; --ink-dim: #a0a0c0;
  --pink: #e6e6f0; --cyan: #9aa3c0; --lime: #cfcfff; --yellow: #ffffff; --purple: #6a6a8a; --orange: #b0b0c8;
  --glow-1: #20202e; --glow-2: #2a2a3c;
}
html[data-theme="gold"] {
  --bg: #0e0b03; --bg-2: #171204; --panel: #241b06; --panel-2: #332606; --ink: #fff8e0; --ink-dim: #c8b878;
  --pink: #ffd700; --cyan: #ffae00; --lime: #ffe98a; --yellow: #fff3b0; --purple: #b8860b; --orange: #ff9e00;
  --glow-1: #4a3606; --glow-2: #6e5210;
}

/* =====================================================================
   BONZUMA TREASURE — AdVenture-Capitalist-style idle empire
   ===================================================================== */
.bz-treasure-btn { box-shadow: 0 0 0 2px rgba(255,215,0,.5), 2px 2px 0 #0d0221; }
.bz-btn-island { background: linear-gradient(135deg, #ffd700, #ff9e00); color: #2a1500; }

.bz-treasure { position: fixed; inset: 0; z-index: 9600; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(9,2,24,.92); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-treasure[hidden] { display: none; }
.bz-tr-box { width: min(96vw, 640px); height: min(94vh, 820px); display: flex; flex-direction: column; background: var(--bg-2); border: 4px solid #ffd700; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: cabPop .3s cubic-bezier(.34,1.56,.64,1); }
.bz-tr-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: #0d0221; border-bottom: 3px solid #4a3606; }
.bz-tr-title { font-family: var(--funk); font-size: 1.12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ffd700; }
.bz-tr-loot { margin-left: auto; font-family: var(--heavy); font-size: 1.05rem; color: #fff; white-space: nowrap; }
.bz-tr-loot b { color: #ffd700; font-variant-numeric: tabular-nums; }
.bz-tr-sub { display: flex; gap: .9rem; flex-wrap: wrap; padding: .45rem .8rem; background: #14100a; border-bottom: 2px solid #2a124f; }
.tr-stat { font-family: var(--marker); font-size: .74rem; color: var(--ink-dim); }
.tr-stat b { color: var(--cyan); font-variant-numeric: tabular-nums; }

.bz-tr-ctrl { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .55rem .8rem; background: #0d0221; border-bottom: 3px solid #2a124f; }
.tr-bulk { display: flex; gap: 3px; background: #1a0a30; border-radius: 10px; padding: 3px; }
.tr-bulk button { font-family: var(--heavy); font-size: .72rem; color: var(--ink-dim); background: none; border: none; padding: .35em .55em; border-radius: 8px; }
.tr-bulk button.is-active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.tr-boost, .tr-cashout { font-family: var(--heavy); font-size: .74rem; border: 3px solid #0d0221; border-radius: 10px; padding: .45em .7em; box-shadow: 2px 2px 0 #0d0221; white-space: nowrap; }
.tr-boost { background: linear-gradient(135deg, var(--yellow), var(--orange)); color: #2a1500; }
.tr-boost b { font-variant-numeric: tabular-nums; }
.tr-boost:disabled { opacity: .5; }
.tr-cashout { margin-left: auto; background: var(--panel); color: var(--ink-dim); }
.tr-cashout.ready { background: linear-gradient(135deg, #ff7ae0, #9b5cff); color: #fff; animation: claimGlow 1.4s ease-in-out infinite; }

.bz-tr-body { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: .5rem; padding: .7rem; }
.tr-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; background: var(--panel); border: 3px solid #0d0221; border-radius: 13px; padding: .5rem .6rem; box-shadow: 3px 3px 0 #0d0221; opacity: .5; }
.tr-row.owned { opacity: 1; border-color: #4a3606; }
.tr-ic { position: relative; width: 56px; height: 56px; font-size: 2rem; display: grid; place-items: center; background: #0d0221; border: 2px solid #2a124f; border-radius: 12px; cursor: pointer; overflow: hidden; padding: 0; }
.tr-ic:active { transform: scale(.93); }
.tr-prog { position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: rgba(0,0,0,.5); }
.tr-prog > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lime), var(--cyan)); }
.tr-badge { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 3px; font-family: var(--heavy); font-size: .6rem; color: #0d0221; background: var(--yellow); border-radius: 9px; display: grid; place-items: center; }
.tr-mid { min-width: 0; }
.tr-top { display: flex; align-items: baseline; gap: .4rem; }
.tr-name { font-family: var(--heavy); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-ms-n { font-size: .6rem; color: var(--ink-dim); white-space: nowrap; }
.tr-rev { font-size: .72rem; color: var(--lime); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-rev .tr-t { color: var(--ink-dim); margin-left: .3em; }
.tr-bar { height: 6px; margin-top: .3rem; border-radius: 999px; background: #0d0221; overflow: hidden; }
.tr-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.tr-actions { display: flex; flex-direction: column; gap: .3rem; align-items: stretch; }
.tr-buy, .tr-mgr { font-family: var(--heavy); border: 3px solid #0d0221; border-radius: 9px; box-shadow: 2px 2px 0 #0d0221; white-space: nowrap; }
.tr-buy { font-size: .72rem; background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; padding: .35em .6em; display: flex; flex-direction: column; line-height: 1.15; min-width: 80px; }
.tr-buy small { font-size: .58rem; opacity: .82; }
.tr-buy:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 #0d0221; }
.tr-mgr { font-size: .66rem; background: var(--panel-2); color: var(--ink); padding: .3em .5em; }
.tr-buy:disabled, .tr-mgr:disabled { opacity: .42; cursor: not-allowed; }
.tr-auto { font-family: var(--heavy); font-size: .6rem; color: var(--cyan); text-align: center; padding: .25em; }
.bz-tr-foot { margin: 0; padding: .5rem .8rem; font-size: .68rem; color: var(--ink-dim); text-align: center; background: #0d0221; border-top: 3px solid #4a3606; }

/* rush button (in the sub bar) */
.tr-rush { margin-left: auto; font-family: var(--heavy); font-size: .72rem; border: 3px solid #0d0221; border-radius: 999px; padding: .3em .7em; box-shadow: 2px 2px 0 #0d0221; white-space: nowrap; background: linear-gradient(135deg, var(--cyan), var(--lime)); color: #04220f; }
.tr-rush.on { background: linear-gradient(135deg, #ff7a00, #ff2e6a); color: #fff; animation: rushPulse .6s ease-in-out infinite; }
.tr-rush.cd { background: var(--panel); color: var(--ink-dim); }
.tr-rush:disabled { cursor: default; }
@keyframes rushPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* tabs */
.bz-tr-tabs { display: flex; gap: .4rem; padding: .5rem .8rem 0; background: #0d0221; }
.bz-tr-tabs button { flex: 1; font-family: var(--heavy); font-size: .76rem; color: var(--ink-dim); background: var(--panel); border: 3px solid #0d0221; border-bottom: none; padding: .55em .3em; border-radius: 11px 11px 0 0; box-shadow: 2px -1px 0 #0d0221; white-space: nowrap; }
.bz-tr-tabs button.is-active { background: linear-gradient(135deg, #ffd700, #ff9e00); color: #2a1500; }
.bz-tr-ctrl.hide-bulk .tr-bulk { display: none; }

/* upgrade & angel cards */
.tr-hint { margin: 0 0 .2rem; font-size: .72rem; color: var(--ink-dim); text-align: center; }
.tr-hint b { color: var(--cyan); }
.tr-empty { margin: auto; text-align: center; color: var(--ink-dim); font-family: var(--heavy); }
.tr-up { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; background: var(--panel); border: 3px solid #0d0221; border-radius: 13px; padding: .5rem .65rem; box-shadow: 3px 3px 0 #0d0221; }
.tr-up.rdy { border-color: #ffd700; }
.tr-up.ang.rdy { border-color: #ff7ae0; }
.tr-up-ic { font-size: 1.8rem; width: 46px; height: 46px; display: grid; place-items: center; background: #0d0221; border-radius: 11px; }
.tr-up-mid { min-width: 0; }
.tr-up-mid b { font-family: var(--heavy); font-size: .82rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-up-mid small { font-size: .7rem; color: var(--ink-dim); }
.tr-lv { font-family: var(--body); font-size: .64rem; color: var(--cyan); margin-left: .3em; }
.tr-up-buy { font-family: var(--heavy); font-size: .74rem; border: 3px solid #0d0221; border-radius: 10px; padding: .5em .7em; box-shadow: 3px 3px 0 #0d0221; white-space: nowrap; background: linear-gradient(135deg, var(--yellow), var(--orange)); color: #2a1500; }
.tr-up-buy.ang { background: linear-gradient(135deg, #ff7ae0, #9b5cff); color: #fff; }
.tr-up-buy:disabled { opacity: .45; cursor: not-allowed; }

/* frenzy glow on the whole box */
.bz-tr-box.frenzy { border-color: #ff7a00; box-shadow: 0 0 0 3px rgba(255,122,0,.5), 0 0 40px rgba(255,122,0,.55), 0 20px 60px rgba(0,0,0,.6); animation: frenzyGlow 1s ease-in-out infinite; }
@keyframes frenzyGlow { 0%, 100% { box-shadow: 0 0 0 3px rgba(255,122,0,.5), 0 0 36px rgba(255,122,0,.5), 0 20px 60px rgba(0,0,0,.6); } 50% { box-shadow: 0 0 0 3px rgba(255,46,106,.6), 0 0 56px rgba(255,46,106,.65), 0 20px 60px rgba(0,0,0,.6); } }

/* golden chest — drifts across the whole site, tap for a bonus */
.bz-chest { position: fixed; left: -80px; z-index: 9500; width: 56px; height: 56px; font-size: 2.6rem; line-height: 1; display: grid; place-items: center; background: none; border: none; cursor: pointer; filter: drop-shadow(0 0 12px #ffd700) drop-shadow(0 4px 8px rgba(0,0,0,.5)); animation: chestDrift 9s linear forwards; }
.bz-chest:hover { transform: scale(1.15); }
.bz-chest.grab { animation: chestGrab .3s ease forwards; }
@keyframes chestDrift { 0% { left: -80px; transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-22px) rotate(8deg); } 100% { left: 104vw; transform: translateY(0) rotate(-8deg); } }
@keyframes chestGrab { 0% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(2) translateY(-30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bz-chest { animation-duration: 16s; } }

@media (max-width: 600px) {
  .bz-treasure { padding: 0; }
  .bz-tr-box { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border-width: 0; }
  .bz-tr-bar { padding: calc(.5rem + env(safe-area-inset-top, 0px)) .7rem .5rem; }
  .bz-tr-title { font-size: 1rem; }
  .bz-tr-body { padding: .6rem calc(.6rem + env(safe-area-inset-bottom, 0px)); }
  .tr-ic { width: 50px; height: 50px; font-size: 1.7rem; }
  .tr-buy { min-width: 72px; }
  .bz-tr-sub { gap: .5rem; }
}

/* Treasure settings / save panel */
.bz-trset { position: fixed; inset: 0; z-index: 9650; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(9,2,24,.92); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-trset[hidden] { display: none; }
.bz-trset-box { width: min(94vw, 480px); max-height: 92vh; display: flex; flex-direction: column; background: var(--bg-2); border: 4px solid #ffd700; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: cabPop .3s cubic-bezier(.34,1.56,.64,1); }
.bz-trset-bar { display: flex; align-items: center; padding: .6rem .8rem; background: #0d0221; border-bottom: 3px solid #4a3606; }
.bz-trset-bar span { flex: 1; font-family: var(--funk); font-size: 1.05rem; color: #ffd700; }
.bz-trset-body { padding: .9rem; overflow: auto; }
.trs-h { margin: .9rem 0 .4rem; font-family: var(--heavy); font-size: .82rem; color: var(--cyan); }
.trs-h:first-child { margin-top: 0; }
.trs-stats { display: grid; gap: .35rem; }
.trs-stat { display: flex; justify-content: space-between; gap: .8rem; font-size: .82rem; background: var(--panel); border: 2px solid #0d0221; border-radius: 9px; padding: .4rem .6rem; }
.trs-stat b { color: var(--lime); font-variant-numeric: tabular-nums; }
.trs-seg { display: flex; gap: 4px; background: #1a0a30; border-radius: 10px; padding: 4px; }
.trs-seg button { flex: 1; font-family: var(--heavy); font-size: .74rem; color: var(--ink-dim); background: none; border: none; padding: .5em; border-radius: 8px; }
.trs-seg button.is-active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.trs-note { margin: .4rem 0; font-size: .72rem; color: var(--ink-dim); line-height: 1.5; }
.trs-area { width: 100%; box-sizing: border-box; height: 70px; resize: vertical; font-family: monospace; font-size: .7rem; color: var(--ink); background: #0d0221; border: 2px solid #2a124f; border-radius: 10px; padding: .5rem; }
.trs-row { display: flex; gap: .5rem; margin: .5rem 0; }
.trs-btn { flex: 1; font-family: var(--heavy); font-size: .78rem; border: 3px solid #0d0221; border-radius: 10px; padding: .6em; box-shadow: 2px 2px 0 #0d0221; }
.trs-btn.export { background: linear-gradient(135deg, var(--cyan), #0090b0); color: #042028; }
.trs-btn.import { background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; }
.trs-btn.danger { width: 100%; background: linear-gradient(135deg, #ff4d6d, #b00020); color: #fff; margin-top: .2rem; }

/* Treasure welcome-back / offline modal */
.bz-tro { position: fixed; inset: 0; z-index: 9690; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(9,2,24,.9); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-tro[hidden] { display: none; }
.bz-tro-box { width: min(92vw, 400px); text-align: center; background: var(--bg-2); border: 4px solid #ffd700; border-radius: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.6); padding: 1.6rem 1.3rem; animation: cabPop .35s cubic-bezier(.34,1.56,.64,1); }
.bz-tro-emoji { font-size: 3.4rem; animation: crateBob 2.4s ease-in-out infinite; }
.bz-tro-box h2 { font-family: var(--funk); font-size: 1.9rem; margin: .2rem 0 .4rem; color: #ffd700; }
.bz-tro-box p { color: var(--ink-dim); margin: 0 0 1.1rem; }
.tro-amt { display: block; margin-top: .5rem; font-family: var(--heavy); font-size: 1.7rem; color: var(--lime); }
#troClose { width: 100%; }

/* =====================================================================
   BONZUMA DAILY — daily challenge banner + share card
   ===================================================================== */
.bz-daily-ch { position: relative; max-width: min(var(--maxw), calc(100% - 1.6rem)); margin: 1.3rem auto; display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center; justify-content: space-between; padding: clamp(1rem,3vw,1.5rem) clamp(1.1rem,3.5vw,1.8rem); border: 3px solid #0d0221; border-radius: 22px; background: linear-gradient(120deg, rgba(255,46,147,.20), rgba(0,240,255,.16)), var(--panel); box-shadow: 6px 6px 0 #0d0221; overflow: hidden; }
.dch-glow { position: absolute; inset: -40% -10%; background: radial-gradient(circle at 20% 30%, rgba(255,46,147,.35), transparent 45%), radial-gradient(circle at 80% 70%, rgba(0,240,255,.3), transparent 45%); filter: blur(22px); animation: float1 14s ease-in-out infinite; pointer-events: none; z-index: 0; }
.bz-daily-ch > *:not(.dch-glow) { position: relative; z-index: 1; }
.bz-daily-ch.is-done { border-color: var(--lime); }
.bz-daily-ch.pulse { animation: dchPulse 1.1s ease 2; }
@keyframes dchPulse { 0%, 100% { box-shadow: 6px 6px 0 #0d0221; } 50% { box-shadow: 6px 6px 0 #0d0221, 0 0 32px rgba(255,46,147,.7); } }
.dch-left { min-width: 0; flex: 1 1 280px; }
.dch-tag { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--heavy); font-size: .8rem; letter-spacing: .04em; color: var(--cyan); }
.dch-tag #dchNum { color: var(--ink-dim); }
.dch-badge { font-size: .64rem; color: #06210f; background: var(--lime); padding: .15em .5em; border-radius: 999px; }
.dch-game { display: flex; align-items: center; gap: .9rem; margin-top: .55rem; }
.dch-emoji { font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.dch-name { font-family: var(--funk); font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1; }
.dch-sub { font-size: .8rem; color: var(--ink-dim); margin-top: .25rem; max-width: 46ch; }
.dch-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.dch-stats { display: flex; gap: .7rem; }
.dch-stat { text-align: center; background: #0d0221; border: 2px solid #2a124f; border-radius: 12px; padding: .5rem .8rem; min-width: 62px; }
.dch-stat b { display: block; font-family: var(--heavy); font-size: 1.3rem; color: var(--lime); font-variant-numeric: tabular-nums; }
.dch-stat small { font-size: .6rem; color: var(--ink-dim); }
.dch-btns { display: flex; flex-direction: column; gap: .5rem; }
.dch-btns .bz-btn { padding: .6em 1.1em; font-size: .9rem; }

.bz-dres { position: fixed; inset: 0; z-index: 9700; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(9,2,24,.9); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-dres[hidden] { display: none; }
.bz-dres-box { width: min(94vw, 420px); text-align: center; background: var(--bg-2); border: 4px solid var(--pink); border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.6); padding: 1.5rem 1.3rem; animation: cabPop .35s cubic-bezier(.34,1.56,.64,1); }
.dres-emoji { font-size: 3.2rem; }
.dres-title { font-family: var(--funk); font-size: 2rem; margin: .1rem 0 .2rem; color: var(--pink); }
.dres-sub { color: var(--ink-dim); font-size: .84rem; margin: 0 0 1rem; }
.dres-card { text-align: left; white-space: pre-wrap; word-break: break-word; font-family: var(--body); font-size: .82rem; line-height: 1.55; color: var(--ink); background: #0d0221; border: 2px solid #2a124f; border-radius: 12px; padding: .8rem; margin: 0 0 1rem; }
.dres-btns { display: flex; gap: .6rem; }
.dres-btns .bz-btn { flex: 1; }

@media (max-width: 640px) {
  .bz-daily-ch { flex-direction: column; align-items: stretch; }
  .dch-right { justify-content: space-between; }
  .dch-btns { flex-direction: row; flex: 1; }
  .dch-btns .bz-btn { flex: 1; }
}

/* =====================================================================
   BONZUMA COMPETE — duel/challenge banner + leaderboard
   ===================================================================== */
.bz-cab-duel { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; padding: .45rem .7rem; font-family: var(--heavy); font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple)); border-bottom: 3px solid #0d0221; }
.bz-cab-duel[hidden] { display: none; }
.bz-cab-duel b { color: var(--yellow); }
.bz-cab-duel.won { background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; animation: dotPulse 1s ease-in-out infinite; }
.bz-cab-duel.won b { color: #06210f; }
.cab-duel-back { font-family: var(--heavy); font-size: .72rem; border: 2px solid #0d0221; background: #fff; color: #0d0221; padding: .3em .6em; border-radius: 8px; box-shadow: 2px 2px 0 #0d0221; }

.bz-lb { position: fixed; inset: 0; z-index: 9620; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(9,2,24,.9); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.bz-lb[hidden] { display: none; }
.bz-lb-box { width: min(96vw, 460px); max-height: 92vh; display: flex; flex-direction: column; background: var(--bg-2); border: 4px solid var(--cyan); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: cabPop .3s cubic-bezier(.34,1.56,.64,1); }
.bz-lb-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: #0d0221; border-bottom: 3px solid #2a124f; }
.bz-lb-title { font-family: var(--funk); font-size: 1.12rem; color: var(--cyan); white-space: nowrap; }
.bz-lb-pick { flex: 1; min-width: 0; font-family: var(--body); font-weight: 700; font-size: .82rem; color: var(--ink); background: var(--panel); border: 2px solid #2a124f; border-radius: 9px; padding: .4em .5em; }
.bz-lb-you { margin: 0; padding: .55rem .8rem; font-size: .82rem; text-align: center; color: var(--ink-dim); background: #14092e; border-bottom: 2px solid #2a124f; }
.bz-lb-you b { color: var(--lime); }
.bz-lb-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: .4rem; padding: .8rem; }
.lb-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: .6rem; background: var(--panel); border: 3px solid #0d0221; border-radius: 11px; padding: .55rem .7rem; box-shadow: 3px 3px 0 #0d0221; }
.lb-row.you { border-color: var(--lime); background: linear-gradient(135deg, rgba(198,255,0,.14), var(--panel)); }
.lb-row.first .lb-rank { font-size: 1.2rem; }
.lb-rank { font-family: var(--heavy); font-size: .9rem; color: var(--yellow); text-align: center; }
.lb-name { font-family: var(--heavy); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row.you .lb-name { color: var(--lime); }
.lb-score { font-family: var(--heavy); font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.bz-lb-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; justify-content: center; padding: .7rem .8rem; background: #0d0221; border-top: 3px solid #2a124f; }
.bz-lb-foot .bz-btn { padding: .55em 1em; font-size: .85rem; }
.bz-lb-note { font-size: .68rem; color: var(--ink-dim); }

@media (max-width: 600px) {
  .bz-lb { padding: 0; }
  .bz-lb-box { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border-width: 0; }
  .bz-lb-bar { padding: calc(.5rem + env(safe-area-inset-top, 0px)) .7rem .5rem; }
}

/* =====================================================================
   ARCADE BROWSE — category rows (carousels) by default + focused grid
   ===================================================================== */
.bz-arcade-grid.is-rows { display: block; }
.bz-cat-row { margin-bottom: 1.7rem; }
.bz-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; }
.bz-cat-title { font-family: var(--display); font-size: clamp(1.25rem, 3.6vw, 1.7rem); letter-spacing: .02em; margin: 0; }
.bz-cat-n { font-family: var(--body); font-weight: 700; font-size: .66rem; color: var(--ink-dim); background: var(--panel); border: 2px solid #0d0221; border-radius: 999px; padding: .12em .5em; vertical-align: middle; }
.bz-cat-all { font-family: var(--heavy); font-size: .76rem; color: var(--cyan); background: none; border: none; white-space: nowrap; cursor: pointer; }
.bz-cat-all:hover { text-decoration: underline; }
.bz-cat-stripwrap { position: relative; }
.bz-cat-strip { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .35rem .15rem 1rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.bz-cat-strip::-webkit-scrollbar { display: none; }
.is-rows .bz-game-card { flex: 0 0 auto; width: clamp(200px, 58vw, 224px); scroll-snap-align: start; }
.bz-strip-arrow { position: absolute; top: 50%; transform: translateY(-62%); z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #0d0221; background: var(--panel); color: var(--ink); font-size: 1.4rem; line-height: 1; display: grid; place-items: center; box-shadow: 3px 3px 0 #0d0221; opacity: 0; transition: opacity .15s; cursor: pointer; }
.bz-cat-stripwrap:hover .bz-strip-arrow { opacity: .96; }
.bz-strip-arrow.left { left: -6px; } .bz-strip-arrow.right { right: -6px; }
.bz-strip-arrow:hover { transform: translateY(-62%) scale(1.1); }
.bz-strip-arrow:active { transform: translateY(-62%) scale(.94); }
@media (hover: none), (pointer: coarse) { .bz-strip-arrow { display: none; } }
.bz-grid-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 .2rem .3rem; font-family: var(--heavy); font-size: .92rem; color: var(--ink-dim); }
.bz-grid-head b { color: var(--lime); }
.bz-grid-back { font-family: var(--heavy); font-size: .78rem; color: var(--cyan); background: none; border: none; cursor: pointer; white-space: nowrap; }
.bz-grid-back:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .is-rows .bz-game-card { width: 150px; }
  .bz-cat-strip { gap: .7rem; }
  .bz-cat-row { margin-bottom: 1.2rem; }
}

/* =====================================================================
   PRODUCTION POLISH — skip link, no-JS notice, reduced motion
   ===================================================================== */
.bz-skip { position: fixed; top: -60px; left: 10px; z-index: 10000; background: var(--lime); color: #06210f; font-family: var(--heavy); font-size: .9rem; padding: .6em 1.1em; border-radius: 0 0 12px 12px; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.4); transition: top .16s ease; }
.bz-skip:focus { top: 0; outline: 3px solid var(--cyan); outline-offset: 2px; }

.bz-noscript { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; text-align: center; padding: 2rem; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1.15rem; line-height: 1.6; }
.bz-noscript b { color: var(--pink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .bz-parade, .bz-ticker-track, .blob, .dch-glow { animation: none !important; }
}

/* =====================================================================
   ARCADE RUN — session momentum (run chip, next button, run strip)
   ===================================================================== */
.bz-run-chip { display: inline-flex; align-items: center; gap: .25rem; font-family: var(--heavy); font-size: .82rem; color: #fff; background: linear-gradient(135deg, #ff7a00, #ff2e6a); border: 3px solid #0d0221; border-radius: 999px; padding: .28em .6em; box-shadow: 2px 2px 0 #0d0221; animation: runPop .4s cubic-bezier(.34,1.56,.64,1); }
.bz-run-chip[hidden] { display: none; }
.bz-run-chip b { color: var(--yellow); font-variant-numeric: tabular-nums; }
@keyframes runPop { 0% { transform: scale(.5); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.bz-cabinet-btn.is-next { background: linear-gradient(135deg, var(--lime), #00b36b); color: #06210f; }
.bz-cab-run { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .4rem .7rem; font-family: var(--heavy); font-size: .78rem; color: #fff; background: linear-gradient(135deg, #ff7a00, #ff2e6a); border-bottom: 3px solid #0d0221; }
.bz-cab-run[hidden] { display: none; }
.bz-cab-run b { color: var(--yellow); font-size: 1.02rem; margin: 0 .12em; }
.run-goal { opacity: .95; }
