/* ============================================================
   doodlebox · estilo
   Sem framework, sem build step. Tema claro e escuro.
   ============================================================ */

:root{
  --bg:#f7f7fb; --surface:#fff; --surface-2:#f0f0f6;
  --text:#15151c; --muted:#6c6c80; --line:#e4e4ee;
  --brand:#5b3df5; --brand-ink:#fff; --brand-soft:#efeaff;
  --live:#f5384e; --ok:#16a34a;
  --radius:16px; --radius-sm:10px;
  --shadow:0 1px 2px rgba(20,20,40,.05),0 8px 24px rgba(20,20,40,.06);
  --maxw:1080px;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0e0e14; --surface:#17171f; --surface-2:#20202b;
    --text:#f2f2f7; --muted:#9a9ab0; --line:#2a2a38;
    --brand:#8b74ff; --brand-ink:#0e0e14; --brand-soft:#241f45;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"]{
  --bg:#0e0e14; --surface:#17171f; --surface-2:#20202b;
  --text:#f2f2f7; --muted:#9a9ab0; --line:#2a2a38;
  --brand:#8b74ff; --brand-ink:#0e0e14; --brand-soft:#241f45;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
/* Achado 2026-08-26 no /ide: qualquer elemento cuja CLASSE já
   redeclara `display` (`.btn{display:inline-flex}`,
   `.ide-preview{display:flex}`, `.ide-empty{display:flex}`, etc.)
   vence o `[hidden]{display:none}` padrão do navegador — mesma
   especificidade, mas CSS de autor sempre bate estilo de user-agent.
   Resultado: `el.hidden = true` parava de esconder o elemento na
   prática (achado real: editor de código aberto com o texto
   "escolha um arquivo" aparecendo por baixo ao mesmo tempo, porque
   `#ide-empty` continuava com display:flex mesmo com hidden). Uma
   regra global, alta o bastante na cascata pra nunca perder, trava
   essa armadilha de vez — não só onde apareceu hoje. */
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  -webkit-font-smoothing:antialiased;
  /* Rede de segurança: achado 2026-08-26, a página não tinha
     overflow-x nenhum em lugar nenhum — qualquer elemento que
     estourasse a largura (uma palavra longa num idioma sem tradução
     curta, um componente futuro) virava scroll horizontal da página
     inteira, escondendo o rodapé atrás dele. Não substitui corrigir
     a causa de cada estouro (ver .grid/.foot-in nav abaixo) — só
     garante que um estouro nunca mais impede alcançar o rodapé. */
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit;color:inherit}

/* ── banner promocional ─────────────────────────────────── */
/* Paleta do próprio site (--brand-soft/--brand), não um gradiente
   à parte — um gradiente vivo aqui destoava de todo o resto (a
   única outra cor "chapada" do site é a logomarca, pequena, não
   uma faixa inteira) e lia como banner de anúncio genérico.
   Dois grupos flex (.promo-msg / .promo-actions): no mobile eles
   quebram como DOIS blocos inteiros, cada um numa linha — nunca a
   frase e o código se misturando numa quebra no meio da palavra. */
.promo{
  display:flex;flex-wrap:wrap;align-items:center;gap:7px 10px;
  padding:9px 16px;font-size:12.5px;line-height:1.35;
  background:var(--brand-soft);color:var(--text);
  border-bottom:1px solid var(--line);
}
.promo-msg{display:flex;align-items:center;gap:7px;flex:1 1 auto;min-width:180px}
.promo-emoji{font-size:15px}
.promo-text{font-weight:600}
.promo-actions{display:flex;align-items:center;gap:8px;flex:1 1 240px;min-width:0}
.promo-code{
  flex:1 1 auto;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  background:var(--surface);border:1px solid var(--line);color:var(--text);
  padding:5px 10px;border-radius:6px;
  font:11.5px/1.3 ui-monospace,monospace;
}
.promo-copy{
  flex:none;
  background:var(--brand);color:var(--brand-ink);border:0;border-radius:7px;
  padding:6px 13px;font-size:12px;font-weight:700;cursor:pointer;
  white-space:nowrap;
}
.promo-copy:hover{filter:brightness(1.08)}
.promo-close{
  flex:none;
  background:transparent;color:var(--muted);border:0;
  width:24px;height:24px;border-radius:50%;
  font-size:16px;line-height:1;cursor:pointer;
}
.promo-close:hover{background:var(--surface-2);color:var(--text)}
@media (max-width:520px){
  .promo{padding:8px 12px}
}

/* ── topbar ─────────────────────────────────────────────── */
.topbar{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:14px max(16px,env(safe-area-inset-left));
  background:color-mix(in srgb,var(--surface) 88%,transparent);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
  flex-wrap:nowrap;
}
.brand{display:flex;align-items:center;gap:9px;font-weight:800;letter-spacing:-.02em;flex-shrink:0}
.brand-mark{
  width:26px;height:26px;border-radius:9px;flex:none;display:inline-flex;align-items:center;justify-content:center;
  background:url('/assets/img/favicon.svg') center/contain no-repeat;
}
.brand-mark svg{display:block;width:100%;height:100%}
.brand-text{font-size:18px}
.topnav{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;justify-content:flex-end;min-width:0}
.topnav>a{padding:8px 12px;border-radius:var(--radius-sm);color:var(--muted);font-weight:600;font-size:14px}
.topnav>a:hover{background:var(--surface-2);color:var(--text)}
.avatar-link img{border-radius:50%;background:var(--surface-2);display:block}
.topnav-publish{position:relative;flex-shrink:0}
.topnav-publish-icon{display:none}
.topnav-publish-short{display:none}
.topnav-publish.active{filter:brightness(.9)}

.mobile-menu{display:none;position:relative;flex-shrink:0}
.mobile-menu summary{
  list-style:none;display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:var(--radius-sm);cursor:pointer;
  font-size:18px;color:var(--text);
}
.mobile-menu summary::-webkit-details-marker{display:none}
.mobile-menu summary:hover{background:var(--surface-2)}
.mobile-menu[open] summary{background:var(--surface-2)}
.mobile-menu nav{
  position:absolute;top:calc(100% + 6px);right:0;z-index:60;min-width:180px;
  display:flex;flex-direction:column;gap:2px;padding:8px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);
  box-shadow:0 8px 24px rgba(0,0,0,.16);
}
.mobile-menu nav a{padding:9px 12px;border-radius:8px;color:var(--text);font-weight:600;font-size:14px}
.mobile-menu nav a:hover{background:var(--surface-2)}

.notif-bell{position:relative;display:flex;align-items:center;justify-content:center;width:36px;height:36px;font-size:17px;border-radius:var(--radius-sm);flex-shrink:0}
.notif-bell:hover{background:var(--surface-2)}
.notif-badge{position:absolute;top:2px;right:2px;background:var(--live);color:#fff;font-size:10px;font-weight:700;line-height:1;border-radius:8px;padding:2px 4px;min-width:14px;text-align:center}
.account-menu{position:relative;flex-shrink:0}
.account-menu summary{list-style:none;cursor:pointer;display:flex}
.account-menu summary::-webkit-details-marker{display:none}
.account-menu[open] summary img{outline:2px solid var(--brand)}
.account-menu nav{
  position:absolute;top:calc(100% + 6px);right:0;z-index:60;min-width:190px;
  display:flex;flex-direction:column;gap:2px;padding:8px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);
  box-shadow:0 8px 24px rgba(0,0,0,.16);
}
.account-menu nav a{padding:9px 12px;border-radius:8px;color:var(--text);font-weight:600;font-size:14px}
.account-menu nav a:hover{background:var(--surface-2)}

