/* =========================================================================
   xTakker — shared site styles
   Dead by Daylight fan site. Design ported from the Claude Design prototype.
   Fonts: Oswald (display) + Barlow (text), loaded per page via <link>.
   ========================================================================= */

:root {
  --bg: #08060a;
  --ink: #f3eff0;
  --ink-strong: #f6f2f3;
  --muted: rgba(238, 232, 234, 0.78);
  --muted-soft: rgba(214, 204, 210, 0.82);
  --red: #e11d2e;
  --red-hot: #ff2a3d;
  /* El mismo rojo pero para TEXTO. #e11d2e sobre el fondo da 4,24:1 y se
     queda justo por debajo del 4,5 que pide WCAG AA, y es precisamente lo
     que usaban los rótulos de 11-12 px. Este llega a 4,53:1 y a simple
     vista es el mismo color. El relleno de los botones sigue con --red. */
  --red-text: #e72535;
  --hairline: rgba(255, 255, 255, 0.08);
  --panel: linear-gradient(160deg, rgba(26, 11, 15, 0.70) 0%, rgba(12, 8, 10, 0.78) 80%);
  --panel-soft: linear-gradient(160deg, rgba(24, 11, 15, 0.60) 0%, rgba(11, 8, 10, 0.72) 80%);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }
/* El `display` que trae el navegador para [hidden] lo pisa cualquier regla de
   autor: basta un `.x { display: flex }` para que un elemento marcado como
   oculto se siga viendo. Se declara aquí una vez para que `el.hidden = true`
   signifique lo que parece en todo el sitio. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  background: var(--bg);
  overflow-x: hidden;
  font-family: 'Barlow', system-ui, sans-serif;
  color: var(--ink);
}
a { color: inherit; }
img { max-width: 100%; }

@keyframes up   { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop  { 0% { opacity: 0; transform: scale(.82); } 60% { transform: scale(1.05); } 100% { opacity: 1; transform: scale(1); } }
@keyframes glow { 0% { opacity: .45; } 50% { opacity: .9; } 100% { opacity: .45; } }

/* Entrance helper + stagger */
.up   { animation: up .65s ease-out both; }
.d1   { animation-delay: .06s; }
.d2   { animation-delay: .12s; }
.d3   { animation-delay: .18s; }
.d4   { animation-delay: .24s; }

/* ---------- Fixed atmospheric background (injected by site.js) ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg__art {
  position: absolute; inset: -4%;
  background-image: url('../uploads/dbd-hero-960.webp');
  background-size: cover; background-position: 60% 22%;
  filter: blur(4px) brightness(0.32) saturate(0.9);
  transform: scale(1.06);
}
.bg__grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,6,10,0.90) 0%, rgba(6,4,7,0.94) 50%, rgba(5,3,6,0.97) 100%);
}
.bg__glow {
  position: absolute; inset: 0;
  background: radial-gradient(58% 55% at 50% 22%, rgba(225,29,46,0.13) 0%, rgba(225,29,46,0) 60%);
}
.bg__grain {
  position: absolute; inset: 0; opacity: 0.05; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page { position: relative; width: 100%; min-height: 100vh; overflow: hidden; }

/* ---------- Navigation (injected by site.js) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 16px clamp(24px, 4.5vw, 64px);
  border-bottom: 1px solid rgba(255,255,255,0);
  background: rgba(8,6,10,0);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.nav.is-scrolled {
  background: rgba(8,6,10,0.98);
  border-bottom-color: rgba(255,255,255,0.07);
  box-shadow: 0 10px 34px rgba(0,0,0,0.45);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: 0 0 auto; }
.brand__logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(225,29,46,0.4); }
.brand__name { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 21px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
.brand__name span { color: var(--red); }

.nav__center {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: clamp(11px, 1.2vw, 22px);
  font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 12.5px;
  letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap;
}
.nav__link { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav__link:hover, .nav__link.is-active { color: #fff; }
.nav__link--about { display: inline-flex; align-items: center; gap: 8px; }
.nav__link--about img { height: 22px; width: auto; border-radius: 5px; flex: 0 0 auto; }

.nav__right {
  display: flex; align-items: center; gap: 16px;
  font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 13px;
  letter-spacing: 1.4px; text-transform: uppercase; white-space: nowrap; flex: 0 0 auto;
}
.cta {
  display: inline-flex; align-items: center; gap: 8px; color: #fff;
  background: var(--red); padding: 11px 22px; border-radius: 4px; text-decoration: none;
  box-shadow: 0 8px 26px rgba(225,29,46,0.4);
  transition: background .18s, transform .18s, box-shadow .18s;
}
.cta:hover { background: var(--red-hot); transform: translateY(-2px); box-shadow: 0 12px 34px rgba(225,29,46,0.55); }

/* "EN DIRECTO" badge — hidden until site.js sees xTakker is live */
.live {
  align-items: center; gap: 8px;
  font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 11.5px;
  letter-spacing: 1.6px; text-transform: uppercase; color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(225,29,46,0.14); border: 1px solid rgba(225,29,46,0.55);
  transition: background .18s, border-color .18s, transform .18s;
}
.live:not([hidden]) { display: inline-flex; }
.live:hover { background: rgba(225,29,46,0.24); border-color: var(--red-hot); transform: translateY(-1px); }
.live__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red-hot);
  box-shadow: 0 0 0 0 rgba(255,42,61,0.7);
  animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,42,61,0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(255,42,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,42,61,0); }
}
@media (prefers-reduced-motion: reduce) { .live__dot { animation: none; } }

