:root { --teal: #3cc3c8; --ink: #23414d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: 'Baloo 2', system-ui, sans-serif; color: var(--ink);
  background: linear-gradient(180deg, #c4f1ff 0%, #eafaff 55%, #fff4dc 100%); }
canvas { position: fixed; inset: 0; touch-action: none; }
button { font-family: inherit; cursor: pointer; }
#tint { position: fixed; inset: 0; background-color: transparent; opacity: .4; transition: background-color .8s; pointer-events: none; }

#top { position: fixed; top: 0; left: 0; right: 0; display: none; align-items: center; gap: 10px; padding: 12px 14px; pointer-events: none; }
#top > * { pointer-events: auto; }
body:not([data-mode=home]) #top { display: flex; }
.icon { width: 56px; height: 56px; flex: none; border-radius: 50%; border: none; background: #fff; font-size: 27px; line-height: 1;
  box-shadow: 0 5px 0 rgba(0,0,0,.12); transition: transform .08s; }
.icon:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.icon.on { background: #ff5c8a; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
#title { flex: 1; text-align: center; color: #1a8a8f; font-weight: 800; font-size: clamp(15px, 2.4vw, 28px); letter-spacing: .03em; }
#stars { font-size: 24px; font-weight: 800; color: #e79a00; background: #fff; border-radius: 30px; padding: 6px 16px; box-shadow: 0 5px 0 rgba(0,0,0,.12); }
#replayBtn, #micBtn { display: none; }

#bubble { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) scale(1); background: #fff; border: 4px solid var(--teal);
  border-radius: 28px; padding: 8px 26px; font-size: clamp(19px, 3vw, 36px); font-weight: 800; max-width: 92vw; text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.08); transition: transform .25s cubic-bezier(.3,1.6,.5,1), opacity .2s; pointer-events: none; line-height: 1.2; }
#bubble.hidden { opacity: 0; transform: translateX(-50%) scale(.6); }
#bubble small { display: block; font-size: .6em; color: #ff5c8a; }

#bottom { position: fixed; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; pointer-events: none; padding: 0 8px; }
#bottom > * { pointer-events: auto; display: none; }
.big { border: none; background: var(--teal); color: #fff; font-size: clamp(18px, 2.6vw, 28px); font-weight: 800; padding: 10px 30px;
  border-radius: 40px; box-shadow: 0 6px 0 #25989c; letter-spacing: .04em; }
.big:active { transform: translateY(5px); box-shadow: 0 1px 0 #25989c; }
.big:disabled { opacity: .5; }
.big.alt { background: #fff; color: #1a8a8f; box-shadow: 0 6px 0 rgba(0,0,0,.12); }

#home { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; pointer-events: none; padding: 16px; }
[data-mode=home] #home { display: flex; }
#home h1 { margin: 0; font-size: clamp(56px, 12vw, 130px); line-height: .9; letter-spacing: .02em; }
#home h1 span { display: inline-block; animation: bob 2.4s ease-in-out infinite; text-shadow: 0 6px 0 rgba(0,0,0,.12); -webkit-text-stroke: 3px #fff; paint-order: stroke fill; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
#home p { margin: 0; font-weight: 800; color: #1a8a8f; font-size: clamp(16px, 2.2vw, 24px); letter-spacing: .1em; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(620px, 94vw); pointer-events: auto; margin-top: 1vh; }
.card { border-radius: 28px; padding: 14px 10px; background: #fff; box-shadow: 0 7px 0 var(--c); border: 4px solid var(--c);
  display: flex; flex-direction: column; align-items: center; transition: transform .1s; text-decoration: none; }
.card:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--c); }
.card b { font-size: clamp(36px, 6vw, 56px); line-height: 1.1; }
.card strong { font-size: clamp(16px, 2.4vw, 24px); color: var(--c); letter-spacing: .03em; }
.card em { font-style: normal; font-size: clamp(12px, 1.6vw, 15px); color: #7a8d96; font-weight: 600; }
.back { position: fixed; top: 14px; left: 14px; display: none; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 30px; background: #fff;
  color: #1a8a8f; font-weight: 800; font-size: 18px; text-decoration: none; box-shadow: 0 5px 0 rgba(0,0,0,.12); pointer-events: auto; }
[data-mode=home] .back { display: flex; }

/* Speech bubbles and name tags that follow 3D characters */
.speech { position: fixed; left: 0; top: 0; background: #fff; border: 3px solid var(--teal); border-radius: 20px; padding: 6px 16px; font-weight: 800;
  font-size: clamp(14px, 2vw, 22px); color: var(--ink); max-width: 280px; width: max-content; text-align: center; pointer-events: none;
  box-shadow: 0 4px 0 rgba(0,0,0,.08); transition: opacity .2s; line-height: 1.2; }
.speech::after { content: ''; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); border: 10px solid transparent; border-top-color: var(--teal); border-bottom: 0; }
.speech.hidden { opacity: 0; }
.tag { position: fixed; left: 0; top: 0; font-weight: 800; font-size: clamp(13px, 1.8vw, 20px); color: #fff; background: var(--teal); padding: 1px 12px;
  border-radius: 14px; pointer-events: none; transition: opacity .3s; letter-spacing: .04em; }
.tag.me { background: #ff5c8a; }
.tag.hidden { opacity: 0; }
