/* Verdejar — interface mobile-first em estilo pixel art */
@font-face {
  font-family: "Pixelify Sans";
  src: url("../assets/fontes/PixelifySans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --fundo: #12261f;
  --papel: #f7f0da;
  --papel2: #efe4c4;
  --tinta: #22302a;
  --tinta2: #55635a;
  --verde: #45a545;
  --verde-esc: #2d7a37;
  --verde-claro: #a6dc7e;
  --sol: #f4c64a;
  --ceu: #8fd3e8;
  --perigo: #d6544c;
  --borda: #22302a;
  --seg-top: env(safe-area-inset-top, 0px);
  --seg-dir: env(safe-area-inset-right, 0px);
  --seg-baixo: env(safe-area-inset-bottom, 0px);
  --seg-esq: env(safe-area-inset-left, 0px);
  --toque: 48px;
  --acao: 84px;
  --raio: 10px;
}
:root[data-tamanho="p"] { --toque: 44px; --acao: 70px; }
:root[data-tamanho="g"] { --toque: 56px; --acao: 100px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--fundo);
  color: var(--tinta);
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-size: 16px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  font-variant-ligatures: none;
}

#app { position: fixed; inset: 0; overflow: hidden; background: var(--fundo); }

#tela {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

[hidden] { display: none !important; }

