/* Tokens e componentes comuns a home e a mesa.

   Tema escuro sempre, de proposito: a mesa e um tabuleiro (como o playmat do
   deck_play.html do site, que tambem sai do modo noturno), e a home e a porta
   dele. Um tema so tambem e metade do CSS para manter. */

:root {
  color-scheme: dark;
  --bg: #0e0c13;
  --bg-2: #131019;
  --surface: #1a1622;
  --surface-2: #231e2e;
  --surface-3: #2d2739;
  --line: #2f2940;
  --line-2: #433a58;
  --ink: #eeeaf5;
  --muted: #a69fb6;
  --faint: #6f6882;
  --accent: #9b7cff;
  --accent-2: #7a5cf0;
  --accent-ink: #120d1f;
  --accent-soft: #2a2144;
  --ok: #3ccf8e;
  --ok-soft: #173427;
  --warn: #ffb45e;
  --danger: #ff6b6b;
  --danger-soft: #3a1b1f;
  --felt: #10342a;
  --felt-2: #0b271f;
  --felt-line: #1c4c3d;
  --focus: #c3b1ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgb(0 0 0 / .45);
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- botoes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
  font: 600 14px/1 var(--body); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ad93ff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn.icon { width: 36px; min-height: 36px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- campos ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font: 16px/1.4 var(--body);
}
.textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 14px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); outline: none; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; }
.segmented button {
  min-width: 40px; min-height: 34px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font: 600 14px var(--body); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }

/* ---------- dialogos ---------- */
dialog {
  border: 1px solid var(--line-2); border-radius: 16px; padding: 0;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 24px)); width: 100%;
}
dialog::backdrop { background: rgb(5 3 10 / .7); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.dlg-head h2 { margin: 0; font: 700 20px/1.2 var(--display); font-stretch: 90%; }
.dlg-body { padding: 16px 20px; display: grid; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; flex-wrap: wrap; }

/* ---------- avisos ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 1000; display: grid; gap: 8px; pointer-events: none; }
.toast {
  padding: 10px 16px; border-radius: 10px; background: var(--surface-3); color: var(--ink);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px;
  animation: toast-in .2s ease-out;
}
.toast.error { border-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; translate: 0 8px; } }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- anuncio ---------- */
.ad-slot { display: grid; place-items: center; min-height: 0; }
.ad-slot:empty { display: none; }
.ad-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-align: center; margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
