: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, #fdf2ff 0%, #e8f5ff 50%, #f0ffe6 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.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; padding: 12px; gap: 12px; overflow-y: auto; }
.mode-tabs { display: flex; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; justify-content: center; }
.mode-tab { border-radius: 999px; padding: 10px 20px; font-weight: 800; font-size: 1rem; background: #fff; color: var(--ink); box-shadow: 0 3px 8px rgba(120,80,160,0.15); transition: all 0.2s; }
.mode-tab.active { background: var(--purple); color: #fff; }
.question-card { width: min(90vw, 580px); background: #fff; border-radius: 24px; padding: 20px; box-shadow: 0 10px 30px rgba(120,80,160,0.2); text-align: center; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.question-text { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700; margin: 0 0 16px; color: var(--ink); }
.emotion-faces { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.face-card { width: clamp(80px, 20vw, 120px); padding: 12px 8px; border-radius: 20px; background: #f8f4ff; box-shadow: 0 4px 12px rgba(120,80,160,0.12); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform 0.15s, box-shadow 0.15s; border: 3px solid transparent; }
.face-card:active { transform: scale(0.95); }
.face-card.correct { border-color: var(--green); background: rgba(95,211,95,0.15); animation: pop-in 0.3s ease; }
.face-card.wrong { border-color: var(--pink); background: rgba(255,93,143,0.1); animation: shake 0.4s ease; }
@keyframes pop-in { 0% { transform: scale(1.1); } 60% { transform: scale(0.95); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.face-emoji { font-size: clamp(2rem, 7vw, 3.5rem); }
.face-label { font-size: 0.8rem; font-weight: 700; color: var(--ink); }
.scenario-emoji { font-size: clamp(2.5rem, 8vw, 4rem); margin-bottom: 8px; }
.action-choices { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.action-ch { flex: 1 1 auto; min-width: 120px; max-width: 220px; border-radius: 20px; padding: 12px 14px; font-weight: 800; font-size: 0.95rem; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,0.12); transition: transform 0.08s, box-shadow 0.08s; text-align: center; }
.action-ch:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.action-ch.kind { background: linear-gradient(135deg, var(--green), var(--blue)); }
.action-ch.unkind { background: linear-gradient(135deg, var(--orange), var(--pink)); }
.feedback { font-size: 1rem; font-weight: 700; min-height: 28px; margin-top: 10px; color: var(--purple); }
.win-area { text-align: center; padding: 20px; display: none; }
.win-area.show { display: block; }
.win-area .trophy { font-size: clamp(4rem, 12vw, 6rem); animation: bounce 0.8s ease infinite alternate; }
@keyframes bounce { to { transform: translateY(-14px); } }
.win-area h2 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 10px 0; color: var(--purple); }
#confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }
@media (max-width: 500px) { .action-choices { flex-direction: column; align-items: stretch; } .action-ch { max-width: none; } }
