* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --pink: #ff8fb1; --blue: #74b9ff; --ink: #4a3b55; }
html, body { height: 100%; }
body { font-family: 'Quicksand', system-ui, sans-serif; color: var(--ink); background: #cfe6ff; overflow: hidden; }
#app { height: 100vh; display: flex; flex-direction: column; }

#topbar { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; gap: 12px; background: rgba(255,255,255,0.7); backdrop-filter: blur(8px); border-bottom: 2px solid rgba(255,255,255,0.8); z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; }
.logo { font-size: 30px; }
#topbar h1 { font-family: 'Baloo 2'; font-size: 21px; line-height: 1; color: #6b4d7a; }
#topbar p { font-size: 12px; opacity: .8; margin-top: 2px; }
.controls { display: flex; gap: 8px; }
.btn { font-family: 'Baloo 2'; font-weight: 700; font-size: 14px; border: none; border-radius: 13px; padding: 9px 13px; cursor: pointer; background: #fff; color: var(--ink); box-shadow: 0 3px 0 #e6d6e6; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #e6d6e6; }
.btn-ghost { background: #ffeef4; }
select.btn { -webkit-appearance: none; appearance: none; }

main { flex: 1; display: flex; min-height: 0; }
#stage { position: relative; flex: 1; min-width: 0; }
#scene { width: 100%; height: 100%; display: block; }
.clock { position: absolute; left: 14px; top: 12px; background: rgba(255,255,255,.82); border-radius: 12px; padding: 5px 12px; font-family: 'Baloo 2'; font-weight: 700; font-size: 13px; color: #7a5d8a; }
.thinking { position: absolute; right: 14px; top: 12px; background: rgba(255,255,255,.85); border-radius: 12px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: #9b7bab; animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }
.hint-cam { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(255,255,255,.7); border-radius: 10px; padding: 4px 12px; font-size: 11px; color: #6a5a7a; white-space: nowrap; }
#minimap { position: absolute; right: 12px; bottom: 12px; border-radius: 10px; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 4px 12px rgba(0,0,0,.2); width: 150px; height: 150px; }

.bubble { position: absolute; transform: translate(-50%, -100%); max-width: 170px; padding: 7px 11px; border-radius: 15px; background: #fff; color: var(--ink); font-weight: 600; font-size: 12.5px; box-shadow: 0 6px 16px rgba(120,80,140,.22); pointer-events: none; border: 2px solid #fff; transition: opacity .3s; text-align: center; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: #fff; }
.hidden { opacity: 0 !important; }
.nlabel { position: absolute; transform: translate(-50%, -100%); font-family: 'Baloo 2'; font-weight: 700; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; white-space: nowrap; }
.blabel { position: absolute; transform: translate(-50%, -100%); background: rgba(255,180,60,.92); color: #5a3a00; font-family: 'Baloo 2'; font-weight: 800; font-size: 11px; padding: 1px 7px; border-radius: 8px; pointer-events: none; white-space: nowrap; }

#panel { width: 340px; flex-shrink: 0; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; background: rgba(255,255,255,0.4); }
.card { background: #fff; border-radius: 18px; padding: 13px; box-shadow: 0 8px 22px rgba(140,100,160,.12); }
.fam-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.familia h3, .chat h3, .learn h3 { font-family: 'Baloo 2'; font-size: 14px; color: #7a5d8a; }
.fam-count { font-size: 12px; font-weight: 700; color: #c0568a; background: #fff0f6; padding: 3px 9px; border-radius: 10px; }
.need { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; margin: 4px 0; }
.need span { font-size: 11.5px; font-weight: 600; }
.need.vinc span { color: #d2557f; }
.bar { height: 11px; border-radius: 7px; background: #f0e9f3; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 7px; transition: width .5s ease; }
.fam-hint { font-size: 11.5px; color: #a98bbb; margin-top: 8px; font-style: italic; }
.fam-hint.ready { color: #e0457e; font-weight: 700; font-style: normal; }
.stock { margin-top: 10px; font-size: 12px; }
.stock b { color: #7a5d8a; }

.who { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.who .dot { width: 13px; height: 13px; border-radius: 50%; }
.who h2 { font-family: 'Baloo 2'; font-size: 17px; flex: 1; }
.doing { font-size: 11px; font-style: italic; color: #9b7bab; }
.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-bottom: 8px; }
.row { font-size: 12px; margin: 5px 0; line-height: 1.7; }
.row b { color: #7a5d8a; font-family: 'Baloo 2'; font-size: 12px; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; background: #f4eefb; color: #6a4d7a; padding: 2px 7px; border-radius: 8px; margin: 1px; }
.muted { font-size: 11px; color: #b3a6bd; font-style: italic; }
.badge-baby { font-size: 10px; font-weight: 800; color: #fff; background: #ff8fb1; padding: 2px 7px; border-radius: 8px; }
.badge-joven { background: #74b9ff; }
.learn { margin-top: 8px; }
.learn ul { list-style: none; display: grid; gap: 4px; margin-top: 5px; }
.learn li { font-size: 12px; background: #fff6fb; border-left: 3px solid var(--pink); padding: 5px 8px; border-radius: 7px; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 130px; }
#chatlog { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.msg { font-size: 12.5px; padding: 6px 10px; border-radius: 11px; background: #f7f2fb; }
.msg b { font-family: 'Baloo 2'; }
.msg.birth { background: linear-gradient(90deg,#fff0f6,#eef6ff); font-weight: 700; }

@media (max-width: 860px) { main { flex-direction: column; } #panel { width: 100%; height: 44%; } #minimap { width: 110px; height: 110px; } }
