/* Layout: palco do jogo em tela cheia; menus são folhas de caderno de laboratório sobre ele. */
:root {
  --night: #141B3D;      /* fundo atrás de tudo */
  --paper: #F7FAF6;      /* papel levemente esverdeado */
  --grid: #D7E6EE;       /* quadriculado azul */
  --margin: #F0A6B3;     /* linha de margem do caderno */
  --ink: #1F2A5A;        /* tinta azul-marinho */
  --ink-2: #4B5784;      /* tinta clara */
  --marker: #FFE45C;     /* marca-texto */
  --stamp: #D2364F;      /* carimbo */
  --leaf: #2F9E6E;       /* verde biologia */
  --rose: #F2789B;

  --font-display: 'Caveat Brush', 'Segoe Print', 'Comic Sans MS', cursive;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-label: 'Courier Prime', 'Courier New', ui-monospace, monospace;

  --step--1: 0.82rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;

  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }

#app { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; left: 0; top: 0; }
#game { display: block; width: 100%; height: 100%; touch-action: none; }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  z-index: 5;
}
.round {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(20,27,61,0.45);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}
.round svg { fill: currentColor; }
.round:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }

/* ---------- Toque ---------- */
#touch {
  position: absolute;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  touch-action: none;
}
#touch > * { pointer-events: auto; }
.dpad {
  position: relative;
  display: flex;
  width: 168px; height: 84px;
  border-radius: 42px;
  background: rgba(255,255,255,0.16);
  border: 2px solid rgba(255,255,255,0.5);
  touch-action: none;
}
.dpad .arrow {
  flex: 1;
  display: grid; place-items: center;
  border-radius: 40px;
  transition: background-color 120ms ease;
}
.dpad .arrow svg { width: 34px; height: 34px; fill: rgba(255,255,255,0.92); }
.dpad[data-side="left"] .arrow.l,
.dpad[data-side="right"] .arrow.r { background: rgba(255,255,255,0.28); }
.actions { display: flex; align-items: flex-end; gap: 12px; }
.tbtn {
  width: 66px; height: 66px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.16);
  display: grid; place-items: center;
  touch-action: none;
  padding: 0;
}
.tbtn svg { width: 30px; height: 30px; fill: rgba(255,255,255,0.95); }
.tbtn.big { width: 84px; height: 84px; }
.tbtn.big svg { width: 38px; height: 38px; }
.tbtn.small { width: 52px; height: 52px; margin-bottom: 40px; }
.tbtn.small svg { width: 24px; height: 24px; }
.tbtn.on { background: rgba(255,228,92,0.45); }
#touch.portrait { background: var(--night); align-items: center; }
#touch.portrait::before {
  content: "Dica: deite o celular para ver mais do caminho";
  position: absolute;
  top: 8px; left: 0; right: 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}
#touch.portrait .dpad { width: 180px; height: 96px; border-radius: 48px; }
#touch.portrait .tbtn.big { width: 92px; height: 92px; }

/* ---------- Toasts ---------- */
#toasts {
  position: absolute;
  z-index: 30;
  right: max(12px, env(safe-area-inset-right, 0px));
  top: 52px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(270px, calc(100% - 24px));
  pointer-events: none;
}
.toast {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: var(--step--1);
  animation: toast-in 260ms cubic-bezier(.2,1.3,.4,1) both;
}
.toast b { display: block; font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.toast.out { animation: toast-out 300ms ease both; }
@keyframes toast-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(10px); opacity: 0; } }

/* ---------- Telas ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(20,27,61,0.55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#s-title { background: linear-gradient(90deg, rgba(20,27,61,0.55), rgba(20,27,61,0.05) 70%); justify-content: flex-start; }

.sheet {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: auto;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  border-radius: 14px;
  padding: 26px 24px 22px 50px;
  box-shadow: 0 18px 40px rgba(8,10,30,0.45), 0 2px 0 rgba(255,255,255,0.6) inset;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: sheet-in 320ms cubic-bezier(.2,1,.3,1) both;
}
.sheet::before {
  /* margem vermelha do caderno */
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 36px;
  width: 2px;
  background: var(--margin);
}
.sheet::after {
  /* furos da espiral */
  content: "";
  position: absolute;
  top: 18px; bottom: 18px; left: 10px;
  width: 14px;
  background: radial-gradient(circle at 7px 7px, var(--night) 5px, transparent 5.5px) 0 0 / 14px 30px repeat-y;
  opacity: 0.85;
}
.sheet-wide { max-width: 820px; }
.sheet-title { max-width: 430px; margin-left: max(0px, 4vw); }
@keyframes sheet-in { from { transform: translateY(14px) rotate(-0.4deg); opacity: 0; } to { transform: none; opacity: 1; } }

