/* Interfaz navideña intermedia: burdeos de lacre, oro ocre, tipografía festiva (OFL, offline) */
@font-face {
  font-family: "Cinzel";
  src: url("vendor/fonts/Cinzel.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("vendor/fonts/EBGaramond.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #0a1028;
  --card: #7a2f3c;
  --burgundy: #7a2f3c;
  --burgundy-lite: #8e2f3f;
  --burgundy-deep: #5c242c;
  --burgundy-ink: #3f1a22;
  --gold: #c9a24a;
  --gold-muted: #a08a4a;
  --gold-light: #d4b45a;
  --cream: #fff6e4;
  --cream-soft: #f4ead0;
  --ink: #3a2410;
  --line: transparent;
  --fg: #fff6e4;
  --muted: #e2d4b6;
  --warm: #c9a24a;
  --sunset: #e8a878;
  --lilac: #8a78b0;
  --navy: #0a1028;
  --pink: #fa618e;
  --title: "Cinzel", "Palatino Linotype", Palatino, serif;
  --body: "EB Garamond", "Palatino Linotype", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.4 var(--body);
}

h1, h2, .title {
  font-family: var(--title);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.logo, .logo-pixel {
  height: 26px;
  width: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
/* Logo flotante: raster 96×58, ~1.8× para que se note el pixelado (latio queda dominante) */
.logo-float {
  height: 104px;
  width: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter:
    drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55))
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
}
.hud-logo {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 6;
}

/* Pista: logo + sello de recuento, pista de uso que se desvanece, barra inferior */
.hud-brand {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.hud-brand .logo-float,
.hud-brand .hud-logo { position: static; top: auto; left: auto; }
.count-badge {
  display: inline-block;
  margin: 0;
  padding: 4px 12px 5px;
  border-radius: 999px;
  background: rgba(36, 14, 20, 0.92);
  border: 1px solid #c9a24a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font-family: var(--body);
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: none;
}

.hud-hint {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  z-index: 5;
  max-width: 340px;
  width: max-content;
  padding: 8px 14px 9px;
  border-radius: 12px;
  background: rgba(36, 14, 20, 0.94);
  color: var(--cream-soft);
  font-family: var(--body);
  font-size: 16px;
  font-style: normal;
  line-height: 1.35;
  text-align: center;
  text-shadow: none;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.hud-hint.out { opacity: 0; }

.hud-tools {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 14px;
  padding: 8px 16px;
  border-radius: 28px;
  background: rgba(18, 8, 12, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}
.hud-tools > * { pointer-events: auto; }

.hud-ico,
button.hud-ico,
a.hud-ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--cream);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
  transform: none;
  width: auto;
  height: auto;
}
.hud-ico .seal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #9a3a48 0%, #7a2f3c 48%, #5c242c 100%);
  border: 1.5px solid #c9a24a;
  box-shadow:
    inset 0 2px 0 rgba(255, 246, 228, 0.28),
    inset 0 -3px 5px rgba(0, 0, 0, 0.35),
    0 3px 8px rgba(0, 0, 0, 0.4);
}
.hud-ico svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: currentColor;
  filter: none;
}
.hud-ico:hover,
button.hud-ico:hover,
a.hud-ico:hover {
  background: none;
  color: #fffaf0;
  box-shadow: none;
}
.hud-ico:hover .seal,
button.hud-ico:hover .seal,
a.hud-ico:hover .seal {
  background: linear-gradient(180deg, #ad4654 0%, #8e2f3f 55%, #6a2832 100%);
  border-color: #d4b45a;
}
.hud-ico:active,
button.hud-ico:active,
a.hud-ico:active {
  transform: none;
  box-shadow: none;
}
.hud-ico:active .seal { transform: translateY(1px); }
.hud-ico span { display: none; }

/* Botones: burdeos, bisel suave, sin filete de celda */
button {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--cream);
  background: linear-gradient(180deg, #9a3a48 0%, #7a2f3c 55%, #5c242c 100%);
  border: 0;
  border-radius: 10px;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 228, 0.22),
    inset 0 -2px 3px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.28);
}
button:hover {
  background: linear-gradient(180deg, #ad4654 0%, #8e2f3f 60%, #6a2832 100%);
  color: #fffaf0;
}
button:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}
button.on {
  background: linear-gradient(180deg, #e0c36a 0%, #c9a24a 50%, #a08a4a 100%);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 240, 0.5),
    inset 0 -1px 2px rgba(80, 50, 10, 0.28);
}

/* Botones solo icono */
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}
a:has(.icon-btn) { text-decoration: none; display: inline-flex; }

