/*
 * Página de inicio (index.html) con el tema REHIS26: encabezado azul noche con la trama de
 * hexágonos del Visor, la elección de batalla como tarjetas sobre papel y la barra superior que
 * se muestra al abrir una batalla. Usa solo las variables de tema/rehis26.css.
 */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--rh-paper); }
body {
  margin: 0;
  background: var(--rh-paper);
  color: var(--rh-ink);
  font: 16px/1.55 var(--rh-font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ Inicio */

#home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Encabezado: componente .rh-hero de rehis26.css, con el título más grande */
.rh-hero h1 { font-size: clamp(52px, 9vw, 92px); line-height: 1; letter-spacing: .06em; }

.content {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

/* Tarjetas de batalla */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.choices button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 190px;
  padding: 30px 32px 26px;
  overflow: hidden;
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-lg);
  background:
    linear-gradient(105deg, var(--rh-surface) 52%, rgb(255 253 249 / 55%)),
    url("hex.svg") right -12px top -8px / 40px auto repeat var(--rh-surface);
  color: var(--rh-ink);
  font: inherit;
  text-align: left;
  box-shadow: var(--rh-shadow);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* Franja superior con los colores de ambos ejércitos */
.choices button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--rh-chile) 0 50%, var(--rh-peru) 50% 100%);
}
.choices button strong {
  display: block;
  margin-bottom: 8px;
  color: var(--rh-navy);
  font: 600 30px/1.15 var(--rh-font-serif);
}
.choices button small {
  color: var(--rh-ink-soft);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.choices button::after {
  content: "Entrar  →";
  margin-top: auto;
  padding-top: 26px;
  color: var(--rh-gold);
  font: 600 12px/1 var(--rh-font-sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: pre;
  transition: letter-spacing .2s ease, color .2s ease;
}
.choices button:hover {
  transform: translateY(-3px);
  border-color: var(--rh-line-strong);
  box-shadow: 0 2px 4px rgb(27 44 64 / 6%), 0 18px 40px rgb(27 44 64 / 16%);
}
.choices button:hover::after { color: var(--rh-navy); letter-spacing: .2em; }
.choices button:focus-visible { outline: none; box-shadow: var(--rh-focus), var(--rh-shadow); }

/* Texto de apoyo y pie */
.choices + p {
  max-width: 70ch;
  margin: 26px auto 0;
  text-wrap: balance;
  color: var(--rh-ink-soft);
  font-size: 16px;
  text-align: center;
}
.foot {
  margin: 32px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--rh-line);
  color: var(--rh-muted);
  font-size: 13.5px;
  text-align: center;
}

/* ------------------------------------------------------------------ Batalla abierta */

#workspace { display: none; flex-direction: column; height: 100vh; height: 100dvh; }
#bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 16px;
  background: var(--rh-navy);
  border-bottom: 3px solid var(--rh-gold);
  color: #fff;
}
#bar button {
  padding: 7px 14px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: var(--rh-r-sm);
  background: transparent;
  color: #fff;
  font: 500 14px/1.2 var(--rh-font-sans);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
#bar button:hover { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 50%); }
#bar button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(212 180 122 / 55%); }
#battleTitle { font: 600 17px/1.2 var(--rh-font-serif); letter-spacing: .02em; }
iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }

/* ------------------------------------------------------------------ Pantallas pequeñas */

@media (max-width: 640px) {
  .content { padding: 0 16px 24px; }
  .choices { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .choices button { min-height: 0; padding: 28px 22px 22px; }
  .choices button strong { font-size: 26px; }
  #bar { gap: 10px; padding: 6px 10px; }
  #bar button { font-size: 13px; padding: 6px 10px; }
  #battleTitle { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .choices button, .choices button::after { transition: none; }
  .choices button:hover { transform: none; }
}