.eyebrow {
  margin: 0;
  font-family: var(--font-label);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
h2 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: var(--step-2);
  line-height: 1.15;
  text-wrap: balance;
}
.big-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.1rem); line-height: 1; letter-spacing: 0.01em; }
.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 13vw, 4.6rem);
  line-height: 0.92;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.logo span {
  display: inline-block;
  background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
  padding: 0 4px;
  transform: rotate(-1.5deg);
}
.logo.small { font-size: clamp(2.4rem, 9vw, 3.4rem); text-align: center; }
.hand { font-family: var(--font-display); font-size: var(--step-1); color: var(--ink-2); margin: 0; line-height: 1.25; }
.hand.lead { font-size: 1.5rem; color: var(--leaf); }
.quote { border-left: 3px solid var(--marker); padding-left: 12px; margin: 0; font-size: 1.35rem; color: var(--ink); }
.hint { margin: 0; color: var(--ink-2); font-size: var(--step--1); line-height: 1.45; max-width: 62ch; }
.label { font-family: var(--font-label); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.label.center { text-align: center; display: block; margin: 0 0 8px; }
.dedic { font-size: 1.15rem; color: var(--rose); }
.specimen {
  margin: 0;
  align-self: flex-start;
  font-family: var(--font-label);
  font-size: 0.85rem;
  background: #FFFDF2;
  border: 1.5px solid var(--ink);
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--ink);
}
.specimen em { font-style: italic; }

/* ---------- Botões ---------- */
.menu { display: flex; flex-direction: column; gap: 10px; }
.menu-row { display: flex; gap: 10px; }
.menu-row > * { flex: 1; min-width: 0; }
.btn {
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 120ms ease;
}
.btn:hover { background: #FFFDE8; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #2A376F; }
.btn:focus-visible, .chip:focus-visible, .swatch:focus-visible, .pet:focus-visible, .card:focus-visible, .toggle:focus-visible, .tabs button:focus-visible {
  outline: 3px solid var(--marker);
  outline-offset: 2px;
}
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle {
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
  border: 1.5px solid var(--ink-2);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--ink-2); color: var(--paper); }
.toggle[aria-pressed="false"] { text-decoration: line-through; }

.sheet-head { display: flex; flex-direction: column; gap: 4px; }
.sheet-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.sheet-foot.single { justify-content: flex-end; }
.sheet-foot .btn { min-width: 120px; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  font: inherit;
  font-weight: 800;
  font-size: var(--step--1);
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px 10px 4px 4px;
  padding: 7px 12px;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--marker); }

