/* Paleta inspirada en la captura: brasas naranjas, metal oscuro, telas rojo granate */
:root {
  /* Paleta cálida, marrón-ámbar */
  --bg: #0e0b09; /* fondo profundo marrón */
  --ink: #f3ebdf; /* texto principal cálido */
  --muted: #c9b8a8; /* texto secundario arena */
  --ember: #d7863c; /* ámbar tostado */
  --ember-2: #f0b277; /* ámbar suave */
  --steel: #19110d; /* paneles oscuros marrones */
  --card: #14100c; /* tarjetas */
  --accent: #9c5f32; /* cobre/marrón */
  --accent-2: #c47d46; /* cobre claro */
  --cyan: #cfa878; /* resalte sutil cálido */
  --radius: 14px;
  --ring: 0 0 0 2px rgba(215, 134, 60, 0.22), 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Encapsula la página Wuchang para romper con el estilo global */
.wuchang-page {
  isolation: isolate;
  padding-bottom: 72px;
}
html {
  background-color: var(--bg);
}
body {
  background: var(--bg);
  color: var(--ink);
}
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
}
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* Hero con banner */
.wuchang-hero {
  position: relative;
  min-height: calc(100vh - var(--header-h, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(
    --bg
  ); /* solid fallback to avoid white between paints */
  /* default fallback, será sobrescrito por #...Hero{--hero-img:url(...)} */
  --hero-img: url("/images/games/wuchang/wuchang.png");
  /* Solo degradados aquí; la imagen real se pinta en .hero-bg para evitar duplicados */
  background-image: radial-gradient(
      1200px 500px at 50% 0%,
      rgba(215, 134, 60, 0.12),
      transparent 60%
    ),
    radial-gradient(
      900px 360px at 80% 30%,
      rgba(115, 60, 30, 0.14),
      transparent 60%
    );
  background-position: 50% 0%, 80% 30%;
  background-size: 1200px 500px, 900px 360px;
  background-repeat: no-repeat, no-repeat;
}
@supports (height: 100svh) {
  .wuchang-hero {
    min-height: calc(100svh - var(--header-h, 0px));
  }
}
.wuchang-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(32, 20, 14, 0.45),
    rgba(14, 10, 8, 0.72)
  );
}
.wuchang-hero .container {
  position: relative;
  z-index: 2;
}
.wuchang-hero .hero-bg {
  position: absolute;
  inset: 0;
  background-color: var(--bg); /* ensure dark before image paints */
  background-image: var(--hero-img, url("/images/games/wuchang/wuchang.png"));
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0.95;
}
.wuchang-hero canvas.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* Canvases de polvo en secciones normales: no afectan al layout */
.has-dust {
  position: relative;
}
/* Asegura que el contenido quede siempre por encima del canvas decorativo */
.has-dust .dust-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  z-index: 0;
}
.has-dust > *,
.has-dust .container,
.has-dust .trailer-and-summary,
.has-dust .video-wrap {
  position: relative;
  z-index: 1;
}
.wuchang-hero .hero-content {
  text-align: center;
  backdrop-filter: saturate(120%);
}
.wuchang-hero .hero-content h1 {
  margin: 0 0 8px;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: 0.8px;
  color: #f4e4d2;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.wuchang-hero .hero-content p {
  margin: 0 0 16px;
  color: #efe3d6;
  opacity: 0.95;
  font-size: 1.1rem;
}
.wuchang-hero .btn {
  background: linear-gradient(180deg, var(--ember-2), var(--ember));
  border-color: #d78d52;
  color: #1a120d;
  padding: 12px 18px;
  font-weight: 700;
}
.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe0cc;
  text-decoration: none;
  font-size: 28px;
  opacity: 0.8;
}

/* Partículas de brasas sutiles */
.wuchang-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      4px 4px at 10% 70%,
      rgba(240, 178, 119, 0.7),
      transparent 60%
    ),
    radial-gradient(
      3px 3px at 30% 40%,
      rgba(215, 134, 60, 0.7),
      transparent 60%
    ),
    radial-gradient(
      2px 2px at 85% 30%,
      rgba(240, 178, 119, 0.5),
      transparent 60%
    ),
    radial-gradient(
      2px 2px at 60% 80%,
      rgba(215, 134, 60, 0.55),
      transparent 60%
    );
  opacity: 0.35;
  mix-blend-mode: screen;
  border-radius: calc(var(--radius) + 6px);
}

