/* ============ Elybean · Bean Bounce (/bounce) ============ */
/* Full-screen like the Playground (reuses its .pg-icon, .pg-help dialogs and .pg-loading from play.css). */
html:has(body[data-page="bounce"]), body[data-page="bounce"] { height: 100%; overflow: hidden; overscroll-behavior: none; }
body[data-page="bounce"] .site-header { position: fixed; left: 0; right: 0; transition: transform .35s cubic-bezier(.3,1,.4,1); }
body[data-page="bounce"] .site-header.at-top { background-color: transparent; border-bottom-color: transparent; }
/* During a run (and on the results) the navbar slides away so the climb gets the whole screen. */
html.bb-playing body[data-page="bounce"] .site-header { transform: translateY(-110%); }
.bouncemain { background: #7fd0f5; }
.bb { position: fixed; inset: 0; z-index: 1; --top: var(--header-h, 68px); }
html.bb-playing .bb { --top: 0px; }
.bb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bb .bb-tick { width: 17px; height: 17px; stroke: #fff; stroke-width: 2.6; vertical-align: -3px; margin-left: 4px; }
.bb .bb-tick circle { fill: #1d9bf0; stroke: var(--ink); stroke-width: 1.8; }
.bb .muted { color: #4d7184; }
.bb .bad { color: #c2264d; font-weight: 700; }
.bb .ok { color: #1e6b3f; }

/* ---------- stage & the framed play area ---------- */
.bb-stage {
  position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background:
    radial-gradient(60% 40% at 12% 88%, #ffffffcc 0 30%, #fff0 31%),
    radial-gradient(40% 30% at 3% 70%, #ffffffaa 0 30%, #fff0 31%),
    radial-gradient(55% 38% at 92% 92%, #ffffffcc 0 30%, #fff0 31%),
    radial-gradient(35% 26% at 99% 72%, #ffffffaa 0 30%, #fff0 31%),
    linear-gradient(#55bff0, #a8e3fb 60%, #dff6ff);
}
.bb-frame { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(#5cc4f3, #c4efff); }
.bb-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.bb-loading { background: linear-gradient(#5cc4f3, #c4efff 60%, #e9f9ff); }
/* Wider than tall: the column becomes a portrait card in the middle, with the menus beside it. */
@media (min-aspect-ratio: 4/5) {
  .bb { --fw: calc((100dvh - var(--top) - 32px) * .5625); }
  .bb-frame {
    inset: auto; top: calc(var(--top) + 16px); bottom: 16px; left: 50%; transform: translateX(-50%);
    width: var(--fw); border: 3px solid var(--ink); border-radius: 30px; box-shadow: 6px 8px 0 var(--ink);
    transition: top .35s cubic-bezier(.3,1,.4,1), width .35s cubic-bezier(.3,1,.4,1);
  }
}

/* ---------- menu ---------- */
.bb-menu { position: absolute; inset: calc(var(--top) + 16px) 22px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; pointer-events: none; z-index: 3; }
.bb-menu > * { pointer-events: auto; }
.bb-card { background: var(--cream); border: var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.bb-title-card { width: clamp(270px, calc((100vw - var(--fw, 0px)) / 2 - 50px), 380px); padding: 22px 22px 18px; text-align: center; animation: bb-in .5s cubic-bezier(.2,1.3,.4,1); }
.bb-tag { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #29627a; }
.bb-logo { margin: 4px 0 0; display: grid; line-height: .86; font-size: clamp(44px, 4.6vw, 66px); font-weight: 900; letter-spacing: -.045em; text-transform: uppercase; }
.bb-logo span { display: block; color: var(--bean); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 5px 0 var(--ink); }
.bb-logo span:first-child { transform: rotate(-3deg) translateX(-8px); }
.bb-logo span:last-child { color: var(--pink); transform: rotate(2deg) translateX(10px); }
html[data-motion="on"] .bb-logo span:last-child { animation: bb-boing 2.4s cubic-bezier(.3,1.6,.5,1) infinite; }
@keyframes bb-boing { 0%, 70%, 100% { transform: rotate(2deg) translate(10px, 0); } 78% { transform: rotate(2deg) translate(10px, -14px) scaleY(1.06); } 86% { transform: rotate(2deg) translate(10px, 2px) scaleY(.92); } }
.bb-tagline { margin: 10px 0 16px; font-size: 20px; }
.bb-modes { display: grid; gap: 10px; }
.bb-go { width: 100%; min-height: 62px; gap: 12px; }
.bb-go b { display: block; font-size: 21px; font-weight: 900; letter-spacing: -.01em; }
.bb-go small { display: block; font-size: 12px; font-weight: 700; opacity: .8; }
.bb-go span { text-align: left; }
.bb-go svg { width: 26px; height: 26px; }
.bb-go:first-child { flex-direction: column; gap: 0; min-height: 74px; }
.bb-go:first-child b { font-size: 29px; }
.bb-go:disabled { opacity: .7; cursor: progress; }
.bb-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 14px; font-weight: 700; color: #29627a; }
.bb-stats b { color: var(--ink); font-weight: 900; font-variant-numeric: tabular-nums; }
.bb-me { color: var(--ink); }
.bb-keys { margin: 10px 0 0; font-size: 12px; color: #4d7184; }
.bb-side { width: clamp(270px, calc((100vw - var(--fw, 0px)) / 2 - 50px), 360px); max-height: 100%; overflow: auto; padding: 18px 16px 16px; display: grid; gap: 12px; animation: bb-in .55s .05s cubic-bezier(.2,1.3,.4,1) backwards; }
.bb-side h2 { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.bb-side h2 small { font-size: 12px; font-weight: 700; color: #4d7184; letter-spacing: 0; }
.bb-menu-btns { position: absolute; left: 0; bottom: 0; display: flex; gap: 8px; }
@keyframes bb-in { from { transform: translateY(16px) rotate(-1deg); opacity: 0; } }

/* challenges */
.bb-ch { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bb-ch li { display: grid; grid-template-columns: 28px 1fr auto; grid-template-rows: auto auto; gap: 4px 9px; align-items: center; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; }
.bb-ch li.done { background: #d9f6c8; }
.bb-ch-dot { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--gold); font-size: 13px; font-weight: 900; }
.bb-ch li.done .bb-ch-dot { background: #6fd18b; }
.bb-ch-dot svg { width: 15px; height: 15px; stroke-width: 3; }
.bb-ch-label { font-size: 14px; font-weight: 700; line-height: 1.25; }
.bb-ch-pts { font-size: 13px; font-weight: 900; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--gold); }
.bb-ch .bb-ch-bar { grid-column: 2 / 4; }
.bb-ch-bar { display: block; height: 9px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.bb-ch-bar b { display: block; height: 100%; background: var(--pink); border-radius: 999px; transition: width .6s cubic-bezier(.3,1.3,.5,1); }
.bb-ch li.done .bb-ch-bar b { background: #6fd18b; }

/* season */
.bb-season { padding: 10px 12px 11px; border: 2px solid var(--ink); border-radius: 16px; background: #e4f6ff; display: grid; gap: 6px; }
.bb-season.s-frost { background: linear-gradient(135deg, #e9f8ff, #cfeeff); }
.bb-season.s-leaf { background: #ffe9cf; } .bb-season.s-bloom { background: #ffe3ef; } .bb-season.s-sun { background: #fff4c4; }
.bb-season-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.bb-season-top b { font-weight: 900; }
.bb-season-top span { font-weight: 700; font-variant-numeric: tabular-nums; }
.bb-season .bb-ch-bar b { background: #7cc4f0; }
.bb-season small { font: 600 13px/1.2 var(--hand); color: #29627a; }

.bb-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bb-links button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 9px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 2px 3px 0 var(--ink); font-size: 13px; font-weight: 800; transition: transform .18s cubic-bezier(.3,1.6,.5,1), box-shadow .18s; }
.bb-links button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-links button:hover { transform: translate(-1px, -2px) rotate(-2deg); box-shadow: 3px 5px 0 var(--ink); }
.bb-links button:active { transform: translate(1px, 1px) scale(.96); box-shadow: 1px 1px 0 var(--ink); }
.bb-closet { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 2px dashed var(--ink); border-radius: 16px; background: #fff9; font-size: 14px; }
.bb-closet b { display: block; font-weight: 900; }
.bb-closet small { display: block; font: 600 12px/1.2 var(--hand); color: #29627a; }
.bb-closet:hover { background: #fff; }

/* ---------- HUD (inside the frame) ---------- */
.bb-hud { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 3; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.bb-height { display: flex; align-items: baseline; gap: 4px; }
.bb-height b { font-size: 54px; font-weight: 900; line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 3px 4px 0 var(--ink); }
.bb-height span { font-size: 22px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.bb-hud-row { display: flex; gap: 8px; }
.bb-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 8px; border: var(--line); border-radius: 999px; background: var(--cream); box-shadow: 2px 3px 0 var(--ink); font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bb-pill svg { width: 20px; height: 20px; color: #e2477e; }
.bb-pill.score { background: var(--gold); padding-left: 12px; }
.bb-pill small { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.bb-frame-btns { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.bb-frame-btns .pg-icon { width: 42px; height: 42px; box-shadow: 2px 3px 0 var(--ink); }
.bb-frame-btns .pg-icon svg { width: 19px; height: 19px; }
.bb-hint { position: absolute; left: 12px; right: 12px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 3; display: flex; justify-content: space-between; pointer-events: none; animation: bb-hint 4.2s ease forwards; }
.bb-hint span { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border: var(--line); border-radius: 999px; background: #fffd; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
@keyframes bb-hint { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- dialogs ---------- */
.bb-overlay { z-index: 8; }
.bb .bb-overlay .button { margin-top: 0; }
.bb-pause { text-align: center; display: grid; gap: 10px; width: min(360px, 100%); }
.bb-pause h2 { margin: 0; font-size: 46px; }
.bb-pause p { margin: 0 0 6px; font-size: 18px; }

/* game over: head → score → leaderboard → rewards → actions */
.bb-over { width: min(440px, 100%); display: grid; gap: 10px; padding: 18px 20px 18px; }
.bb-over-head { text-align: center; }
.bb-over-head h2 { margin: 0; font-size: 40px; line-height: 1; }
.bb-over-head p { margin: 2px 0 0; font-size: 16px; }
.bb-score { padding: 12px 14px 12px; border: var(--line); border-radius: 20px; background: var(--gold); box-shadow: 3px 4px 0 var(--ink); }
.bb-score-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bb-score-top small { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.bb-score-top em { font-style: normal; padding: 3px 10px 4px; border: 2px solid var(--ink); border-radius: 999px; background: var(--pink); font-size: 13px; font-weight: 900; transform: rotate(-2deg); }
html[data-motion="on"] .bb-score-top em { animation: bb-pop .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes bb-pop { from { transform: rotate(-2deg) scale(.4); } }
.bb-score-num { display: block; font-size: 50px; font-weight: 900; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.bb-score-parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px dashed #092c4466; padding-top: 9px; }
.bb .bb-score-parts li { display: grid; grid-template-columns: 1fr; gap: 0; text-align: center; }
.bb .bb-score-parts li b { display: block; height: auto; border: 0; border-radius: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: 0; }
.bb-score-parts li + li { border-left: 2px solid #092c4426; }
.bb-score-parts b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bb-score-parts small { font-size: 11px; font-weight: 800; color: #3d4f45; letter-spacing: .04em; }
.bb-block { display: grid; gap: 6px; }
.bb-block h3 { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #29627a; }
.bb-line { margin: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; font-size: 15px; font-weight: 800; }
.bb-line > span:not(.bb-rank):not(.bb-spin) { flex: 1; min-width: 0; }
.bb-line small { display: block; font: 600 12px/1.3 var(--hand); color: #4d7184; }
.bb-line.bad, .bb-line.muted { font-weight: 600; font-size: 14px; }
.bb-rank { flex: none; min-width: 44px; height: 44px; padding: 0 6px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 14px; background: var(--bean); font-size: 17px; font-weight: 900; }
.bb-rank svg { width: 20px; height: 20px; stroke-width: 3; }
.bb-rewards { list-style: none; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 16px; background: #fff; overflow: hidden; }
.bb .bb-rewards li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: 14px; font-weight: 800; line-height: 1.25; }
.bb-rewards li + li { border-top: 2px solid #092c441a; }
.bb-rewards li > span:nth-child(2) { flex: 1; min-width: 0; }
.bb-rewards small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4d7184; }
.bb-rewards em { font-style: normal; font-weight: 900; font-size: 13px; padding: 1px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--gold); }
.bb-rewards .ico { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; }
.bb-rewards .ico svg { width: 16px; height: 16px; stroke-width: 2.6; }
.bb-rewards .ico img { width: 20px; height: 20px; object-fit: contain; }
.bb-rewards .pts { background: var(--gold); } .bb-rewards .ch { background: #6fd18b; } .bb-rewards .badge { background: #bfe6ff; } .bb-rewards .unlock { background: var(--pink); }
.bb-ask { display: grid; gap: 8px; padding: 12px; border: 2px dashed var(--ink); border-radius: 16px; background: #fff; }
.bb-ask small { color: #4d7184; font-size: 13px; }
.bb-row { display: flex; gap: 8px; }
.bb-row input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: var(--line); border-radius: 14px; font: 700 17px Rubik, system-ui, sans-serif; color: var(--ink); background: var(--cream); }
.bb-row input:focus { outline: 4px solid #e2477e55; }
.bb .bb-row .button { width: auto; flex: none; margin: 0; min-height: 48px; padding: 10px 18px; }
.bb-textbtn { justify-self: start; flex: none; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.bb-over-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.bb .bb-over-actions .button { width: auto; margin: 0; min-height: 44px; padding: 8px 14px; font-size: 15px; }
.bb .bb-over-actions .button.primary { grid-column: 1 / -1; min-height: 54px; font-size: 19px; }
.bb-over-actions svg { width: 18px; height: 18px; }
.bb-spin { flex: none; display: inline-block; width: 18px; height: 18px; border: 3px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: bb-spin .8s linear infinite; }
@keyframes bb-spin { to { transform: rotate(1turn); } }

/* panels: leaderboard, badges, nickname, help */
.bb-panel { width: min(500px, 100%); position: relative; }
.bb-panel h2 { padding-right: 52px; }
.bb-x { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; z-index: 2; }
.bb-panel .bb-season { margin-bottom: 12px; }
.bb-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.bb-tabs button { flex: 1; padding: 9px 8px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 800; font-size: 14px; }
.bb-tabs button.on { background: var(--bean); box-shadow: 2px 3px 0 var(--ink); }
.bb-board-meta { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #29627a; }
.bb-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bb .bb-panel .bb-board li { display: grid; grid-template-columns: 34px 1fr auto 70px; gap: 8px; align-items: center; padding: 7px 10px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; font-size: 15px; }
.bb-board .r { font-weight: 900; text-align: center; }
.bb-board .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-board .h { font-size: 12px; color: #4d7184; font-weight: 700; }
.bb .bb-board li b { display: block; height: auto; border: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.bb .bb-panel .bb-board .top1 { background: #ffe58f; } .bb .bb-panel .bb-board .top2 { background: #eef1f6; } .bb .bb-panel .bb-board .top3 { background: #ffd9b8; }
.bb-board .me { outline: 3px solid #e2477e; outline-offset: -1px; }
.bb-board .sep { margin-top: 8px; }
.bb-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bb .bb-panel .bb-badges li { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: start; padding: 9px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; opacity: .78; }
.bb .bb-panel .bb-badges li.have { opacity: 1; background: #fff6d6; }
.bb-badge-ico { width: 40px; height: 40px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: #e7eef3; }
.bb-badges li.have .bb-badge-ico { background: var(--gold); box-shadow: 2px 2px 0 var(--ink); }
.bb .bb-panel .bb-badge-txt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.bb .bb-badges li b { display: block; height: auto; border: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 900; line-height: 1.15; }
.bb-badge-txt small { font-size: 12px; color: #4d7184; line-height: 1.25; }
.bb .bb-badge-txt .bb-ch-bar { height: 8px; grid-column: auto; }
.bb .bb-badge-txt .bb-ch-bar b { height: 100%; background: var(--pink); border-radius: 999px; }
.bb-badge-txt em { font-style: normal; font-size: 11px; font-weight: 800; color: #1d7bc4; display: inline-flex; align-items: center; gap: 2px; }
.bb-badge-txt em .bb-tick { width: 14px; height: 14px; margin: 0 2px 0 0; }
.bb-verify { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; }
.bb-verify p { margin: 0; font-size: 14px; }
.bb .bb-verify .button { width: auto; justify-self: start; min-height: 46px; padding: 8px 18px; font-size: 15px; margin: 0; }
.bb-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.bb-mini span { display: grid; padding: 8px; border: 2px solid var(--ink); border-radius: 14px; background: var(--cream); text-align: center; }
.bb-mini small { font-size: 11px; font-weight: 800; color: #29627a; text-transform: uppercase; letter-spacing: .06em; }
.bb-mini b { font-size: 15px; font-weight: 900; }
.bb-panel .bb-textbtn { margin-top: 12px; }
.p-help li b { font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  .bb-title-card, .bb-side, .bb-hint { animation: none; }
  .bb-hint { opacity: 1; }
}

/* ---------- narrow wide screens: the menu cards overlay the frame ---------- */
@media (max-width: 1000px) and (min-aspect-ratio: 4/5) {
  .bb-title-card, .bb-side { width: min(340px, 44vw); }
}
/* ---------- portrait (phones, tablets) ---------- */
@media (max-aspect-ratio: 4/5) {
  .bb-menu { inset: calc(var(--top) + 10px) 10px max(10px, env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; justify-content: space-between; gap: 10px; }
  .bb-title-card { width: auto; padding: 14px 16px; }
  .bb-logo { font-size: clamp(38px, 10vw, 52px); }
  .bb-tagline { margin: 6px 0 10px; font-size: 17px; }
  .bb-modes { grid-template-columns: 1.2fr 1fr; }
  .bb-go, .bb-go:first-child { min-height: 62px; padding: 8px 10px; }
  .bb-go:first-child b { font-size: 24px; }
  .bb-go b { font-size: 17px; }
  .bb-go small { font-size: 11px; }
  .bb-go svg { display: none; }
  .bb-stats { margin-top: 10px; }
  .bb-keys { display: none; }
  .bb-side { width: auto; max-height: 42vh; padding: 12px; gap: 9px; border-radius: 22px; }
  .bb-side .bb-links, .bb-side .bb-closet { order: -1; }
  .bb-side h2 { font-size: 17px; }
  .bb-ch li { padding: 6px 8px; }
  .bb-ch-label { font-size: 13px; }
  .bb-menu-btns { left: auto; right: 6px; bottom: auto; top: 6px; flex-direction: column; z-index: 2; }
  .bb-menu-btns .pg-icon { width: 38px; height: 38px; box-shadow: 2px 3px 0 var(--ink); }
  .bb-badges { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .bb-height b { font-size: 46px; }
  .bb-pill { height: 30px; font-size: 15px; }
  .bb-over { padding: 18px 16px 16px; gap: 10px; }
  .bb-over-head h2 { font-size: 38px; }
  .bb-score-num { font-size: 46px; }
  .bb-row { flex-wrap: wrap; }
  .bb .bb-row .button { flex: 1 1 100%; }
  .bb .bb-panel .bb-board li { grid-template-columns: 30px 1fr 64px; font-size: 14px; }
  .bb-board .h { display: none; }
}
/* Short screens (phones in landscape): smaller cards beside the frame. */
@media (max-height: 620px) and (min-aspect-ratio: 4/5) {
  .bb-menu { inset: calc(var(--top) + 8px) 12px 10px; }
  .bb-title-card { padding: 12px 14px; }
  .bb-logo { font-size: 38px; }
  .bb-tagline { margin: 4px 0 8px; font-size: 16px; }
  .bb-go, .bb-go:first-child { min-height: 50px; }
  .bb-keys { display: none; }
}
