/* =========================================================
   EL RETO — jugar.html (WebGL embebido)
   Complementa styles.css (no lo modifica): solo estilos
   propios de la página de juego.
   ========================================================= */

/* ---------- Layout de la página ---------- */
.play-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) var(--pad) 0;
}
.play-head { margin-bottom: 22px; }
.play-head h1 { font-size: clamp(30px, 5vw, 48px); }

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

/* ---------- Marco del juego ---------- */
.game-frame {
  position: relative;
  overflow: hidden;
  background: #060708;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.game-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #060708;
}
#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #060708;
}

/* Overlay de estado (carga / error / build ausente) */
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(700px 340px at 50% 0%, rgba(255, 59, 48, .08), transparent 60%),
    #0a0b0e;
}
.game-overlay[hidden] { display: none; }
.game-overlay .sem-mini {
  display: flex;
  gap: 10px;
}
.game-overlay .sem-mini i {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #1c1f26;
  border: 1px solid #000;
}
.game-overlay .sem-mini i.on-red   { background: var(--red);   box-shadow: 0 0 12px var(--red); }
.game-overlay .sem-mini i.on-amber { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.game-overlay .sem-mini i.on-green { background: var(--green); box-shadow: 0 0 12px var(--green); }

.game-status {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--muted);
  max-width: 46ch;
}
.game-status strong { color: var(--text); }
.game-status.bad { color: var(--red); }

/* Barra de progreso de carga */
.load-bar {
  width: min(360px, 80%);
  height: 10px;
  background: #101218;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  overflow: hidden;
}
.load-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-deep));
  transition: width .25s ease;
}
.load-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

/* Aviso "build no publicado" */
.build-missing {
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: 52ch;
}
.build-missing h2 {
  font-size: 20px;
  color: var(--amber);
}
.build-missing p { color: var(--muted); font-size: 14.5px; }
.build-missing code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 8px;
  background: #101218;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  color: var(--gold);
}

/* Barra inferior del marco */
.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}
.game-bar-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.btn-fullscreen {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12px;
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}
.btn-fullscreen:hover { border-color: var(--green); color: var(--green); }

/* ---------- Panel lateral: torneo ---------- */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.side-panel h2 { font-size: 19px; }
.side-balance {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: #0a0b0e;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.side-balance .k {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-balance strong {
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.side-balance .eq { font-size: 12.5px; color: var(--faint); }

.side-note { color: var(--muted); font-size: 14px; }
.side-note strong { color: var(--text); }

@media (max-width: 940px) {
  .play-layout { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
}