/* Hub grid con tarjetas redondeadas y glow */
.guides-section {
  padding: 28px 0 24px;
  background: radial-gradient(
    1000px 400px at 80% 0%,
    rgba(215, 134, 60, 0.08),
    transparent 60%
  );
}
.guides-section .breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 8px 0 10px;
  color: var(--muted);
  padding: 4px 6px;
  background: #16100c;
  border: 1px solid #2f231c;
  border-radius: 999px;
}
.guides-section .breadcrumbs a,
.guides-section .breadcrumbs span[aria-current="page"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  color: #ccb8a6;
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.1s ease;
}
.guides-section .breadcrumbs a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #efe4d7;
}
.guides-section .breadcrumbs a:active {
  transform: translateY(1px);
}
.guides-section .breadcrumbs a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 134, 60, 0.22);
  color: #f3ebdf;
}
.guides-section .breadcrumbs span[aria-current="page"] {
  background: rgba(215, 134, 60, 0.08);
  color: #f3ebdf;
  cursor: default;
}
.guides-section .breadcrumbs > span[aria-hidden="true"] {
  display: none;
}
.guides-section .breadcrumbs > a:not(:first-child)::before,
.guides-section
  .breadcrumbs
  > span[aria-current="page"]:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 16px;
  background: #2f231c;
  margin: 0 6px 0 2px;
  vertical-align: middle;
}
.section-title {
  font-size: 22px;
  margin: 0 0 12px 4px;
  color: #ffe0cc;
}
.guides-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px auto 12px;
}
.guide-card {
  display: block;
  background: linear-gradient(180deg, #1a130e, #120e0b);
  color: var(--ink);
  text-decoration: none;
  padding: 16px 18px;
  border: 1px solid #3a2a21;
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 10px 30px rgba(0, 0, 0, 0.25);
}
.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(215, 134, 60, 0.34) inset,
    0 18px 40px rgba(0, 0, 0, 0.38);
  border-color: #4a3428;
}
.guide-card.special {
  background: linear-gradient(160deg, #21160f, #271a12);
  border-color: #704a2a;
  box-shadow: 0 0 0 1px rgba(215, 134, 60, 0.22) inset,
    0 16px 36px rgba(0, 0, 0, 0.35);
  color: #f7efe6;
}
.guide-card .title {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
.guide-card .subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Fila dedicada para el CTA de tutoriales centrado */
.tutorial-cta {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  margin: 6px 0 24px;
}
.tutorial-cta .guide-card {
  max-width: 460px;
  width: 100%;
  text-align: center;
  position: relative;
}
.tutorial-cta .guide-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(126, 240, 255, 0.18);
}

/* Trailer y resumen */
.trailer-section {
  padding: 10px 0 0;
}
.trailer-and-summary {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: 1px solid #3a2a21;
  border-radius: calc(var(--radius) + 2px);
  background: var(--steel);
  box-shadow: var(--ring);
}
.video-wrap.small {
  padding-bottom: 52%;
}
.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: calc(var(--radius) + 2px);
}
/* Garantiza que el vídeo se pinte por encima de cualquier canvas decorativo */
.trailer-section .container,
.trailer-and-summary,
.video-wrap {
  position: relative;
  z-index: 2;
}

/* Mini resumen junto al trailer */
/* Limpieza: ya no usamos mini-summary al lado del trailer */

