/* Skål · Hierro y brasa — variables, tipografía, texturas y piezas comunes.
   Contrastes calculados (WCAG): texto/fondo 14:1 · texto-suave/superficie 7,8:1 · oro/fondo 5,8:1
   · texto/brasa-btn 4,8:1 · texto/sangre 6,8:1 · brasa-clara/fondo 5,8:1 · musgo-claro/fondo 7,6:1.
   La brasa pura (#8B3A2B) y el musgo (#5C7A3A) solo se usan en filetes y adornos, nunca en texto pequeño. */

@font-face { font-family: "Poppins"; src: url("/fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --fondo: #1F1D1B;
  --superficie: #2A2825;
  --superficie-alta: #34312D;
  --texto: #EFE8DA;
  --texto-suave: #BDB5A5;
  --brasa: #B0533F;
  --brasa-clara: #D07A63;
  --brasa-btn: #8B3A2B;
  --oro: #B8925A;
  --oro-claro: #D2B07A;
  --sangre: #8B3A2B;
  --musgo: #445D45;
  --musgo-claro: #86A98A;
  --linea: #3F3C37;
  --linea-fuerte: #5E594F;

  --f-titulo: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-texto: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tap: 48px;
  --ancho: 70rem;
  --pad: clamp(1rem, 4vw, 2rem);
  --sombra-hierro: 0 0 0 1px var(--linea), 0 0 0 4px var(--fondo), 0 0 0 5px var(--linea);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; /* 16 px: Poppins es ancha */ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--fondo);
  background-image: url("/img/grano.svg");
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  overflow-wrap: break-word;
}
body.bloqueado { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--f-titulo); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: 0.04em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--oro-claro); text-underline-offset: 0.2em; }
a:hover { color: var(--texto); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; }
.solo-lector { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.saltar { position: absolute; left: 0.5rem; top: -4rem; z-index: 100; background: var(--texto); color: var(--fondo); padding: 0.75rem 1rem; font-weight: 600; }
.saltar:focus { top: 0.5rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: var(--tap); min-width: var(--tap); padding: 0.6rem 1.25rem;
  border: 2px solid var(--oro); border-radius: 0; background: transparent;
  font-family: var(--f-titulo); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  color: var(--texto);
}
.btn:hover { background: var(--superficie-alta); }
.btn:active { transform: translateY(1px); }
.btn--primario { background: var(--brasa-btn); border-color: var(--brasa-clara); }
.btn--primario:hover { background: #8F3410; }
.btn--lleno { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--superficie); border-color: var(--linea-fuerte); color: var(--texto-suave); cursor: not-allowed; }
.btn--texto { border-color: transparent; text-transform: none; font-family: var(--f-texto); font-weight: 600; letter-spacing: 0; text-decoration: underline; text-underline-offset: 0.2em; padding-inline: 0.5rem; }

/* ---------- Iconos y runas (SVG propios, trazo recto) ---------- */
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.ico--lleno { fill: currentColor; stroke: none; }
.runa { width: 1.5em; height: 1.5em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; }

/* ---------- Adornos de hierro ---------- */
.cenefa { height: 16px; background: url("/img/cenefa.svg") center / auto 16px repeat-x; opacity: 0.9; }
.marco { position: relative; }
.marco::before, .marco::after { content: ""; position: absolute; width: 18px; height: 18px; border: 0 solid var(--oro); pointer-events: none; }
.marco::before { top: -3px; left: -3px; border-top-width: 3px; border-left-width: 3px; }
.marco::after { bottom: -3px; right: -3px; border-bottom-width: 3px; border-right-width: 3px; }

/* ---------- Etiquetas ---------- */
.etiqueta { display: inline-block; padding: 0.1rem 0.55rem; border: 1px solid var(--oro); color: var(--oro-claro); font-family: var(--f-titulo); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.5; }
.etiqueta--agotado { background: var(--sangre); border-color: var(--sangre); color: var(--texto); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: 5.5rem; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0 1rem; pointer-events: none; }
.toast { max-width: 28rem; background: var(--texto); color: var(--fondo); padding: 0.7rem 1rem; border-left: 6px solid var(--musgo); font-weight: 600; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4); }
.toast--error { border-left-color: var(--sangre); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .toast { animation: entra 0.2s ease-out; }
  @keyframes entra { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) { .btn, .etiqueta { border-color: CanvasText; } }

.solo-lectores { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
