* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: "Trebuchet MS", system-ui, sans-serif; background: #0b2a3a; color: #fff; user-select: none; }
canvas#game { display: block; width: 100vw; height: 100vh; touch-action: none; }

.pill { background: rgba(8, 32, 48, .88); border: 2px solid #2f7f99; border-radius: 12px; padding: 6px 12px; font-weight: 700; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
#topbar { position: fixed; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; gap: 8px; }
#topbar > * { pointer-events: auto; }
#logo { font-size: 18px; letter-spacing: 1px; color: #ffd86b; text-shadow: 2px 2px 0 #b5462e; }
#roomName { font-size: 13px; color: #bfe9ff; margin-left: 8px; font-weight: 400; }
#topRight { display: flex; gap: 8px; }
#clock { font-size: 14px; }
#coins { display: flex; align-items: center; gap: 6px; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a8, #f2b818 55%, #b07a07); border: 2px solid #7a5200; }
#level { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
#level .xpbar { width: 70px; height: 8px; background: #0a2230; border-radius: 5px; overflow: hidden; border: 1px solid #2f7f99; }
#level .xpfill { height: 100%; background: #9be7ff; transition: width .3s; }

#bottombar { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; }
#chatInput { width: min(360px, 40vw); padding: 9px 12px; border-radius: 10px; border: 2px solid #2f7f99; background: #fff; color: #123; font-size: 14px; outline: none; }
.btn { background: #ffb347; color: #3a1d00; border: none; border-radius: 10px; padding: 9px 12px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 #b8691a; font-family: inherit; font-size: 13px; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b8691a; }
.btn.blue { background: #5cc8e8; color: #06263a; box-shadow: 0 3px 0 #2b7d99; }
.btn.small { padding: 4px 8px; font-size: 11px; box-shadow: 0 2px 0 #b8691a; }

.panel { position: fixed; right: 10px; top: 60px; width: 320px; max-height: calc(100vh - 140px); overflow: auto; background: rgba(8, 32, 48, .95); border: 2px solid #2f7f99; border-radius: 14px; padding: 12px; display: none; box-shadow: 0 6px 0 rgba(0,0,0,.35); z-index: 10; }
.panel.open { display: block; }
.panel h2 { font-size: 16px; color: #ffd86b; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.panel h2 span { cursor: pointer; color: #bfe9ff; font-size: 18px; }
.panel p { font-size: 13px; line-height: 1.5; color: #d9f2ff; margin-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.item { background: #12445a; border: 2px solid transparent; border-radius: 10px; padding: 4px; text-align: center; cursor: pointer; font-size: 11px; line-height: 1.3; }
.item:hover { border-color: #ffd86b; }
.item.locked { opacity: .45; cursor: not-allowed; }
.item.locked:hover { border-color: transparent; }
.item canvas { width: 80px; height: 65px; display: block; margin: 0 auto; image-rendering: pixelated; }
.item .emoji { font-size: 30px; line-height: 56px; height: 56px; }
.item .price { color: #ffd86b; font-weight: 700; }
.item .mini { margin-top: 4px; }
.empty { font-size: 13px; color: #9cc; text-align: center; padding: 16px 0; }
.section { font-size: 13px; color: #ffd86b; font-weight: 700; margin: 12px 0 6px; }
.section:first-of-type { margin-top: 0; }

.quest { background: #12445a; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.quest.done { opacity: .6; }
.quest .top, .statrow .top { display: flex; justify-content: space-between; gap: 6px; }
.bar2 { height: 8px; background: #0a2230; border-radius: 5px; overflow: hidden; margin-top: 5px; border: 1px solid #2f7f99; }
.bar2 div { height: 100%; background: #6cc072; }
.bar2.xp div { background: #9be7ff; }
.bar2.rel div { background: #f28bb8; }
.statrow { font-size: 13px; margin-bottom: 9px; }
.tag { display: inline-block; background: #12445a; border-radius: 8px; padding: 2px 8px; margin: 2px 2px 0 0; font-size: 12px; }

.look-top { display: flex; align-items: center; gap: 10px; background: radial-gradient(circle at 50% 70%, #1f6a86, #0f3a50); border-radius: 12px; padding: 6px; }
.look-prev { width: 120px; height: 150px; }
.look-btns { display: flex; flex-direction: column; gap: 6px; }
.look-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin: 5px 0; text-align: left; }
.look-row.col { flex-direction: column; align-items: flex-start; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper b { min-width: 118px; text-align: center; font-size: 12px; background: #12445a; border-radius: 6px; padding: 4px 6px; }
.stepper button { background: #ffb347; border: none; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; font-weight: 700; color: #3a1d00; }
.sw.mini { width: 20px; height: 20px; border-width: 2px; }
#welcome .card { max-height: 94vh; overflow: auto; }
#welcomeEditor { text-align: left; }
#allowance { font-size: 10px; color: #bfe9ff; font-weight: 400; margin-left: 4px; }
.tints { display: grid; grid-template-columns: repeat(5, 22px); gap: 6px; padding: 4px 6px 8px; }
.prof-head { display: flex; gap: 10px; align-items: center; background: radial-gradient(circle at 40% 70%, #1f6a86, #0f3a50); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.prof-head canvas { width: 96px; height: 120px; flex-shrink: 0; }
.prof-info { font-size: 13px; line-height: 1.6; }
.prof-info .pname { font-size: 18px; font-weight: 700; color: #ffd86b; }
.prof-info .btn { margin-top: 4px; }
.needgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: #12445a; border-radius: 10px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.stat span { font-size: 18px; } .stat b { font-size: 15px; color: #ffd86b; } .stat small { font-size: 10px; color: #9cc; }
.friend { display: flex; gap: 8px; align-items: center; background: #12445a; border-radius: 10px; padding: 4px 8px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.friend:hover { outline: 2px solid #ffd86b; }
.friend canvas { width: 40px; height: 50px; }
.friend .top { display: flex; justify-content: space-between; }
.friend small { color: #9cc; font-size: 11px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.badge { background: #12445a; border: 2px solid #ffd86b; border-radius: 10px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; font-size: 11px; }
.badge span { font-size: 20px; } .badge small { color: #9cc; font-size: 10px; }
.badge.locked { border-color: transparent; opacity: .5; }
#profilePanel, #npcPanel { width: 400px; max-width: calc(100vw - 20px); }
#zoomBox { position: fixed; right: 10px; bottom: 10px; display: flex; gap: 4px; }
#zoomBox .btn { width: 32px; padding: 6px 0; font-size: 15px; }
.sizebox { background: #12445a; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.sizebox .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.sizebox .grid2 .btn { font-size: 11px; padding: 6px 4px; white-space: normal; }
.fee { color: #ffd86b; font-size: 11px; }
.panel.wide { width: 420px; max-width: calc(100vw - 20px); }
.panel.wide .grid { grid-template-columns: repeat(4, 1fr); }
.search { width: 100%; padding: 8px 10px; border-radius: 8px; border: 2px solid #2f7f99; font-family: inherit; font-size: 13px; margin-bottom: 6px; outline: none; }
.build { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ffd86b; margin-bottom: 8px; cursor: pointer; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.tab { background: #12445a; color: #d9f2ff; border: 2px solid transparent; border-radius: 8px; padding: 4px 8px; font-family: inherit; font-size: 12px; cursor: pointer; }
.tab.on { border-color: #ffd86b; color: #ffd86b; font-weight: 700; }
.place { display: flex; align-items: center; gap: 8px; background: #12445a; border: 2px solid transparent; border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; }
.place.here { border-color: #ffd86b; }
.place .pic { font-size: 24px; width: 32px; text-align: center; }
.place .info { flex: 1; min-width: 0; font-size: 13px; }
.place .info small { display: block; color: #9cc; font-size: 11px; line-height: 1.3; }
.place .acts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.here-tag { font-size: 11px; color: #ffd86b; white-space: nowrap; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form input, .form select { padding: 8px; border-radius: 8px; border: 2px solid #2f7f99; font-family: inherit; font-size: 13px; background: #fff; color: #123; }
.form small { font-size: 11px; color: #9cc; }
.swatches.left { justify-content: flex-start; }
.sw.sq { border-radius: 6px; }

#ctxmenu { position: fixed; display: none; background: rgba(8, 32, 48, .96); border: 2px solid #ffd86b; border-radius: 10px; padding: 6px; z-index: 20; min-width: 150px; }
#ctxmenu .title { font-size: 12px; color: #ffd86b; padding: 2px 6px 6px; font-weight: 700; }
#ctxmenu button { display: block; width: 100%; text-align: left; background: none; border: none; color: #fff; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 13px; }
#ctxmenu button:hover { background: #2f7f99; }

#dialog { position: fixed; left: 50%; bottom: 66px; transform: translateX(-50%); width: min(520px, 94vw); background: rgba(8, 32, 48, .97); border: 3px solid #ffd86b; border-radius: 14px; padding: 12px 14px; display: none; z-index: 25; box-shadow: 0 6px 0 rgba(0,0,0,.4); }
#dialog .who { color: #ffd86b; font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
#dialog .who small { color: #f28bb8; font-weight: 400; font-size: 12px; }
#dialog .line { font-size: 15px; line-height: 1.45; margin-bottom: 10px; }
#dialog .opts { display: flex; flex-direction: column; gap: 6px; }
#dialog .opt { text-align: left; background: #12445a; color: #fff; border: 2px solid #2f7f99; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-family: inherit; font-size: 14px; }
#dialog .opt:hover { border-color: #ffd86b; }

#log { position: fixed; left: 10px; bottom: 64px; width: 300px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
#log div { background: rgba(8, 32, 48, .75); border-radius: 8px; padding: 4px 8px; font-size: 12px; transition: opacity 1s; }
#log b { color: #ffd86b; }

#toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: #ffd86b; color: #3a1d00; font-weight: 700; padding: 8px 14px; border-radius: 10px; display: none; z-index: 30; box-shadow: 0 3px 0 #b8691a; max-width: 90vw; text-align: center; }
#hint { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); background: rgba(8, 32, 48, .88); border: 2px solid #5cc8e8; border-radius: 10px; padding: 6px 10px; font-size: 12px; display: none; white-space: nowrap; }

#needs { position: fixed; top: 60px; left: 10px; width: 210px; padding: 10px; }
#needs .row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 5px; }
#needs .row .ic { width: 18px; text-align: center; }
#needs .row .nm { width: 58px; color: #d9f2ff; font-weight: 400; }
#needs .bar { flex: 1; height: 10px; background: #0a2230; border-radius: 6px; overflow: hidden; border: 1px solid #2f7f99; }
#needs .fill { height: 100%; border-radius: 6px; transition: width .3s, background .3s; }
#mood { font-size: 13px; margin-bottom: 8px; color: #ffd86b; }

#welcome { position: fixed; inset: 0; background: rgba(4, 20, 32, .82); display: none; align-items: center; justify-content: center; z-index: 50; }
#welcome.open { display: flex; }
#welcome .card { background: #0f3a50; border: 3px solid #ffd86b; border-radius: 18px; padding: 20px; width: min(380px, 92vw); text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.4); }
#welcome h1 { color: #ffd86b; text-shadow: 3px 3px 0 #b5462e; font-size: 30px; margin-bottom: 4px; }
#welcome .sub { color: #bfe9ff; font-size: 13px; margin-bottom: 10px; }
#welcome input { width: 100%; padding: 10px; border-radius: 10px; border: 2px solid #2f7f99; font-size: 15px; margin: 8px 0; text-align: center; outline: none; }
#preview { width: 120px; height: 130px; image-rendering: pixelated; }
.label { font-size: 12px; color: #bfe9ff; margin-top: 6px; }
.swatches { display: flex; gap: 6px; justify-content: center; margin: 4px 0; flex-wrap: wrap; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.sw.on { border-color: #fff; }
#enterBtn { margin-top: 12px; width: 100%; font-size: 16px; padding: 12px; }

.bar2.rom > div { background: linear-gradient(90deg, #f28bb8, #e0457b); }
.bar2.trust > div { background: linear-gradient(90deg, #5cc8e8, #3a7bd5); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos figure { margin: 0; background: #fff; padding: 4px 4px 2px; border-radius: 4px; transform: rotate(-1deg); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.photos figure:nth-child(2n) { transform: rotate(1.2deg); }
.photos img { width: 100%; display: block; image-rendering: pixelated; }
.photos figcaption { color: #333; font-size: 10px; text-align: center; padding: 2px 0; }
#ctxmenu { max-height: 80vh; overflow-y: auto; }

/* guarda-roupa */
.ward { display: flex; gap: 10px; align-items: flex-start; }
.ward-left { flex: 0 0 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: radial-gradient(circle at 50% 75%, #1f6a86, #0f3a50); border-radius: 12px; padding: 6px; position: sticky; top: 0; }
.ward-left .look-prev { width: 132px; height: 270px; image-rendering: pixelated; }
.ward-left .look-btns { flex-direction: row; }
.ward-right { flex: 1; min-width: 0; }
.ward-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; margin-bottom: 8px; }
.ward-tabs button { background: #12445a; border: 2px solid transparent; border-radius: 9px; color: #fff; font-size: 18px; padding: 4px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.ward-tabs button small { font-size: 9px; color: #bde; line-height: 1.1; }
.ward-tabs button.on { border-color: #ffd86b; background: #1b5d78; }
.ward-title { font-weight: bold; margin: 2px 0 6px; text-align: left; }
.ward-sub { font-size: 12px; color: #9cc; margin: 8px 0 4px; text-align: left; }
.ward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 5px; }
.ward-item { background: #e9f3f6; border: 2px solid #9cc; border-radius: 9px; padding: 3px 2px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.ward-item canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.ward-item small { font-size: 9px; color: #234; line-height: 1.1; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ward-item.on { border-color: #ffb400; background: #fff6d6; box-shadow: 0 0 0 2px #ffd86b; }
.ward-colors { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 560px) { .ward { flex-direction: column; } .ward-left { position: static; flex: none; width: 100%; } }
#visualPanel { width: 680px; }
#welcome .card { width: min(700px, 96vw); }
/* nascimento do bebê */
#birthBox { position: fixed; inset: 0; background: rgba(8, 20, 40, .55); display: none; align-items: center; justify-content: center; z-index: 60; }
#birthBox .birth-card { background: #1d3550; color: #fff; border: 3px solid #ffd86b; border-radius: 16px; padding: 20px 22px; width: min(380px, 92vw); text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
#birthBox h2 { margin: 0 0 8px; color: #ffd86b; }
#birthBox input { width: 100%; box-sizing: border-box; padding: 10px; border-radius: 10px; border: 0; font-size: 16px; margin: 10px 0 12px; }
#birthBox .birth-sex { display: flex; gap: 10px; justify-content: center; }
#birthBox .btn.pink { background: #f28bb8; }

#ctxmenu { max-height: calc(100vh - 16px); overflow-y: auto; }

#onlinePill { cursor: pointer; font-size: 13px; }
#onlinePill.off { opacity: .6; }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-st { display: flex; align-items: center; gap: 10px; text-align: left; background: #12445a; color: #fff; border: 2px solid transparent; border-radius: 10px; padding: 7px 10px; cursor: pointer; font-family: inherit; }
.radio-st:hover { border-color: #5cc8e8; }
.radio-st.on { border-color: #ffd86b; background: #1b5a72; }
.radio-st .ri { font-size: 22px; }
.radio-st small { display: block; color: #bfe9ff; font-size: 11px; }
.radio-st .eq { margin-left: auto; color: #ffd86b; letter-spacing: 1px; animation: eq .6s infinite alternate; }
@keyframes eq { from { opacity: .4; } to { opacity: 1; } }
.radio-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.radio-row input[type=range] { flex: 1; }

#ctrlBar { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: none; align-items: center; gap: 10px; background: rgba(176,124,216,.95); color: #fff; padding: 6px 12px; border-radius: 12px; font-size: 14px; z-index: 20; box-shadow: 0 3px 0 #6d4590; }

#workBar { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: none; align-items: center; gap: 8px; background: rgba(18,68,90,.95); color: #fff; padding: 6px 12px; border-radius: 12px; font-size: 14px; z-index: 20; border: 2px solid #ffd86b; }

#gems { font-size: 15px; font-weight: 700; color: #bff3ff; }
.item.gem-item { background: linear-gradient(160deg, #1b4f6e, #2b3a7a); border-color: #7fd6ff; }
.price.gem { color: #9fe8ff; font-weight: 700; }

.friend-ask { position: fixed; top: 110px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; gap: 8px; align-items: center; background: #12445a; border: 2px solid #ffd86b; color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.pm-box { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px; background: rgba(0,0,0,.18); border-radius: 10px; margin: 6px 0; }
.pm { align-self: flex-start; background: #1b5a72; padding: 6px 10px; border-radius: 12px 12px 12px 3px; max-width: 80%; font-size: 13px; word-wrap: break-word; }
.pm.eu { align-self: flex-end; background: #ffb347; color: #3a1d00; border-radius: 12px 12px 3px 12px; }
.pm-send { display: flex; gap: 6px; } .pm-send input { flex: 1; border-radius: 8px; border: none; padding: 7px; font-family: inherit; }
/* v36 anúncio com recompensa */
#btnAd { cursor: pointer; color: #bff3ff; background: linear-gradient(#1f6f3f, #134d2b); border-color: #5fd38a; animation: adPulse 2.4s infinite; }
#btnAd.off { animation: none; filter: saturate(.4); opacity: .8; }
@keyframes adPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
#adDemo { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 9999; display: flex; align-items: center; justify-content: center; }
#adDemo .card { background: #0d2a3a; border: 3px solid #5fd38a; border-radius: 16px; padding: 22px; max-width: 340px; text-align: center; color: #fff; position: relative; }
#adDemo .tag { position: absolute; top: 8px; left: 10px; font-size: 10px; background: #ffd86b; color: #222; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
#adDemo .bar { height: 8px; background: #123; border-radius: 4px; overflow: hidden; margin: 12px 0; }
#adDemo .bar i { display: block; height: 100%; width: 0; background: #5fd38a; animation: adFill 5s linear forwards; }
@keyframes adFill { to { width: 100%; } }
#adDemo .cnt { font-size: 28px; font-weight: 700; margin: 6px 0 12px; }
/* v37: Visual e Perfil ficam no menu do boneco (clique em você) */
#btnVisual, #btnProfile { display: none !important; }