/* Ratings */
.ratings-section {
  padding: 24px 0;
  background: radial-gradient(
    1000px 400px at 20% 20%,
    rgba(215, 134, 60, 0.08),
    transparent 60%
  );
}
.ratings-inline {
  padding: 0;
  background: none;
}
.ratings-inline .section-title {
  margin: 0 0 8px;
}
.ratings-inline .ratings-grid {
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}
.ratings-panel {
  border: 1px solid #3a2a21;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: linear-gradient(180deg, #1a130e, #120e0b);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}
.ratings {
  margin: 0 auto;
}
.ratings-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  margin-bottom: 8px;
  color: #f0e4db;
  letter-spacing: 0.2px;
}
.ratings-section .stars {
  display: inline-flex;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.ratings-section .star {
  width: 30px;
  height: 30px;
  display: inline-block;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>')
    no-repeat center / contain;
  background: #3a3c45;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.05));
}
.ratings-section .star.full {
  background: linear-gradient(180deg, var(--ember), var(--ember-2));
}
.ratings-section .star.half {
  background: linear-gradient(90deg, var(--ember) 50%, #3a3c45 50%);
}
.wuchang-page .btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid #3a2a21;
  background: linear-gradient(180deg, #1a130e, #120e0b);
  color: #f3ebdf;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(215, 134, 60, 0.06) inset,
    0 10px 30px rgba(0, 0, 0, 0.25);
}
.wuchang-page .btn:hover {
  filter: brightness(1.02);
}
.wuchang-page .btn.solid {
  background: linear-gradient(180deg, var(--ember-2), var(--ember));
  border-color: #d78d52;
  color: #1a120d;
}
.wuchang-page .btn.solid:hover {
  filter: brightness(1.04);
}
.wuchang-page .form-msg {
  min-height: 1.2em;
  color: var(--muted);
  margin-top: 10px;
}

/* Botón de guardar en valoraciones: sin glow/sombra y con paleta cálida */
.ratings-section .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 10px;
  box-shadow: none;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.ratings-section .btn.solid {
  background: linear-gradient(180deg, #eeb77a, #cf7f42);
  border-color: #b26c39;
  color: #1b130d;
  filter: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 6px 18px rgba(0, 0, 0, 0.18);
}
.ratings-section .btn.solid:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}
.ratings-section .btn.solid:active {
  transform: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 4px 12px rgba(0, 0, 0, 0.16);
}
.ratings-section .btn.solid:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(215, 134, 60, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 6px 18px rgba(0, 0, 0, 0.18);
}

.summary-box {
  border: 1px solid #3a2a21;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: linear-gradient(180deg, #1a130e, #120e0b);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}
.summary-box .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #4a362a;
}
.summary-box .row.total {
  font-weight: 700;
  border-bottom: 0;
  color: #f4e4d2;
}

@media (max-width: 980px) {
  .guides-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trailer-and-summary {
    grid-template-columns: 1fr;
  }
  .ratings-inline .ratings-grid {
    grid-template-columns: 1fr;
  }
  .ratings-grid {
    grid-template-columns: 1fr;
  }
  .wuchang-hero .hero-banner {
    height: 200px;
  }
}
@media (max-width: 640px) {
  .guides-grid {
    grid-template-columns: 1fr;
  }
  .wuchang-hero {
    min-height: 78svh;
  }
  .wuchang-hero .hero-content h1 {
    font-size: clamp(28px, 9vw, 40px);
    letter-spacing: 0.4px;
  }
  .wuchang-hero .hero-content p {
    font-size: 1rem;
  }
  .trailer-and-summary {
    gap: 12px;
  }
  .ratings-section {
    padding: 18px 0;
  }
  .ratings-panel {
    padding: 12px;
  }
  .summary-box {
    padding: 12px;
  }
  /* En móvil, usa aspect-ratio para el vídeo y evita height:0 */
  .video-wrap,
  .video-wrap.small {
    padding-bottom: 0;
    height: auto;
    aspect-ratio: 16/9;
  }
  .video-wrap iframe {
    position: static;
    width: 100%;
    height: 100%;
  }
}
/* Estilos legacy del hub - adaptados a la paleta marrón */
.wuchang-hero {
  padding: 32px 0 8px;
  background: linear-gradient(180deg, #14100c, #1a130e);
  border-bottom: 1px solid #3a2a21;
}
.wuchang-hero .hero-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.wuchang-hero h1 {
  margin: 12px 0 4px;
  font-family: Cinzel, serif;
  letter-spacing: 0.5px;
}
.wuchang-hero .sub {
  color: #c9b8a8;
  margin: 0 0 8px;
}

.wuchang-hub .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 20px 0;
}
.hub-card {
  background: #1a130e;
  border: 1px solid #3a2a21;
  color: #f3ebdf;
  padding: 18px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border-color: #4a3428;
}
.hub-card.special {
  background: radial-gradient(100% 100% at 0% 0%, #25180f, #1a120d);
  border-color: #8a5b2c;
  color: #fff;
}
.hub-card.special:hover {
  box-shadow: 0 10px 28px rgba(215, 134, 60, 0.28);
}

.wuchang-media {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  padding: 10px 0 24px;
  align-items: start;
}
.wuchang-media .trailer iframe {
  width: 100%;
  border-radius: 10px;
  background: #000;
}
.wuchang-media .desc {
  background: #1a130e;
  border: 1px solid #3a2a21;
  padding: 16px;
  border-radius: 10px;
  color: #f3ebdf;
}
.wuchang-media .desc h2 {
  margin: 0 0 8px;
}

.wuchang-ratings {
  padding: 8px 0 32px;
}
.ratings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.rating-inputs {
  background: #1a130e;
  border: 1px solid #3a2a21;
  padding: 16px;
  border-radius: 12px;
}
.rating-summary {
  background: #120e0b;
  border: 1px solid #3a2a21;
  padding: 16px;
  border-radius: 12px;
}
.rating-summary .metric {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #4a362a;
}
.rating-summary .metric:last-child {
  border-bottom: 0;
}
.rating-summary .metric .label {
  color: #c9b8a8;
}

.rating-field {
  margin-bottom: 10px;
}
.rating-field label {
  display: block;
  margin-bottom: 6px;
  color: #c7ceef;
}
.wuchang-ratings .stars {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.wuchang-ratings .star {
  width: 22px;
  height: 22px;
  color: #666d9a;
  cursor: pointer;
}
.wuchang-ratings .star.filled {
  color: #f3c969;
}
.wuchang-ratings .star.half::before {
  content: "\\2605";
  position: absolute;
  width: 50%;
  overflow: hidden;
  color: #f3c969;
}

/* Remove legacy blue button styles to keep warm palette */
.wuchang-page .form-msg {
  margin-top: 8px;
  min-height: 20px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .wuchang-media {
    grid-template-columns: 1fr;
  }
  .ratings-grid {
    grid-template-columns: 1fr;
  }
}
