/**
 * Estilos mínimos para pantalla táctil fullscreen 1080×1920 (vertical).
 * Sin frameworks externos.
 */

@font-face {
  font-family: 'oups';
  src: url('assets/fonts/Oups_Clean.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'cocogoose';
  src: url('assets/fonts/CocogoosePro-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'rotunda';
  src: url('assets/fonts/Rotunda-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f121d;
  /* Evita gestos del navegador en touch (scroll, zoom, selección) */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Con INFO abierto: permitir pan vertical en la capa de créditos */
body.app-info-open {
  touch-action: manipulation;
}

body.app-info-open .app-info,
body.app-info-open .app-info__panel,
body.app-info-open .app-info__scroll {
  touch-action: pan-y;
}

#game-root {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-root canvas {
  display: block;
  cursor: default;
}

/* Boot mientras p5 precarga planeta + fuentes */
#boot-load {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f121d;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#boot-load.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-load__label {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: rgba(240, 244, 255, 0.75);
}

/* ——— CAPA INFO (overlay HTML) ——— */
.app-info {
  --info-text: #2a2418;
  --info-text-dim: #5a5040;
  --info-accent: #ffcc00;
  --info-panel: #fffaf2;
  --info-verano: #d29628;
  --info-link: #1a5a9c;

  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.5vw, 28px);
  background: rgba(10, 10, 14, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-info.is-open {
  visibility: visible;
  pointer-events: auto;
}

.app-info__panel {
  width: min(920px, 100%);
  max-height: min(1680px, 94vh);
  display: flex;
  flex-direction: column;
  background: var(--info-panel);
  color: var(--info-text);
  border-radius: 36px;
  box-shadow: 0 20px 50px rgba(10, 10, 14, 0.45);
  border: 4px solid rgba(255, 255, 255, 0.75);
  padding: 28px 20px 20px;
  -webkit-user-select: text;
  user-select: text;
}

.app-info__scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 4px 20px 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.app-info__title {
  margin: 0 0 1rem;
  font-family: cocogoose, sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 400;
  color: var(--info-text);
  text-align: center;
  letter-spacing: 0.04em;
}

.app-info__p {
  margin: 0 0 1.15rem;
  font-family: rotunda, Georgia, serif;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.45;
  color: var(--info-text);
}

.app-info__p b,
.app-info__p strong {
  font-family: cocogoose, sans-serif;
  font-weight: 400;
  color: #8a3d14;
}

.app-info__p em,
.app-info__p i {
  font-style: italic;
}

.app-info__loading {
  margin: 1rem 0;
  font-family: rotunda, Georgia, serif;
  color: var(--info-text-dim);
}

.app-info__close {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 12px auto 4px;
  height: 72px;
  border: none;
  border-radius: 999px;
  background: var(--info-accent);
  color: #1a1208;
  font-family: oups, sans-serif;
  font-size: 28px;
  box-shadow: 0 8px 20px rgba(30, 20, 10, 0.2);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.app-info__close:active {
  transform: scale(0.98);
}

.app-info__close:disabled {
  opacity: 0.6;
}

/* ——— Créditos (clases de contenido_creditos.html / portada) ——— */
.credits {
  width: 100%;
  margin: 1.5rem 0 0;
  padding: 1.35rem 1.15rem 1.5rem;
  background: rgba(255, 252, 245, 0.98);
  border-radius: 1.1rem;
  box-shadow: 0 6px 18px rgba(42, 36, 24, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.65);
  color: var(--info-text);
}

.credits__title {
  margin: 0 0 1.25rem;
  font-family: cocogoose, sans-serif;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 400;
  color: var(--info-text);
  text-align: center;
}

.credits__group {
  margin: 0 0 1.6rem;
}

.credits__group:last-child {
  margin-bottom: 0;
}

.credits__group h3 {
  margin: 0 0 0.35rem;
  font-family: cocogoose, sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #8a3d14;
}

.credits__group .subtitle {
  margin: 0 0 1rem;
  font-family: rotunda, Georgia, serif;
  font-size: 1rem;
  color: var(--info-text-dim);
  line-height: 1.4;
}

.credits__list {
  margin: 0;
  display: flow-root;
}

.credits__list dt {
  float: left;
  clear: left;
  width: 11.5rem;
  margin: 0.55rem 0 0;
  padding: 0;
  font-family: cocogoose, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: #8a3d14;
}

.credits__list dt:first-child {
  margin-top: 0;
}

.credits__list dd {
  margin: 0.55rem 0 0 12.5rem;
  padding: 0;
  font-family: rotunda, sans-serif;
  font-size: 1.02rem;
  color: var(--info-text);
}

.credits__list dt:first-child + dd {
  margin-top: 0;
}

.credits__list dd + dd {
  margin-top: 0.15rem;
}

.credits .note {
  display: inline;
  font-size: 0.9em;
  color: var(--info-text-dim);
  font-style: italic;
}

.credits__highlight {
  margin: 0 0 1.6rem;
  padding: 1rem 1.15rem;
  border-radius: 0.9rem;
  background: rgba(210, 150, 40, 0.18);
  border-left: 5px solid var(--info-verano);
}

.credits__highlight p {
  margin: 0;
  font-family: rotunda, Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--info-text);
}

.credits__highlight strong {
  font-family: cocogoose, sans-serif;
  font-weight: 400;
}

.credits__social .social-links,
.credits__institutions ul {
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.credits__social a {
  color: var(--info-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-family: rotunda, sans-serif;
  font-size: 1.02rem;
  touch-action: manipulation;
}

.credits__social a:hover,
.credits__social a:focus-visible {
  color: #0d3d6e;
}

.credits__institutions li {
  font-family: rotunda, sans-serif;
  font-size: 1.02rem;
  padding-left: 1rem;
  position: relative;
  color: var(--info-text);
}

.credits__institutions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--info-verano);
}

@media (min-width: 900px) {
  .credits {
    padding: 1.75rem 1.75rem 1.9rem;
  }

  .credits__list dt {
    width: 13.5rem;
  }

  .credits__list dd {
    margin-left: 14.5rem;
  }
}

@media (max-width: 540px) {
  .credits__list dt {
    float: none;
    width: auto;
    margin-top: 0.85rem;
  }

  .credits__list dd {
    margin: 0.15rem 0 0;
  }
}
