/* Bee's Meadow (app home) */
html.hub-page, .hub-page body { margin: 0; height: 100%; overflow: hidden; background: #cfe6fa; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.hub-page body { font-family: ui-rounded, "Fredoka", "Nunito", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif; color: #2b2730; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.hub { position: fixed; inset: 0; overflow: hidden; }
#hub-canvas { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity .6s ease; }
.hub.live #hub-canvas { opacity: 1; }

/* top bar */
.hub-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; z-index: 3; }
.hub-top > * { pointer-events: auto; }
.hub-title { margin: 0; display: flex; align-items: center; gap: .35rem; font-size: clamp(1.05rem, 3.6vw, 1.6rem); font-weight: 800; color: #fff;
  text-shadow: 0 2px 0 rgba(40, 70, 120, .35), 0 0 14px rgba(40, 90, 160, .35); letter-spacing: .01em; }
.hub-title img { width: 1.7em; height: 1.7em; filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.hub-grown, .hub-sound { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: 0 .85rem; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, .78); color: #3a3550; font-weight: 700; font-size: .9rem; line-height: 1; font-family: inherit; text-decoration: none; box-shadow: 0 2px 8px rgba(30, 60, 100, .18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: pointer; }
.hub-sound { width: 48px; justify-content: center; padding: 0; font-size: 1.3rem; }
.hub-grown:active, .hub-sound:active { transform: scale(.94); }

/* station labels */
.hub-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.hub-label { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  min-height: 52px; padding: .3rem 1.05rem .3rem .55rem; border-radius: 999px; text-decoration: none; color: #2b2730; font-weight: 800;
  font-size: clamp(1rem, 3.4vw, 1.25rem); background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12), 0 6px 16px rgba(30, 60, 30, .22);
  transition: box-shadow .15s ease, background-color .15s ease; will-change: transform; opacity: 0; }
