/* Piu — linguagem "figurinha": tudo que dá pra tocar é um adesivo recortado
   (borda branca grossa, sombra dura, levemente torto) colado em cima do cenário
   ou da bandeja roxa. Mobile first; no desktop vira um aparelhinho centralizado. */
:root {
  --ink: #2B1D4E;      /* roxo-uva: texto, contornos, bandeja */
  --ink-2: #3C2C68;    /* superfícies dentro da bandeja */
  --ink-mut: #A99BD0;  /* texto apagado em cima do roxo */
  --paper: #F4F0FF;    /* fundo das folhas (modais, telas de jogo) */
  --line: #DED5F5;
  --mut: #74679A;
  --lime: #B8F03C; --pink: #FF5C9D; --sky: #4FC3F7; --sun: #FFC83D; --orange: #FF8A3D;
  --hard: 0 4px 0 rgba(20, 10, 45, .38);
  --display: 'Lilita One', 'Rubik', system-ui, sans-serif;
  --tap: 48px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--ink); overscroll-behavior: none; touch-action: manipulation; }
body { font-family: 'Rubik', system-ui, sans-serif; font-size: 16px; font-weight: 500; user-select: none; -webkit-user-select: none; touch-action: manipulation; overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { opacity: .45; pointer-events: none; }
button:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
[hidden] { display: none !important; }
b { font-weight: 700; }

#app { position: relative; width: 100%; height: 100dvh; display: flex; flex-direction: column; background: var(--ink); overflow: hidden; }

/* ---------- PALCO (cenário 3D ocupa tudo, HUD flutua por cima) ---------- */
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; }
.room-deco { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.room-deco canvas { position: absolute; inset: 0; }
.stage.swap-r .room-deco { animation: inR .32s cubic-bezier(.2,.9,.3,1); }
.stage.swap-l .room-deco { animation: inL .32s cubic-bezier(.2,.9,.3,1); }
@keyframes inR { from { transform: translateX(40px); opacity: .3; } }
@keyframes inL { from { transform: translateX(-40px); opacity: .3; } }

.hud { position: absolute; z-index: 6; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 0; }
.lvl { display: flex; align-items: center; min-height: var(--tap); }
.lvl > span { position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 21px; background: var(--lime); color: var(--ink); border: 3px solid var(--ink); }
.xpbar { width: 54px; height: 14px; margin-left: -6px; border-radius: 0 8px 8px 0; background: #fff; border: 3px solid var(--ink); border-left: 0; overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: var(--lime); transition: width .5s ease; }
.name { flex: 1; min-width: 0; font-family: var(--display); font-size: 22px; letter-spacing: .3px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 2px 2px #fff, -2px -2px #fff, 2px -2px #fff, -2px 2px #fff; padding: 2px 4px; }
.coins { display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px 0 6px; border-radius: 20px; background: var(--sun); border: 3px solid var(--ink); font-family: var(--display); font-size: 18px; transform: rotate(-2deg); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.bump { animation: bump .3s ease; }
@keyframes bump { 40% { transform: scale(1.22) rotate(-4deg); } }
.nope { animation: nope .4s; }
@keyframes nope { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }

/* status: 4 adesivos com medidor */
.stats { position: absolute; z-index: 6; left: 12px; right: 12px; top: calc(62px + env(safe-area-inset-top)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { --v: 50; display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 7px 0 3px; border-radius: 17px; background: #fff; border: 2.5px solid var(--ink); }
.stat > span { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--col); color: var(--ink); display: grid; place-items: center; }
.meter { flex: 1; height: 8px; border-radius: 4px; background: #ECE6FA; overflow: hidden; }
.meter i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--col); border-radius: 4px; transition: width .6s ease; }
.stat.low { border-color: #E2335F; animation: lowp 1s infinite; }
.stat.low .meter i { background: #E2335F; }
@keyframes lowp { 50% { transform: rotate(-3deg) scale(1.04); } }

.pet-wrap { position: absolute; left: 30%; top: 30%; width: 40%; height: 50%; touch-action: none; z-index: 2; cursor: pointer; }
.pet-wrap svg { width: 100%; height: 100%; overflow: visible; display: block; }
.piu { overflow: visible; }
.piu .mouth > g, .piu .closed, .piu .brows, .piu .dirt { display: none; }

.stink { position: absolute; left: 50%; bottom: 62%; transform: translateX(-50%); display: none; gap: 12px; z-index: 3; pointer-events: none; }
.stink.on { display: flex; }
.stink i { font-style: normal; color: #7E9A45; opacity: .8; animation: stink 2s infinite; transform: rotate(90deg); }
.stink i:nth-child(2) { animation-delay: .5s; } .stink i:nth-child(3) { animation-delay: 1s; }
@keyframes stink { 0% { transform: rotate(90deg) translateX(10px); opacity: 0; } 50% { opacity: .8; } 100% { transform: rotate(90deg) translateX(-30px); opacity: 0; } }

/* balão de fala */
.say { position: absolute; left: 50%; top: calc(112px + env(safe-area-inset-top)); transform: translate(-50%, 8px) rotate(-1.5deg); opacity: 0; z-index: 5; pointer-events: none; background: #fff; border: 3px solid var(--ink); font-weight: 600; font-size: 16px; padding: 8px 14px; border-radius: 18px; white-space: nowrap; max-width: 86%; text-overflow: ellipsis; transition: transform .2s ease, opacity .2s; }
.say::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 14px; height: 14px; background: #fff; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.say.show { opacity: 1; transform: translate(-50%, 0) rotate(-1.5deg); }

.night-ov { position: absolute; inset: 0; background: rgba(18,12,48,.55); opacity: 0; pointer-events: none; transition: opacity .8s; z-index: 3; }
#app.night .night-ov { opacity: 1; }

/* voz */
.mic-bar { position: absolute; right: 12px; bottom: 40px; z-index: 5; display: flex; gap: 8px; align-items: center; }
.mic-btn, .voice-btn { width: 54px; height: 54px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; color: var(--ink); box-shadow: var(--hard); transition: transform .1s; }
.voice-btn { width: 44px; height: 44px; }
.mic-btn:active, .voice-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(20,10,45,.38); }
.mic-btn.on { background: var(--pink); color: #fff; box-shadow: 0 0 0 calc(4px + var(--lv, 0) * 14px) rgba(255,92,157,.32), var(--hard); transition: box-shadow .08s; }

/* ---------- BANDEJA (painel + navegação) ---------- */
.tray { position: relative; z-index: 8; margin-top: -24px; background: var(--ink); border-radius: 26px 26px 0 0; padding-top: 6px; color: #fff; }
.panel { min-height: 136px; padding: 8px 0 6px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.dock { display: flex; gap: 4px; padding: 4px 10px calc(8px + env(safe-area-inset-bottom)); }
.dock button { flex: 1; min-height: 50px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-mut); transition: flex .25s cubic-bezier(.2,.9,.3,1), background .2s; }
.dock button span { display: none; font-family: var(--display); font-size: 16px; }
.dock button.on { flex: 2.1; background: var(--lime); color: var(--ink); }
.dock button.on span { display: inline; }
.dock button:active { transform: scale(.94); }

.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 10px 14px 12px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
.hint { flex: 1; color: #DCD3F7; font-size: 15px; line-height: 1.35; }
.hint .ic { color: var(--lime); margin-right: 4px; }

/* adesivo genérico: comidas, itens da loja */
.food, .item { position: relative; flex: none; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; background: #fff; color: var(--ink); border-radius: 18px; box-shadow: 0 0 0 3px #fff, var(--hard); }
.food:nth-child(odd), .item:nth-child(odd), .gcard:nth-child(odd) { transform: rotate(-1.6deg); }
.food:nth-child(even), .item:nth-child(even), .gcard:nth-child(even) { transform: rotate(1.3deg); }
.food:active, .item:active, .gcard:active { transform: translateY(3px) rotate(0); box-shadow: 0 0 0 3px #fff, 0 1px 0 rgba(20,10,45,.38); }
.food { width: 84px; min-height: 100px; justify-content: center; gap: 2px; padding: 8px 4px 6px; }
.food small { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.food b { font-family: var(--display); font-weight: 400; font-size: 15px; display: flex; align-items: center; gap: 3px; }
.tag { position: absolute; top: -8px; right: -6px; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--pink); color: #fff; border: 2px solid #fff; transform: rotate(8deg); }

.tile { display: grid; place-items: center; border-radius: 14px; background: var(--tc); color: var(--ink); flex: none; border: 2.5px solid var(--ink); }
.food .tile { margin-bottom: 3px; }
.fly .tile { box-shadow: var(--hard); }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--tap); padding: 0 22px; border-radius: 16px; font-family: var(--display); font-size: 18px; letter-spacing: .2px; background: var(--lime); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); white-space: nowrap; transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.big { font-size: 21px; min-height: 56px; padding: 0 28px; }
.btn.wide { width: 100%; margin: 6px 0; }
.btn.ghost { background: #fff; }
.btn.danger { background: #fff; color: #D2275A; }
.btn.moon { background: #A493FF; }
.btn.sun { background: var(--sun); }
.tray .btn { border-color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.4); }

/* cards de jogo */
.gcard { position: relative; flex: none; width: 108px; height: 112px; scroll-snap-align: start; border-radius: 20px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: var(--c1, #fff); color: var(--ink); box-shadow: 0 0 0 3px #fff, var(--hard); }
.gcard .em { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); margin-bottom: 2px; }
.gcard b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.05; text-align: center; }
.gcard small { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.gcard.spin { --c1: var(--sun); }
.gcard.ach { --c1: #fff; }
.gcard.new::before { content: 'novo'; position: absolute; top: -9px; left: -6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--pink); color: #fff; border: 2px solid #fff; transform: rotate(-8deg); }
.dot { position: absolute; top: 7px; right: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--pink); border: 2px solid var(--ink); }

/* loja */
.seg { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1; min-height: 36px; padding: 0 10px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-mut); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.seg button.on { background: var(--ink-2); color: #fff; }
.item { width: 94px; padding: 8px 4px 7px; gap: 1px; }
.item.using { background: var(--lime); }
.item .prev { width: 56px; height: 58px; }
.item .prev svg, .item .prev img { width: 100%; height: 100%; object-fit: contain; overflow: visible; }
.item small { font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.item b { font-family: var(--display); font-weight: 400; font-size: 14px; display: flex; align-items: center; gap: 3px; }
.rar { position: absolute; top: 6px; left: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--rc); border: 2px solid var(--ink); font-size: 0; }
.item.box { background: var(--sun); justify-content: center; }
.gift-mini { height: 58px; display: grid; place-items: center; animation: wiggle 2.4s infinite; }
@keyframes wiggle { 0%,80%,100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-5deg); } }

/* ovo */
.egg-row { flex-direction: column; gap: 12px; text-align: center; }
.eggbar { width: min(260px, 80%); height: 16px; border-radius: 9px; background: var(--ink-2); border: 2.5px solid #fff; overflow: hidden; }
.eggbar i { display: block; height: 100%; background: var(--sun); transition: width .2s; }

/* ---------- FX ---------- */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.fly { position: fixed; left: 0; top: 0; will-change: transform; }
.part { position: fixed; will-change: transform, opacity; }
.float { position: fixed; transform: translate(-50%, -50%); font-family: var(--display); white-space: nowrap; text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 2px 2px #fff, -2px -2px #fff; animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { 0% { transform: translate(-50%, -30%) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; } 100% { transform: translate(-50%, -150%); opacity: 0; } }
.part .ic, .fly .ic, .float .ic { width: 1em; height: 1em; }
.soap { position: fixed; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: inset -3px -3px 0 rgba(160,210,225,.6); animation: soap 1.6s ease-out forwards; }
@keyframes soap { 0% { transform: translate(-50%, -50%) scale(.2); } 20% { transform: translate(-50%, -50%) scale(1.05); } 80% { opacity: 1; } 100% { transform: translate(-50%, -90%); opacity: 0; } }
.drop { position: fixed; width: 4px; height: 14px; border-radius: 4px; background: #7EC3E6; animation: drop .9s linear forwards; }
@keyframes drop { to { transform: translateY(var(--h)); opacity: .2; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 300; }

#toast { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translate(-50%, -180%); z-index: 250; width: max-content; max-width: calc(100vw - 32px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 16px; border: 3px solid #fff; box-shadow: var(--hard); font-size: 15px; line-height: 1.4; text-align: center; transition: transform .3s cubic-bezier(.2,.9,.3,1); }
#toast.show { transform: translate(-50%, 0) rotate(-1deg); }
#toast .ic { vertical-align: -0.2em; color: var(--lime); }

/* ---------- MODAL (folha que sobe) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(20,12,45,0); transition: background .22s; }
.modal.hidden { display: none; }
.modal.show { background: rgba(20,12,45,.55); }
.sheet { width: 100%; max-height: 90dvh; overflow-y: auto; text-align: center; padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); border-top: 3px solid var(--ink); transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.sheet::before { content: ''; display: block; width: 44px; height: 6px; border-radius: 3px; background: var(--ink); opacity: .2; margin: -8px auto 12px; }
.modal.show .sheet { transform: none; }
.modal.ghost { background: transparent !important; pointer-events: none; }
.modal.ghost .sheet { transform: translateY(110%) !important; }
.sheet h2 { margin: 4px 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.mut { color: var(--mut); margin: 6px 0 14px; line-height: 1.4; }
.sheet .btn.big { margin-top: 12px; width: 100%; }
.btns { display: flex; gap: 10px; margin-top: 8px; }
.btns .btn { flex: 1; }
.btns .btn.big { margin-top: 0; }
.reward { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 32px; color: var(--ink); background: var(--sun); border: 3px solid var(--ink); border-radius: 18px; padding: 4px 16px; margin: 10px 0; transform: rotate(-2deg); }
.field { display: block; text-align: left; font-size: 14px; font-weight: 600; color: var(--mut); margin: 6px 0 12px; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 14px 16px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-size: 18px; outline: none; user-select: text; -webkit-user-select: text; }
.field input:focus { box-shadow: 0 0 0 4px var(--lime); }
.prev.hero { width: 140px; height: 154px; margin: 0 auto; animation: hatch .6s ease; }
.prev.hero svg, .prev.hero img { width: 100%; height: 100%; object-fit: contain; overflow: visible; }
.prev.hero.evo { width: 170px; height: 170px; }
@keyframes hatch { 0% { transform: scale(0); } 70% { transform: scale(1.08); } }

.lvl-burst { position: relative; width: 140px; height: 140px; margin: 0 auto; display: grid; place-items: center; }
.rays { position: absolute; inset: -30px; background: repeating-conic-gradient(rgba(184,240,60,.35) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lvl-big { position: relative; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 54px; color: var(--ink); background: var(--lime); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.1); } }

.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px; background: #fff; border: 2.5px solid var(--line); font-size: 12px; font-weight: 600; }
.day span { display: grid; place-items: center; height: 26px; } .day b { font-family: var(--display); font-weight: 400; font-size: 15px; }
.day.done { opacity: .45; }
.day.cur { background: var(--sun); border-color: var(--ink); transform: rotate(-2deg); }
.day:last-child { grid-column: span 2; }

.wheel-wrap { position: relative; width: min(290px, 80vw); aspect-ratio: 1; margin: 8px auto; }
.wheel-wrap canvas { width: 100%; height: 100%; }
.pointer { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 30px; color: var(--ink); }

.box-stage { height: 190px; display: grid; place-items: center; }
.gift { --s: 1; display: inline-grid; place-items: center; cursor: pointer; transform: scale(var(--s)); transition: transform .2s; animation: wiggle 2s infinite; }
.gift.shake { animation: boxshake .5s; }
@keyframes boxshake { 0%,100% { transform: scale(var(--s)) rotate(0); } 20% { transform: scale(calc(var(--s) * 1.1)) rotate(-12deg); } 45% { transform: scale(calc(var(--s) * 1.1)) rotate(12deg); } 70% { transform: scale(var(--s)) rotate(-6deg); } }
.rar-label { display: inline-block; font-family: var(--display); font-size: 18px; color: #fff; background: var(--rc); border: 3px solid var(--ink); padding: 3px 14px; border-radius: 12px; transform: rotate(-3deg); animation: pop .4s ease; }
.reveal { position: relative; width: 160px; height: 170px; margin: 8px auto; display: grid; place-items: center; }
.reveal .rays { background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 30%, transparent) 0 10deg, transparent 10deg 20deg); }
.reveal .prev { position: relative; width: 140px; height: 154px; animation: pop .5s ease; }
.reveal .prev svg, .reveal .prev img { width: 100%; height: 100%; object-fit: contain; overflow: visible; }

.achs { display: flex; flex-direction: column; gap: 8px; text-align: left; margin: 10px 0; }
.achi { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #fff; border: 2.5px solid var(--line); opacity: .6; }
.achi.ok { opacity: 1; border-color: var(--ink); }
.achi span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--paper); flex: none; }
.achi.ok span { background: var(--sun); }
.achi div { flex: 1; } .achi b { display: block; font-size: 15px; } .achi small { color: var(--mut); font-size: 13px; }
.achi i { font-style: normal; font-family: var(--display); font-size: 15px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }

/* ---------- MINIGAME ---------- */
.game { position: fixed; inset: 0; z-index: 60; background: var(--paper); touch-action: none; }
.game.hidden { display: none; }
#gc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ghud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; pointer-events: none; font-family: var(--display); font-size: 20px; color: var(--ink); }
.ghud .icon-btn { pointer-events: auto; width: var(--tap); height: var(--tap); }
#gLives { display: flex; gap: 2px; font-size: 18px; }
#gScore { flex: 1; text-align: center; font-size: 30px; text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 2px 2px #fff, -2px -2px #fff, 2px -2px #fff, -2px 2px #fff; }
#gTime { text-align: right; font-size: 18px; }
#gTime:not(:empty) { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 4px 10px; }
#gscreen { position: absolute; inset: 0; display: none; align-items: flex-end; background: rgba(20,12,45,.5); }
#gscreen.on { display: flex; }
.gs-card { width: 100%; text-align: center; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); border-top: 3px solid var(--ink); animation: up .3s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(100%); } }
.gs-card h2 { margin: 4px 0; font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.05; }
.gs-card p { margin: 6px auto 14px; color: var(--mut); max-width: 34ch; line-height: 1.4; }
.gs-card .btn { width: 100%; margin-top: 10px; }
.gs-em { font-size: 60px; line-height: 1.1; display: grid; place-items: center; }
.gs-best { color: var(--mut); font-size: 15px; }
.gs-rec { display: inline-block; font-family: var(--display); font-size: 22px; background: var(--lime); border: 3px solid var(--ink); border-radius: 14px; padding: 3px 14px; transform: rotate(-3deg); animation: pop .5s ease; }
.gs-coins { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 30px; margin: 12px 0 6px; background: var(--sun); border: 3px solid var(--ink); border-radius: 16px; padding: 2px 16px; transform: rotate(-2deg); }
.gs-stats { display: flex; justify-content: center; gap: 14px; font-size: 13px; color: var(--mut); }
.gbig { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); font-family: var(--display); font-size: 104px; color: var(--ink); pointer-events: none; text-shadow: 4px 0 #fff, -4px 0 #fff, 0 4px #fff, 0 -4px #fff, 4px 4px #fff, -4px -4px #fff, 4px -4px #fff, -4px 4px #fff; animation: gbig .7s ease forwards; }
@keyframes gbig { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-10deg); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.1) rotate(3deg); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; } }

/* ---------- ÍCONES ---------- */
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
.btn .ic, .seg button .ic, #toast .ic, .reward .ic, .gs-coins .ic, .item b .ic, .food b .ic, .gcard small .ic { vertical-align: -0.2em; }

/* telas baixinhas */
@media (max-height: 660px) {
  .panel { min-height: 116px; } .food { min-height: 88px; } .gcard { height: 98px; } .gcard .em { width: 36px; height: 36px; }
  .dock button { min-height: 44px; }
}
/* desktop/tablet: aparelhinho centralizado */
@media (min-width: 560px) {
  body { background: #1C1236; }
  #app, .game { max-width: 430px; margin: 0 auto; left: 0; right: 0; }
  #app { border-left: 3px solid #fff; border-right: 3px solid #fff; }
  .modal .sheet { max-width: 430px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- APOIE O DEV ---------- */
.gcard.sup { --c1: #fff; }
.pix-vals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 14px; }
.pix-vals button { min-height: 44px; border-radius: 14px; background: #fff; border: 2.5px solid var(--line); font-family: var(--display); font-size: 16px; line-height: 1.05; padding: 0 4px; }
.pix-vals button.on { background: var(--lime); border-color: var(--ink); transform: rotate(-2deg); }
.pix-qr { width: min(210px, 60vw); aspect-ratio: 1; margin: 0 auto; padding: 12px; background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--hard); }
.pix-qr svg { display: block; width: 100%; height: 100%; }
.pix-tip { font-size: 13px; color: var(--mut); line-height: 1.45; margin: 14px auto 2px; max-width: 34ch; }
.pix-tip b { color: var(--ink); }
.gs-sup { display: block; margin: 14px auto 0; font-size: 14px; color: var(--mut); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.gs-sup b { color: var(--ink); }
.item.sup { justify-content: center; background: #FFE3EE; }

/* ---------- ESTÚDIO (loja) ---------- */
.seg-row { display: flex; align-items: center; gap: 6px; padding-right: 12px; }
.seg-row .seg { flex: 1; min-width: 0; }
.seg-row .seg button { flex: none; }
.dice { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sun); color: var(--ink); border: 2.5px solid #fff; }
.dice:active { transform: rotate(-20deg) scale(.9); }
.item.trying { background: var(--sun); }
.item.trying b { animation: lowp 1s infinite; }
.swatch { display: block; width: 100%; height: 100%; border-radius: 10px; border: 2.5px solid var(--ink); background: linear-gradient(var(--w) 0 62%, var(--ink) 62% 64%, var(--f) 64%); }
.reveal .prev .swatch { width: 120px; height: 120px; margin: 17px auto; border-radius: 22px; }

/* ---------- BACKUP ---------- */
.code-box { margin: 4px auto 0; padding: 12px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--hard); transform: rotate(-1deg); }
.code-box small { display: block; font-size: 12px; font-weight: 600; color: var(--mut); }
.code-box b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: 2px; margin-top: 2px; user-select: text; -webkit-user-select: text; }
.err { color: #D2275A; font-weight: 600; font-size: 14px; margin: -4px 0 8px; }

/* ---------- ATUALIZAÇÃO ---------- */
.upd { position: absolute; z-index: 6; left: 12px; right: 80px; bottom: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--lime); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--hard); font-family: var(--display); font-size: 17px; transform: rotate(-1deg); animation: pop .4s ease; }
.upd .btn { min-height: 40px; padding: 0 16px; font-size: 16px; background: #fff; }
.ver { font-size: 13px; color: var(--mut); margin: 2px 0 8px; }

/* ---------- MISSÕES ---------- */
.icon-btn.mis { position: relative; background: var(--sun); }
.icon-btn.mis.has::after { content: ''; position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--pink); border: 2.5px solid var(--ink); animation: lowp 1s infinite; }
.name { background: none; border: 0; text-align: left; cursor: pointer; }
.mis { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; text-align: left; }
.misi { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 16px; background: #fff; border: 2.5px solid var(--line); }
.misi.done { border-color: var(--ink); background: #F4FFD9; }
.misi.got { opacity: .55; }
.mtxt { flex: 1; min-width: 0; }
.mtxt b { display: block; font-size: 15px; }
.mtxt small { font-size: 12px; color: var(--mut); }
.bar { display: block; height: 8px; border-radius: 4px; background: #ECE6FA; overflow: hidden; margin: 5px 0 2px; }
.bar > i { display: block; height: 100%; background: var(--lime); border-radius: 4px; }
.misi .btn { min-height: 40px; padding: 0 12px; font-size: 15px; }
.misi .ok { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); border: 2.5px solid var(--ink); }
.chest { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 18px; background: #fff; border: 2.5px dashed var(--line); margin-bottom: 4px; }
.chest div { flex: 1; } .chest b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; } .chest small { color: var(--mut); }
.chest.open { background: var(--sun); border: 3px solid var(--ink); transform: rotate(-1deg); }
.chest.open .ic { animation: wiggle 1.2s infinite; }
.chest.gone { opacity: .55; }
/* perfil / personalidade */
.trait-hero { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 18px; background: var(--tc); border: 3px solid var(--ink); margin: 4px 0 12px; transform: rotate(-1deg); }
.trait-hero b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; } .trait-hero small { font-size: 14px; }
.traits { display: grid; gap: 6px; margin: 6px 0 12px; text-align: left; }
.tr { display: grid; grid-template-columns: 28px 92px 1fr; align-items: center; gap: 8px; font-size: 14px; }
.tr span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--tc); border: 2px solid var(--ink); }
.tr .bar { margin: 0; }
/* compartilhar */
.card-prev { display: block; width: min(260px, 70vw); margin: 6px auto 8px; border-radius: 18px; border: 3px solid var(--ink); box-shadow: var(--hard); }
/* ranking */
.gcard.rank { --c1: #FFE07A; }
.rk-tabs { margin: 0 -6px 10px; padding: 0 6px; }
.rk-tabs button { flex: none; background: #fff; color: var(--mut); border: 2px solid var(--line); }
.rk-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.rk { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; min-height: 120px; }
.rki { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: #fff; border: 2px solid var(--line); text-align: left; }
.rki.me { border-color: var(--ink); background: #F4FFD9; }
.rki b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rki i { font-style: normal; font-family: var(--display); font-size: 17px; }
.pos { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); background: var(--paper); }
.pos.p1 { background: var(--sun); border: 2px solid var(--ink); } .pos.p2 { background: #E2E6F0; border: 2px solid var(--ink); } .pos.p3 { background: #F2B48C; border: 2px solid var(--ink); }
.gs-rank { display: block; margin: 10px auto 0; font-size: 15px; font-weight: 600; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 14px; }
/* avisos / anúncio */
.ask-ic { width: 76px; height: 76px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 50%; background: var(--sun); border: 3px solid var(--ink); transform: rotate(-6deg); }

/* ---------- iOS: app instalado sem faixa vazia embaixo ----------
   Bug do WebKit (iOS 26): com viewport-fit=cover + barra black-translucent, o app da
   tela inicial ganha uma viewport menor que a tela e sobra uma faixa no rodapé.
   No modo instalado não existe barra do Safari, então lvh = a tela inteira. E o JS
   (fixIOSHeight em app.js) ainda mede a tela e grava --app-h como garantia. */
@supports (height: 100lvh) {
  @media (display-mode: standalone) {
    html, body { height: 100lvh; }
    #app { height: 100lvh; }
  }
}
html.ios-app, html.ios-app body { height: var(--app-h); }
html.ios-app #app { height: var(--app-h); }
html.ios-app .game, html.ios-app .modal { bottom: auto; height: var(--app-h); }

/* ---------- MODO FOTO ---------- */
.cam-btn { position: absolute; left: 12px; bottom: 40px; z-index: 5; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; color: var(--ink); box-shadow: var(--hard); }
.cam-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(20,10,45,.38); }
body.photo .hud, body.photo .stats, body.photo .tray, body.photo .mic-bar, body.photo .cam-btn, body.photo .say, body.photo .upd, body.photo .stink { display: none !important; }
#photoUI { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; pointer-events: none; }
.ph-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 0; pointer-events: auto; }
.ph-top span { flex: 1; text-align: center; font-family: var(--display); font-size: 20px; color: var(--ink); text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff; }
.ph-layer { position: relative; flex: 1; }
.ph-bottom { pointer-events: auto; padding: 8px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(43,29,78,.55) 30%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ph-row { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 4px 12px; scrollbar-width: none; }
.ph-row::-webkit-scrollbar { display: none; }
.ph-row button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 6px 8px; border-radius: 14px; background: #fff; border: 2.5px solid var(--ink); color: var(--ink); font-size: 11px; font-weight: 600; }
.ph-row.stk button { flex-direction: row; min-width: 0; min-height: 40px; }
.ph-row.stk b { font-family: var(--display); font-weight: 400; font-size: 15px; background: var(--sc); padding: 2px 8px; border-radius: 8px; }
.shutter { width: 68px; height: 68px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); box-shadow: 0 0 0 4px #fff, var(--hard); }
.shutter:active { transform: scale(.92); }
.ph-stk { position: absolute; pointer-events: auto; touch-action: none; cursor: grab; filter: drop-shadow(0 3px 0 rgba(20,10,45,.35)); }
.ph-stk b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--ink); background: var(--sc); padding: 2px 12px; border-radius: 11px; box-shadow: 0 0 0 3px #fff; white-space: nowrap; }
.ph-stk .ic { display: block; filter: drop-shadow(0 0 0 #fff); }
.ph-flash { position: absolute; inset: 0; z-index: 30; background: #fff; animation: phf .4s ease-out forwards; pointer-events: none; }
@keyframes phf { from { opacity: .95; } to { opacity: 0; } }

/* ---------- COZINHA ---------- */
.food.cook { background: var(--sun); }
.food.cook .tile { background: #fff; }
.food.med { background: #FFE3EE; }
.pot { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 12px; }
.slot { width: 92px; height: 92px; border-radius: 22px; border: 3px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #fff; font-weight: 600; color: var(--mut); }
.slot.on { border: 3px solid var(--ink); color: var(--ink); transform: rotate(-2deg); }
.slot.on + .plus + .slot.on { transform: rotate(2deg); }
.plus { font-family: var(--display); font-size: 30px; }
.ingr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ingr button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; background: #fff; border: 2.5px solid var(--line); font-size: 11px; font-weight: 600; }
.ingr button.on { border-color: var(--ink); background: #F4FFD9; }
.ingr b { font-size: 11px; display: flex; align-items: center; gap: 2px; }
.book { display: grid; gap: 6px; text-align: left; margin: 8px 0 12px; max-height: 50dvh; overflow-y: auto; }
.rec { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.rec.lock { opacity: .55; }
.rec b { display: block; font-size: 14px; } .rec small { font-size: 12px; color: var(--mut); }
.rec .q { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); font-family: var(--display); font-size: 20px; color: var(--mut); }
.pan { height: 150px; display: grid; place-items: center; animation: boxshake .5s infinite; --s: 1; }
.cooked { display: grid; place-items: center; margin: 8px 0; animation: pop .5s ease; }

/* ====== natal: neve, calendário do advento ====== */
.snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snow i { position: absolute; top: -12px; border-radius: 50%; background: #fff; opacity: .85; box-shadow: 0 0 3px rgba(255,255,255,.6); animation: snowfall linear infinite; will-change: transform; }
@keyframes snowfall { to { transform: translate3d(var(--dx, 0), calc(var(--app-h, 100vh) + 24px), 0); } }
.gcard.natal { --c1: #FF7A7A; }
.adv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 10px 0 6px; }
.door { position: relative; aspect-ratio: 1; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: #fff; border: 2.5px solid var(--line); color: var(--ink); }
.door b { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1; }
.door span { display: grid; place-items: center; height: 18px; color: var(--mut); }
.door.can { background: var(--lime); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); animation: doorWob 2.4s ease-in-out infinite; }
.door.can span { color: var(--ink); }
.door.done { background: var(--paper); opacity: .55; }
.door.done span { color: #57B85A; }
.door.big { background: #FF7A7A; border-color: var(--ink); }
.door.big.lock span, .door.big.lock { color: var(--ink); }
.door.pop { animation: doorPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes doorWob { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg); } }
@keyframes doorPop { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .door.can { animation: none; } }

/* ====== desafio entre amigos ====== */
.ask-ic { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%; background: var(--sun); border: 3px solid var(--ink); box-shadow: var(--hard); }
.ask-ic.duel { background: var(--pink); color: #fff; transform: rotate(-4deg); }
.gs-duel { margin: 10px auto 0; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 12px; background: var(--paper); border: 2px dashed var(--ink); display: inline-block; }
.gs-duel.win { background: var(--lime); border-style: solid; }
.gs-row { display: flex; gap: 8px; justify-content: center; }
.gs-row .btn { flex: 1; }

/* ====== álbum de figurinhas ====== */
.gcard.album { --c1: #C9B8FF; }
.gcard .pk { position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; border-radius: 12px; background: var(--pink); color: #fff; font-style: normal; font-weight: 700; font-size: 13px; border: 2px solid #fff; transform: rotate(6deg); }
.alb-tabs { margin: 6px auto 10px; }
.alb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stk { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; padding: 10px 5px 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; background: var(--sc); color: var(--ink); box-shadow: 0 0 0 3px #fff, var(--hard); text-align: center; }
.alb .stk:nth-child(odd) { transform: rotate(-2deg); } .alb .stk:nth-child(even) { transform: rotate(1.5deg); }
.stk span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); margin: 4px 0 2px; }
.stk b { font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1.05; }
.stk small { font-size: 10.5px; line-height: 1.15; font-weight: 500; opacity: .8; }
.stk em { margin-top: auto; font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: #fff; color: var(--ink); border: 1.5px solid var(--rc); }
.stk .no { position: absolute; top: 5px; left: 8px; font-style: normal; font-family: var(--display); font-size: 12px; opacity: .55; }
.stk.r-lendario { background: linear-gradient(135deg, var(--sc), #FFE48A 50%, var(--sc)); }
.stk.r-lendario span { box-shadow: 0 0 0 3px #FFD23F; }
.stk.empty { background: transparent; box-shadow: none; border: 2.5px dashed var(--line); color: var(--mut); justify-content: center; }
.stk.empty b { font-size: 26px; opacity: .6; }
.pkn { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; margin-left: 4px; border-radius: 13px; background: var(--ink); color: #fff; font-size: 15px; }
.pk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 26px; perspective: 600px; }
.pk-slot { position: relative; aspect-ratio: 3 / 4; cursor: pointer; }
.pk-back { height: 100%; border-radius: 14px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--ink) 0 10px, var(--ink-2) 10px 20px); color: var(--lime); box-shadow: 0 0 0 3px #fff, var(--hard); animation: doorWob 1.8s ease-in-out infinite; }
.pk-slot:nth-child(2) .pk-back { animation-delay: -.6s; } .pk-slot:nth-child(3) .pk-back { animation-delay: -1.2s; }
.pk-slot .stk { height: 100%; }
.pk-slot.flip .stk { animation: stkFlip .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes stkFlip { from { transform: rotateY(90deg) scale(.9); } to { transform: none; } }
.pk-tag { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%) rotate(-4deg); white-space: nowrap; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #fff; color: var(--mut); border: 2px solid var(--line); }
.pk-tag.new { background: var(--pink); color: #fff; border-color: #fff; }
.ask-ic.bday { background: var(--lime); transform: rotate(4deg); }
@media (prefers-reduced-motion: reduce) { .pk-back { animation: none; } }

/* ====== escola ====== */
.gcard.dev-go { --c1: var(--lime); width: 150px; }
.gcard.dev-go b { font-size: 16px; }
.gcard.dev-sk { --c1: #fff; }
.gcard.locked { opacity: .75; }
.gcard.locked .em { color: var(--mut); }
.gcard.dev-brain { --c1: var(--sky); }
.gcard.dev-brain.locked { --c1: #E6E0F5; }
.dev-ls { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; text-align: left; }
.dev-l { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: #fff; border: 2.5px solid var(--line); color: var(--mut); }
.dev-l span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--paper); flex: none; }
.dev-l b { flex: 1; font-family: var(--display); font-weight: 400; font-size: 17px; }
.dev-l small { font-size: 12px; font-weight: 600; }
.dev-l.open { border-color: var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.dev-l.open span { background: var(--lime); }
.dev-l.done { color: var(--ink); }
.dev-l.done span { background: #57B85A; color: #fff; }

/* lição: o Piu fica visível em cima pra executar o código */
.modal:has(.sheet.lesson).show { background: rgba(20,12,45,.18); }
.sheet.lesson { max-height: 66dvh; text-align: left; display: flex; flex-direction: column; padding-top: 14px; }
.ls-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ls-x { display: grid; place-items: center; width: 36px; height: 36px; color: var(--mut); flex: none; }
.ls-bar { flex: 1; height: 14px; border-radius: 8px; background: var(--line); overflow: hidden; }
.ls-bar i { display: block; height: 100%; background: var(--lime); border-right: 2.5px solid var(--ink); border-radius: 8px; transition: width .4s cubic-bezier(.2,.9,.3,1); }
.ls-body { flex: 1; min-height: 0; }
.ls-q, .ls-card h3 { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.15; margin: 2px 0 12px; color: var(--ink); }
.ls-card { background: #fff; border: 2.5px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: var(--hard); margin-bottom: 12px; }
.ls-card h3 { margin: 6px 0 6px; }
.ls-card p { margin: 0; line-height: 1.45; color: var(--ink); }
.code, .bug-code, .ord-ans { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.55; }
.code { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #1E1838; color: #EDE8FF; white-space: pre-wrap; word-break: break-word; }
.tk { color: #FF9DC6; } .ts { color: #FFD45E; } .tn { color: #8FD8FF; } .tc { color: #8C82B3; font-style: italic; } .tp { color: #B8F03C; }
.gap { display: inline-block; min-width: 3.5em; padding: 0 6px; border-radius: 6px; border-bottom: 2.5px dashed #B8F03C; color: #B8F03C; text-align: center; }
.gap.fill { background: rgba(184,240,60,.15); border-bottom-style: solid; }
.gap.ok { background: #B8F03C; color: var(--ink); } .gap.bad { background: #FF5C9D; color: #fff; border-color: #FF5C9D; }
.ls-opts { display: flex; flex-direction: column; gap: 8px; }
.ls-opt { text-align: left; min-height: 50px; padding: 10px 14px; border-radius: 14px; background: #fff; border: 2.5px solid var(--line); font-weight: 600; font-size: 16px; color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.ls-opt.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14.5px; }
.ls-opt.on { border-color: var(--ink); background: #EFFAD6; box-shadow: 0 3px 0 var(--ink); }
.ls-opt.ok { border-color: #3E9B42; background: #DDF6C6; } .ls-opt.bad { border-color: #D2275A; background: #FFE0EA; }
.ls-chips, .ord-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 6px 14px; border-radius: 12px; background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px; font-weight: 600; color: var(--ink); text-align: left; }
.chip.on { background: var(--lime); }
.code-chip { background: #1E1838; color: #EDE8FF; border-color: #1E1838; box-shadow: 0 3px 0 #000; white-space: pre; font-weight: 500; font-size: 14px; }
.code-chip.used { opacity: .18; box-shadow: none; }
.ord-ans { min-height: 64px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; margin-bottom: 12px; border-radius: 14px; border: 2.5px dashed var(--line); }
.ord-ans small { font-family: Rubik, sans-serif; color: var(--mut); font-size: 13px; margin: auto; }
.ord-ans.has small { display: none; }
.ord-ans .chip { min-height: 38px; }
.bug-code { border-radius: 14px; overflow: hidden; background: #1E1838; }
.bug-ln { display: flex; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; color: #EDE8FF; border-bottom: 1px solid rgba(255,255,255,.06); }
.bug-ln i { font-style: normal; color: #6E6597; min-width: 1.2em; }
.bug-ln code { white-space: pre; font: inherit; }
.bug-ln.on { background: rgba(255,200,61,.22); box-shadow: inset 4px 0 0 var(--sun); }
.bug-ln.ok { background: rgba(184,240,60,.22); box-shadow: inset 4px 0 0 var(--lime); }
.bug-ln.bad { background: rgba(255,92,157,.25); box-shadow: inset 4px 0 0 var(--pink); }
.ls-foot { margin: 14px -18px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--paper); }
.ls-foot .btn.big { margin-top: 0; }
.ls-foot.good { background: #DDF6C6; border-top: 3px solid #3E9B42; }
.ls-foot.bad { background: #FFE0EA; border-top: 3px solid #D2275A; }
.ls-fb b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.ls-foot.good .ls-fb b { color: #2F7D33; } .ls-foot.bad .ls-fb b { color: #B5174A; }
.ls-fb p { margin: 4px 0 0; line-height: 1.4; font-size: 14.5px; color: var(--ink); }
.ls-fb code { font-family: ui-monospace, Menlo, monospace; background: #fff; padding: 1px 6px; border-radius: 6px; }
.ls-fb small { display: block; margin: 4px 0 10px; color: var(--mut); font-size: 12px; }
.ls-fb + .btn { margin-top: 10px !important; }
.ls-end { text-align: center; }
.ls-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.ls-stats div { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 4px; box-shadow: 0 3px 0 var(--ink); }
.ls-stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; }
.ls-stats small { font-size: 12px; color: var(--mut); font-weight: 600; }

/* cérebro do piu */
.rules { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; text-align: left; }
.rule { background: #1E1838; color: #EDE8FF; border-radius: 16px; padding: 12px; box-shadow: var(--hard); }
.rule.off { opacity: .55; }
.rule code { display: block; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; line-height: 2.1; }
.rule select { appearance: none; -webkit-appearance: none; font: inherit; color: #FFD45E; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.25); border-radius: 8px; padding: 2px 6px; }
.rule-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.rule-b button { min-height: 34px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.rule-b .tg { background: var(--lime); color: var(--ink); }
.rule.off .rule-b .tg { background: rgba(255,255,255,.12); color: #fff; }
.rlog { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0 0; }
.rlog small { color: var(--mut); font-weight: 600; font-size: 12px; }
.rlog div { display: flex; gap: 10px; font-size: 13px; margin-top: 4px; } .rlog i { font-style: normal; color: var(--mut); }
.rlog code { font-family: ui-monospace, Menlo, monospace; }
#toast code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; }
.ls-body button:disabled { opacity: 1; }