button { font-variant-ligatures: none; font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; border: 0; background: none; padding: 0; }
input { font-family: inherit; }
canvas.px, .palco canvas, .miniatura canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- Ícones (máscaras SVG em pixel) ---------- */
.ico {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
  flex: none;
}
.ico-telacheia { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M1 1h4v1H2v3H1zM7 1h4v4h-1V2H7zM1 7h1v3h3v1H1zM10 7h1v4H7v-1h3z'/%3E%3C/svg%3E"); }
.em-telacheia .ico-telacheia { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M4 1h1v4H1V4h3zM7 1h1v3h3v1H7zM1 7h4v4H4V8H1zM7 7h4v1H8v3H7z'/%3E%3C/svg%3E"); }
.ico-voltar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M5 2h1v1H5v1H4v1h7v2H4v1h1v1h1v1H5V9H4V8H3V7H2V5h1V4h1V3h1z'/%3E%3C/svg%3E"); }
.ico-girar-esq { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M7 2h1v8H7V9H6V8H5V7H4V5h1V4h1V3h1z'/%3E%3C/svg%3E"); }
.ico-girar-dir { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M4 2h1v1h1v1h1v1h1v2H7v1H6v1H5v1H4z'/%3E%3C/svg%3E"); }
.ico-dado { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill-rule='evenodd' d='M2 1h8v1h1v8h-1v1H2v-1H1V2h1zM3 3v2h2V3zM7 7v2h2V7zM5 5v2h2V5z'/%3E%3C/svg%3E"); }
.ico-restaurar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M4 1h5v1h1v1h1v6h-1v1H9v1H4v-1H3V9h2v1h3V9h1V4H8V3H5v1H4v1h2v1H1V2h1v1h1V2h1z'/%3E%3C/svg%3E"); }
.ico-salvar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill-rule='evenodd' d='M1 1h8l2 2v8H1zM3 2v3h5V2zM3 7v3h6V7z'/%3E%3C/svg%3E"); }
.ico-ok { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M10 2h1v2h-1v1H9v1H8v1H7v1H6v1H5v1H4V9H3V8H2V7H1V6h2v1h1v1h1V7h1V6h1V5h1V4h1V3h1z'/%3E%3C/svg%3E"); }
.ico-folha { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M6 1h5v5h-1v2H9v1H7v1H4v1H2v-1H1V9h1V8h1V7h1V6h1V5h1V4h1V3H6v1H5v1H4v1H3V4h1V3h1V2h1z'/%3E%3C/svg%3E"); }
.ico-diario { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill-rule='evenodd' d='M2 1h8v10H2zM4 3v1h4V3zM4 5v1h4V5zM4 7v1h3V7z'/%3E%3C/svg%3E"); }
.ico-pausa { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M3 2h2v8H3zM7 2h2v8H7z'/%3E%3C/svg%3E"); }
.ico-mao { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M5 1h1v5h1V2h1v4h1V3h1v5H9v2H8v1H4v-1H3V9H2V6h1v1h1V2h1z'/%3E%3C/svg%3E"); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--toque);
  padding: 10px 18px;
  border: 3px solid var(--borda);
  border-radius: var(--raio);
  background: var(--papel);
  color: var(--tinta);
  font-size: 18px;
  font-weight: 600;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
  transition: transform 0.08s, filter 0.15s;
}
.btn:active, .btn.pressionado { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14); }
.btn-principal { background: var(--verde); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn-perigo { background: var(--perigo); color: #fff; }
.btn-pequeno { font-size: 15px; padding: 6px 10px; gap: 6px; }
.btn:focus-visible, .btn-icone:focus-visible, .opcao:focus-visible, .aba:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; }

.btn-icone {
  width: var(--toque);
  height: var(--toque);
  display: inline-grid;
  place-items: center;
  border: 3px solid var(--borda);
  border-radius: var(--raio);
  background: var(--papel);
  color: var(--tinta);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}
.btn-icone:active { transform: translateY(2px); }

.pilha-botoes { display: flex; flex-direction: column; gap: 10px; width: min(100%, 320px); margin: 0 auto; }
.pilha-botoes .btn { width: 100%; }
.linha-botoes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.linha-botoes .btn { flex: 1 1 140px; }

/* ---------- Telas de interface ---------- */
.tela-cheia-ui {
  position: absolute;
  inset: 0;
  padding: calc(12px + var(--seg-top)) calc(12px + var(--seg-dir)) calc(12px + var(--seg-baixo)) calc(12px + var(--seg-esq));
  z-index: 20;
}

.logo {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 var(--verde-esc), 0 6px 0 rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo.grande { font-size: clamp(46px, 13vw, 76px); }
.logo-folha { width: 0.8em; height: 0.8em; background: var(--verde-claro); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M6 1h5v5h-1v2H9v1H7v1H4v1H2v-1H1V9h1V8h1V7h1V6h1V5h1V4h1V3H6v1H5v1H4v1H3V4h1V3h1V2h1z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M6 1h5v5h-1v2H9v1H7v1H4v1H2v-1H1V9h1V8h1V7h1V6h1V5h1V4h1V3H6v1H5v1H4v1H3V4h1V3h1V2h1z'/%3E%3C/svg%3E") center/contain no-repeat; filter: drop-shadow(0 3px 0 var(--verde-esc)); }

#carregando { display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; color: var(--papel); background: radial-gradient(circle at 50% 40%, #24503d, var(--fundo)); }
.barra { width: min(70vw, 280px); height: 18px; border: 3px solid var(--papel); border-radius: 6px; padding: 2px; }
#carregando-barra { height: 100%; width: 0; background: var(--verde-claro); border-radius: 2px; transition: width 0.2s; }

#titulo { display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(18, 38, 31, 0.15), rgba(18, 38, 31, 0.55) 70%, rgba(18, 38, 31, 0.85)); }
.topo-direita { display: flex; justify-content: flex-end; }
.titulo-centro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; min-height: 0; }
.subtitulo { margin: -6px 0 0; color: var(--papel); font-size: 18px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.titulo-personagem { width: min(38vw, 30vh, 190px); aspect-ratio: 1; }
.titulo-personagem canvas, .confirmar-previa canvas, .perfil-previa canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.rodape-titulo { margin: 4px 0 0; color: var(--papel2); font-size: 14px; opacity: 0.85; }

/* ---------- Editor ---------- */
#editor { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; background: linear-gradient(180deg, #2c5a45, var(--fundo)); }
.editor-topo { display: flex; align-items: center; gap: 8px; }
.editor-topo h1 { flex: 1; margin: 0; text-align: center; color: #fff; font-size: 20px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.editor-corpo { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.editor-previa, .editor-opcoes, .editor-topo, .editor-base { min-width: 0; }
.editor-topo h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-previa { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.palco {
  position: relative;
  height: clamp(150px, 30dvh, 300px);
  border: 3px solid var(--borda);
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 85%, #6fbf55 0 28%, transparent 29%), linear-gradient(180deg, #a8e1f0, #d8f1e4 70%, #8acb6a 70.5%);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.palco > canvas { position: absolute; left: 50%; bottom: 4%; height: 100%; aspect-ratio: 1; transform: translateX(-50%); }
.palco > canvas.pulo { animation: pulo 0.28s ease-out; }
@keyframes pulo { 40% { transform: translateX(-50%) translateY(-5%) scale(1.03); } }
.btn-girar { position: absolute; top: 55%; translate: 0 -50%; width: var(--toque); height: var(--toque); border-radius: 50%; display: grid; place-items: center; background: rgba(247, 240, 218, 0.92); border: 3px solid var(--borda); }
.btn-girar.esq { left: 8px; }
.btn-girar.dir { right: 8px; }
.btn-girar:active { scale: 0.92; }
.chip-palco { position: absolute; left: 8px; bottom: 8px; padding: 6px 12px; min-height: 36px; border-radius: 99px; background: rgba(247, 240, 218, 0.92); border: 2px solid var(--borda); font-size: 14px; font-weight: 600; }
.chip-palco[aria-pressed="true"] { background: var(--verde); color: #fff; }
.selo-eco { position: absolute; right: 8px; top: 8px; max-width: 46%; padding: 5px 9px; border-radius: 8px; background: rgba(34, 48, 42, 0.86); color: var(--verde-claro); font-size: 12px; line-height: 1.25; }
.campo-nome { display: flex; align-items: center; gap: 8px; color: var(--papel); font-size: 15px; }
.campo-nome input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 3px solid var(--borda); border-radius: 8px; background: var(--papel); color: var(--tinta); font-size: 16px; user-select: text; -webkit-user-select: text; touch-action: manipulation; }

.editor-opcoes { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 3px solid var(--borda); border-radius: 14px; background: var(--papel); overflow: hidden; }
.abas { display: flex; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none; background: var(--papel2); border-bottom: 3px solid var(--borda); touch-action: pan-x; flex: none; }
.abas::-webkit-scrollbar { display: none; }
.aba { flex: none; min-height: 40px; padding: 6px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--tinta2); white-space: nowrap; }
.aba[aria-selected="true"] { background: var(--tinta); color: var(--papel); }
.painel-opcoes { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 16px; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.secao { margin-bottom: 14px; }
.secao h3 { margin: 0 0 6px; font-size: 15px; color: var(--tinta2); display: flex; justify-content: space-between; gap: 8px; }
.secao h3 small { font-weight: 400; color: var(--verde-esc); }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
.grade.grande { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.opcao {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 64px;
  padding: 4px 2px 5px;
  border: 2px solid #cdbf98;
  border-radius: 10px;
  background: #fffaf0;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}
.opcao canvas { width: 100%; max-width: 64px; aspect-ratio: 1; image-rendering: pixelated; }
.grade.grande .opcao canvas { max-width: 88px; }
.opcao[aria-pressed="true"] { border: 3px solid var(--verde-esc); background: #e5f6d6; box-shadow: 0 0 0 2px var(--verde-claro); }
.opcao[aria-pressed="true"]::after { content: ""; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; background: var(--verde-esc); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M10 2h1v2h-1v1H9v1H8v1H7v1H6v1H5v1H4V9H3V8H2V7H1V6h2v1h1v1h1V7h1V6h1V5h1V4h1V3h1z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M10 2h1v2h-1v1H9v1H8v1H7v1H6v1H5v1H4V9H3V8H2V7H1V6h2v1h1v1h1V7h1V6h1V5h1V4h1V3h1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.opcao .eco { color: var(--verde-esc); font-size: 11px; }
.cores { display: flex; flex-wrap: wrap; gap: 6px; }
.cor { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, 0.25); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.cor[aria-pressed="true"] { border: 3px solid var(--tinta); box-shadow: 0 0 0 3px var(--sol), inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.nota { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: #fff3c4; font-size: 13px; }
.material { align-items: flex-start; text-align: left; padding: 8px; min-height: 0; }
.material b { font-size: 13px; }
.material span { font-size: 11px; color: var(--tinta2); }

.editor-base { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.editor-base .btn { flex-direction: column; gap: 2px; padding: 6px 2px; min-height: 58px; font-size: 13px; }

@media (orientation: landscape) and (min-width: 640px) {
  .editor-corpo { flex-direction: row; }
  .editor-previa { flex: 0 0 38%; justify-content: center; }
  .palco { height: auto; flex: 1; min-height: 0; }
  .editor-base { grid-template-columns: repeat(4, minmax(0, 180px)); justify-content: end; }
  .editor-base .btn { flex-direction: row; min-height: var(--toque); font-size: 15px; }
}
@media (orientation: landscape) and (max-height: 480px) {
  .editor-topo h1 { font-size: 16px; }
  .campo-nome { display: none; }
  .editor-base .btn { min-height: 44px; }
  .tela-cheia-ui { padding-top: calc(6px + var(--seg-top)); padding-bottom: calc(6px + var(--seg-baixo)); }
}

/* ---------- Modais ---------- */
.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: calc(12px + var(--seg-top)) calc(12px + var(--seg-dir)) calc(12px + var(--seg-baixo)) calc(12px + var(--seg-esq));
  background: rgba(10, 20, 16, 0.6);
  animation: aparecer 0.18s ease-out;
}
@keyframes aparecer { from { opacity: 0; } }
.cartao-modal {
  width: min(100%, 440px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 3px solid var(--borda);
  border-radius: 16px;
  background: var(--papel);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3);
  animation: subir 0.22s cubic-bezier(0.2, 1.4, 0.5, 1);
}
@keyframes subir { from { transform: translateY(16px) scale(0.97); } }
.cartao-modal h2 { margin: 0; text-align: center; font-size: 22px; }
.cartao-modal p { margin: 0; line-height: 1.4; }
.confirmar-previa { width: min(52vw, 32dvh, 220px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 50% 80%, #8acb6a 0 30%, #d8f1e4 31%); border: 3px solid var(--borda); overflow: hidden; }
.conf-nome { text-align: center; font-size: 20px; font-weight: 700; min-height: 1em; }

.perfil { display: flex; gap: 12px; align-items: center; }
.perfil-previa { width: 112px; flex: none; aspect-ratio: 1; border-radius: 14px; background: radial-gradient(circle at 50% 80%, #8acb6a 0 30%, #d8f1e4 31%); border: 3px solid var(--borda); overflow: hidden; }
.perfil-nome { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.perfil-stats { margin: 0; padding: 0; list-style: none; font-size: 14px; display: grid; gap: 3px; }
.perfil-stats li { display: flex; justify-content: space-between; gap: 10px; }

.diario-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.diario-lista li { padding: 10px 12px; border: 2px solid #cdbf98; border-radius: 10px; background: #fffaf0; }
.diario-lista li.feita { background: #e5f6d6; border-color: var(--verde); }
.diario-lista li.bloqueada { opacity: 0.6; }
.diario-lista b { display: block; font-size: 16px; }
.diario-lista span { font-size: 13px; color: var(--tinta2); }
.progresso { height: 8px; margin-top: 6px; border-radius: 4px; background: #e2d6b4; overflow: hidden; }
.progresso > i { display: block; height: 100%; background: var(--verde); }

.opcoes-cartao { width: min(100%, 520px); }
.opcoes-grade { display: grid; gap: 12px; }
.op { display: grid; gap: 6px; font-size: 15px; font-weight: 600; }
.op input[type="range"] { width: 100%; height: 32px; accent-color: var(--verde); touch-action: pan-x; }
.segmentado { display: flex; border: 3px solid var(--borda); border-radius: 10px; overflow: hidden; }
.segmentado button { flex: 1; min-height: 42px; font-size: 14px; font-weight: 600; background: #fffaf0; border-right: 2px solid #cdbf98; }
.segmentado button:last-child { border-right: 0; }
.segmentado button[aria-pressed="true"] { background: var(--verde); color: #fff; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud-topo { position: absolute; top: calc(8px + var(--seg-top)); left: calc(8px + var(--seg-esq)); right: calc(8px + var(--seg-dir)); display: flex; gap: 8px; align-items: flex-start; }
.hud-botoes { display: flex; gap: 6px; margin-left: auto; pointer-events: auto; }
.hud-botoes .btn-icone { width: 44px; height: 44px; background: rgba(247, 240, 218, 0.94); }
.medidor { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; max-width: 300px; height: 44px; padding: 0 10px; border: 3px solid var(--borda); border-radius: 12px; background: rgba(247, 240, 218, 0.94); font-weight: 700; color: var(--verde-esc); }
.medidor-barra { flex: 1; height: 12px; min-width: 40px; border-radius: 6px; background: #c9bb93; overflow: hidden; border: 2px solid var(--borda); }
#hud-eco { height: 100%; width: 0; background: linear-gradient(90deg, #9bbf4a, var(--verde)); transition: width 0.6s; }
#hud-eco-txt { font-size: 15px; min-width: 3ch; text-align: right; }
.hud-linha2 { position: absolute; top: calc(60px + var(--seg-top)); left: calc(8px + var(--seg-esq)); right: calc(8px + var(--seg-dir)); display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.chip-missao { max-width: min(100%, 360px); padding: 6px 10px; border-radius: 10px; background: rgba(34, 48, 42, 0.86); color: var(--papel); font-size: 14px; line-height: 1.25; pointer-events: auto; }
.chip-missao b { color: var(--sol); font-weight: 600; }
.chip-missao:empty { display: none; }
.inventario { display: flex; gap: 4px; }
.inventario span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 10px; background: rgba(34, 48, 42, 0.86); color: var(--papel); font-size: 14px; }
.inventario canvas { width: 18px; height: 18px; image-rendering: pixelated; }
.dicas-teclado { position: absolute; left: 50%; bottom: calc(10px + var(--seg-baixo)); transform: translateX(-50%); display: flex; gap: 12px; padding: 6px 12px; border-radius: 10px; background: rgba(34, 48, 42, 0.75); color: var(--papel); font-size: 13px; white-space: nowrap; }
kbd { display: inline-block; padding: 0 5px; margin-right: 4px; border-radius: 4px; background: var(--papel); color: var(--tinta); font-family: inherit; font-size: 12px; }
.modo-toque .dicas-teclado { display: none; }

/* ---------- Toque ---------- */
#toque { position: absolute; inset: 0; pointer-events: none; z-index: 11; }
#joystick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; background: rgba(247, 240, 218, 0.18); border: 3px solid rgba(247, 240, 218, 0.55); }
#joystick-pino { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(247, 240, 218, 0.85); border: 3px solid var(--borda); }
.btn-acao {
  position: absolute;
  right: calc(18px + var(--seg-dir));
  bottom: calc(22px + var(--seg-baixo));
  width: var(--acao);
  height: var(--acao);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--sol);
  border: 3px solid var(--borda);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 4px 0 rgba(0, 0, 0, 0.3);
  color: var(--tinta);
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-acao .ico { width: 28px; height: 28px; }
.btn-acao.inativo { opacity: 0.42; background: var(--papel); }
.btn-acao.pressionado { transform: scale(0.92); }
.mao-esq .btn-acao { right: auto; left: calc(18px + var(--seg-esq)); }

/* ---------- Diálogo ---------- */
#dialogo { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 calc(10px + var(--seg-dir)) calc(12px + var(--seg-baixo)) calc(10px + var(--seg-esq)); display: flex; justify-content: center; }
.dialogo-caixa { position: relative; width: min(100%, 640px); display: flex; gap: 10px; padding: 12px; border: 3px solid var(--borda); border-radius: 14px; background: var(--papel); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); animation: subir 0.2s ease-out; cursor: pointer; }
#dialogo-retrato { width: 64px; height: 64px; flex: none; border-radius: 10px; border: 3px solid var(--borda); background: #cfeedd; image-rendering: pixelated; }
.dialogo-corpo { flex: 1; min-width: 0; }
.dialogo-nome { font-weight: 700; color: var(--verde-esc); font-size: 15px; margin-bottom: 2px; }
#dialogo-texto { margin: 0; font-size: 17px; line-height: 1.4; min-height: 2.8em; }
.dialogo-seta { position: absolute; right: 12px; bottom: 8px; width: 0; height: 0; border: 7px solid transparent; border-top-color: var(--tinta); animation: piscar 0.8s steps(2) infinite; }
@keyframes piscar { 50% { opacity: 0; } }

/* ---------- Triagem ---------- */
.triagem-cartao { width: min(100%, 520px); }
.triagem-ajuda { text-align: center; font-size: 14px; color: var(--tinta2); }
.triagem-itens { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 74px; }
.item-lixo { width: 70px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 2px solid #cdbf98; border-radius: 10px; background: #fffaf0; font-size: 11px; line-height: 1.1; touch-action: none; }
.item-lixo canvas { width: 44px; height: 44px; image-rendering: pixelated; pointer-events: none; }
.item-lixo.escolhido { border: 3px solid var(--sol); background: #fff3c4; transform: translateY(-3px); }
.item-lixo.errou { animation: tremer 0.3s; }
.item-lixo.arrastando { position: fixed; z-index: 60; pointer-events: none; transform: scale(1.1); }
@keyframes tremer { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.triagem-dica { text-align: center; min-height: 2.8em; font-size: 14px; }
.triagem-lixeiras { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lixeira { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 3px solid var(--borda); border-radius: 10px 10px 6px 6px; color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2); min-height: 72px; justify-content: flex-end; }
.lixeira::before { content: ""; width: 70%; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.3); margin-bottom: auto; }
.lixeira.alvo { outline: 4px solid var(--sol); }
.lixeira.acertou { animation: pulo2 0.3s; }
@keyframes pulo2 { 50% { transform: scale(1.08); } }

/* ---------- Avisos ---------- */
.aviso { position: absolute; left: 50%; top: calc(104px + var(--seg-top)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 24px); padding: 10px 16px; border: 3px solid var(--borda); border-radius: 12px; background: var(--papel); font-weight: 600; font-size: 15px; text-align: center; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); animation: subir 0.2s ease-out; display: flex; gap: 10px; align-items: center; pointer-events: auto; }
.aviso button { padding: 4px 10px; border-radius: 8px; background: var(--tinta); color: var(--papel); font-size: 14px; min-height: 36px; }
.fps { position: absolute; left: calc(8px + var(--seg-esq)); bottom: calc(8px + var(--seg-baixo)); z-index: 60; padding: 2px 6px; background: rgba(0, 0, 0, 0.6); color: #9f9; font: 12px monospace; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .btn-icone:hover, .opcao:hover { filter: brightness(1.05); }
}
@media (max-width: 360px) {
  .editor-base .btn { font-size: 12px; }
  .medidor { padding: 0 6px; }
  .hud-botoes .btn-icone { width: 42px; height: 42px; }
}

/* Modo ampliado (navegador sem tela cheia): HUD compacta para sobrar mais cenário */
.modo-ampliado .hud-linha2 .inventario, .modo-ampliado .dicas-teclado { display: none; }
.modo-ampliado .chip-missao { font-size: 13px; padding: 4px 8px; }
html:not(.modo-toque) .btn-acao.inativo { opacity: 0; pointer-events: none; }

/* Escolha rápida de corpo por imagem (canto da prévia) */
.bases-palco { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; }
.btn-base { width: 52px; height: 52px; padding: 2px; border-radius: 12px; background: rgba(247, 240, 218, 0.92); border: 3px solid var(--borda); display: grid; place-items: center; }
.btn-base canvas { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.btn-base[aria-pressed="true"] { background: #e5f6d6; border-color: var(--verde-esc); box-shadow: 0 0 0 3px var(--verde-claro); }
.btn-base:active { transform: scale(0.94); }
.grade.bases { grid-template-columns: repeat(2, 1fr); max-width: 280px; }
.grade.bases .opcao canvas { max-width: 110px; }
:root[data-tamanho="g"] .btn-base { width: 60px; height: 60px; }

/* =====================================================================
   Raízes do Sertão — interface da fazenda (mobile primeiro)
   ===================================================================== */
:root { --fundo: #2a1f14; --terra: #b5653a; --areia: #e8d3a6; }
html, body, #app { background: var(--fundo); }
#carregando { background: radial-gradient(circle at 50% 40%, #6a4a2a, var(--fundo)); }
#titulo { background: linear-gradient(180deg, rgba(42, 31, 20, 0.1), rgba(42, 31, 20, 0.55) 65%, rgba(42, 31, 20, 0.9)); }
.logo { text-shadow: 0 3px 0 #8a4a20, 0 6px 0 rgba(0, 0, 0, 0.35); line-height: 0.95; text-align: left; }
.logo.grande { font-size: clamp(40px, 11.5vw, 68px); }
.subtitulo { max-width: 30ch; font-size: 16px; line-height: 1.35; }
#editor { background: linear-gradient(180deg, #7a5230, var(--fundo)); }
.ico-menu { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M1 2h10v2H1zM1 5h10v2H1zM1 8h10v2H1z'/%3E%3C/svg%3E"); }
.ico-fechar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M2 1h2v1h1v1h2V2h1V1h2v2H9v1H8v1H7v2h1v1h1v1h1v2H8v-1H7V9H5v1H4v1H2V9h1V8h1V7h1V5H4V4H3V3H2z'/%3E%3C/svg%3E"); }
canvas.ic { width: 18px; height: 18px; image-rendering: pixelated; flex: none; vertical-align: middle; }
canvas.ic.grande { width: 30px; height: 30px; }

/* HUD */
#hud .hud-topo { align-items: center; }
.recursos { display: flex; gap: 5px; min-width: 0; flex: 1; flex-wrap: wrap; }
.rec { display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 9px; border: 3px solid var(--borda); border-radius: 12px; background: rgba(247, 240, 218, 0.95); font-size: 15px; pointer-events: auto; }
.rec b { font-weight: 700; }
.rec-nivel { flex-direction: column; justify-content: center; gap: 2px; padding: 0 8px; min-width: 64px; }
.rec-nivel .nv { font-size: 13px; line-height: 1; }
.mini-barra { width: 100%; min-width: 40px; height: 6px; border-radius: 3px; background: #d6c79e; overflow: hidden; }
.mini-barra i { display: block; height: 100%; width: 0; background: var(--verde); transition: width 0.4s; }
.rec-agua { position: relative; padding-bottom: 6px; }
.rec-agua .mini-barra { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 4px; min-width: 0; width: auto; }
.mini-barra.agua i { background: #3a9ad0; }
.rec-agua.alerta { background: #ffd9cf; }
#hud .hud-linha2 { top: calc(54px + var(--seg-top)); align-items: center; flex-wrap: nowrap; }
.relogio { display: flex; flex-direction: column; padding: 4px 9px; border-radius: 10px; background: rgba(34, 48, 42, 0.86); color: var(--papel); font-size: 12px; line-height: 1.2; flex: none; pointer-events: auto; }
.relogio #hud-dia { font-weight: 700; font-size: 13px; }
#hud-clima[data-estacao="seca"] { color: #ffcf7a; }
#hud .chip-missao { text-align: left; font-family: inherit; border: 0; cursor: pointer; flex: 1; min-width: 0; min-height: 40px; }
.lateral { position: absolute; right: calc(8px + var(--seg-dir)); bottom: calc(132px + var(--seg-baixo)); display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.btn-redondo { width: 62px; height: 58px; letter-spacing: -0.2px; border-radius: 16px; border: 3px solid var(--borda); background: rgba(247, 240, 218, 0.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; font-weight: 700; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14); }
.btn-redondo canvas.ic { width: 24px; height: 24px; }
.btn-redondo:active { transform: scale(0.94); }
.base { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(6px + var(--seg-dir)) calc(6px + var(--seg-baixo)) calc(6px + var(--seg-esq)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.ferramentas { display: flex; gap: 4px; padding: 5px; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 3px solid var(--borda); border-radius: 16px; background: rgba(247, 240, 218, 0.96); pointer-events: auto; touch-action: pan-x; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.ferramentas::-webkit-scrollbar { display: none; }
.ferr { position: relative; flex: none; width: 52px; min-height: 58px; padding: 4px 2px 3px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--tinta); }
:root[data-tamanho="g"] .ferr { width: 60px; min-height: 64px; font-size: 12px; }
:root[data-tamanho="p"] .ferr { width: 46px; min-height: 52px; }
.ferr canvas.ic.grande { width: 30px; height: 30px; }
.ferr[aria-pressed="true"] { background: var(--sol); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.ferr .selo { position: absolute; top: 1px; right: 1px; padding: 0 3px; border-radius: 6px; background: #3a9ad0; color: #fff; font-size: 10px; line-height: 14px; }
.chip-semente { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--borda); background: rgba(247, 240, 218, 0.96); font-size: 14px; pointer-events: auto; }
.chip-semente b { color: var(--verde-esc); font-size: 12px; text-decoration: underline; }
.dica-pulsa { animation: pulsa 1s ease-in-out infinite; }
@keyframes pulsa { 50% { box-shadow: 0 0 0 4px var(--sol), 0 0 14px 4px rgba(244, 198, 74, 0.8); } }
.colocacao { width: min(100%, 520px); padding: 10px 12px; border: 3px solid var(--borda); border-radius: 14px; background: var(--papel); pointer-events: auto; display: grid; gap: 6px; }
.colocacao ul { margin: 0; padding-left: 18px; font-size: 13px; }
.colocacao li.ruim { color: var(--perigo); font-weight: 700; }
#hud .dicas-teclado { display: none; }

/* Painéis (gaveta no celular, janela no computador) */
.folha { position: absolute; inset: 0; z-index: 35; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 14, 8, 0.5); animation: aparecer 0.15s ease-out; }
.folha-cartao { width: min(100%, 560px); max-height: 86%; display: flex; flex-direction: column; border: 3px solid var(--borda); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--papel); box-shadow: 0 -6px 0 rgba(0, 0, 0, 0.2); animation: gaveta 0.22s cubic-bezier(0.2, 1, 0.4, 1); padding-bottom: var(--seg-baixo); }
@keyframes gaveta { from { transform: translateY(40px); opacity: 0.4; } }
.folha.folha-pequena .folha-cartao { max-height: 60%; }
.folha-topo { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 16px; border-bottom: 2px solid #e2d4ae; }
.folha-topo h2 { flex: 1; margin: 0; font-size: 20px; }
.folha-corpo { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 12px 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.folha-corpo h3 { margin: 6px 0 0; font-size: 16px; color: var(--tinta2); }
.folha-corpo p { margin: 0; line-height: 1.4; }
@media (min-width: 700px) and (min-height: 520px) {
  .folha { align-items: center; }
  .folha-cartao { border-bottom: 3px solid var(--borda); border-radius: 18px; max-height: 84%; }
}
.lista { display: grid; gap: 6px; }
.linha { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid #d9c89c; border-radius: 12px; background: #fffaf0; text-align: left; font-size: 14px; width: 100%; }
.linha.escolha { cursor: pointer; }
.linha.sel { border: 3px solid var(--verde-esc); background: #e5f6d6; }
.linha.travada { opacity: 0.55; }
.linha-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.linha-txt small { color: var(--tinta2); font-size: 12px; line-height: 1.3; }
.linha-acoes { display: flex; gap: 4px; flex: none; }
.linha-acoes .btn, .linha > .btn { min-height: 40px; padding: 4px 10px; font-size: 14px; gap: 4px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn .ic { width: 18px; height: 18px; }
.saldo { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.nota { padding: 8px 10px; border-radius: 10px; background: #f3e8c6; font-size: 13px; }
.nota.ok { background: #dff3cf; }
.nota.alerta { background: #ffd9cf; }
.vazio { color: var(--tinta2); font-size: 14px; }
.ok-txt { color: var(--verde-esc); font-weight: 700; }
.itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 2px solid #d9c89c; border-radius: 10px; background: #fffaf0; font-size: 12px; text-align: center; }
.item b { font-size: 15px; }
.medida { display: grid; gap: 3px; }
.medida-rotulo { font-size: 13px; font-weight: 600; }
.medida-barra { height: 12px; border-radius: 6px; background: #e2d6b4; border: 2px solid var(--borda); overflow: hidden; }
.medida-barra i { display: block; height: 100%; background: var(--verde); }
.medida.agua .medida-barra i { background: #3a9ad0; }
.medida.alerta .medida-barra i { background: var(--perigo); }
.medida.alerta .medida-rotulo::before { content: "⚠ "; }
.mistura-barra { position: relative; height: 14px; border-radius: 7px; border: 2px solid var(--borda); background: linear-gradient(90deg, #5aa847, #c9b46a 50%, #b07a3a); }
.mistura-barra .zona { position: absolute; top: 0; bottom: 0; left: 39%; width: 25%; border-left: 2px dashed #fff; border-right: 2px dashed #fff; }
.mistura-barra i { position: absolute; top: -5px; width: 8px; height: 20px; margin-left: -4px; border-radius: 3px; background: var(--tinta); border: 2px solid #fff; }
.mistura-legenda { display: flex; justify-content: space-between; font-size: 11px; color: var(--tinta2); }
.problemas { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.problemas b { color: #a8361e; }
.tag-seco { color: #8a5a20 !important; font-weight: 700; }
.tag-verde { color: #2d7a37 !important; font-weight: 700; }
.acoes-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.acoes-grade .btn { font-size: 14px; padding: 8px 10px; min-height: 46px; }
.comp-topo { display: flex; align-items: center; gap: 12px; }
.comp-vis { width: 80px; height: 76px; image-rendering: pixelated; flex: none; background: #e9dcb6; border-radius: 10px; }
.balde { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.balde-item { display: grid; gap: 3px; padding: 10px; border: 2px solid #d9c89c; border-radius: 12px; background: #fffaf0; text-align: left; font-size: 14px; min-height: 64px; }
.balde-item small { font-size: 12px; color: var(--tinta2); line-height: 1.3; }
.balde-item.sel { border: 3px solid var(--verde-esc); background: #e5f6d6; }
.balde-item.certo { border-color: var(--verde); background: #e5f6d6; }
.balde-item.errado { border-color: var(--perigo); background: #ffd9cf; }
.pedido { display: grid; gap: 6px; padding: 10px; border: 2px solid #d9c89c; border-radius: 12px; background: #fffaf0; }
.pedido-itens { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.pedido-itens span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 8px; background: #f3e8c6; }
.pedido-itens .tem { background: #dff3cf; }
.pedido-itens .falta::after { content: " ✗"; color: var(--perigo); }
.pedido-itens .tem::after { content: " ✓"; color: var(--verde-esc); }
.pedido-pe { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.pedido-pe span { display: inline-flex; align-items: center; gap: 3px; }
.menu-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border: 2px solid #d9c89c; border-radius: 12px; background: #fffaf0; font-size: 14px; font-weight: 700; }
.menu-item small { font-size: 11px; color: var(--tinta2); font-weight: 400; }
.menu-item[disabled] { opacity: 0.5; }
.etapas { margin: 0; padding-left: 22px; display: grid; gap: 2px; font-size: 14px; }
.etapas .feita { color: var(--verde-esc); text-decoration: line-through; }
.etapas .atual { font-weight: 700; }
.etapas .atual::marker { color: var(--terra); }
.cartao-op { display: grid; gap: 6px; padding: 10px; border: 2px solid #d9c89c; border-radius: 12px; background: #fffaf0; }
.cartao-op p { font-size: 13px; }
.real { padding: 10px 12px; border-left: 5px solid var(--terra); border-radius: 8px; background: #f7e7d6; }
.real p { font-size: 13px; margin-top: 4px; }
.mandala-prev { width: 160px; height: 160px; margin: 0 auto; image-rendering: pixelated; }
.op { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.missao { display: grid; gap: 4px; padding: 10px; border: 2px solid #d9c89c; border-radius: 12px; background: #fffaf0; }
.missao small { color: var(--tinta2); font-size: 12px; }
.missao ol { margin: 4px 0; padding-left: 20px; font-size: 14px; display: grid; gap: 2px; }
.missao .feita { color: var(--verde-esc); }
.missao .atual { font-weight: 700; }
.fontes { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.fontes a { color: #2b5aa8; }
.como { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.4; }
.modulos, .fluxos { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 3px; }
.modulos .feita { color: var(--verde-esc); font-weight: 700; }
.cores { display: flex; flex-wrap: wrap; gap: 8px; }
.nivel-lista { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.perfil-stats li { display: flex; justify-content: space-between; gap: 10px; }
:root.sem-animacao *, :root.sem-animacao *::before { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }

@media (orientation: landscape) and (max-height: 480px) {
  .lateral { bottom: calc(80px + var(--seg-baixo)); flex-direction: row; right: calc(8px + var(--seg-dir)); }
  .btn-redondo { width: 50px; height: 50px; }
  .ferr { min-height: 50px; }
  .folha-cartao { max-height: 94%; }
}
@media (max-width: 370px) {
  .rec { padding: 0 6px; font-size: 13px; }
  .ferr { width: 46px; }
  .btn-redondo { width: 50px; height: 50px; }
}
.folha-cartao { max-height: calc(100% - 150px - var(--seg-top)); }
@media (orientation: landscape) and (max-height: 480px) { .folha-cartao { max-height: calc(100% - 70px); } .aviso { top: calc(8px + var(--seg-top)); } }
.ferr { width: clamp(40px, calc((100vw - 52px - var(--seg-esq) - var(--seg-dir)) / 7), 56px); }
@media (max-width: 400px) { .ferr { font-size: 10px; } .ferr canvas.ic.grande { width: 26px; height: 26px; } }
.recursos { flex-wrap: nowrap; }
.btn-redondo { width: 68px; font-size: 10.5px; }
@media (max-width: 380px) {
  .rec { height: 34px; padding: 0 5px; font-size: 12px; gap: 3px; }
  .rec canvas.ic { width: 14px; height: 14px; }
  .rec-nivel { min-width: 40px; padding: 0 5px; }
  #hud .hud-botoes .btn-icone { width: 38px; height: 38px; }
  #hud .hud-linha2 { top: calc(48px + var(--seg-top)); }
  .btn-redondo { width: 58px; height: 54px; }
}

/* Botão Usar (só no toque) */
.btn-usar { position: absolute; left: calc(10px + var(--seg-esq)); bottom: calc(100px + var(--seg-baixo)); width: 64px; height: 64px; border-radius: 50%; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--sol); border: 3px solid var(--borda); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 3px 0 rgba(0, 0, 0, 0.3); font-size: 12px; font-weight: 700; color: var(--tinta); pointer-events: auto; }
.modo-toque .btn-usar { display: flex; }
.btn-usar:active { transform: scale(0.92); }
@media (orientation: landscape) and (max-height: 480px) { .btn-usar { bottom: calc(76px + var(--seg-baixo)); width: 56px; height: 56px; } }

/* Número do atalho de teclado em cada ferramenta (só no computador) */
html:not(.modo-toque) .ferr[data-num]::before { content: attr(data-num); position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--tinta2); }
