:root {
  --sky: #b8d4f0;
  --ink: #1c1e24;
  --mute: #4a5564;
  --gold: #e6b35c;
  --brick: #c91a09;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--sky);
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#bb-wordmark {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 13;
  margin: 0;
  font-family: Fredoka, sans-serif;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35), 0 2px 14px rgba(0,0,0,0.6);
  pointer-events: none;
}
#hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(255,255,255,0.6);
  max-width: 28rem;
}
#title {
  display: none;
}
#hud-line {
  font-weight: 600;
  margin-top: 2px;
}
#hud-hint {
  font-size: 0.82rem;
  color: var(--mute);
  line-height: 1.4;
  margin-top: 4px;
}
#hud[data-demo="1"] { display: none; }
body:has(#hud[data-demo="1"]) > button { display: none !important; }

#bb-demo-tag {
  display: none;
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  text-align: center;
  min-width: min(92vw, 640px);
}
#bb-demo-tag.on { display: block; }
#bb-demo-tag .key {
  display: inline-block;
  font-family: Fredoka, sans-serif;
  font-size: clamp(1.35rem, 4.2vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  background: #c91a09;
  padding: 8px 16px 10px;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(28, 30, 36, 0.28);
  letter-spacing: 0.02em;
}
#bb-demo-tag .sub {
  display: none;
}

#start {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(245, 205, 47, 0.18), transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(201, 26, 9, 0.12), transparent 46%),
    #b8d4f0;
}
#start .panel {
  width: min(560px, 92vw);
  padding: 28px 28px 24px;
  background: rgba(255,255,255,0.72);
  border-radius: 16px;
  border: 1px solid rgba(28,30,36,0.08);
}
.kicker {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0;
  font-weight: 700;
}
h1 {
  font-family: Fredoka, sans-serif;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  margin: 6px 0 10px;
  font-weight: 600;
  color: var(--brick);
}
#start p { color: var(--mute); line-height: 1.5; }
#start ul {
  padding-left: 1.1rem;
  color: var(--mute);
  font-size: 0.88rem;
  line-height: 1.5;
}
#start .desk { font-size: 0.8rem; }
#start .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#start button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brick);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  font-family: Outfit, sans-serif;
}
#start button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #889;
}

button:not(:disabled), [role="button"] { cursor: pointer; }

#bb-menu {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(18, 22, 30, 0.48);
}
#bb-menu[hidden] { display: none !important; }
#bb-menu .panel {
  width: min(420px, 92vw);
  padding: 22px 22px 18px;
  background: rgba(255,255,255,0.88);
  border-radius: 16px;
  border: 1px solid rgba(28,30,36,0.1);
}
#bb-menu h2 {
  font-family: Fredoka, sans-serif;
  margin: 4px 0 12px;
  color: var(--brick);
}
#bb-menu .menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#bb-menu button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-family: Outfit, sans-serif;
}
#bb-menu button[data-m="resume"],
#bb-menu button[data-m="new"] {
  grid-column: 1 / -1;
  background: var(--brick);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