.hub.live .hub-label { opacity: 1; transition: opacity .5s ease .25s, box-shadow .15s ease; }
@media (max-width: 560px) { .hub-title { font-size: 1.05rem; white-space: nowrap; } .hub-title img { width: 1.5em; height: 1.5em; } .hub-grown { white-space: nowrap; } .hub-label { min-height: 44px; font-size: 1rem; padding: .2rem .8rem .2rem .35rem; } .hub-label .hub-ico { width: 34px !important; height: 34px !important; font-size: 1.1rem !important; } .hub-grown { font-size: .82rem; padding: 0 .7rem; } }
.hub-label .hub-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 1.35rem; background: #ffe48a; }
.hub-games .hub-ico { background: #ffd2cf; } .hub-paint .hub-ico { background: #cfe8ff; } .hub-color .hub-ico { background: #d6f5d0; }
.hub-winter .hub-ico { background: #e3ecff; } .hub-videos .hub-ico { background: #ffe0c2; } .hub-sheets .hub-ico { background: #fff0b8; } .hub-learn .hub-ico { background: #f0dcff; }
.hub-label:active, .hub-label.is-chosen { box-shadow: 0 1px 0 rgba(0, 0, 0, .12), 0 3px 8px rgba(30, 60, 30, .22); }
.hub-label.is-chosen { background: #fff6cf; }
.hub.choosing .hub-label:not(.is-chosen) { opacity: 0 !important; transition: opacity .25s ease; }
.hub-label:focus-visible { outline: 4px solid #3c86e6; outline-offset: 3px; }

/* splash */
.hub-splash { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 30%, #fff6d8 0%, #ffe08a 55%, #ffc93c 100%);
  transition: opacity .55s ease, visibility .55s; }
.hub-splash.gone { opacity: 0; visibility: hidden; }
.splash-card { text-align: center; }
.splash-bee { width: min(34vw, 150px); height: auto; animation: hover 2.6s ease-in-out infinite; filter: drop-shadow(0 10px 10px rgba(160, 100, 0, .25)); }
.splash-name { margin: .4rem 0 1.2rem; font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 800; color: #4a2f10; }
.splash-go { min-height: 64px; padding: 0 2rem; border: 0; border-radius: 999px; background: #3c86e6; color: #fff; font-weight: 800; font-size: clamp(1.25rem, 5vw, 1.6rem); line-height: 1; font-family: inherit;
  box-shadow: 0 6px 0 #275fae, 0 10px 22px rgba(40, 80, 160, .35); cursor: pointer; }
.splash-go:active { transform: translateY(4px); box-shadow: 0 2px 0 #275fae, 0 6px 12px rgba(40, 80, 160, .3); }
@keyframes hover { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }

.hub-fade { position: absolute; inset: 0; z-index: 6; background: #fff8e7; opacity: 0; pointer-events: none; transition: opacity .32s ease; }
.hub-fade.on { opacity: 1; }

/* flat fallback (no WebGL 2) */
.hub-flat { display: none; }
.hub.no3d #hub-canvas, .hub.no3d .hub-labels { display: none; }
.hub.no3d { background: linear-gradient(#7cc0f2, #cfe8b8 60%, #7fc45a); overflow: auto; }
.hub.no3d .hub-flat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 90px 18px 30px; max-width: 760px; margin-inline: auto; }
.hub-flat a { display: grid; justify-items: center; gap: .4rem; padding: 18px 10px; border-radius: 26px; background: #fff; text-decoration: none; color: #2b2730; font-weight: 800; font-size: 1.2rem; box-shadow: 0 5px 0 rgba(0,0,0,.1); }
.flat-emoji { font-size: 4rem; line-height: 96px; }

@media (prefers-reduced-motion: reduce) { .splash-bee { animation: none; } #hub-canvas, .hub-label { transition: none; } }

/* ---- app mode (inside the installed app) ---- */
html.bc-app .site-head nav, html.bc-app .menu-toggle, html.bc-app .crumbs, html.bc-app .site-foot, html.bc-app .get-app, html.bc-app .nav-app, html.bc-app [data-install] { display: none !important; }
html.bc-app .site-head .logo { visibility: hidden; }
html.bc-app .site-head { min-height: 64px; }
html.bc-app body { overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
.bc-home { position: fixed; z-index: 9990; left: max(10px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top)); display: inline-flex; align-items: center; gap: .3rem;
  min-height: 52px; padding: 4px 14px 4px 6px; border-radius: 999px; background: #fff; color: #2b2730; font: 800 1rem/1 var(--head, system-ui); text-decoration: none;
  box-shadow: 0 3px 0 rgba(0,0,0,.12), 0 6px 16px rgba(30,40,60,.2); transition: transform .12s ease; }
.bc-home img { width: 44px; height: 44px; }
.bc-home:active { transform: scale(.94); }
body.bc-leaving { opacity: 0; transition: opacity .18s ease; }
/* full-screen games keep their own top bar; tuck the home button into the corner */
html.bc-app .xg-root ~ .bc-home, html.bc-app body.fullscreen-game .bc-home { top: auto; bottom: max(10px, env(safe-area-inset-bottom)); }

.bc-gate { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: rgba(30, 30, 50, .55); padding: 16px; }
.bc-gate[hidden] { display: none; }
.bc-gate-box { width: min(360px, 100%); padding: 22px 20px 18px; border-radius: 26px; background: #fffaf0; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); font-family: var(--body, system-ui); }
.bc-gate h2 { margin: 0 0 .3rem; font: 800 1.5rem/1.2 var(--head, system-ui); color: #3a3550; }
.bc-gate-q { margin: 0 0 .6rem; font-size: 1.05rem; color: #4a4560; }
.bc-gate-ans { height: 52px; margin: 0 auto 12px; width: 140px; border-radius: 14px; background: #fff; border: 3px solid #e8dcc4; font: 800 1.8rem/46px var(--head, system-ui); letter-spacing: .1em; }
.bc-gate-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bc-gate-keys button { min-height: 52px; border: 0; border-radius: 14px; background: #ffe48a; font: 800 1.35rem/1 var(--head, system-ui); color: #3a3550; box-shadow: 0 3px 0 #e2bf4a; cursor: pointer; }
.bc-gate-keys button:active { transform: translateY(2px); box-shadow: 0 1px 0 #e2bf4a; }
.bc-gate-x { margin-top: 14px; min-height: 46px; padding: 0 1.2rem; border: 0; border-radius: 999px; background: #3c86e6; color: #fff; font: 800 1rem/1 var(--head, system-ui); cursor: pointer; }
.bc-gate.shake .bc-gate-box { animation: bcshake .4s; }
@keyframes bcshake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
