/* ==========================================================================
   Base: tokens (paleta Dark Red · Black Olive · Platinum), reset, tipografia
   ========================================================================== */
:root {
  /* Paleta base */
  --dark-red: #8c0007;
  --black-olive: #25291c;
  --platinum: #e6e1de;

  /* Derivadas do Black Olive (fundos e superfícies) */
  --bg: var(--black-olive);
  --bg-deep: #1b1e14;
  --surface: #2e3324;
  --surface-2: #363c2b;
  --surface-3: #414834;
  --line: #4b533b;
  --line-strong: #646d50;

  /* Texto (Platinum e tons derivados; contraste ≥ 4.5:1 sobre --surface) */
  --text: var(--platinum);
  --text-2: #cdc8c2;
  --muted: #aba99d;

  /* Acento: Dark Red para fundos (botões, selos, ativos) com texto Platinum;
     --red-text é um vermelho claro derivado para texto/ligações sobre fundo escuro. */
  --red: var(--dark-red);
  --red-hover: #a8070f;
  --red-deep: #5c0005;
  --red-tint: #3d1914;
  --red-text: #f39a9a;
  --on-red: var(--platinum);
  --red-text-hover: #ffc2c0;

  /* Derivados do acento (substituídos por cada paleta em css/palettes.css) */
  --accent-glow: #8c0007;
  --accent-bright: #c0161d;
  --accent-border: #5a2a1f;
  --accent-border-strong: #6b1a17;
  --band: var(--red);
  --on-band: var(--on-red);

  /* Semânticas */
  --ok: #9ad48f;
  --ok-bg: #26391f;
  --ok-line: #4f7d43;
  --no: #f39a9a;
  --no-bg: #3d1914;
  --no-line: #b3383b;
  --warn: #ebc77a;
  --warn-bg: #3a3518;
  --warn-line: #8a7a35;

  /* Cores por estilo de combate (chips) */
  --style-melee: #ef8f78;
  --style-ranged: #a6d686;
  --style-magic: #8fbdf0;
  --style-necromancy: #c9a5f2;
  --style-hybrid: var(--platinum);

  /* Laranja das runas do logotipo: só como realce pontual (anel do logo, selo Grandmaster) */
  --logo-orange: #e8862a;

  /* Cores por nível de Combat Mastery (selos; texto claro sobre --surface, contraste ≥ 4.5:1) */
  --tier-easy: #8fbdf0;   /* azul */
  --tier-medium: #a6d686; /* verde */
  --tier-hard: #f39a9a;   /* vermelho */
  --tier-elite: #c9a5f2;  /* roxo */
  --tier-master: #e6e1de; /* branco */
  --tier-gm: #f2d35c;     /* amarelo */
  /* Tier extra "Special" (tasks de collection log / kills): turquesa, distinto dos 6 níveis */
  --tier-special: #4fd8c8;

  /* Tipografia */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Bahnschrift", "Arial Narrow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font: var(--font-body);
  /* Destaques do hero da Home (nível, números, títulos das ações, "Em foco"): Rajdhani 600/700; sem rede cai
     para a Barlow / Bahnschrift, de métricas parecidas, para não saltar o layout */
  --font-hero: "Rajdhani", "Barlow Semi Condensed", "Bahnschrift", "Arial Narrow", system-ui, sans-serif;
  /* Ficha do boss: nome (Cinzel Decorative) e títulos de secção (Cinzel); sem rede ficam em Georgia/serif */
  --font-name: "Cinzel Decorative", "Cinzel", Georgia, "Times New Roman", serif;
  --font-ornate: "Cinzel", Georgia, "Times New Roman", serif;

  /* Tema do boss (padrão = paleta do site). A ficha e os cartões da Home recebem os valores de
     data/boss-themes.js como estilo inline (App.ui.bossTheme); as derivadas estão em views.css. */
  --boss-accent: var(--red-text);
  --boss-accent-2: var(--red);
  --boss-glow: var(--accent-bright);
  --boss-bg-deep: var(--bg-deep);
  --boss-gold: #d9b45a;
  --boss-accent-text: var(--red-text);
  /* Escala tipográfica (moderada) */
  --fs-xs: 0.75rem;     /* 12px: chips, badges */
  --fs-sm: 0.875rem;    /* 14px: texto de apoio */
  --fs-base: 0.9375rem; /* 15px: corpo */
  --fs-md: 1.125rem;    /* 18px: títulos de cartão */
  --fs-lg: 1.375rem;    /* 22px */
  --fs-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);  /* títulos de página */
  --fs-2xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);  /* hero */

  /* Espaçamento (escala de 4 px) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.28);
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--red-text);
  --header-h: 80px;
  --bottom-nav-h: 0px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent-glow) 16%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }

/* Títulos: fonte de display semi-condensada, sem maiúsculas forçadas */
.display, .page-title, .card-title, .phase-title, .brand strong, .sub-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.005em;
}
/* Etiqueta pequena por cima de títulos: maiúsculas discretas */
.eyebrow { font-weight: 700; text-transform: uppercase; }

p { margin: 0; }

a { color: var(--red-text); text-underline-offset: 2px; }
a:hover { color: var(--red-text-hover); }

img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 40px; height: 40px; stroke-width: 1.6; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.prose { white-space: pre-line; overflow-wrap: anywhere; color: var(--text-2); }

.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;
}

[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--red);
  color: var(--on-red);
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus { top: var(--sp-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