/* Cabecera: barra burdeos con canto de oro ocre, sin retícula */
.ui-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px;
  background: linear-gradient(180deg, #8e2f3f 0%, #7a2f3c 42%, #5c242c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 228, 0.2),
    0 1px 0 #c9a24a,
    0 4px 14px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.ui-header::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, #6a5420, #d4b45a 20%, #fff6e4 50%, #d4b45a 80%, #6a5420);
  pointer-events: none;
}
.ui-header .t, .ui-header h1 {
  font-family: var(--body);
  font-size: 17px;
  font-style: italic;
  line-height: 1.3;
  color: var(--cream-soft);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}
.ui-header h1 {
  font-family: var(--title);
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
}
.ui-header .sp { flex: 1; }

/* Paneles colgados: burdeos translúcido con blur, cabeceras idénticas */
.hung {
  position: relative;
  margin-top: 10px;
  padding: 0 12px 10px;
  background: rgba(92, 36, 44, 0.58);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 74, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 228, 0.2),
    0 8px 22px rgba(0, 0, 0, 0.28);
}
.hung::before, .hung::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 11px;
  height: 18px;
  background: linear-gradient(90deg, #6a2832, #c9a24a 45%, #fff6e4 52%, #c9a24a 60%, #6a2832);
  border-radius: 2px 2px 3px 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.hung::before { left: 20px; }
.hung::after { right: 20px; }
.hung > h2 {
  margin: 0 -12px 8px;
  height: 36px;
  padding: 0 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #d4b45a 0%, #c9a24a 48%, #a08a4a 100%);
  color: var(--ink);
  font-family: var(--title);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 240, 0.45);
}

/* CTA principal: botón de acción final, ancho completo, tipo mayor */
.cta, button.cta {
  display: block;
  width: 100%;
  margin: 0;
  padding: 18px 16px 17px;
  border: 0;
  border-radius: 10px;
  font-family: var(--title);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(180deg, #e8cd74 0%, #c9a24a 48%, #a08a4a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 240, 0.6),
    inset 0 -2px 0 rgba(80, 50, 10, 0.3),
    0 4px 0 #6a5420,
    0 8px 18px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
}
.cta:hover, button.cta:hover {
  background: linear-gradient(180deg, #f0d884 0%, #d4b45a 50%, #b39240 100%);
  color: var(--ink);
}
.cta::before, .cta::after,
button.cta::before, button.cta::after { content: none; display: none; }

/* Sello de lacre en el color o el interruptor activo, sin retícula */
.sw {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  padding: 0;
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.28);
}
.sw.on {
  border-radius: 50%;
  box-shadow:
    0 0 0 3px #7a2f3c,
    0 0 0 5px #c9a24a,
    inset 0 1px 0 rgba(255, 246, 228, 0.35);
}

@media (max-width: 760px) {
  button { font-size: 14px; padding: 8px 11px; }
  .icon-btn { width: 38px; height: 38px; }
  .ui-header { flex-wrap: wrap; gap: 8px; padding: 10px 10px 10px; }
  .ui-header .t { display: none; }
  .ui-header h1 { font-size: 11px; letter-spacing: 0.08em; }
  .cta, button.cta { font-size: 16px; letter-spacing: 0.08em; padding: 16px 14px 15px; }
  .logo-float { height: 70px; }
  .hud-brand { top: 12px; left: 12px; gap: 6px; }
  .count-badge { font-size: 13px; padding: 3px 10px 4px; }
  .hud-tools { bottom: 10px; gap: 10px; padding: 8px 12px 6px; border-radius: 22px; }
  .hud-ico .seal { width: 48px; height: 48px; }
  .hud-ico svg { width: 23px; height: 23px; }
  .hud-ico span { display: block; max-width: 72px; text-align: center; font-size: 10px; color: var(--cream); text-shadow: 0 1px 2px #000a; }
  .hud-hint { bottom: 118px; max-width: min(340px, calc(100% - 24px)); font-size: 15px; }
}

/* Botón con icono y etiqueta corta (Deshacer / Rehacer) */
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 11px;
  font-size: 15px;
}
.btn-text svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: none;
}
.btn-text:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* Enlace discreto (Empezar de cero) */
.quiet,
button.quiet {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-family: var(--body);
  font-size: 14px;
  font-style: italic;
  padding: 6px 2px 2px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quiet:hover,
button.quiet:hover {
  background: none;
  color: var(--cream-soft);
  box-shadow: none;
}
.quiet:active,
button.quiet:active {
  transform: none;
  box-shadow: none;
}
