:root {
  --pink: #ff5d8f;
  --purple: #9b7bff;
  --blue: #3fa9f5;
  --green: #5fd35f;
  --yellow: #ffd23d;
  --orange: #ff9f43;
  --ink: #3a2c5a;
  --panel: #fffdf7;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", system-ui, sans-serif; color: var(--ink); background: linear-gradient(160deg, #fde9ff 0%, #e6f3ff 50%, #e9fff2 100%); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
body { display: flex; flex-direction: column; }
button { font-family: inherit; cursor: pointer; border: none; }
.topbar { position: relative; z-index: 3; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255,255,255,0.72); backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(120,80,160,0.15); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.topbar::-webkit-scrollbar { display: none; }
.topbar > * { flex: 0 0 auto; }
.topbar-spacer { flex: 1 1 auto; min-width: clamp(60px, 16vw, 200px); }
.site-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 0.95rem; font-weight: 900; text-decoration: none; }
.site-logo-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid var(--ink); border-radius: 9px; background: var(--green); color: #fff; box-shadow: 3px 3px 0 rgba(58,44,90,0.28); font-size: 0.72rem; letter-spacing: 0; }
.logo { font-size: 1.25rem; font-weight: 800; background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo .star { -webkit-text-fill-color: initial; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: 0.85rem; box-shadow: 0 2px 6px rgba(120,80,160,0.18); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 1.15rem; background: #fff; box-shadow: 0 3px 8px rgba(120,80,160,0.22); display: grid; place-items: center; transition: transform 0.1s; }
.icon-btn:active { transform: scale(0.9); }
.btn { border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 0.95rem; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,0.12); transition: transform 0.08s, box-shadow 0.08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.btn.green { background: var(--green); }
.btn.blue { background: var(--blue); }
.btn.pink { background: var(--pink); }
.btn.orange { background: var(--orange); }
.progress-wrap { position: relative; z-index: 3; flex: 0 0 auto; height: 10px; background: rgba(255,255,255,0.6); }
.progress-bar { height: 100%; width: 0%; border-radius: 0 999px 999px 0; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width 0.35s ease; }
.game-area { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 16px; overflow-y: auto; }
.scene-card { width: min(90vw, 600px); background: #fff; border-radius: 24px; padding: 24px 20px; box-shadow: 0 10px 30px rgba(120,80,160,0.2); text-align: center; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.scene-emoji { font-size: clamp(3rem, 10vw, 5rem); margin-bottom: 12px; }
.scene-text { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700; line-height: 1.4; margin: 0 0 20px; color: var(--ink); }
.choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.choice-btn { flex: 1 1 auto; min-width: 140px; max-width: 240px; border-radius: 20px; padding: 14px 18px; font-weight: 800; font-size: 1.05rem; color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,0.12); transition: transform 0.08s, box-shadow 0.08s; text-align: center; }
.choice-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.choice-a { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.choice-b { background: linear-gradient(135deg, var(--pink), var(--orange)); }
.back-btn { margin-top: 8px; border-radius: 999px; padding: 8px 18px; font-weight: 700; font-size: 0.9rem; background: #fff; color: var(--ink); box-shadow: 0 3px 8px rgba(120,80,160,0.15); }
.end-screen { text-align: center; padding: 20px; }
.end-screen .trophy { font-size: clamp(4rem, 12vw, 6rem); animation: bounce 0.8s ease infinite alternate; }
@keyframes bounce { to { transform: translateY(-14px); } }
.end-screen h2 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 10px 0; color: var(--purple); }
.story-summary { margin: 12px 0 20px; font-size: 1rem; font-weight: 600; color: var(--ink); opacity: 0.8; }
#confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }
@media (max-width: 500px) { .choices { flex-direction: column; align-items: stretch; } .choice-btn { max-width: none; } }
