:root {
  --bg: #0a0d14;
  --panel: rgba(8, 12, 20, 0.92);
  --panel-border: rgba(42, 53, 72, 0.9);
  --text: #e8eaef;
  --muted: #b8c0d0;
  --accent: #3dd66a;
  --accent-dim: #2a3548;
  --link: #7eb8ff;
  --content-max: 42rem;
  --safe-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  --safe-right: max(1rem, env(safe-area-inset-right, 0px));
  --text-stroke:
    -1px -1px 0 #0a0a0a,
    1px -1px 0 #0a0a0a,
    -1px 1px 0 #0a0a0a,
    1px 1px 0 #0a0a0a,
    0 2px 6px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background-color: #1e3a28;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(8, 12, 20, 0.06), rgba(8, 12, 20, 0.22)),
    url("./images/fondo-github.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* —— Barra de idiomas: siempre arriba, nunca encima del contenido —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0.65rem clamp(0.75rem, 3vw, 1.25rem);
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  background: rgba(8, 12, 20, 0.97);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.lang-switch button {
  border: 1px solid rgba(42, 53, 72, 0.85);
  background: rgba(18, 24, 36, 0.92);
  color: var(--muted);
  padding: 0.5rem 0.4rem;
  border-radius: 8px;
  font-size: clamp(0.68rem, 2.8vw, 0.82rem);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-width: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lang-switch button:hover {
  border-color: rgba(61, 214, 106, 0.45);
  color: var(--text);
}

.lang-switch button.is-active {
  background: rgba(61, 214, 106, 0.14);
  border-color: rgba(61, 214, 106, 0.55);
  color: var(--accent);
}

/* —— Área principal —— */
.site-main {
  width: 100%;
  max-width: calc(var(--content-max) + 2.5rem);
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vw, 1.25rem);
  padding-bottom: calc(4.75rem + var(--safe-bottom));
}

/* En inicio: espacio para el logo ANGRY AXIES del fondo */
.hero-banner {
  min-height: clamp(14rem, 48vh, 22rem);
  margin-bottom: clamp(0.75rem, 2.5vw, 1.25rem);
  pointer-events: none;
}

body[data-page="index"] .site-main {
  padding-top: clamp(0.25rem, 1.5vw, 0.75rem);
}

/* Panel único: todo el texto legible sobre cualquier fondo */
.site-panel {
  width: 100%;
  padding: clamp(1rem, 3.5vw, 1.75rem);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.38);
}

.site-panel--narrow {
  max-width: 40rem;
  margin: 0 auto;
}

.site-title {
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  margin: 0 0 0.85rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow:
    -2px -2px 0 #3d2817,
    2px -2px 0 #3d2817,
    -2px 2px 0 #3d2817,
    2px 2px 0 #3d2817,
    0 4px 0 rgba(45, 30, 12, 0.85),
    0 8px 22px rgba(0, 0, 0, 0.45);
}

h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  margin: 0 0 0.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

h1.h1-sm {
  font-size: clamp(1.15rem, 3.8vw, 1.4rem);
  font-weight: 700;
}

.lead {
  font-size: clamp(0.98rem, 2.8vw, 1.05rem);
  color: var(--muted);
  margin: 0 0 1.25rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

strong { color: var(--text); }

code {
  background: #1a2230;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  font-size: 0.92em;
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}

.actions .btn {
  flex: 1 1 calc(50% - 0.35rem);
  min-width: 9rem;
}

a.btn {
  display: inline-block;
  flex: 1 1 12rem;
  padding: 0.85rem 1.1rem;
  background: var(--accent);
  color: #0a0d14 !important;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: clamp(0.88rem, 2.8vw, 0.95rem);
  text-align: center;
}

a.btn.secondary {
  background: var(--accent-dim);
  color: var(--text) !important;
}

a.btn.discord {
  background: #5865f2;
  color: #ffffff !important;
}

a.btn.discord:hover {
  filter: brightness(1.1);
}

a.btn:hover { filter: brightness(1.08); }

.actions--card {
  margin-bottom: 0;
}

.actions--card .btn {
  flex: 1 1 100%;
}

.card, .note {
  background: rgba(18, 24, 36, 0.65);
  border: 1px solid rgba(50, 62, 82, 0.85);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.note { border-radius: 10px; margin: 1rem 0; }

.card h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

li {
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

footer, .back {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

footer a, .back a { color: var(--link); }

.site-panel a:not(.btn) {
  color: var(--link);
  word-break: break-word;
}

footer p:last-child,
.back { margin-bottom: 0; }

/* Placa de versión */
.version-plaque {
  position: fixed;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  z-index: 150;
  min-width: 5.25rem;
  padding: 0.45rem 0.85rem 0.5rem;
  border-radius: 12px;
  border: 2px solid #3d2817;
  background:
    linear-gradient(180deg, rgba(255, 228, 160, 0.22) 0%, transparent 38%),
    linear-gradient(180deg, #9a7428 0%, #6f5218 42%, #4a3510 100%);
  box-shadow:
    0 3px 0 #2a1d0c,
    0 10px 28px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 236, 190, 0.45);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.version-plaque::before,
.version-plaque::after {
  content: "";
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd76a, #c4921f);
  border: 1px solid rgba(61, 40, 23, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.version-plaque::before { top: -0.28rem; left: 0.65rem; }
.version-plaque::after { top: -0.28rem; right: 0.65rem; }

.version-plaque__label {
  display: block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f7e8c8;
  text-shadow: 0 1px 0 #2a1d0c;
  margin-bottom: 0.12rem;
}

.version-plaque__num {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #ece6dc;
  text-shadow:
    -1px -1px 0 #4a4034,
    1px -1px 0 #4a4034,
    -1px 1px 0 #4a4034,
    1px 1px 0 #4a4034,
    0 2px 0 #2f2922;
}

/* Pantallas muy estrechas: idiomas en 2×2 */
@media (max-width: 380px) {
  .lang-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Pantallas anchas: botones de acción en fila */
@media (min-width: 520px) {
  .actions .btn {
    flex: 1 1 auto;
    min-width: 9.5rem;
  }
}