@media (max-width:720px){
  .topbar{padding:10px max(12px,env(safe-area-inset-left));gap:6px}
  .topnav-explore{display:none}
  .topnav-publish-text{display:none}
  .topnav-publish-icon{display:none}
  .topnav-publish-short{display:inline-block;font-size:13px;font-weight:800;line-height:1}
  .topnav-publish{padding:6px 12px;min-width:32px;height:32px}
  .mobile-menu{display:block}
}
@media (max-width:440px){
  .topbar{padding:8px max(8px,env(safe-area-inset-left));gap:4px}
  .brand{gap:6px}
  .brand-text{font-size:16px}
  .topnav{gap:3px}
  .user-coins-pill{padding:3px 7px;font-size:11px}
  .user-coins-pill .coin-icon{font-size:12px}
  .notif-bell{width:30px;height:30px;font-size:15px}
  .mobile-menu summary{width:30px;height:30px;font-size:16px}
  .avatar-link img{width:28px;height:28px}
}

/* ── layout ─────────────────────────────────────────────── */
.wrap{max-width:var(--maxw);margin:0 auto;padding:24px 16px 64px}
h1{font-size:26px;letter-spacing:-.02em;margin:0 0 4px}
h2{font-size:19px;letter-spacing:-.01em;margin:32px 0 12px}
.muted{color:var(--muted)}
.small{font-size:13px}

/* ── botões ─────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:11px 18px;border-radius:var(--radius-sm);border:1px solid transparent;
  background:var(--brand);color:var(--brand-ink);font-weight:700;font-size:15px;
  cursor:pointer;transition:transform .06s ease,filter .15s ease;
}
.btn:hover{filter:brightness(1.07)}
.btn:active{transform:translateY(1px)}
.btn-sm{padding:8px 14px;font-size:14px}
.btn-ghost{background:var(--surface);color:var(--text);border-color:var(--line)}
.btn-ghost:hover{background:var(--surface-2);filter:none}
.btn-block{width:100%}
.btn[disabled]{opacity:.55;cursor:default}

/* ── hero da home + busca (2026-08-26) ────────────────────── */
.hero{text-align:center;padding:36px 16px 28px}
.hero h1{font-size:clamp(24px,5vw,38px);margin-bottom:10px}
.hero p{max-width:520px;margin:0 auto 18px;color:var(--muted)}
.hero-ctas{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:8px}
.search-box{display:flex;flex-wrap:wrap;gap:8px;max-width:480px;margin:0 auto 24px}
.search-box input{
  flex:1 1 160px;min-width:0;padding:11px 13px;border-radius:var(--radius-sm);
  border:1px solid var(--line);background:var(--bg);
}

.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:20px;max-width:900px;margin:8px auto 40px;padding:0 16px}
.feature{text-align:center}
.feature-icon{font-size:32px;margin-bottom:8px}
.feature h3{font-size:15px;margin-bottom:4px}
.feature p{font-size:13px}

/* ── tabs ───────────────────────────────────────────────── */
.tabs{display:flex;gap:4px;margin:0 0 20px;border-bottom:1px solid var(--line)}
.tabs a{padding:10px 14px;font-weight:600;font-size:14px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs a.on{color:var(--brand);border-bottom-color:var(--brand)}

.explore-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 6px}
.explore-tabs a{padding:6px 12px;border-radius:999px;font-size:13px;font-weight:600;color:var(--muted);background:var(--surface-2);display:inline-flex;align-items:center;gap:4px;transition:background 0.15s, color 0.15s}
.explore-tabs a .tab-count{font-size:11px;opacity:0.8;padding:1px 6px;background:rgba(255,255,255,0.08);border-radius:10px;font-weight:700}
.explore-tabs a.on{color:var(--brand-ink);background:var(--brand)}
.explore-tabs a.on .tab-count{background:rgba(0,0,0,0.18);color:inherit}

.profile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:16px}
.profile-card{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:14px 10px;border-radius:var(--radius);background:var(--surface-2);color:inherit}
.profile-card img{width:64px;height:64px;border-radius:50%}
.profile-card-handle{font-weight:700;font-size:13px;overflow-wrap:break-word}
.profile-card-meta{font-size:12px;color:var(--muted)}

/* ── grade de projetos (o "feed") ───────────────────────── */
.grid{
  display:grid;gap:18px;
  grid-template-columns:repeat(auto-fill,minmax(min(230px,100%),1fr));
}
.card{
  /* min-width:0: achado 2026-08-26 — item de grid tem min-width:auto
     por padrão (o tamanho do conteúdo mais largo que não quebra
     linha), o que pode estourar a coluna de 230px mesmo com
     minmax(). Foi exatamente o que aconteceu com os botões de
     dono (.card-owner-actions, pages/me.php) sem flex-wrap. Trava
     essa armadilha pra qualquer conteúdo futuro, não só o de hoje. */
  min-width:0;position:relative;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  overflow:hidden;box-shadow:var(--shadow);
  transition:transform .12s ease,box-shadow .12s ease;
  display:flex;flex-direction:column;
}
.card:hover{transform:translateY(-3px);box-shadow:0 6px 12px rgba(20,20,40,.08),0 18px 40px rgba(20,20,40,.10)}
/* Sem aspect-ratio fixo de propósito (5ª tentativa nessa história —
   ver .stage abaixo e CLAUDE.md pro histórico completo): a thumbnail
   agora é capturada (bin/thumbnail.js) já recortada na altura real
   do conteúdo, então a própria imagem dita a proporção do card —
   width:100% + height:auto, sem object-fit:cover cortando nada. O
   placeholder (.ph, sem thumbnail ainda) não tem imagem pra ditar
   proporção nenhuma, então cai num valor razoável fixo só pra ele. */
.card-thumb{display:block;position:relative;background:var(--surface-2);overflow:hidden}
.card-thumb img{width:100%;height:auto;display:block}
.card-thumb .ph{
  width:100%;aspect-ratio:3/4;display:grid;place-items:center;
  font-size:34px;
  background:linear-gradient(135deg,var(--brand-soft),var(--surface-2));
}
/* Card "tocando": mesmo box (overflow:hidden, position:relative já vêm
   de .card-thumb acima) — só troca o conteúdo interno pro palco de
   verdade. É o mesmo componente do .stage da página do projeto, por
   isso .stage-frame/.stage-fs/.stage-back (abaixo) não são aninhadas
   sob .stage: funcionam dentro de QUALQUER caixa relative+overflow:hidden. */
