/* COLOR CAULDRON — cozy dusk witch-hut kid aesthetic, touch-first, no
   fonts/images fetched. Family trick (pattern-peak style.css): the WebGL
   canvas has an alpha-cleared clear color, so the dusk sky behind the hut IS
   this gradient: deep night violet up high, dusk plum then hearth amber at the
   horizon. No network assets anywhere. */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: "Trebuchet MS", "Comic Sans MS", Verdana, sans-serif;
  background: linear-gradient(180deg,
    rgb(24, 16, 56) 0%,
    rgb(58, 36, 96) 30%,
    rgb(116, 64, 122) 56%,
    rgb(176, 96, 108) 79%,
    rgb(228, 150, 108) 100%);
  touch-action: none; -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
#game3d { position: fixed; inset: 0; display: block; touch-action: none; }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 14px; z-index: 8;
  display: flex; gap: 10px;
}
.pillBtn {
  width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.85); color: #7048a8; font-size: 26px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.pillBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.pillBtn.off { opacity: .45; }

/* ---------- big label (color names + beat words are the ONLY text) ---------- */
#wordLabel {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  max-width: 78vw; padding: 14px 36px; border-radius: 30px;
  background: #ffffff; color: #3b2a63;
  font-size: clamp(26px, 5vmin, 52px); font-weight: 900; text-align: center;
  box-shadow: 0 5px 0 rgba(0,0,0,.15);
  z-index: 7; pointer-events: none; min-height: 1em;
}
/* per-beat label colors: brew = dusk lavender, pour = rose, free = amber, hero = white-gold */
#wordLabel[data-link="brew"]  { background: #e5dbff; color: #5f3dc4; }
#wordLabel[data-link="pour"]  { background: #ffe3ec; color: #a61e4d; }
#wordLabel[data-link="free"]  { background: #ffec99; color: #b08900; }
#wordLabel[data-link="hero"]  { background: #fff9e6; color: #9a7b00; }
#wordLabel.pop { animation: labelPop .5s ease-out; }
@media (max-width: 900px) { #wordLabel { top: calc(78px + env(safe-area-inset-top)); } }
@keyframes labelPop { 0% { transform: translateX(-50%) scale(.5); opacity: 0; }
                      60% { transform: translateX(-50%) scale(1.12); opacity: 1; }
                      100% { transform: translateX(-50%) scale(1); } }

/* ---------- micro-pop (FREE BREW TIME! / ALL THE PAINTS!) — deliberately
   quieter than the big label ---------- */
#microPop {
  position: fixed; top: 24%; left: 50%; transform: translateX(-50%) scale(.6);
  padding: 8px 22px; border-radius: 20px; z-index: 7; pointer-events: none;
  background: rgba(255,255,255,.92); color: #7048a8;
  font-size: clamp(18px, 3vmin, 30px); font-weight: 900; opacity: 0;
  box-shadow: 0 3px 0 rgba(0,0,0,.15);
}
#microPop.pop { animation: microPop 1.0s ease-out; }
@keyframes microPop { 0% { opacity: 0; transform: translateX(-50%) scale(.6); }
                      18% { opacity: 1; transform: translateX(-50%) scale(1.06); }
                      75% { opacity: 1; transform: translateX(-50%) scale(1); }
                      100% { opacity: 0; transform: translateX(-50%) scale(.94); } }

/* ---------- first-time hint ---------- */
#handHint {
  position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  padding: 12px 26px; border-radius: 26px; z-index: 7; pointer-events: none;
  background: rgba(255,255,255,.94); color: #5f3dc4;
  font-size: clamp(20px, 3.6vmin, 32px); font-weight: 900;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  animation: hintBob 1.6s ease-in-out infinite;
  transition: opacity .6s ease, transform .6s ease;
}
#handHint.gone { opacity: 0; transform: translateX(-50%) translateY(30px); }
@keyframes hintBob { 0%,100% { margin-bottom: 0; } 50% { margin-bottom: 10px; } }

/* 2026-11-05 phone layout fixes (Claude Code, Ryan: "fix and finish all 18 learning apps").
   left:50% + translateX(-50%) with no width made these shrink-to-fit inside HALF the screen: on a phone the hint
   wrapped to 5-6 lines in a 192px bubble and two-word titles broke onto two lines. max-content + a screen-wide cap fixes it. */
#handHint { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
#wordLabel { width: max-content; }
#wordLabel:empty { display: none; }   /* an empty white pill showed before the first word */

/* ---------- colour wheel ---------- */
#cwheel { position: fixed; left: 10px; top: 36%; width: 120px; height: 140px; z-index: 6; pointer-events: none; }
#cwheel .ring { position: absolute; left: 6px; top: 6px; width: 108px; height: 108px; border-radius: 50%;
  background: conic-gradient(from 0deg, #e03131, #f76707 60deg, #fcc419 120deg, #37b24d 180deg, #1c7ed6 240deg, #9c36b5 300deg, #e03131 360deg); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
#cwheel .hub { position: absolute; left: 24px; top: 24px; width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.88); }
#cwheel i.now { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px #333, 0 2px 6px rgba(0,0,0,.4); transition: left .3s, top .3s, background .3s; left: 60px; top: 60px; background: #fff; }
#cwheel b { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
#cwheel span { position: absolute; left: 0; right: 0; top: 118px; text-align: center; font-weight: 900; font-size: 11px; letter-spacing: 1px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
@media (max-width: 520px) { #cwheel { top: 27%; left: 4px; transform: scale(.78); transform-origin: top left; } }