/* Tools dropdown (CSS hover) */
.tools { position: relative; padding-bottom: 8px; margin-bottom: -8px; }
.tools__trigger { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; transition: color .2s; }
.tools:hover .tools__trigger, .tools__trigger:focus-visible { color: #fff; outline: none; }
.tools__caret { font-size: 9px; opacity: .7; }
.tools__menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(6px);
  padding-top: 10px; min-width: 230px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.tools:hover .tools__menu, .tools:focus-within .tools__menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.tools__panel {
  background: rgba(14,9,12,0.97); border: 1px solid var(--hairline);
  border-radius: 10px; box-shadow: 0 22px 50px rgba(0,0,0,0.6);
  overflow: hidden;
}
.tools__item { display: block; padding: 15px 18px; text-decoration: none; color: #e9e3e5; border-left: 2px solid transparent; transition: background .15s, border-color .15s; }
.tools__item + .tools__item { border-top: 1px solid rgba(255,255,255,0.05); }
.tools__item:hover { background: rgba(225,29,46,0.12); border-left-color: var(--red); }
.tools__item[aria-current="page"] { background: rgba(225,29,46,0.1); border-left-color: var(--red); }
.tools__item-title { display: block; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 14px; letter-spacing: .5px; text-transform: uppercase; }
.tools__item-sub { display: block; font-family: 'Barlow', sans-serif; font-weight: 400; font-size: 12px; color: #948a90; margin-top: 2px; }

/* Compact navigation used when the desktop links no longer fit. */
.mobile-nav { display: none; position: relative; flex: 0 0 auto; }
.mobile-nav__trigger {
  min-height: 42px; display: inline-flex; align-items: center; gap: 9px; padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 7px; background: rgba(14,9,12,0.76);
  color: #eee8eb; font: 700 11px/1 'Barlow', sans-serif; letter-spacing: 1.2px; text-transform: uppercase;
  cursor: pointer; transition: border-color .18s, background .18s, color .18s;
}
.mobile-nav__trigger:hover,.mobile-nav__trigger[aria-expanded="true"] { border-color: rgba(225,29,46,0.65); background: rgba(225,29,46,0.13); color: #fff; }
.mobile-nav__trigger:focus-visible { outline: 2px solid rgba(255,42,61,0.85); outline-offset: 3px; }
.mobile-nav__icon { width: 17px; display: grid; gap: 3px; }
.mobile-nav__icon i { height: 1.5px; display: block; border-radius: 2px; background: currentColor; transition: transform .18s, opacity .18s; }
.mobile-nav__trigger[aria-expanded="true"] .mobile-nav__icon i:first-child { transform: translateY(4.5px) rotate(45deg); }
.mobile-nav__trigger[aria-expanded="true"] .mobile-nav__icon i:nth-child(2) { opacity: 0; }
.mobile-nav__trigger[aria-expanded="true"] .mobile-nav__icon i:last-child { transform: translateY(-4.5px) rotate(-45deg); }
.mobile-nav__menu {
  position: absolute; top: calc(100% + 12px); right: 0; width: min(88vw, 390px); max-height: calc(100vh - 90px);
  overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid rgba(255,255,255,0.11);
  border-radius: 11px; background: rgba(10,6,9,0.985); box-shadow: 0 24px 70px rgba(0,0,0,0.72);
  scrollbar-width: thin; scrollbar-color: #5c2933 #120b0e;
}
.mobile-nav__menu[hidden] { display: none; }
.mobile-nav__home,.mobile-nav__support {
  min-height: 44px; display: flex; align-items: center; padding: 10px 12px; border-radius: 6px;
  color: #eee8eb; text-decoration: none; font: 700 12px/1 'Barlow', sans-serif; letter-spacing: 1.2px; text-transform: uppercase;
}
.mobile-nav__home:hover,.mobile-nav__home.is-active { background: rgba(255,255,255,0.055); color: #fff; }
.mobile-nav__group { padding: 12px 4px 5px; border-top: 1px solid rgba(255,255,255,0.065); }
.mobile-nav__heading { margin: 0 8px 7px; color: #746a70; font: 700 9.5px/1 'Barlow', sans-serif; letter-spacing: 1.8px; text-transform: uppercase; }
.mobile-nav__links { display: grid; gap: 2px; }
.mobile-nav__link { display: grid; gap: 3px; padding: 9px 10px; border-left: 2px solid transparent; border-radius: 5px; color: #d9d1d5; text-decoration: none; }
.mobile-nav__link span { font: 600 13px/1.2 'Barlow', sans-serif; }
.mobile-nav__link small { color: #786f74; font: 400 11px/1.25 'Barlow', sans-serif; }
.mobile-nav__link:hover,.mobile-nav__link.is-active { border-left-color: var(--red); background: rgba(225,29,46,0.11); color: #fff; }
.mobile-nav__link.is-active small { color: #a99fa4; }
.mobile-nav__support { justify-content: center; margin-top: 7px; background: var(--red); color: #fff; box-shadow: 0 8px 24px rgba(225,29,46,0.28); }
.mobile-nav__support:hover { background: var(--red-hot); }
.nav.is-mobile-open { background: rgba(8,6,10,0.98); border-bottom-color: rgba(255,255,255,0.07); }

.nav-spacer { height: 64px; }

/* ---------- Layout + hero pattern ---------- */
.shell { position: relative; z-index: 5; max-width: 1180px; margin: 0 auto; }
.shell--wide { max-width: 1240px; }
.head { padding: clamp(24px, 4vh, 50px) clamp(20px, 5vw, 56px) clamp(28px, 4vh, 44px); }
.body { padding: 0 clamp(20px, 5vw, 56px) clamp(60px, 9vh, 110px); }

.eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.eyebrow--center { justify-content: center; }
.eyebrow__line { display: block; width: 30px; height: 2px; background: var(--red); }
.eyebrow__text { font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 12.5px; letter-spacing: 3px; text-transform: uppercase; color: var(--red-text); }

.page-title {
  margin: 0 0 16px; font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: clamp(40px, 5.4vw, 80px); line-height: 0.92; letter-spacing: -0.5px;
  text-transform: uppercase; color: var(--ink-strong); text-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.lead { margin: 0; font-family: 'Barlow', sans-serif; font-weight: 400; font-size: clamp(16px, 1.2vw, 18px); line-height: 1.62; color: var(--muted-soft); max-width: 660px; text-wrap: pretty; }

/* ---------- Reusable components ---------- */
.panel {
  position: relative; padding: clamp(24px, 3.4vw, 40px); border-radius: 16px;
  border: 1px solid var(--hairline); background: var(--panel); box-shadow: var(--shadow);
}
.panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.panel__line { display: block; width: 20px; height: 2px; background: var(--red); }
.panel__label { margin: 0; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--red-text); }

/* Empty image slot (where the user drops a TierMaker/infographic image) */
.slot {
  display: block; width: 100%; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(45deg, rgba(225,29,46,0.05) 0 12px, rgba(255,255,255,0.015) 12px 24px), rgba(16,10,13,0.6);
}
.slot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slot--contain img { object-fit: contain; }
.slot--empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px; border: 1px dashed rgba(255,255,255,0.10);
}
.slot__icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(225,29,46,0.12); border: 1px solid rgba(225,29,46,0.35); color: #ff6470;
}
.slot__text { max-width: 32ch; font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 14px; color: rgba(214,205,210,0.66); }

/* Primary action button (tools) */
.btn {
  display: inline-flex; align-items: center; gap: 11px; font-family: 'Barlow', sans-serif;
  font-weight: 600; font-size: 15px; letter-spacing: 1.6px; text-transform: uppercase; color: #fff;
  background: var(--red); border: none; padding: 16px 40px; border-radius: 5px; cursor: pointer;
  box-shadow: 0 10px 34px rgba(225,29,46,0.45); transition: background .18s, transform .18s, box-shadow .18s;
}
.btn:hover { background: var(--red-hot); transform: translateY(-2px); box-shadow: 0 16px 44px rgba(225,29,46,0.6); }
.btn:active { transform: translateY(0); }
.btn__spin { font-size: 17px; line-height: 1; }

/* Perk diamond (build randomizer / killer detail) */
.perk { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.perk__diamond {
  width: clamp(60px, 9vw, 84px); height: clamp(60px, 9vw, 84px); transform: rotate(45deg);
  border: 1.5px solid rgba(225,29,46,0.42); border-radius: 14px; background: rgba(18,10,13,0.7);
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 22px rgba(0,0,0,0.45);
}
.perk__diamond > * { transform: rotate(-45deg); opacity: 0.3; color: var(--red); }
.perk__name { font-family: 'Barlow', sans-serif; font-weight: 600; font-size: clamp(11px, 1vw, 13px); line-height: 1.25; color: rgba(228,219,224,0.92); min-height: 32px; display: flex; align-items: flex-start; justify-content: center; text-align: center; text-wrap: balance; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .nav__center { display: none; }
  .mobile-nav { display: block; margin-left: auto; }
}
@media (max-width: 760px) {
  .nav { gap: 10px; padding: 12px 16px; }
  .nav__right { gap: 9px; }
  .nav__right .nav__link { display: none; }
  .cta { padding: 10px 14px; font-size: 11px; }
  .nav-spacer { height: 60px; }
}
@media (max-width: 560px) {
  .nav { padding-inline: 12px; }
  .nav__right .cta { display: none; }
  .mobile-nav__menu { position: fixed; top: 68px; left: 10px; right: 10px; width: auto; max-height: calc(100dvh - 78px); }
}
@media (max-width: 430px) {
  .mobile-nav__trigger > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .mobile-nav__trigger { width: 44px; justify-content: center; padding: 0; }
}
@media (max-width: 360px) { .brand__name { display: none; } }

/* ---------- Contenido bajo las herramientas ----------
   La ruleta y el randomizer ocupan la pantalla entera, así que su texto vive
   por debajo del pliegue. Es lo que le da a Google algo que leer (en crudo
   eran 66 y 33 palabras) y lo que enlaza con las fichas de cada asesino. */
.toolinfo { position: relative; z-index: 5; width: 100%; max-width: 900px; margin: 0 auto; text-align: left; padding: clamp(22px, 3.5vh, 38px) clamp(20px, 5vw, 48px) clamp(60px, 9vh, 100px); }
.toolinfo h2 { margin: 0 0 14px; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: clamp(22px, 2.8vw, 32px); line-height: 1.1; letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink-strong); }
.toolinfo h3 { margin: 0 0 6px; font-family: 'Oswald', sans-serif; font-weight: 500; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.25; letter-spacing: 0.2px; color: var(--ink-strong); }
.toolinfo p, .toolinfo li { font-family: 'Barlow', sans-serif; font-size: 15px; line-height: 1.65; color: var(--muted-soft); text-wrap: pretty; }
.toolinfo p { margin: 0 0 14px; }
.toolinfo a { color: var(--red-text); text-decoration: none; border-bottom: 1px solid rgba(225,29,46,0.35); transition: color .15s, border-color .15s; }
.toolinfo a:hover { color: var(--red-hot); border-bottom-color: var(--red-hot); }
.toolinfo__block { margin-bottom: clamp(34px, 5vh, 52px); }
.toolinfo__block:last-child { margin-bottom: 0; }
.toolinfo__steps { margin: 0; padding: 0 0 0 20px; display: grid; gap: 10px; }
.toolinfo__steps li::marker { color: var(--red-text); font-weight: 700; }

/* Los asesinos como texto y enlaces reales, no como un array de JavaScript.
   Lo regenera tools/build-roster-list.js. */
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.roster li { margin: 0; }
.roster a { display: block; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--hairline); background: rgba(16,10,13,0.55); color: var(--ink-strong); font-size: 14px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--hairline); transition: border-color .15s, background .15s, transform .15s; }
.roster a:hover { border-color: rgba(225,29,46,0.55); background: rgba(225,29,46,0.09); transform: translateY(-1px); }
.roster__en { display: block; font-weight: 400; font-size: 12px; color: rgba(206,196,202,0.68); }

/* El servidor lee este bloque para componer el FAQPage de la página
   (ver pageSchema() en server/server.js), así que la pareja <h3> + <p> es
   estructura, no sólo estilo. */
.faq { display: grid; gap: 20px; }
.faq p:last-child { margin-bottom: 0; }
