@font-face {
  font-family: "Archivo";
  src: url("archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ink: #0e2238;
  --navy: #004a8d;
  --navy-deep: #00305e;
  --night: #041a33;
  --sky: #5fc0ff;
  --bar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: #dbe8f5;
  font-family: "Archivo", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 3px; }

/* Barra superior */
.pts-bar {
  height: var(--bar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--navy-deep);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.pts-bar .brand img { height: 44px; width: auto; display: block; }
.pts-bar .actions { display: flex; gap: .5rem; }
.pts-bar a, .pts-bar button {
  font: inherit;
  font-size: .9rem;
  color: #dbe8f5;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  padding: .45rem .9rem;
  text-decoration: none;
  cursor: pointer;
}
.pts-bar a:hover, .pts-bar button:hover { background: rgba(255,255,255,.08); color: #fff; }
.pts-bar button[disabled] { opacity: .45; cursor: default; }

/* Escenario: el canvas mantiene la proporción 16:10 del build y ocupa el máximo posible */
.pts-stage {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 1rem;
  min-height: 0;
  background: radial-gradient(900px 500px at 50% 45%, rgba(95,192,255,.08), transparent 70%);
}
#unity-container {
  position: relative;
  width: min(100%, calc((100vh - var(--bar-h) - 2rem) * 1.6));
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  background: #000;
}
#unity-canvas { width: 100%; height: 100%; display: block; background: #000; }

/* Pantalla de carga */
#pts-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  background: radial-gradient(700px 400px at 50% 40%, #0a3a6e, var(--night));
  text-align: center;
  padding: 2rem;
}
#pts-loading img { width: min(340px, 60%); height: auto; }
.pts-progress {
  width: min(360px, 70%);
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}
.pts-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--sky);
  box-shadow: 0 0 12px rgba(95,192,255,.7);
  transition: width .2s ease;
}
#pts-status { margin: 0; font-size: .95rem; color: #a9c3dd; min-height: 1.4em; }

/* Mensajes de Unity */
#unity-warning {
  position: absolute;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  display: none;
  width: min(90%, 640px);
  z-index: 5;
}
#unity-warning div {
  margin-bottom: .5rem;
  padding: .75rem 1rem;
  border-radius: 6px;
  background: #fff4c2;
  color: var(--ink);
  font-size: .92rem;
}
#unity-warning div.error { background: #ffd9d6; }

/* Aviso de pantalla pequeña */
.pts-small-note {
  display: none;
  margin: 0;
  padding: .6rem 1rem;
  font-size: .85rem;
  text-align: center;
  background: #0a3a6e;
  color: #dbe8f5;
}

/* Móvil: el canvas ocupa toda la pantalla */
body.is-mobile .pts-stage { padding: 0; }
body.is-mobile #unity-container {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}
body.is-mobile .pts-small-note { display: block; }
body.is-mobile .pts-bar .fullscreen { display: none; }
