/* Colores del juego (LoqColors): el gris del splash, el de la barra, el verde de marca y los de
   cada categoría (Category.color), los mismos de las tarjetas de la pestaña Jugar. Un solo tema,
   como la app. */
:root {
  --splash: #1d1d1d;
  --toolbar: #282828;
  --ink: #333333;
  --muted: #666666;
  --line: #e5e5e5;
  --paper: #ffffff;
  --soft: #f6f6f6;
  --green: #43a047;
  --green-button: #4caf50;
  --green-pressed: #66bb6a;
  --link: #2e7d32;

  --general: #c62828;
  --geography: #03a9f4;
  --shows: #ec407a;
  --history: #fdd835;
  --art: #795548;
  --science: #4caf50;
  --sports: #ff9800;

  /* Los colores de turno del tablero, para los modos de juego. */
  --turn0: #df2454;
  --turn1: #008cb6;
  --turn2: #21b57c;
  --turn3: #dfae31;
}

/* Montserrat, la fuente del juego, servida desde aquí (OFL, ver fonts/OFL.txt): sin Google Fonts,
   el navegador no le pasa la IP del visitante a nadie. */
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("/fonts/montserrat-400.otf") format("opentype"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("/fonts/montserrat-600.otf") format("opentype"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("/fonts/montserrat-800.otf") format("opentype"); }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

a { color: var(--link); }
img { max-width: 100%; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Barra superior: la de las pantallas del juego (toolbarBackground). */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--toolbar);
  color: #fff;
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img { border-radius: 8px; flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Selector de idioma: un <details> con las banderas del juego. */
.languages { position: relative; flex: none; }

.languages summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
}

.languages summary::-webkit-details-marker { display: none; }
.languages summary:hover,
.languages[open] summary { background: rgba(255, 255, 255, 0.1); }
.languages summary:focus-visible { outline: 2px solid var(--green-pressed); outline-offset: 2px; }

.languages summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}

.languages[open] summary::after { transform: translateY(2px) rotate(-135deg); }

.flag {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex: none;
}

.languages ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.languages li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.languages li a:hover,
.languages li a:focus-visible { background: var(--soft); outline: none; }
.languages li a[aria-current] { color: var(--green); }
.languages li a[aria-current]::after { content: "✓"; margin-left: auto; }

/* Portada: el fondo del splash con la ruleta. */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--splash);
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/img/pattern-general.png") 0 0 / 150px repeat;
  opacity: 0.05;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 48px;
  padding-top: 64px;
  padding-bottom: 72px;
}

.wheel {
  flex: none;
  width: 240px;
  height: 240px;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.5));
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
}

.tagline {
  margin: 12px 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.lead {
  margin: 12px 0 0;
  max-width: 560px;
  color: #cccccc;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.play img { display: block; height: 60px; width: auto; }

.soon {
  display: inline-flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  color: #cccccc;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Secciones. */
.section { padding: 64px 0; }
.section.soft { background: var(--soft); }

.section h2,
.cta h2 {
  margin: 0 0 32px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

/* Categorías: los botones de la pestaña Jugar, con su color, su patrón y su icono. */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  padding: 16px 10px;
  border-radius: 4px;
  background-color: var(--c);
  color: #fff;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.category::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pattern) 0 0 / 150px repeat;
  opacity: 0.35;
}

.category img,
.category span { position: relative; }
.category img { width: 56px; height: 56px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }

/* Modos de juego. */
.modes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.mode {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.mode-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c);
}

.mode-icon img { width: 32px; height: 32px; }
.mode h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; }
.mode p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Y mucho más. */
.more {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.more li { display: flex; gap: 14px; align-items: flex-start; }
.more img { flex: none; width: 36px; height: 36px; }
.more p { margin: 0; color: var(--muted); }

.account {
  margin-top: 48px;
  padding: 20px 24px;
  border-left: 4px solid var(--green);
  background: var(--soft);
  border-radius: 0 4px 4px 0;
}

.account h3 { margin: 0 0 4px; font-weight: 800; }
.account p { margin: 0; }

/* Llamada final, en el verde de marca. */
.cta {
  padding: 56px 0;
  background: var(--green);
  color: #fff;
  text-align: center;
}

.cta h2 { margin-bottom: 8px; }
.cta p { margin: 0 0 24px; }
.cta .play { display: inline-block; }

.button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  background: var(--green-button);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover { background: var(--green-pressed); }

.not-found { text-align: center; }
.not-found .wrap { position: relative; padding-top: 64px; padding-bottom: 72px; }
.not-found .wheel { width: 120px; height: 120px; }
.not-found h1 { margin-top: 16px; }

/* Páginas legales. */
.legal {
  max-width: 760px;
  padding-top: 32px;
  padding-bottom: 64px;
}

.legal h1 { font-weight: 800; line-height: 1.25; }
.legal h2 { font-weight: 800; font-size: 1.25rem; margin-top: 2em; }
.legal h3 { font-weight: 600; }

.legal section + section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.legal-languages {
  display: inline-flex;
  margin: 0;
  padding: 4px;
  border-radius: 6px;
  background: var(--soft);
  list-style: none;
}

.legal-languages a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.legal-languages a:hover { background: var(--paper); }

/* Pie: el gris del splash. */
.footer {
  padding: 32px 0;
  background: var(--splash);
  color: #bbbbbb;
  font-size: 0.9rem;
  text-align: center;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.footer a { color: #fff; }
.footer p { margin: 8px 0 0; }
.footer .fine { font-size: 0.8rem; color: #999999; }

@media (max-width: 720px) {
  .hero-inner {
    flex-direction: column;
    gap: 24px;
    padding-top: 40px;
    padding-bottom: 48px;
    text-align: center;
  }

  .wheel { width: 160px; height: 160px; }
  .lead { margin-left: auto; margin-right: auto; }
  .stores { justify-content: center; }
  .section { padding: 48px 0; }
  .section h2 { margin-bottom: 24px; }
  .modes { grid-template-columns: 1fr; }
  .languages summary span { display: none; }
}

@media (max-width: 360px) {
  .categories { grid-template-columns: repeat(2, 1fr); }
}
