/* Tokens, reset e peças comuns às páginas: botões, aviso flutuante, faixa de protótipo. */

:root {
  color-scheme: light;

  --ink: #262019;
  --paper: #fffdf6;
  --paper-back: #f3eee1;
  --line: #a8c6ea;
  --margin: #ef8a84;
  --pen: #1f3f8a;
  --pen-soft: rgba(31, 63, 138, .5);
  --hole: #e2d3b5;
  --hole-rim: #c9b896;

  --wall: #f1e6cf;
  --wall-stripe: rgba(255, 255, 255, .38);
  --desk-top: #6f431d;
  --desk-1: #c58a50;
  --desk-2: #a46d39;

  --btn: #ff6b5a;
  --btn-ink: #fff;
  --sticker: #ffd23f;
  --sticker-2: #ffb38a;

  --ok: #1d6b45;
  --ok-bg: #d6f0df;
  --warn: #7a4300;
  --warn-bg: #ffe4c2;
  --danger: #a8231b;
  --danger-bg: #fde1de;
  --focus: #2f6fd6;

  --display: "Baloo 2", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--text);
  color: var(--ink);
  background-color: var(--wall);
  background-image: repeating-linear-gradient(90deg, var(--wall-stripe) 0 22px, transparent 22px 44px);
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 9px 22px 10px;
  border: 4px solid var(--ink); border-radius: 16px;
  background: var(--btn); color: var(--btn-ink);
  font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.15;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn svg { width: 24px; height: 24px; flex: none; }
.btn:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn[aria-disabled="true"] { cursor: progress; filter: saturate(.55); transform: none; box-shadow: 0 5px 0 var(--ink); }
.btn-big {
  min-height: 60px; padding: 12px 28px 13px; border-radius: 18px;
  font-size: clamp(19px, 2.4vw, 23px); box-shadow: 0 6px 0 var(--ink);
}
.btn-alt { background: var(--sticker); color: var(--ink); }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm {
  min-height: 36px; padding: 4px 12px 5px; border-width: 3px; border-radius: 11px;
  font-size: 15px; box-shadow: 0 3px 0 var(--ink);
}
.btn-sm:hover { box-shadow: 0 4px 0 var(--ink); }
.btn-sm:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-sm[aria-disabled="true"] { box-shadow: 0 3px 0 var(--ink); }
.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--pen); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- aviso flutuante ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 150; margin: 0;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 20px 11px; text-align: center; pointer-events: none;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.25;
  opacity: 0; transform: translate(-50%, 30px);
  transition: opacity .25s, transform .35s cubic-bezier(.3, 1.5, .5, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"] { background: var(--danger-bg); color: var(--danger); }

/* ---------- faixa do protótipo (só com armazenamento mock) ---------- */
.proto-ribbon {
  margin: 0; padding: 7px 16px; text-align: center;
  background: var(--sticker); border-bottom: 3px dashed var(--ink);
  font-size: 14px; font-weight: 700; line-height: 1.3;
}

/* ---------- movimento reduzido (classe aplicada por ui/motion.js) ---------- */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