/* ---------- Criação ---------- */
.create-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.preview { display: flex; flex-direction: column; align-items: center; gap: 10px; position: sticky; top: 0; }
#c-preview {
  width: 200px; height: 220px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: linear-gradient(#BFE6F7, #EAF7FF 70%, #9AD7A0 70%);
}
.options { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pane { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.chips, .swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip.locked { opacity: 0.6; border-style: dashed; cursor: help; display: inline-flex; align-items: center; gap: 4px; }
.chip .lock { width: 12px; height: 12px; fill: currentColor; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(31,42,90,0.35);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
input[type="text"] {
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input[type="text"]:focus, textarea.code:focus { outline: 3px solid var(--marker); outline-offset: 1px; }
textarea.code {
  font-family: var(--font-label);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink);
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
  resize: vertical;
  word-break: break-all;
}
.sync-msg { margin: 0; font-size: 0.88rem; line-height: 1.4; min-height: 1.2em; }
.sync-msg.ok { color: var(--leaf); font-weight: 700; }
.sync-msg.err { color: var(--stamp); font-weight: 700; }
.pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pet {
  font: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  background: #FFFFFF;
  border: 2px solid rgba(31,42,90,0.3);
  border-radius: 12px;
  padding: 8px;
  color: var(--ink);
  cursor: pointer;
}
.pet canvas { width: 48px; height: 44px; grid-row: span 3; }
.pet strong { font-size: 0.92rem; }
.pet .bonus { font-family: var(--font-label); font-size: 0.72rem; color: var(--leaf); font-weight: 700; }
.pet .desc { font-size: 0.74rem; color: var(--ink-2); line-height: 1.3; }
.pet[aria-pressed="true"] { border-color: var(--ink); background: #FFFBE0; box-shadow: 0 3px 0 var(--ink); }
.pet-desc { margin: 0; font-size: 0.9rem; line-height: 1.4; background: #FFFBE0; border: 1.5px dashed var(--ink-2); border-radius: 10px; padding: 8px 12px; }
.pet-desc b { color: var(--leaf); }

/* ---------- Intro ---------- */
.newbies { display: flex; flex-direction: column; gap: 8px; }
.newbie {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,0.75);
  border: 1.5px dashed var(--ink-2);
  border-radius: 10px;
  padding: 8px 10px;
}
.newbie canvas { width: 56px; height: 48px; }
.newbie b { display: block; }
.newbie i { font-family: var(--font-label); font-size: 0.78rem; color: var(--ink-2); }
.newbie p { margin: 2px 0 0; font-size: 0.82rem; color: var(--ink-2); line-height: 1.35; }
.mod {
  background: #FFF6CC;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

/* ---------- Concluída ---------- */
.stamp-wrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; min-height: 64px; }
.sticker { flex: none; width: 72px; height: 72px; animation: sticker 520ms cubic-bezier(.2,1.5,.4,1) 600ms both; }
@keyframes sticker { from { transform: scale(0) rotate(-20deg); } to { transform: scale(1) rotate(6deg); } }
.btn.madeira { background: #A4703F; color: #FFF6E6; border-color: #6B4524; box-shadow: 0 3px 0 #6B4524; }
.letter.letter-night { background-color: #141B3D; background-image: radial-gradient(circle at 80% 20%, rgba(255,230,160,0.18), transparent 40%), radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 60% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 55%, #fff, transparent), radial-gradient(1px 1px at 35% 85%, #fff, transparent); color: #F7FAF6; transform: none; }
.letter.letter-night .menu { width: 100%; }
.letter-night .eyebrow { color: #B9C2E8; }
.letter-night .letter-text { color: #F7FAF6; }
.letter-night .logo { color: #F7FAF6; }
.letter-night .logo span { background: linear-gradient(transparent 58%, rgba(255,209,102,0.55) 58%, rgba(255,209,102,0.55) 92%, transparent 92%); }
.letter-night .btn:not(.primary) { background: transparent; color: #F7FAF6; border-color: #F7FAF6; box-shadow: 0 3px 0 #F7FAF6; }
.letter-night .btn.primary { background: #FFD166; color: #141B3D; border-color: #FFD166; box-shadow: 0 3px 0 #C9A13F; }
.smart { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.85); border: 1.5px solid rgba(31,42,90,0.25); border-radius: 10px; padding: 10px 12px; }
.smart .row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 8px; align-items: center; font-size: 0.82rem; }
.smart .bar { height: 10px; border-radius: 5px; background: rgba(31,42,90,0.12); overflow: visible; position: relative; }
.smart .bar i { display: block; height: 100%; border-radius: 5px; }
.smart .bar.over i { background: linear-gradient(90deg, var(--leaf), #7CE38B); width: 100%; box-shadow: 0 0 0 2px rgba(124,227,139,0.35); }
.smart small { color: var(--ink-2); }
.stamp {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  letter-spacing: 0.08em;
  color: var(--stamp);
  border: 4px double var(--stamp);
  border-radius: 8px;
  padding: 6px 16px;
  transform: rotate(-6deg);
  text-align: center;
  mix-blend-mode: multiply;
  animation: stamp 520ms cubic-bezier(.2,1.4,.4,1) 150ms both;
}
@keyframes stamp {
  from { transform: rotate(-14deg) scale(2.4); opacity: 0; }
  70% { opacity: 1; }
  to { transform: rotate(-6deg) scale(1); opacity: 0.92; }
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0;
}
.stats div {
  background: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(31,42,90,0.25);
  border-radius: 10px;
  padding: 8px 10px;
}
.stats dt { font-family: var(--font-label); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.stats dd { margin: 2px 0 0; font-weight: 900; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.card {
  font: inherit;
  color: var(--ink);
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 10px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: transform 120ms ease, background-color 120ms ease;
}
.card:hover { transform: translateY(-2px) rotate(-0.5deg); background: #FFFDE8; }
.card canvas { width: 46px; height: 46px; }
.card strong { font-size: 0.98rem; }
.card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card span { font-size: 0.8rem; color: var(--ink-2); line-height: 1.35; }
.card .lvl { font-family: var(--font-label); font-size: 0.7rem; color: var(--leaf); }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.chosen span {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255,255,255,0.85);
  border: 1.5px solid var(--ink-2);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---------- Bilhete / carta ---------- */
.letter {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: auto;
  background: #FFF6F8;
  background-image: repeating-linear-gradient(transparent 0 29px, rgba(229,138,181,0.35) 29px 30px);
  border-radius: 6px;
  padding: 28px 26px 22px;
  box-shadow: 0 18px 40px rgba(8,10,30,0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: rotate(-1deg);
  animation: sheet-in 360ms cubic-bezier(.2,1,.3,1) both;
}
.letter-big { max-width: 560px; transform: none; }
.letter-text { font-size: 1.55rem; color: var(--ink); line-height: 1.2; }
.letter-sign { text-align: right; color: var(--rose); font-size: 1.3rem; }
.letter .btn { align-self: center; }

/* ---------- Caderno ---------- */
.species { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sp {
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(31,42,90,0.3);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 10px;
}
.sp canvas { width: 64px; height: 56px; grid-row: span 3; }
.sp b { font-size: 0.95rem; }
.sp i { font-family: var(--font-label); font-size: 0.75rem; color: var(--ink-2); }
.sp p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 0.82rem; line-height: 1.4; color: var(--ink-2); }
.sp .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill {
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1.5px solid currentColor;
}
.pill.s0 { color: #B23A4F; }
.pill.s1 { color: #B36B12; }
.pill.s2 { color: #2C7FA8; }
.pill.s3 { color: var(--leaf); background: #E3F6EC; }
.meter { height: 6px; background: rgba(31,42,90,0.12); border-radius: 3px; overflow: hidden; grid-column: 1 / -1; }
.meter > i { display: block; height: 100%; background: var(--leaf); border-radius: 3px; }
.sp.unknown { opacity: 0.6; }
.lattes { display: flex; flex-direction: column; gap: 14px; }
.lattes h3 { margin: 0; font-size: 1rem; font-weight: 900; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ach div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: start;
  background: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(31,42,90,0.2);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
}
.ach .ok { color: var(--leaf); font-weight: 900; }
.ach .no { color: rgba(31,42,90,0.35); font-weight: 900; }
.ach small { grid-column: 2; color: var(--ink-2); }
.ach .locked { opacity: 0.6; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.notes p {
  margin: 0;
  background: #FFF6F8;
  border-left: 3px solid var(--rose);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.2;
}

/* ---------- Como jogar ---------- */
.howto { display: flex; flex-direction: column; gap: 12px; }
.keys p { margin: 0 0 6px; font-size: 0.92rem; }
kbd {
  font-family: var(--font-label);
  font-size: 0.8rem;
  background: #FFFFFF;
  border: 1.5px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 3px;
}
.rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; line-height: 1.45; }

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
  .create-grid { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; flex-direction: row; justify-content: center; }
  #c-preview { width: 130px; height: 150px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { flex-direction: row; text-align: left; }
}
@media (max-width: 480px) {
  .sheet { padding: 20px 16px 18px 40px; gap: 12px; }
  .sheet::before { left: 30px; }
  .sheet::after { left: 7px; }
  .pets { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pet { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
  .pet canvas { grid-row: auto; }
  .pet .desc { display: none; }
  .sheet-foot .btn { min-width: 0; flex: 1; }
  .letter-text { font-size: 1.35rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sheet { gap: 10px; padding-top: 18px; padding-bottom: 16px; }
  .big-title { font-size: 2.1rem; }
  .quote { font-size: 1.12rem; }
  .newbie p { display: none; }
  .newbie { padding: 6px 10px; }
  .stats dd { font-size: 1.05rem; }
  .stats div { padding: 6px 8px; }
  .stamp-wrap { min-height: 48px; }
  .letter-text { font-size: 1.3rem; }
  .logo { font-size: 2.8rem; }
  .sheet-title { max-width: 400px; }
  .create-grid { grid-template-columns: 150px minmax(0, 1fr); }
  #c-preview { width: 140px; height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