.card-thumb.is-playing{background:#fff;cursor:default;height:min(70vh,700px);min-height:320px}
.card-thumb .play-hint{
  position:absolute;inset:0;display:grid;place-items:center;
  background:rgba(0,0,0,.15);opacity:0;transition:opacity .12s ease;
}
.card:hover .card-thumb .play-hint,.card-thumb:focus-visible .play-hint{opacity:1}
.play-hint span{
  width:52px;height:52px;border-radius:50%;
  background:rgba(0,0,0,.6);color:#fff;backdrop-filter:blur(6px);
  display:grid;place-items:center;font-size:20px;
}
.card-body{padding:12px 14px 14px;display:flex;flex-direction:column;gap:6px;flex:1}
.card-title{font-weight:700;font-size:15px;line-height:1.3;letter-spacing:-.01em;overflow-wrap:break-word}
.card-author{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px}
.card-author img{width:18px;height:18px;border-radius:50%}
.card-stats{display:flex;gap:12px;font-size:12px;color:var(--muted);margin-top:auto;padding-top:6px}
.card-edit-btn{text-align:center;margin-top:2px}

.card-menu-btn{
  position:absolute;bottom:8px;right:8px;z-index:5;
  width:30px;height:30px;border-radius:50%;border:0;cursor:pointer;
  background:rgba(20,20,30,.55);color:#fff;font-weight:800;font-size:15px;
  display:flex;align-items:center;justify-content:center;line-height:1;
}
.card-menu-btn:hover{background:rgba(20,20,30,.75)}
.card-menu{
  position:fixed;z-index:200;min-width:170px;
  display:none;flex-direction:column;gap:2px;padding:8px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);
  box-shadow:0 8px 24px rgba(0,0,0,.18);
}
.card-menu.open{display:flex}
.card-menu a,.card-menu button{
  padding:8px 10px;border-radius:8px;text-align:left;background:transparent;border:0;
  color:var(--text);font-weight:600;font-size:13px;cursor:pointer;
}
.card-menu a:hover,.card-menu button:hover{background:var(--surface-2)}
.card-menu select{width:100%;padding:7px 8px;border-radius:8px;border:1px solid var(--line);background:var(--bg);font-size:12px}

/* "jogando agora" — o número que motiva a criança */
.live{
  display:inline-flex;align-items:center;gap:5px;
  color:var(--live);font-weight:700;
}
.live .dot{
  width:7px;height:7px;border-radius:50%;background:var(--live);
  animation:pulse 1.8s ease-in-out infinite;
}
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.8)}}
@media (prefers-reduced-motion:reduce){.live .dot{animation:none}}
.badge-live{
  position:absolute;top:8px;left:8px;
  background:rgba(0,0,0,.72);color:#fff;backdrop-filter:blur(6px);
  padding:4px 9px;border-radius:999px;font-size:11px;font-weight:700;
  display:inline-flex;align-items:center;gap:5px;
}
.badge-live .dot{background:#fff}
.badge-category{
  position:absolute;top:8px;right:8px;
  background:rgba(0,0,0,.72);color:#fff;backdrop-filter:blur(6px);
  padding:4px 9px;border-radius:999px;font-size:11px;font-weight:700;
}
.badge-mp{
  position:absolute;bottom:8px;left:8px;
  background:rgba(91,61,245,.85);color:#fff;backdrop-filter:blur(6px);
  padding:4px 9px;border-radius:999px;font-size:11px;font-weight:700;
}

/* ── página do projeto ──────────────────────────────────── */
.proj-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.proj-actions{display:flex;gap:8px;flex-wrap:wrap}
.stage{
  position:relative;width:100%;
  background:#090c15;border-radius:var(--radius);overflow:hidden;
  border:1px solid var(--line);box-shadow:var(--shadow);
  height:min(70vh,700px);min-height:320px;
  display:flex;flex-direction:column;
}
.stage-topbar{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  height:38px;min-height:38px;max-height:38px;flex-shrink:0;
  background:#0c0f1d;border-bottom:1px solid rgba(255,255,255,.08);
  padding:0 8px;position:relative;z-index:10;box-sizing:border-box;
  overflow:visible;
}
.stage-topbar .stage-controls{
  position:relative;top:auto;left:auto;z-index:2;
  display:flex;align-items:center;gap:6px;pointer-events:auto;
}
.stage-topbar .stage-buttons-group{
  display:inline-flex;align-items:center;gap:6px;
  overflow:visible;opacity:1;max-width:none;transform:none;
}
.stage-topbar .stage-fs,.stage-topbar .stage-qr,.stage-topbar .stage-pwa,.stage-topbar .stage-edit{
  height:28px;padding:0 9px;border-radius:6px;font-size:11px;font-weight:600;
  background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.12);color:#fff;
  box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  cursor:pointer;white-space:nowrap;transition:all .15s;
}
.stage-topbar .stage-fs:hover,.stage-topbar .stage-qr:hover,.stage-topbar .stage-pwa:hover,.stage-topbar .stage-edit:hover{
  background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.22);
}

.stage-topbar .stage-mp-bar{
  position:relative;top:auto;right:auto;z-index:2;
  display:inline-flex;align-items:center;
  padding:2px 8px;height:28px;box-sizing:border-box;
  max-width:calc(100vw - 24px);
  border-radius:9999px;background:rgba(255,255,255,.07);color:#fff;
  border:1px solid rgba(255,255,255,.12);box-shadow:none;
  backdrop-filter:none;-webkit-backdrop-filter:none;
  font-size:11px;font-weight:600;white-space:nowrap;pointer-events:auto;
  animation:none;transition:all .2s ease;
}
.stage-topbar .stage-mp-bar:hover{
  background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2);
}
.stage-topbar .stage-mp-bar .stage-mp-toggle-btn{display:none !important}
.stage-topbar .stage-mp-bar .stage-mp-content{display:inline-flex !important}
.stage-topbar .stage-mp-btn{height:22px;padding:0 6px;font-size:10px}
.stage-frame{
  position:relative;flex:1 1 0%;
  width:100%;height:100%;min-height:0;
  border:0;display:block;
}
.stage-static-img{position:relative;width:100%;max-height:80vh;object-fit:contain;margin:0 auto;display:block}
.stage-static-pdf{position:relative;width:100%;height:80vh;border:0;display:block}
.stage-controls{
  position:absolute;top:10px;left:10px;z-index:4;
  display:flex;align-items:flex-start;gap:6px;
  pointer-events:none;
}
.stage-controls-left{
  display:inline-flex;align-items:center;gap:4px;
  pointer-events:auto;
  transition:all .25s cubic-bezier(.16,1,.3,1);
}
.stage-buttons-group{
  display:inline-flex;align-items:center;gap:4px;
  transition:all .25s cubic-bezier(.16,1,.3,1);
}
.stage-toggle-btn{
  background:rgba(18,18,24,.82);color:#fff;border:1px solid rgba(255,255,255,.18);
  border-radius:8px;width:30px;height:30px;padding:0;font-size:13px;cursor:pointer;
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  display:inline-flex;align-items:center;justify-content:center;
  box-shadow:0 4px 12px rgba(0,0,0,.35);
  flex-shrink:0;
  opacity:1;
  transition:opacity .6s cubic-bezier(.16,1,.3,1), background .15s ease, transform .15s ease, border-color .15s ease;
}
.stage-toggle-btn.is-dimmed{
  opacity:0.25;
}
.stage-toggle-btn:hover,
.stage-toggle-btn:focus-visible,
.stage-toggle-btn:active{
  opacity:1 !important;
  background:rgba(28,28,38,.95);
  transform:scale(1.05);
}
.stage-controls-left:not(.collapsed) .stage-toggle-btn{
  opacity:1 !important;
  background:rgba(99,102,241,.35);border-color:rgba(129,140,248,.6);
}
.stage-buttons-group{
  display:inline-flex;align-items:center;gap:4px;
  transition:all .25s cubic-bezier(.16,1,.3,1);
  overflow:hidden;
}
.stage-controls-left.collapsed .stage-buttons-group{
  max-width:0;opacity:0;pointer-events:none;margin:0;
  transform:translateX(-8px) scale(.9);
}
.stage-controls-left:not(.collapsed) .stage-buttons-group{
  max-width:600px;opacity:1;pointer-events:auto;
  transform:none;
}

