/* BooZoo. A tangerine field, deep sea-navy ink, cream paper. Photos are cut-outs
 * with a white edge, like the share card's cheetah. Everything fills the window. */
@font-face { font-family: 'Space Grotesk'; src: url(/fonts/space-grotesk-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(/fonts/space-grotesk-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(/fonts/space-grotesk-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ground: #f6720d; --ground-deep: #c9500a; --navy: #0d2b45; --cream: #fff4dc;
  --right: #1f9d57; --wrong: #d7263d;
  --panel: #fff4dc; --panel-2: rgba(13,43,69,.08);
  --ink: #0d2b45; --ink-dim: rgba(13,43,69,.72); --rule: #0d2b45; --rule-soft: rgba(13,43,69,.2);
  --accent: #0d2b45; --accent-ink: #fff4dc; --good: #1f9d57; --warn: #d9a13b;
  --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --ui: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px; --rule-w: 2px; --shadow-hard: 0 5px 0 rgba(13,43,69,.9);
  --play-max: 100%;
  color-scheme: light;
}
#stage { padding: 0; }
#stage > * { max-width: none; }
button { font-family: inherit; }
kbd { font-family: var(--ui); }

/* ---- buttons: level navy slabs, cream words -------------------------------- */
.bz-btn, .bz-next, .btn {
  display: block; width: 100%; min-height: 54px; padding: 12px 22px; cursor: pointer;
  font: 700 19px/1.1 var(--display); letter-spacing: .04em; text-transform: uppercase;
  color: var(--cream); background: var(--navy);
  border: 0; border-radius: 12px; box-shadow: 0 5px 0 #061726;
  transition: transform .1s, box-shadow .1s;
}
.bz-btn:active, .bz-next:active, .btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #061726; }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.bz-link, .textlink {
  background: none; border: 0; padding: 10px 4px; min-height: 44px; cursor: pointer;
  font: 700 14px/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; color: var(--navy);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.bz-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
.gad-shelf:empty, .gad-end:empty { display: none; }

/* ---- the ten marks ----------------------------------------------------------- */
.bz-pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: 100%; }
.bz-pips i {
  font: 700 12px/1 var(--ui); font-style: normal; text-align: center; padding: 6px 0; border-radius: 6px;
  color: rgba(13,43,69,.55); background: rgba(13,43,69,.16);
}
.bz-pips i.hit { background: var(--right); color: #fff; }
.bz-pips i.bad { background: var(--wrong); color: #fff; }
.bz-pips i.now { background: var(--cream); color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }

/* ---- play ----------------------------------------------------------------------
   Four rows: marks, photo, question, answer box. The photo takes what is left;
   the question and the box are fixed heights, so answering never moves anything. */
.bz-play {
  --box-h: 236px; --q-h: 82px;
  height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) var(--q-h) var(--box-h); gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  margin: 0 auto; width: 100%;
}
#stage > .bz-play { max-width: 620px; }
.bz-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.bz-count { font: 700 13px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--navy); white-space: nowrap; min-width: 62px; text-align: right; }
.bz-shot { min-height: 0; display: grid; place-items: center; padding: 4px 6px 0; }
.bz-photo { margin: 0; height: 100%; max-width: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; }
.bz-photo img {
  display: block; min-height: 0; height: 100%; width: auto; max-width: 100%; object-fit: cover;
  border: 5px solid #fff; border-radius: 4px; background: var(--ground-deep);
  box-shadow: 0 6px 0 rgba(13,43,69,.35); transform: rotate(var(--tilt, -1.5deg));
  animation: bz-drop .35s cubic-bezier(.3,1.5,.5,1) both;
}
@keyframes bz-drop { from { transform: translateY(-14px) rotate(calc(var(--tilt) * -3)) scale(.94); opacity: 0; } }
.bz-cred {
  font: 500 10px/1.2 var(--ui); color: var(--navy); opacity: .8; padding: 9px 4px 0; max-width: 100%;
  text-align: center; text-underline-offset: 2px;
}
.bz-q {
  margin: 0; display: grid; place-items: center; text-align: center; text-wrap: balance;
  font: 700 clamp(16px, 4.6cqw, 22px)/1.14 var(--display); color: var(--navy);
}
/* No picture: the question takes the room the picture would have had. */
.bz-play[data-photo="no"] { grid-template-rows: auto 0 minmax(0, 1fr) var(--box-h); }
.bz-play[data-photo="no"] .bz-q { font-size: clamp(26px, 9cqw, 46px); color: var(--cream); text-shadow: 0 3px 0 var(--navy); padding: 0 6px; -webkit-text-stroke: 0; }
.bz-play[data-photo="no"] .bz-shot { display: none; }
.bz-play[data-photo="no"] { grid-template-rows: auto minmax(0, 1fr) var(--box-h); }

.bz-box { position: relative; min-height: 0; }
.bz-answers { height: 100%; display: grid; grid-template-rows: repeat(4, 1fr); gap: 8px; }
.bz-answers[hidden], .bz-fact[hidden] { display: none; }
.bz-a {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 44px; padding: 4px 14px; cursor: pointer;
  font: 700 clamp(15px, 4.5cqw, 18px)/1.1 var(--ui); text-align: left; color: var(--navy);
  background: var(--cream); border: 0; border-radius: 12px; box-shadow: 0 4px 0 rgba(13,43,69,.85);
  transition: transform .08s, box-shadow .08s, background .12s;
}
.bz-a:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(13,43,69,.85); }
.bz-a kbd, .bz-next kbd { display: none; }
.bz-a.right { background: var(--right); color: #fff; animation: bz-yes .4s cubic-bezier(.3,1.6,.5,1); }
.bz-a.wrong { background: var(--wrong); color: #fff; animation: bz-no .4s; }
.bz-a.dim { opacity: .45; }
@keyframes bz-yes { 40% { transform: scale(1.05); } }
@keyframes bz-no { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.bz-play.flash-wrong .bz-photo img { filter: saturate(.3); transition: filter .3s; }

.bz-fact {
  height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 5px;
  background: var(--cream); border-radius: 12px; padding: 9px 12px 11px; box-shadow: 0 4px 0 rgba(13,43,69,.85);
}
.bz-fact.in { animation: bz-turn .28s cubic-bezier(.3,1.3,.5,1); }
@keyframes bz-turn { from { transform: perspective(700px) rotateX(-70deg); opacity: 0; } }
.bz-verdict { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; font: 700 15px/1.15 var(--ui); color: var(--navy); }
.bz-verdict b { font: 700 13px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: #fff; padding: 5px 9px; border-radius: 6px; background: var(--right); }
.bz-fact.wrong .bz-verdict b { background: var(--wrong); }
.bz-facttext { margin: 0; font: 500 clamp(13px, 3.9cqw, 16px)/1.22 var(--ui); color: var(--navy); align-self: center; }
.bz-src { font: 700 12px/1.2 var(--ui); color: var(--navy); text-underline-offset: 3px; padding: 2px 0; justify-self: start; }
.bz-next { min-height: 46px; padding: 8px 18px; font-size: 18px; }

/* Wide and short-wide screens: photo on the left, the rest on the right. With no photo the
   question takes the photo's place, so the answer box is in the same spot either way. */
@media (min-width: 900px), (orientation: landscape) and (min-width: 620px) {
  #stage > .bz-play { max-width: 1280px; }
  .bz-play, .bz-play[data-photo="no"] {
    grid-template-columns: 53% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) var(--box-h);
    grid-template-areas: "shot top" "shot q" "shot box"; column-gap: clamp(18px, 4vw, 56px); padding-inline: clamp(16px, 4vw, 56px);
  }
  .bz-top { grid-area: top; }
  .bz-shot { grid-area: shot; padding: 8px; }
  .bz-q { grid-area: q; }
  .bz-box { grid-area: box; }
  .bz-photo { height: auto; max-height: 100%; }
  .bz-photo img { height: auto; max-height: 100%; width: auto; max-width: 100%; }
  .bz-play[data-photo="no"] .bz-q { grid-area: shot; grid-row: 1 / -1; font-size: clamp(28px, 4.6vw, 64px); }
}
@media (min-width: 900px) and (min-height: 640px) {
  .bz-play { --box-h: 300px; padding-block: 28px; row-gap: 16px; }
  .bz-play[data-photo="yes"] .bz-q { font-size: clamp(24px, 2.4vw, 36px); }
  .bz-a { font-size: 20px; padding: 6px 18px; }
  .bz-facttext { font-size: 18px; }
  .bz-verdict { font-size: 18px; }
  .bz-pips i { padding: 9px 0; font-size: 14px; }
  .bz-count { font-size: 15px; }
  .bz-cred { font-size: 12px; }
}
/* A mouse and keyboard: show the keys. */
@media (hover: hover) and (pointer: fine) {
  .bz-a kbd { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font: 700 14px/1 var(--ui); color: var(--cream); background: var(--navy); }
  .bz-a.right kbd, .bz-a.wrong kbd { background: rgba(0,0,0,.25); }
  .bz-next kbd { display: inline-block; margin-left: 10px; padding: 3px 7px; border-radius: 5px; font: 700 11px/1 var(--ui); letter-spacing: .04em; background: rgba(255,244,220,.2); vertical-align: 2px; }
  .bz-a:hover:not(:disabled) { background: #fff; transform: translateY(-1px); }
}
@media (max-height: 460px) { .bz-play { --box-h: 250px; row-gap: 6px; padding-block: 8px; } .bz-facttext { font-size: 13px; } .bz-play[data-photo="yes"] .bz-q { font-size: 15px; } .bz-answers { gap: 6px; } .bz-next { min-height: 44px; } }

/* ---- home: a moving wall of the animals, the door across the foot ---------------- */
.bz-home { position: relative; height: 100%; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.bz-wall { position: absolute; inset: -6% -10%; display: grid; grid-auto-rows: 1fr; gap: 14px; transform: rotate(-5deg); }
.bz-row { display: flex; gap: 14px; width: max-content; min-height: 0; animation: bz-slide var(--secs, 50s) linear infinite; will-change: transform; }
.bz-row.back { animation-direction: reverse; }
@keyframes bz-slide { to { transform: translateX(-50%); } }
.bz-tile { height: 100%; aspect-ratio: 4 / 3; width: auto; object-fit: cover; border: 5px solid #fff; border-radius: 4px; background: var(--ground-deep); box-shadow: 0 5px 0 rgba(13,43,69,.3); transform: rotate(var(--tilt, 0deg)); }
.bz-door {
  grid-row: 2; position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; text-align: center;
  background: var(--ground); padding: 0 18px max(14px, env(safe-area-inset-bottom));
  box-shadow: 0 -6px 0 var(--navy);
}
.bz-wordwrap { margin: -11vw 0 0; width: min(92vw, 720px); filter: drop-shadow(0 6px 0 var(--navy)) drop-shadow(0 0 1px var(--navy)); animation: bz-bob 3.2s ease-in-out infinite; }
@media (min-width: 720px) { .bz-wordwrap { margin-top: -80px; } }
.bz-word { display: block; width: 100%; height: auto; }
@keyframes bz-bob { 50% { transform: translateY(-5px) rotate(-.6deg); } }
.bz-day { font: 700 14px/1.2 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.bz-line { font: 700 clamp(17px, 5cqw, 24px)/1.15 var(--display); color: var(--navy); text-wrap: balance; }
.bz-playbtn { width: min(100%, 420px); min-height: 64px; font-size: 26px; animation: bz-pulse 1.6s ease-in-out infinite; }
@keyframes bz-pulse { 50% { box-shadow: 0 5px 0 #061726, 0 0 0 8px rgba(255,244,220,.5); } }
.bz-streak { font: 700 14px/1.2 var(--ui); color: var(--navy); }
@media (min-width: 900px) {
  .bz-door { padding-bottom: 22px; gap: 12px; }
  .bz-wall { gap: 20px; } .bz-row { gap: 20px; }
}
@media (max-height: 460px) {
  .bz-door { grid-template-columns: 1fr auto; text-align: left; justify-items: start; column-gap: 20px; gap: 4px; padding-bottom: 8px; }
  .bz-wordwrap { width: min(46vw, 340px); margin-top: -34px; grid-row: 1 / span 2; }
  .bz-day { grid-column: 2; align-self: end; } .bz-line { display: none; }
  .bz-playbtn { grid-column: 2; min-height: 52px; min-width: 220px; }
  .bz-links { grid-column: 1 / -1; }
}

/* ---- result, board, record ---------------------------------------------------- */
.bz-result, .bz-page { position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; display: grid; padding: max(18px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.bz-rescol, .bz-pagecol { width: 100%; max-width: 620px; margin: auto; display: grid; gap: 10px; justify-items: center; text-align: center; }
.bz-pagecol { margin-top: 0; }
.bz-kicker, .bz-sub { font: 700 13px/1.2 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.bz-sub { margin-top: 8px; }
.bz-head { margin: 0; font: 700 clamp(40px, 14cqw, 104px)/1 var(--display); letter-spacing: -.01em; color: var(--cream); text-shadow: 0 5px 0 var(--navy); text-wrap: balance; animation: bz-slam .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes bz-slam { from { transform: scale(1.6) rotate(-4deg); opacity: 0; } }
.bz-title { margin: 0; font: 700 clamp(34px, 10cqw, 64px)/1.1 var(--display); color: var(--cream); text-shadow: 0 4px 0 var(--navy); }
.bz-trail { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 6px; padding: 4px 2px; }
.bz-t { position: relative; aspect-ratio: 4 / 3; border-radius: 4px; border: 4px solid #fff; background: rgba(13,43,69,.2); overflow: hidden; transform: rotate(calc((var(--i) - 4.5) * .7deg)); animation: bz-deal .4s calc(var(--i) * 60ms) cubic-bezier(.3,1.5,.5,1) both; }
@keyframes bz-deal { from { transform: translateY(24px) scale(.6); opacity: 0; } }
.bz-t img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bz-t b { position: absolute; left: 0; bottom: 0; min-width: 20px; padding: 3px 5px; font: 700 12px/1 var(--ui); color: #fff; background: var(--right); border-radius: 0 6px 0 0; }
.bz-t.hit:not(:has(img)) { background: var(--right); }
.bz-t.bad { border-color: var(--wrong); } .bz-t.bad b { background: var(--wrong); } .bz-t.bad img { filter: saturate(.25); }
.bz-t.bad:not(:has(img)) { background: var(--wrong); }
.bz-t.wait { border-color: rgba(255,255,255,.35); background: rgba(13,43,69,.14); } .bz-t.wait b { background: none; color: rgba(13,43,69,.6); }
.bz-rank, .bz-rec, .bz-nextin, .bz-note { font: 700 14px/1.3 var(--ui); color: var(--navy); }
.bz-nextin { font-variant-numeric: tabular-nums; }
.bz-acts { width: min(100%, 420px); margin-top: 6px; }
.bz-back { width: min(100%, 420px); margin-top: 10px; }
.bz-spreadbox { width: 100%; min-height: 104px; display: grid; }
.bz-spread { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; height: 104px; align-items: end; }
.bz-col { height: 100%; display: grid; grid-template-rows: 16px minmax(0, 1fr) 22px; gap: 3px; justify-items: stretch; }
.bz-col .c { font: 700 12px/16px var(--ui); color: var(--navy); }
.bz-col i { align-self: end; height: var(--h); min-height: 3px; border-radius: 5px 5px 0 0; background: var(--navy); transform-origin: bottom; animation: bz-grow .5s cubic-bezier(.2,1.2,.4,1) both; }
.bz-col.none i { background: rgba(13,43,69,.25); }
@keyframes bz-grow { from { transform: scaleY(0); } }
.bz-col .n { font: 700 13px/22px var(--ui); color: var(--navy); border-radius: 6px; }
.bz-col.me i { background: var(--cream); box-shadow: inset 0 0 0 2px var(--navy); }
.bz-col.me .n { background: var(--cream); box-shadow: 0 0 0 2px var(--navy); }
.bz-board, .bz-days { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 5px; font-variant-numeric: tabular-nums; }
.bz-board li, .bz-days li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 50px; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--cream); color: var(--navy); font: 700 15px/1.1 var(--ui); text-align: left; }
.bz-days li { grid-template-columns: 62px minmax(0, 1fr) auto 50px; }
.bz-board li.me { box-shadow: 0 0 0 3px var(--navy); }
.bz-board li.bz-note, .bz-days li.bz-note { display: block; background: none; text-align: center; }
.bz-board .n { overflow-wrap: anywhere; }
.bz-board .r, .bz-days .w { opacity: .7; }
.bz-board .v, .bz-days .v { text-align: right; }
.mini { display: grid; grid-template-columns: repeat(10, 7px); gap: 2px; }
.mini i { height: 14px; border-radius: 2px; background: rgba(13,43,69,.16); }
.mini i.hit { background: var(--right); } .mini i.bad { background: var(--wrong); }
.bz-stats { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bz-stat { display: grid; gap: 4px; padding: 12px 4px; border-radius: 10px; background: var(--navy); color: var(--cream); }
.bz-stat b { font: 700 clamp(22px, 7cqw, 34px)/1 var(--display); }
.bz-stat span { font: 700 10px/1.1 var(--ui); letter-spacing: .04em; text-transform: uppercase; }
.bz-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bz-confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; background: var(--c); animation: bz-fall 2.4s var(--d) cubic-bezier(.2,.6,.4,1) both; }
@keyframes bz-fall { to { transform: translateY(110vh) rotate(var(--r)); } }
@media (min-width: 900px) {
  .bz-spread { height: 180px; } .bz-spreadbox { min-height: 180px; }
  .bz-rank, .bz-rec, .bz-nextin { font-size: 16px; }
}

/* ---- sheets, credits, toast ------------------------------------------------------ */
.sheet { background: rgba(13,43,69,.6); }
.sheet-body { background: var(--cream); color: var(--navy); border: 0; border-radius: 16px 16px 0 0; }
.sheet-body h2 { margin: 0 0 10px; font: 700 24px/1.1 var(--display); }
.sheet-body p { margin: 0 0 10px; font: 500 16px/1.35 var(--ui); color: var(--navy); }
.sheet-body .btn { margin-top: 12px; }
.sheet-body input { border-color: var(--navy) !important; background: #fff !important; color: var(--navy) !important; }
.credits { height: 100%; max-height: none; overflow-y: auto; padding: max(18px, env(safe-area-inset-top)) 18px 24px; max-width: 760px !important; margin: 0 auto; }
.credits .big { font: 700 clamp(34px, 10cqw, 64px)/1 var(--display); color: var(--cream); text-shadow: 0 4px 0 var(--navy); }
.credits h2 { color: var(--navy); font: 700 13px/1 var(--ui); letter-spacing: .1em; }
.credits p { font: 500 15px/1.4 var(--ui); color: var(--navy); margin: 6px 0; }
.credit-list li { border-top: 2px solid rgba(13,43,69,.2); font-weight: 500; }
.credit-list a { color: var(--navy); font-weight: 700; }
.credit-list .who, .credit-list .lic { color: var(--navy); opacity: .85; }
#toast { background: var(--navy); color: var(--cream); font-weight: 700; }
@media (max-height: 620px) and (max-width: 899px) {
  .bz-spread { height: 76px; } .bz-spreadbox { min-height: 76px; }
  .bz-rescol { gap: 7px; } .bz-sub { margin-top: 2px; }
  .bz-result .bz-btn { min-height: 46px; }
  .bz-head { font-size: clamp(34px, 12cqw, 60px); }
  .bz-trail { gap: 5px; }
}
#toast { max-width: calc(100vw - 32px); width: max-content; text-align: center; border-radius: 12px; bottom: auto; top: max(14px, env(safe-area-inset-top)); transform: translate(-50%, -14px); }
#toast.on { transform: translate(-50%, 0); }
