/* EC Play — game screen. Big, chunky, bright. No text wraps inside buttons. */
@font-face { font-family: 'Baloo 2'; src: url('/fonts/baloo2-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
:root {
  --ink: #0f172a; --sub: #475569; --card: #ffffff; --blue: #2563eb; --green: #16a34a; --yellow: #facc15; --pink: #ec4899; --red: #ef4444;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  --font: 'Baloo 2', ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #38bdf8; color: var(--ink); font-family: var(--font); user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; white-space: nowrap; touch-action: manipulation; }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }

/* top HUD */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.me-chip { background: rgba(255,255,255,.92); border-radius: 18px; padding: 6px 12px 8px; box-shadow: 0 4px 0 rgba(15,23,42,.15); min-width: 120px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.lv { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 14px; line-height: 24px; white-space: nowrap; }
.me-name { font-size: 17px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.lv-bar { grid-column: 1 / -1; height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-top: 4px; }
.lv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #facc15); border-radius: 6px; transition: width .6s; }
.today { text-align: center; background: rgba(255,255,255,.92); border-radius: 18px; padding: 4px 14px 6px; box-shadow: 0 4px 0 rgba(15,23,42,.15); }
.island { font-size: 14px; color: var(--sub); white-space: nowrap; }
.stars { font-size: 22px; letter-spacing: 2px; font-family: var(--emoji); line-height: 1.1; }
.stars i { font-style: normal; color: #cbd5e1; }
.stars i.on { animation: pop .4s; }
.money { display: flex; gap: 6px; align-items: center; }
.pill { background: rgba(255,255,255,.92); border-radius: 16px; padding: 4px 10px; font-size: 17px; box-shadow: 0 4px 0 rgba(15,23,42,.15); white-space: nowrap; }
.icon-btn { background: rgba(255,255,255,.92); border-radius: 50%; width: 40px; height: 40px; font-size: 20px; box-shadow: 0 4px 0 rgba(15,23,42,.15); font-family: var(--emoji); }

.words-strip { position: fixed; top: calc(max(10px, env(safe-area-inset-top)) + 64px); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
.words-strip span { background: rgba(255,255,255,.85); border-radius: 14px; padding: 2px 10px 2px 6px; font-size: 16px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.goal { position: fixed; top: calc(max(10px, env(safe-area-inset-top)) + 100px); left: 50%; transform: translateX(-50%); background: rgba(15,23,42,.55); color: #fff; border-radius: 14px; padding: 3px 12px; font-size: 14px; white-space: nowrap; pointer-events: none; font-family: var(--font), var(--emoji); }

/* bottom controls */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 14px max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.bottom > * { pointer-events: auto; }
.play-btn { min-width: 220px; padding: 10px 34px 12px; border-radius: 28px; background: linear-gradient(#4ade80, #16a34a); color: #fff; box-shadow: 0 8px 0 #166534, 0 12px 24px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; animation: breathe 1.8s ease-in-out infinite; }
.play-btn b { font-size: 40px; line-height: 1; letter-spacing: 2px; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.play-btn small { font-size: 15px; opacity: .95; }
.play-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #166534; animation: none; }
.me-btn { position: absolute; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); background: #fff; border-radius: 22px; padding: 6px 12px; box-shadow: 0 5px 0 rgba(15,23,42,.2); display: flex; flex-direction: column; align-items: center; }
.me-btn span { font-size: 30px; font-family: var(--emoji); line-height: 1.1; }
.me-btn small { font-size: 13px; }
.joy { position: absolute; left: 18px; bottom: max(18px, env(safe-area-inset-bottom)); width: 104px; height: 104px; border-radius: 50%; background: rgba(255,255,255,.35); border: 3px solid rgba(255,255,255,.7); touch-action: none; }
.joy i { position: absolute; left: 32px; top: 32px; width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
@media (hover: hover) and (pointer: fine) { .joy { display: none; } }

/* pictures */
.pic { font-family: var(--emoji); display: inline-flex; align-items: center; justify-content: center; line-height: 1; font-size: 54px; }
.pic.sm { font-size: 20px; } .pic.lg { font-size: 72px; } .pic.xl { font-size: 130px; }
.pic.pic-wide.xl { font-size: 96px; } .pic.pic-wide.lg { font-size: 56px; }
.pic-color { width: 1em; height: 1em; border-radius: 30%; background: var(--c); border: 4px solid rgba(15,23,42,.15); }
.pic-color.sm { width: 18px; height: 18px; border-width: 2px; }

/* full-screen game stage */
.stage { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px 24px; background: radial-gradient(circle at 50% 30%, #e0f2fe, #bae6fd 60%, #7dd3fc); overflow: hidden; }
.stage[hidden] { display: none; }
.quit { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 20px; box-shadow: 0 4px 0 rgba(0,0,0,.15); z-index: 3; }
.dots { position: absolute; top: max(22px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.7); border: 3px solid #fff; }
.dots i.s { border-radius: 4px; width: 26px; }
.dots i.now { background: var(--yellow); transform: scale(1.2); }
.dots i.ok { background: var(--green); }
.card { background: var(--card); border-radius: 32px; padding: 20px 26px 18px; box-shadow: 0 10px 0 rgba(15,23,42,.12); text-align: center; max-width: 560px; width: 100%; }
.big-pic { background: none; padding: 0; }
.word { font-size: clamp(44px, 9vw, 72px); line-height: 1.1; margin-top: 4px; }
.ear { margin-top: 8px; background: #e0f2fe; color: #0369a1; border-radius: 18px; padding: 8px 18px; font-size: 18px; }
.ear-row { display: flex; gap: 8px; justify-content: center; }
.speak { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 150px; }
.mic { width: 108px; height: 108px; border-radius: 50%; background: linear-gradient(#f87171, #dc2626); color: #fff; box-shadow: 0 7px 0 #991b1b; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mic span { font-size: 40px; font-family: var(--emoji); line-height: 1; }
.mic b { font-size: 17px; }
.mic.on { animation: ring 1s infinite; background: linear-gradient(#fb7185, #e11d48); }
.mic:disabled { cursor: default; }
.heard { min-height: 24px; font-size: 20px; color: var(--sub); text-align: center; }
.help { min-height: 22px; font-size: 17px; color: #b45309; text-align: center; max-width: 480px; white-space: normal; }
.said { background: #fff; border: 3px solid var(--green); color: var(--green); border-radius: 18px; padding: 8px 18px; font-size: 18px; }
.scene { min-height: 80px; }
.sent-slots { font-size: clamp(26px, 5.4vw, 40px); margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.slot { min-width: 60px; min-height: 48px; border-bottom: 4px dashed #cbd5e1; padding: 0 4px; }
.slot.fill { border-bottom: 4px solid var(--green); animation: pop .3s; }
.slot.miss { color: var(--red); border-bottom-color: var(--red); }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.tile { background: #fef3c7; border-radius: 16px; padding: 10px 18px; font-size: clamp(22px, 4.4vw, 30px); box-shadow: 0 5px 0 #f59e0b; }
.tile.used { opacity: .25; box-shadow: none; transform: translateY(5px); }
.hint-line { margin-top: 10px; color: var(--sub); font-size: 17px; }

/* pop */
.hud-row { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 70px; right: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 22px; gap: 8px; }
.turn { background: #fff; border-radius: 14px; padding: 2px 14px; white-space: nowrap; }
.turn.p0 { background: #dbeafe; color: #1d4ed8; } .turn.p1 { background: #fce7f3; color: #be185d; }
.combo { color: #ea580c; font-size: 26px; }
.score { background: var(--ink); color: #fff; border-radius: 14px; padding: 2px 14px; min-width: 52px; text-align: center; }
.best { color: var(--sub); font-size: 16px; }
.prompt { position: absolute; top: calc(max(16px, env(safe-area-inset-top)) + 52px); display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 24px; padding: 6px 20px 6px 8px; box-shadow: 0 6px 0 rgba(0,0,0,.12); z-index: 2; }
.prompt .ear { margin: 0; font-size: 24px; padding: 6px 12px; }
.prompt b { font-size: clamp(32px, 7vw, 52px); }
.sky { position: absolute; inset: 120px 0 0 0; }
.balloon { position: absolute; bottom: -180px; width: 128px; height: 150px; border-radius: 50% 50% 46% 46%; display: flex; align-items: center; justify-content: center; animation: rise linear forwards; box-shadow: inset -12px -14px 0 rgba(0,0,0,.12); }
.balloon::after { content: ''; position: absolute; bottom: -34px; left: 50%; width: 2px; height: 34px; background: rgba(15,23,42,.4); }
.balloon .pic { font-size: 62px; } .balloon .pic.pic-wide { font-size: 44px; }
.balloon.c0 { background: #fca5a5; } .balloon.c1 { background: #93c5fd; } .balloon.c2 { background: #fde047; } .balloon.c3 { background: #c4b5fd; }
.balloon.popped { animation: popped .3s forwards !important; }

/* bomb */
.bomb-wrap { margin-top: 10px; }
.bomb-ball { position: relative; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #475569, #0f172a 70%); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 0 rgba(0,0,0,.25); }
.bomb-ball::before { content: '✨'; position: absolute; top: -26px; right: 22px; font-size: 34px; font-family: var(--emoji); animation: spark .3s infinite alternate; }
.bomb-ball .pic { font-size: 104px; } .bomb-ball .pic.pic-wide { font-size: 72px; }
.bomb-ball .pic-color { width: 100px; height: 100px; }
.fuse { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); transform: rotate(-90deg); }
.fuse circle { fill: none; stroke: #f59e0b; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 0; }
.bomb-ball.hot { animation: shake .15s infinite; }
.bomb-ball.hot .fuse circle { stroke: var(--red); }
.bomb-ball.fly { animation: fly .35s; }
.bomb-ball.boom { animation: boom .5s forwards; }
.choices { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.choice { background: #fff; border-radius: 22px; padding: 14px 28px; font-size: clamp(26px, 5vw, 38px); box-shadow: 0 7px 0 rgba(15,23,42,.18); min-width: 150px; }
.choice:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(15,23,42,.18); }
.bomb-mic { margin-top: 18px; font-size: 18px; color: var(--sub); }
.boom-msg { font-size: 34px; width: 100%; text-align: center; }
.answer-was { font-size: 30px; display: flex; gap: 10px; align-items: center; justify-content: center; width: 100%; }
.answer-was .pic { font-size: 44px; }

/* chant */
.stage.chant { background: radial-gradient(circle at 50% 30%, #f5d0fe, #c084fc 70%, #7e22ce); color: #fff; }
.chant-top { position: absolute; top: max(24px, env(safe-area-inset-top)); }
.beat-dots { display: flex; gap: 12px; }
.beat-dots i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.35); transition: transform .08s; }
.beat-dots i.on { background: #fff; transform: scale(1.5); }
.chant-pic { min-height: 100px; }
.chant-line { font-size: clamp(34px, 7vw, 60px); text-align: center; margin: 8px 0 14px; max-width: 900px; display: flex; flex-wrap: wrap; gap: 0 14px; justify-content: center; }
.chant-line span { opacity: .45; transition: opacity .1s, transform .1s; }
.chant-line span.lit { opacity: 1; transform: scale(1.12); color: #fef08a; }
.chant-line span.you { opacity: 1; color: #fff; text-decoration: underline 4px rgba(255,255,255,.5); }
.chant-line span.hit { color: #86efac; opacity: 1; }
.chant-who { font-size: 28px; background: rgba(0,0,0,.2); border-radius: 18px; padding: 4px 18px; }
.stage.chant .heard { color: rgba(255,255,255,.85); margin-top: 8px; }

/* overlays */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.reward, .wardrobe, .menu { position: relative; background: #fff; border-radius: 32px; padding: 26px 24px 22px; text-align: center; width: min(420px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 12px 0 rgba(0,0,0,.2); }
.reward h2, .wardrobe h2, .menu h2 { margin: 6px 0 10px; font-size: 34px; }
.reward-stars { font-size: 56px; font-family: var(--emoji); }
.reward-stars i { font-style: normal; display: inline-block; filter: grayscale(1) opacity(.3); }
.reward-stars i.on { filter: none; animation: pop .45s both; }
.reward-gain { display: flex; gap: 10px; justify-content: center; font-size: 24px; }
.reward-gain span { background: #ecfccb; border-radius: 14px; padding: 4px 14px; white-space: nowrap; }
.reward-gain .coin-gain { background: #fef9c3; }
.level-up { margin-top: 12px; font-size: 22px; color: #7c3aed; animation: pop .5s; }
.vs { font-size: 22px; margin-bottom: 8px; }
.btn-go { margin-top: 18px; background: linear-gradient(#4ade80, #16a34a); color: #fff; font-size: 26px; padding: 10px 36px; border-radius: 22px; box-shadow: 0 6px 0 #166534; }
.chest-ico { font-size: 84px; font-family: var(--emoji); animation: wobble 1s infinite; }
.streak-line { font-size: 22px; margin-top: 10px; }
.tomorrow { margin: 14px 0 6px; color: var(--sub); font-size: 18px; }
.tomorrow-words { display: flex; gap: 10px; justify-content: center; }
.tomorrow-words span { background: #f1f5f9; border-radius: 16px; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; }
.tomorrow-words .pic { font-size: 40px; }
.wardrobe .quit, .menu .quit { top: 12px; left: 12px; }
.hero-preview { width: 160px; height: 170px; }
.coins-line { font-size: 22px; }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.skin { background: #f8fafc; border: 3px solid #e2e8f0; border-radius: 18px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; }
.skin.on { border-color: var(--green); background: #f0fdf4; }
.skin.lock { opacity: .55; }
.skin-face { font-size: 36px; font-family: var(--emoji); }
.skin small { font-size: 13px; color: var(--sub); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.skin em { font-style: normal; font-size: 15px; }
.tiny { font-size: 14px; color: var(--sub); }
.menu-row { display: flex; justify-content: space-between; width: 100%; background: #f1f5f9; border-radius: 16px; padding: 12px 16px; font-size: 19px; margin-top: 10px; }
.mic-test { margin-top: 8px; font-size: 18px; min-height: 26px; white-space: normal; }
.ptoast { position: fixed; z-index: 60; left: 50%; bottom: 140px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 18px; font-size: 18px; animation: pop .3s; max-width: 90vw; text-align: center; }
.cheer { position: fixed; z-index: 55; top: 30%; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 26px; padding: 14px 24px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 0 rgba(0,0,0,.2); font-size: 30px; }
.cheer span { font-size: 46px; font-family: var(--emoji); }
.burst { position: fixed; z-index: 70; font-size: 26px; font-family: var(--emoji); pointer-events: none; animation: burst .7s ease-out forwards; }
.loading { position: fixed; inset: 0; z-index: 80; background: #38bdf8; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 40px; }
.loading div { font-size: 90px; font-family: var(--emoji); animation: wobble 1s infinite; }

.pop-in { animation: pop .35s; }
.shake { animation: shake .35s; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes ring { 0% { box-shadow: 0 7px 0 #991b1b, 0 0 0 0 rgba(239,68,68,.6); } 100% { box-shadow: 0 7px 0 #991b1b, 0 0 0 26px rgba(239,68,68,0); } }
@keyframes rise { to { transform: translateY(calc(-100vh - 200px)); } }
@keyframes popped { to { transform: scale(1.6); opacity: 0; } }
@keyframes spark { to { transform: scale(1.3) rotate(20deg); } }
@keyframes fly { 0% { transform: translateX(-120px) scale(.7); } 100% { transform: none; } }
@keyframes boom { 50% { transform: scale(1.5); } 100% { transform: scale(1.2); background: radial-gradient(#fde047, #f97316 60%, transparent 70%); } }
@keyframes wobble { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }

/* Spell Run (inside Meet): letter pellets + fall */
.spell-slots { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; flex-wrap: wrap; }
.spell-slots .slot { min-width: 40px; min-height: 50px; display: grid; place-items: center; font-size: 26px; font-weight: 900; border-radius: 12px; background: #f1f5f9; border: 3px solid #e2e8f0; color: #1e293b; }
.spell-slots .slot.fill { background: #dcfce7; border-color: #22c55e; animation: pop .3s; }
.spell-slots .slot.now { border-color: #38bdf8; background: #e0f2fe; }
.pellets { display: flex; gap: 14px; justify-content: center; margin-top: 14px; }
.pellet { width: 68px; height: 68px; border-radius: 50%; font-size: 29px; font-weight: 900; border: 3px solid #fff; background: #ffd23f; color: #5b4300; box-shadow: 0 7px 0 #d9a400, 0 14px 22px rgba(30,64,175,.22); cursor: pointer; }
.pellet:active { transform: translateY(4px); box-shadow: 0 2px 0 #d9a400; }
.spell-pic { display: grid; place-items: center; }
.spell-pic.fall { animation: spellfall .6s ease; }
@keyframes spellfall { 0% { transform: translateY(0) rotate(0); } 55% { transform: translateY(54px) rotate(36deg); opacity: .45; } 100% { transform: translateY(0) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .spell-pic.fall { animation: none; } }

@media (max-width: 640px) {
  .me-chip { min-width: 0; padding: 4px 8px 6px; } .me-name { max-width: 70px; font-size: 15px; }
  .today { padding: 2px 8px 4px; } .stars { font-size: 18px; } .island { font-size: 12px; }
  .pill { padding: 3px 8px; font-size: 15px; } .icon-btn { width: 36px; height: 36px; font-size: 18px; }
  .play-btn { min-width: 180px; padding: 8px 24px 10px; } .play-btn b { font-size: 34px; }
  .words-strip { top: calc(max(10px, env(safe-area-inset-top)) + 58px); } .words-strip span { font-size: 14px; }
  .goal { top: calc(max(10px, env(safe-area-inset-top)) + 92px); font-size: 13px; }
  .balloon { width: 104px; height: 124px; } .balloon .pic { font-size: 50px; }
  .bomb-ball { width: 190px; height: 190px; } .bomb-ball .pic { font-size: 86px; }
  .pic.xl { font-size: 104px; }
}
@media (max-width: 400px) { .money .pill:nth-child(2) { display: none; } }
@media (prefers-reduced-motion: reduce) { .play-btn, .chest-ico { animation: none; } }