.stage-fs,.stage-back,.stage-restart,.stage-window,.stage-qr,.stage-mute,.stage-pwa,.stage-edit{
  pointer-events:auto;
  background:rgba(18,18,24,.82);color:#fff;
  border:1px solid rgba(255,255,255,.18);border-radius:8px;
  padding:5px 9px;height:30px;box-sizing:border-box;
  font-size:11px;font-weight:600;cursor:pointer;
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  white-space:nowrap;transition:all .15s;
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  box-shadow:0 4px 12px rgba(0,0,0,.35);
}
.stage-fs:hover,.stage-back:hover,.stage-restart:hover,.stage-window:hover,.stage-qr:hover,.stage-mute:hover,.stage-pwa:hover,.stage-edit:hover{background:rgba(28,28,38,.95)}
.stage-mute.is-muted{color:#f87171;border-color:rgba(239,68,68,0.4)}
.stage-edit{text-decoration:none}
.stage-back{display:none}
:fullscreen .stage-back,:-webkit-full-screen .stage-back,.is-windowed .stage-back{display:inline-flex}
.stage:fullscreen,.stage:-webkit-full-screen{width:100vw;height:100vh;background:#000;display:flex;flex-direction:column}
:fullscreen .stage-window,.is-windowed .stage-fs{display:none}

@media(max-width:768px){
  .stage-buttons-group .btn-text{display:none !important}
  .stage-buttons-group .stage-qr .btn-text{display:inline !important}
  .stage-fs,.stage-back,.stage-restart,.stage-window,.stage-mute,.stage-pwa,.stage-edit,.stage-toggle-btn{
    width:28px !important;height:28px !important;min-width:28px !important;
    padding:0 !important;font-size:13px !important;border-radius:6px !important;
  }
  .stage-qr{
    width:auto !important;height:28px !important;min-width:28px !important;
    padding:0 8px !important;font-size:11px !important;border-radius:6px !important;
  }
  .stage-lang-btn{
    height:28px !important;padding:0 6px !important;font-size:11px !important;border-radius:6px !important;
  }
}

/* ── Doodlebox MP Bar (Multiplayer HUD fora do iframe) ───── */
.stage-mp-bar{
  position:absolute;top:10px;right:12px;z-index:4;
  display:inline-flex;align-items:center;
  padding:4px 10px;height:34px;box-sizing:border-box;
  max-width:calc(100vw - 24px);
  border-radius:9999px;background:rgba(15,18,28,.88);color:#fff;
  border:1px solid rgba(255,255,255,.16);box-shadow:0 6px 20px rgba(0,0,0,.4);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  font-size:11px;font-weight:600;white-space:nowrap;pointer-events:auto;
  animation:stage-mp-slide-down .25s cubic-bezier(.16,1,.3,1);
  transition:all .2s ease;
}
.stage-mp-toggle-btn{
  background:transparent;color:#fff;border:0;padding:0 6px;
  height:24px;line-height:24px;font-size:11px;font-weight:700;
  cursor:pointer;display:none;border-radius:9999px;align-items:center;gap:4px;
  white-space:nowrap;
}
.stage-mp-content{
  display:inline-flex;align-items:center;gap:8px;white-space:nowrap;
  transition:all .2s ease;
}
.stage-mp-bar.collapsed{padding:4px 8px;border-radius:9999px}
.stage-mp-bar.collapsed .stage-mp-toggle-btn{display:inline-flex}
.stage-mp-bar.collapsed .stage-mp-content{display:none}
.stage-mp-bar.collapsed:hover .stage-mp-content,
.stage-mp-bar.collapsed:focus-within .stage-mp-content{
  display:inline-flex;margin-left:6px;
}

@keyframes stage-mp-slide-down{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
.stage-mp-left,.stage-mp-center,.stage-mp-right{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.stage-mp-status{display:inline-flex;align-items:center;gap:5px;color:#34d399;font-size:11px;font-weight:600}
.stage-mp-status.connecting{color:#fbbf24}
.stage-mp-status.connecting .stage-mp-dot{background:#fbbf24}
.stage-mp-status.disconnected{color:#f87171}
.stage-mp-status.disconnected .stage-mp-dot{background:#f87171;animation:none}
.stage-mp-status.solo{color:#38bdf8}
.stage-mp-status.solo .stage-mp-dot{background:#38bdf8;animation:none}
.stage-mp-dot{width:7px;height:7px;border-radius:50%;background:#34d399;display:inline-block;animation:stage-mp-pulse 1.8s infinite;flex-shrink:0}
@keyframes stage-mp-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.85)}}
.stage-mp-handle{color:#cbd5e1;font-weight:600;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage-mp-room{display:inline-flex;align-items:center;gap:4px;background:rgba(255,255,255,.08);padding:2px 8px;border-radius:9999px;border:1px solid rgba(255,255,255,.12);white-space:nowrap}
.stage-mp-room-label{color:#94a3b8;font-weight:500;font-size:10px}
.stage-mp-room strong{color:var(--brand);font-family:monospace;font-size:12px;letter-spacing:1px}
.stage-mp-queue{
  display:inline-flex;align-items:center;gap:5px;
  background:rgba(255,255,255,.08);padding:2px 8px;border-radius:9999px;
  border:1px solid rgba(255,255,255,.12);color:#f1f5f9;font-size:11px;white-space:nowrap;
}
.stage-mp-queue.counting{
  border-color:rgba(255,224,102,.5);background:rgba(255,224,102,.15);
  color:#ffe066;box-shadow:0 0 12px rgba(255,224,102,.2);
}
.stage-mp-countdown-num{
  display:inline-block;font-family:monospace;font-weight:800;font-size:12px;
  padding:0 4px;border-radius:4px;background:rgba(255,224,102,.25);color:#ffe066;
}
.stage-mp-btn{
  background:rgba(255,255,255,.1);color:#fff;border:0;border-radius:9999px;
  height:22px;padding:0 7px;font-size:11px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;gap:4px;transition:background .15s ease;white-space:nowrap;
}
.stage-mp-btn:hover{background:rgba(255,255,255,.22)}
.stage-mp-room-wrapper{position:relative}
.stage-mp-room-select-btn{background:rgba(255,255,255,.12);font-weight:700;color:#f8fafc;padding:0 9px}
.stage-mp-room-select-btn:hover{background:rgba(255,255,255,.25)}
.stage-mp-room-popover{
  position:absolute;top:calc(100% + 6px);right:0;left:auto;transform:none;
  width:320px;max-width:calc(100vw - 20px);max-height:calc(100vh - 60px);max-height:calc(100dvh - 60px);overflow-y:auto;z-index:999999;background:var(--surface-2, #182035);color:var(--text, #fff);
  border:1px solid rgba(255,255,255,.18);border-radius:12px;
  box-shadow:0 16px 40px rgba(0,0,0,.7);padding:10px 12px;
  animation:stage-mp-pop .18s ease;white-space:normal;
}
.stage-mp-room-popover-head{
  font-size:11px;font-weight:800;text-transform:uppercase;color:#94a3b8;
  border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:6px;margin-bottom:8px;
}
.stage-mp-room-popover-body{display:flex;flex-direction:column;gap:7px}
.stage-mp-action-quick-btn{
  background:#4f46e5;color:#fff;border:0;border-radius:8px;padding:7px 10px;
  font-size:12px;font-weight:600;cursor:pointer;display:flex;align-items:center;
  justify-content:center;gap:6px;width:100%;transition:background .15s;
}
.stage-mp-action-quick-btn:hover{background:#4338ca}
.stage-mp-action-server-btn{
  background:linear-gradient(135deg, #059669 0%, #10b981 100%);color:#fff;border:0;border-radius:8px;padding:7px 10px;
  font-size:12px;font-weight:700;cursor:pointer;display:flex;align-items:center;
  justify-content:center;gap:6px;width:100%;transition:filter .15s, transform .1s;
}
.stage-mp-action-server-btn:hover{filter:brightness(1.1)}
.stage-mp-action-server-btn:active{transform:scale(0.98)}
.stage-mp-divider{
  display:flex;align-items:center;text-align:center;color:#64748b;font-size:10px;
  font-weight:700;text-transform:uppercase;margin:2px 0;
}
.stage-mp-divider::before,.stage-mp-divider::after{
  content:'';flex:1;border-bottom:1px solid rgba(255,255,255,.1);
}
.stage-mp-divider span{padding:0 6px}
.stage-mp-code-form{display:flex;gap:6px;width:100%}
.stage-mp-code-input{
  flex:1;background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.2);
  color:#fff;border-radius:6px;padding:5px 8px;font-size:12px;font-weight:600;
  outline:none;
}
.stage-mp-code-input:focus{border-color:#818cf8}
.stage-mp-code-submit{
  background:#3b82f6;color:#fff;border:0;border-radius:6px;padding:0 12px;
  font-size:11px;font-weight:700;cursor:pointer;transition:background .15s;
}
.stage-mp-code-submit:hover{background:#2563eb}
.stage-mp-rooms-list{
  display:flex;flex-direction:column;gap:3px;max-height:100px;overflow-y:auto;
}
.stage-mp-room-item{
  display:flex;align-items:center;justify-content:space-between;
  background:rgba(255,255,255,.05);border-radius:6px;padding:3px 7px;
  font-size:11px;border:1px solid rgba(255,255,255,.06);
}
.stage-mp-room-item-code{font-weight:700;font-family:monospace;color:#38bdf8}
.stage-mp-room-item-count{color:#94a3b8;font-size:10px;font-weight:600}
.stage-mp-room-item-btn{
  background:rgba(255,255,255,.12);border:0;border-radius:4px;color:#fff;
  padding:2px 6px;font-size:10px;font-weight:700;cursor:pointer;
}
.stage-mp-room-item-btn:hover{background:rgba(255,255,255,.25)}
.stage-mp-room-item-btn.current{
  background:#059669;color:#ecfdf5;cursor:default;opacity:1;pointer-events:none;font-weight:800;
}
.stage-mp-rooms-loading,.stage-mp-empty-rooms{color:#64748b;font-size:10px;text-align:center;padding:3px 0}

.stage-mp-current-room-box{
  background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.08);
  border-radius:8px;padding:6px 8px;display:flex;flex-direction:column;gap:5px;
}
.stage-mp-current-room-head{
  display:flex;justify-content:space-between;align-items:center;
}
.stage-mp-current-room-name{
  font-size:11px;font-weight:700;color:#38bdf8;
}
.stage-mp-pop-copy-btn{
  font-size:10px;padding:2px 6px;background:rgba(255,255,255,.12);border-radius:4px;color:#fff;border:0;cursor:pointer;
}
.stage-mp-pop-copy-btn:hover{background:rgba(255,255,255,.25)}

.stage-mp-debug-wrapper{position:relative}
.stage-mp-debug-btn{color:#38bdf8}
.stage-mp-debug-popover{
  position:absolute;top:calc(100% + 6px);right:0;left:auto;transform:none;
  width:300px;max-width:calc(100vw - 20px);max-height:calc(100vh - 60px);max-height:calc(100dvh - 60px);overflow-y:auto;z-index:999999;
  background:var(--surface-2, #182035);color:var(--text, #fff);
  border:1px solid rgba(255,255,255,.18);border-radius:12px;
  box-shadow:0 14px 36px rgba(0,0,0,.6);padding:10px 14px;
  animation:stage-mp-pop .18s ease;white-space:normal;
}
.stage-mp-debug-head{font-size:11px;font-weight:700;text-transform:uppercase;color:#94a3b8;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:6px;margin-bottom:8px}
.stage-mp-debug-body{display:flex;flex-direction:column;gap:6px;font-size:11px}
.stage-mp-debug-row{display:flex;justify-content:space-between;align-items:center}
.stage-mp-debug-lbl{color:#94a3b8}
.stage-mp-debug-val{color:#38bdf8;font-weight:700;font-family:monospace}
.stage-mp-debug-val.ok{color:#34d399}
.stage-mp-debug-val.warn{color:#fbbf24}

.stage-mp-players-list{list-style:none;margin:0;padding:0;max-height:100px;overflow-y:auto;display:flex;flex-direction:column;gap:2px}
.stage-mp-player-item{padding:3px 6px;display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;background:rgba(255,255,255,.04);border-radius:4px}
.stage-mp-player-item:hover{background:rgba(255,255,255,.08)}
.stage-mp-player-name{display:flex;align-items:center;gap:4px;font-weight:600;color:#e2e8f0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage-mp-player-badge{font-size:9px;font-weight:700;padding:1px 5px;border-radius:4px;background:var(--brand-soft);color:var(--brand);white-space:nowrap}

@keyframes stage-mp-pop{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}

@media(max-width:640px){
  .stage-topbar{
    height:34px;min-height:34px;max-height:34px;padding:0 6px;
  }
  .stage-topbar .stage-fs,.stage-topbar .stage-back,.stage-topbar .stage-restart,
  .stage-topbar .stage-window,.stage-topbar .stage-qr,.stage-topbar .stage-mute,
  .stage-topbar .stage-pwa,.stage-topbar .stage-edit,.stage-topbar .stage-toggle-btn{
    height:26px !important;min-width:26px !important;width:26px !important;padding:0 !important;
  }
  .stage-topbar .stage-qr{
    width:auto !important;padding:0 6px !important;
  }
  .stage-topbar .stage-mp-bar{
    height:26px !important;padding:2px 6px !important;
    top:auto !important;right:auto !important;left:auto !important;
  }
  .stage-mp-bar{
    top:10px;right:10px;left:auto;font-size:10px;padding:3px 6px;height:28px;
    max-width:calc(100vw - 20px);
  }
  .stage-mp-bar.collapsed{max-width:none}
  .stage-mp-content{gap:4px}
  .stage-mp-left,.stage-mp-center,.stage-mp-right{gap:3px}
  .stage-mp-handle{display:none}
  .stage-mp-new-room-btn{display:none}
  .stage-mp-room-select-btn{padding:0 7px;font-size:10px}
  [data-mp-room-btn-text]{
    display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;
    white-space:nowrap;vertical-align:middle;
  }
  [data-mp-queue-text]{
    display:inline-block;max-width:80px;overflow:hidden;text-overflow:ellipsis;
    white-space:nowrap;vertical-align:middle;
  }
  .stage-mp-room-popover{
    position:fixed;
    top:44px;
    left:50%;
    right:auto;
    transform:translateX(-50%);
    width:min(320px, calc(100vw - 20px));
    max-width:calc(100vw - 20px);
    max-height:calc(100vh - 56px);
    max-height:calc(100dvh - 56px);
    overflow-y:auto;
    z-index:999999;
  }
  .stage-mp-debug-popover{
    position:fixed;
    top:44px;
    left:50%;
    right:auto;
    transform:translateX(-50%);
    width:min(280px, calc(100vw - 20px));
    max-width:calc(100vw - 20px);
    max-height:calc(100vh - 56px);
    max-height:calc(100dvh - 56px);
    overflow-y:auto;
    z-index:999999;
  }
  .stage-loading{
    top:34px;
  }
}

.stage.is-windowed,.card-thumb.is-playing.is-windowed{
  position:fixed !important;top:0 !important;left:0 !important;right:0 !important;bottom:0 !important;
  z-index:999999 !important;width:100vw !important;height:100vh !important;height:100dvh !important;
  max-width:100vw !important;max-height:100dvh !important;border-radius:0 !important;margin:0 !important;
  display:flex !important;flex-direction:column !important;
}
body.db-windowed-open{overflow:hidden !important}
/* Barra de carregamento: cross-origin não dá pra medir progresso real
   de download do iframe (nenhuma API expõe isso), então a barra em si
   é simulada — mas o "sumiu" é real, disparado pelo próprio evento
   load do iframe (ver app.js initLoadingBar()), nunca um tempo fixo. */
.stage-loading{
  position:absolute;top:38px;bottom:0;left:0;right:0;z-index:5;
  background:#000;display:flex;align-items:center;justify-content:center;
  transition:opacity .25s ease;
}
.stage-loading.done{opacity:0;pointer-events:none}
.stage-loading-track{
  width:60%;max-width:180px;height:4px;border-radius:999px;
  background:rgba(255,255,255,.18);overflow:hidden;
}
.stage-loading-bar{
  height:100%;width:15%;border-radius:999px;
  background:var(--brand);
  transition:width .3s ease;
}
:fullscreen .stage-fs,:-webkit-full-screen .stage-fs{display:none}

.stage-lang-wrapper{position:relative;display:inline-flex}
.stage-lang-btn{
  pointer-events:auto;
  background:rgba(18,18,24,.75);color:#fff;
  border:1px solid rgba(255,255,255,.15);border-radius:8px;
  padding:5px 9px;font-size:11px;font-weight:600;cursor:pointer;
  backdrop-filter:blur(8px);white-space:nowrap;transition:background .15s;
  display:inline-flex;align-items:center;gap:4px;
}
.stage-lang-btn:hover{background:rgba(18,18,24,.95)}
.stage-lang-popover{
  position:absolute;top:calc(100% + 6px);left:0;
  background:var(--surface-2, #182035);color:var(--text, #fff);
  border:1px solid rgba(255,255,255,.18);border-radius:10px;
  box-shadow:0 12px 32px rgba(0,0,0,.6);padding:6px;z-index:20;
  display:flex;flex-direction:column;gap:4px;min-width:140px;
  animation:stage-mp-pop .18s ease;white-space:normal;
}
.stage-lang-opt{
  background:transparent;border:0;color:#e2e8f0;font-size:12px;font-weight:600;
  padding:6px 10px;border-radius:6px;cursor:pointer;text-align:left;display:flex;align-items:center;gap:6px;text-decoration:none;
}
.stage-lang-opt:hover{background:rgba(255,255,255,.1);color:#fff}
.stage-lang-opt.active{background:var(--brand, #4f46e5);color:#fff}

.proj-meta{display:flex;gap:18px;flex-wrap:wrap;margin:14px 0;font-size:14px;color:var(--muted)}
.author-row{display:flex;align-items:center;gap:10px;margin:18px 0;flex-wrap:wrap}
.author-row img{width:44px;height:44px;border-radius:50%}
.author-name{font-weight:700}

/* ── perfil ─────────────────────────────────────────────── */
.profile-head{display:flex;gap:20px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.profile-head img.pfp{width:88px;height:88px;border-radius:50%;background:var(--surface-2)}
.profile-stats{display:flex;gap:22px;margin:10px 0}
.profile-stats b{display:block;font-size:18px}
.profile-stats span{font-size:13px;color:var(--muted)}
.bio{max-width:60ch;color:var(--muted)}

/* ── formulários ────────────────────────────────────────── */
.panel{
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:26px;box-shadow:var(--shadow);
}
.panel-narrow{max-width:400px;margin:32px auto}
.field{margin-bottom:14px}
.field label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:var(--muted)}
.field input,.field textarea{
  width:100%;padding:11px 13px;border-radius:var(--radius-sm);
  border:1px solid var(--line);background:var(--bg);
}
.field input:focus,.field textarea:focus{outline:2px solid var(--brand);outline-offset:-1px;border-color:transparent}
.sep{display:flex;align-items:center;gap:12px;margin:18px 0;color:var(--muted);font-size:13px}
.sep::before,.sep::after{content:"";height:1px;background:var(--line);flex:1}
.msg{padding:11px 14px;border-radius:var(--radius-sm);margin-bottom:14px;font-size:14px}
.msg-err{background:#fee;color:#b42318;border:1px solid #fcc}
.msg-ok{background:#eafaf0;color:#0a7b3e;border:1px solid #bfe9d0}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .msg-err{background:#3b1418;color:#ffb4ad;border-color:#5c1f26}
  :root:not([data-theme="light"]) .msg-ok{background:#0e2f1e;color:#8ce0ae;border-color:#1b5233}
}

/* frase de recuperação */
.phrase{
  font:600 19px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;
  background:var(--brand-soft);color:var(--text);
  padding:16px 18px;border-radius:var(--radius-sm);
  text-align:center;letter-spacing:.02em;word-spacing:.3em;
  border:1px dashed var(--brand);
}

/* ── rodapé ─────────────────────────────────────────────── */
.foot{border-top:1px solid var(--line);margin-top:48px;background:var(--surface)}
.foot-in{
  max-width:var(--maxw);margin:0 auto;padding:20px 16px;
  display:flex;align-items:center;gap:16px;flex-wrap:wrap;
  font-size:13px;color:var(--muted);
}
/* flex-wrap: achado 2026-08-26 — sem isso, o link mais longo entre
   os idiomas (ex. "veröffentlichen" em de.php, "документация" em
   ru.php) força a largura mínima da linha inteira além de qualquer
   tela de celular, mesmo o .foot-in pai já tendo flex-wrap (o filho
   flex não herda isso, só o próprio pai quebra linha). */
.foot-in nav{display:flex;gap:14px;flex-wrap:wrap;margin-right:auto}
.langpick select{
  background:var(--bg);border:1px solid var(--line);
  border-radius:8px;padding:5px 8px;font-size:13px;
}
.category-nav{
  background:var(--bg);border:1px solid var(--line);color:var(--muted);
  border-radius:8px;padding:6px 8px;font-size:13px;max-width:140px;
}

/* ── estado vazio ───────────────────────────────────────── */
.empty{text-align:center;padding:56px 20px;color:var(--muted)}
.empty .big{font-size:44px;margin-bottom:10px}

.spinner{text-align:center;padding:26px;color:var(--muted);font-size:14px}

/* ── modal de QR/compartilhar ───────────────────────────── */
.qr-backdrop{
  position:fixed;inset:0;z-index:100000;
  background:rgba(10,10,20,.7);
  display:flex;align-items:center;justify-content:center;
  padding:20px;
}
.qr-modal{
  background:var(--surface);color:var(--text);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:22px;max-width:320px;width:100%;
  text-align:center;position:relative;z-index:1;font-family:inherit;
}
.qr-modal h3{margin:0 0 6px}
.qr-modal .qr-hint{color:var(--muted);font-size:13px;margin:0 0 14px}
.qr-modal .qr-room-badge{
  background:rgba(91,61,245,0.15);border:1px solid rgba(91,61,245,0.3);
  border-radius:var(--radius-sm);padding:6px 10px;font-size:13px;
  margin:-6px 0 14px;color:#c7d2fe;
}
.qr-modal .qr-box{
  background:#fff;border-radius:var(--radius-sm);padding:12px;
  display:flex;align-items:center;justify-content:center;margin-bottom:14px;
}
.qr-modal .qr-box.qr-loading{
  min-height:220px;flex-direction:column;gap:12px;
  color:var(--muted);font-size:13px;font-weight:600;
  background:rgba(255,255,255,0.05);border:1px dashed var(--line);
}
.qr-modal .qr-box .qr-spinner{
  width:32px;height:32px;
  border:3px solid rgba(255,255,255,0.15);border-top-color:var(--primary, #5b3df5);
  border-radius:50%;animation:qr-spin .7s linear infinite;
}
.qr-modal .qr-box .qr-gen-text{color:var(--muted);font-size:12px}
@keyframes qr-spin{to{transform:rotate(360deg)}}
.qr-modal .qr-box svg{width:220px;height:220px;max-width:100%}
.qr-modal .qr-link-row{display:flex;gap:6px;margin-bottom:12px}
.qr-modal .qr-link-row input{
  flex:1;min-width:0;border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:8px 10px;font-size:12px;background:var(--surface-2);color:var(--text);
}
.qr-modal .qr-close{width:100%}
.qr-modal .qr-invite-label{display:block;font-size:12px;margin:10px 0 4px;color:var(--muted)}

/* ── DoodleCoins & Economia ──────────────────────────────── */
.user-coins-pill{
  display:inline-flex;align-items:center;gap:5px;
  background:rgba(245,158,11,0.12);border:1px solid rgba(245,158,11,0.3);
  color:#f59e0b;font-weight:800;font-size:13px;padding:4px 9px;
  border-radius:20px;cursor:pointer;transition:all .15s;
  white-space:nowrap;flex-shrink:0;
}
.user-coins-pill:hover{
  background:rgba(245,158,11,0.22);border-color:rgba(245,158,11,0.5);
  box-shadow:0 0 12px rgba(245,158,11,0.25);
}
.user-coins-pill .coin-icon{font-size:13px}

.economy-modal-backdrop{
  position:fixed;inset:0;z-index:200000;
  background:rgba(3,7,18,0.8);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  display:flex;align-items:center;justify-content:center;padding:16px;
  animation:fadeIn .15s ease-out;
}
.economy-modal-card{
  background:var(--surface);border:1px solid var(--line);border-radius:16px;
  box-shadow:0 25px 50px -12px rgba(0,0,0,0.7), 0 0 30px rgba(245,158,11,0.15);
  max-width:380px;width:100%;overflow:hidden;animation:popIn .2s cubic-bezier(0.16,1,0.3,1);
}
.economy-modal-header{
  padding:14px 18px;background:var(--surface-2);border-bottom:1px solid var(--line);
  font-weight:800;font-size:15px;color:var(--text);display:flex;align-items:center;gap:8px;
}
.economy-modal-body{
  padding:20px 18px;text-align:center;
}
.economy-modal-item-name{
  font-size:18px;font-weight:800;color:var(--text);margin-bottom:8px;
}
.economy-modal-price{
  font-size:24px;font-weight:900;color:#f59e0b;margin-bottom:12px;
  display:inline-flex;align-items:center;gap:6px;background:rgba(245,158,11,0.1);
  padding:6px 16px;border-radius:24px;border:1px solid rgba(245,158,11,0.25);
}
.economy-modal-desc{
  color:var(--muted);font-size:13px;margin:0;line-height:1.4;
}
.economy-modal-actions{
  padding:14px 18px;background:var(--surface-2);border-top:1px solid var(--line);
  display:flex;gap:10px;justify-content:flex-end;
}
.economy-modal-actions .btn{padding:8px 16px;font-size:13px}
.economy-modal-confirm{
  background:linear-gradient(135deg,#f59e0b,#d97706);color:#000;font-weight:700;border:none;
}
.economy-modal-confirm:hover{filter:brightness(1.1);box-shadow:0 0 15px rgba(245,158,11,0.4)}

/* ── Modal de Instalação PWA (Safari/iOS & App) ─────────── */
.pwa-backdrop{
  position:fixed;inset:0;z-index:100000;
  background:rgba(10,10,20,0.75);
  backdrop-filter:blur(4px);
  display:flex;align-items:center;justify-content:center;
  padding:16px;
}
.pwa-modal{
  background:var(--surface);color:var(--text);border-radius:var(--radius);
  border:1px solid var(--line);
  box-shadow:0 16px 40px rgba(0,0,0,0.4);padding:22px;max-width:360px;width:100%;
  text-align:center;position:relative;font-family:inherit;
  animation:pwaModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pwaModalPop{
  0%{transform:scale(0.92);opacity:0}
  100%{transform:scale(1);opacity:1}
}
.pwa-modal-icon{
  width:72px;height:72px;border-radius:18px;object-fit:cover;
  box-shadow:0 8px 20px rgba(0,0,0,0.3);margin:0 auto 12px;display:block;
}
.pwa-modal-title{margin:0 0 6px;font-size:17px;font-weight:800}
.pwa-modal-subtitle{color:var(--muted);font-size:13px;margin:0 0 16px;line-height:1.4}
.pwa-modal-steps{
  background:var(--surface-2);border-radius:var(--radius-sm);padding:12px;
  text-align:left;font-size:13px;line-height:1.5;margin-bottom:16px;
  display:flex;flex-direction:column;gap:10px;
}
.pwa-modal-step{display:flex;align-items:flex-start;gap:10px}
.pwa-step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;border-radius:50%;background:var(--brand);
  color:#fff;font-weight:800;font-size:11px;flex-shrink:0;margin-top:1px;
}
.pwa-modal-close-btn{width:100%}
.stage-pwa{font-size:13px}
.btn-meta-pwa{
  color:var(--brand) !important;
  border-color:rgba(91,61,245,0.3) !important;
  background:rgba(91,61,245,0.08) !important;
}
.btn-meta-pwa:hover{
  background:rgba(91,61,245,0.18) !important;
  border-color:var(--brand) !important;
}

/* ── Modo PWA Standalone (Jogo em Tela Cheia sem distrações) ── */
body.pwa-mode .proj-head,
body.pwa-mode .proj-meta,
body.pwa-mode .author-row,
body.pwa-mode .bio,
body.pwa-mode > header,
body.pwa-mode > footer,
body.pwa-mode > nav,
body.pwa-mode .nav-wrap{
  display:none !important;
}
body.pwa-mode .container,
body.pwa-mode main,
body.pwa-mode{
  padding:0 !important;
  margin:0 !important;
  width:100vw !important;
  height:100vh !important;
  max-width:none !important;
  overflow:hidden !important;
}
body.pwa-mode .stage{
  margin:0 !important;
  width:100vw !important;
  height:100vh !important;
  max-width:none !important;
  border-radius:0 !important;
  border:none !important;
  background:#000 !important;
  display:flex !important;
  flex-direction:column !important;
}
body.pwa-mode .stage iframe{
  width:100% !important;
  flex:1 1 0% !important;
  height:auto !important;
  min-height:0 !important;
  border-radius:0 !important;
  border:none !important;
}
@media (display-mode: standalone){
  .stage-pwa, [data-stage-pwa], [data-pwa-install]{
    display:none !important;
  }
}
body.pwa-mode .stage-pwa,
body.pwa-mode [data-stage-pwa],
body.pwa-mode [data-pwa-install]{
  display:none !important;
}

/* ── Home: Meus Apps & Favoritos (App Launcher) ──────────── */
.home-apps-section {
  margin: 28px 0 32px;
}
.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.home-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-section-title h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}
.home-section-icon {
  font-size: 20px;
}
.home-section-badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.home-section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.15s;
}
.home-section-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.home-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 20px 14px;
  justify-items: center;
}
@media (max-width: 640px) {
  .home-apps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
  }
}
@media (max-width: 380px) {
  .home-apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 6px;
  }
}

.home-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  width: 100%;
  max-width: 92px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.home-app-item:hover {
  transform: translateY(-4px) scale(1.04);
}
.home-app-item:active {
  transform: scale(0.95);
}

.home-app-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
  background: var(--surface-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.home-app-item:hover .home-app-icon-wrap {
  box-shadow: 0 8px 24px rgba(91, 61, 245, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
  border-color: rgba(91, 61, 245, 0.5);
}

.home-app-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-app-item-new .home-app-icon-wrap {
  border: 2px dashed rgba(91, 61, 245, 0.45);
  background: rgba(91, 61, 245, 0.08);
  font-size: 24px;
  box-shadow: none;
  color: var(--brand);
}
.home-app-item-new:hover .home-app-icon-wrap {
  border-color: var(--brand);
  background: rgba(91, 61, 245, 0.16);
  box-shadow: 0 4px 16px rgba(91, 61, 245, 0.25);
}

.home-app-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
  word-break: break-word;
  transition: color 0.15s ease;
}
.home-app-item:hover .home-app-label {
  color: var(--brand);
}

.home-creators-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.home-creators-list::-webkit-scrollbar {
  height: 6px;
}
.home-creators-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.home-creator-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  min-width: 90px;
  max-width: 120px;
  flex: 0 0 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-align: center;
}
.home-creator-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 61, 245, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.home-creator-avatar-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface-2);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.home-creator-card:hover .home-creator-avatar-wrap {
  border-color: var(--brand);
  transform: scale(1.06);
}
.home-creator-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-creator-handle {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text);
  transition: color 0.15s ease;
}
.home-creator-card:hover .home-creator-handle {
  color: var(--brand);
}

/* ── Modal de Inicialização Nativo da Plataforma (Multiplayer / Solo) ── */
.stage-startup-modal {
  position: absolute;
  inset: 0;
  z-index: 99999;
  background: rgba(7, 9, 19, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  animation: stage-startup-fade-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-startup-modal[hidden] {
  display: none !important;
}
@keyframes stage-startup-fade-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.stage-startup-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface-2, #182035);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
  padding: 22px 18px;
  box-sizing: border-box;
  text-align: center;
}

.stage-startup-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.stage-startup-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 5px 0;
  line-height: 1.25;
}

.stage-startup-sub {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 16px 0;
}

.stage-startup-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.stage-startup-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}
.stage-startup-btn:active {
  transform: scale(0.98);
}

.stage-startup-btn.btn-create-server {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.25), rgba(16, 185, 129, 0.14));
  border-color: rgba(16, 185, 129, 0.35);
}
.stage-startup-btn.btn-create-server:hover {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.42), rgba(16, 185, 129, 0.26));
  border-color: rgba(16, 185, 129, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.22);
}

.stage-startup-btn.btn-browse-servers {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(99, 102, 241, 0.14));
  border-color: rgba(99, 102, 241, 0.35);
}
.stage-startup-btn.btn-browse-servers:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.42), rgba(99, 102, 241, 0.26));
  border-color: rgba(99, 102, 241, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.22);
}

.stage-startup-btn.btn-play-offline {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.22), rgba(245, 158, 11, 0.12));
  border-color: rgba(245, 158, 11, 0.35);
}
.stage-startup-btn.btn-play-offline:hover {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.38), rgba(245, 158, 11, 0.24));
  border-color: rgba(245, 158, 11, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.22);
}

.startup-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.startup-btn-info {
  flex: 1;
  min-width: 0;
}
.startup-btn-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}
.startup-btn-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.35;
}

.stage-startup-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.stage-startup-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.stage-startup-remember input[type="checkbox"] {
  cursor: pointer;
  accent-color: #6366f1;
}

.stage-mp-action-offline-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.stage-mp-action-offline-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}
.stage-mp-action-offline-btn:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  .stage-startup-card {
    padding: 16px 14px;
    border-radius: 15px;
    max-height: calc(100vh - 30px);
    overflow-y: auto;
  }
  .stage-startup-title {
    font-size: 17px;
  }
  .stage-startup-btn {
    padding: 10px 12px;
  }
}

