/* Necro Empire · plantilla WebGL (Bloque Web 1). Colores del tema del juego (UiKit.Theme). */
:root {
  --bg: #020204;
  --bg-2: #0b0716;
  --text: #e6ded0;
  --dim: #9a9284;
  --gold: #cca873;
  --soul: #78dbab;
  --soul-deep: #1f6b4c;
  --danger: #d9655a;
  --serif: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); }

#necro-root { position: fixed; inset: 0; --strip: 30px; }
/* El lienzo ocupa toda la ventana menos una franja inferior (marca y pantalla completa) que nunca tapa la interfaz del juego.
   Unity ajusta la resolución al tamaño real (y al zoom del navegador). */
#unity-canvas { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - var(--strip)); display: block; background: var(--bg); outline: none; }

/* ---------- pantalla de carga ---------- */
#necro-loader {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10;
  background: radial-gradient(ellipse at 50% 42%, #14102a 0%, var(--bg-2) 38%, var(--bg) 78%);
  transition: opacity .7s ease, visibility .7s;
}
#necro-loader.necro-hidden, #necro-error[hidden] { opacity: 0; visibility: hidden; pointer-events: none; }
.necro-mist {
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 30% 70%, rgba(120, 219, 171, .07), transparent 40%),
    radial-gradient(circle at 72% 30%, rgba(204, 168, 115, .05), transparent 38%);
  animation: necro-drift 14s ease-in-out infinite alternate;
}
@keyframes necro-drift { from { transform: translate3d(-2%, 1%, 0) scale(1); } to { transform: translate3d(2%, -1%, 0) scale(1.06); } }

.necro-loader-inner { position: relative; width: min(560px, 88vw); text-align: center; }
.necro-studio {
  margin: 0; display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--serif); font-size: 13px; letter-spacing: .5em; color: var(--gold);
}
.necro-rule { display: inline-block; width: 56px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.necro-presents { margin: 6px 0 22px; font-size: 12px; letter-spacing: .3em; color: var(--dim); text-transform: uppercase; }
.necro-emblem {
  width: 148px; height: 148px; border-radius: 50%;
  filter: drop-shadow(0 0 22px rgba(120, 219, 171, .35));
  animation: necro-breathe 3.2s ease-in-out infinite;
}
@keyframes necro-breathe { 50% { filter: drop-shadow(0 0 34px rgba(120, 219, 171, .55)); transform: scale(1.025); } }
.necro-title {
  margin: 18px 0 28px; font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 6vw, 58px); letter-spacing: .14em;
  color: var(--text); text-shadow: 0 0 24px rgba(120, 219, 171, .25), 0 2px 0 #000; text-transform: uppercase;
}
.necro-bar {
  position: relative; height: 10px; border-radius: 6px; overflow: hidden;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(204, 168, 115, .35);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .8);
}
.necro-bar-fill {
  height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--soul-deep), var(--soul));
  box-shadow: 0 0 14px rgba(120, 219, 171, .6);
  transition: width .25s ease-out;
}
.necro-bar-fill::after {
  content: ""; display: block; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: necro-shine 1.6s linear infinite;
}
@keyframes necro-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.necro-status { margin: 14px 0 0; display: flex; justify-content: space-between; font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
.necro-hint { margin: 34px 0 0; font-size: 12px; color: #6d675e; letter-spacing: .02em; }

/* ---------- errores ---------- */
#necro-error {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, #1a0f14 0%, var(--bg) 75%);
}
.necro-error-box {
  width: min(520px, 100%); padding: 32px 28px; text-align: center; border-radius: 10px;
  background: rgba(10, 8, 14, .92); border: 1px solid rgba(217, 101, 90, .45); box-shadow: 0 12px 48px rgba(0, 0, 0, .7);
}
.necro-error-emblem { border-radius: 50%; opacity: .85; filter: grayscale(.6); }
.necro-error-box h2 { margin: 14px 0 10px; font-family: var(--serif); font-size: 24px; letter-spacing: .06em; color: var(--text); }
.necro-error-box p { margin: 8px 0; line-height: 1.5; color: var(--text); }
.necro-error-box .necro-error-help { color: var(--dim); font-size: 14px; }
.necro-error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.necro-error-actions button, #necro-fullscreen {
  font: inherit; cursor: pointer; color: var(--text); border-radius: 6px; padding: 9px 18px;
  background: rgba(204, 168, 115, .12); border: 1px solid rgba(204, 168, 115, .5);
}
.necro-error-actions button:hover, #necro-fullscreen:hover { background: rgba(204, 168, 115, .24); }
#necro-error-details { margin-top: 18px; text-align: left; color: var(--dim); font-size: 12px; }
#necro-error-details pre { white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; background: #000; padding: 8px; border-radius: 4px; }

/* ---------- barra inferior y avisos ---------- */
#necro-bar-ui {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--strip); z-index: 30; display: flex; align-items: center; justify-content: flex-end;
  gap: 14px; padding: 0 10px; font-size: 12px; color: var(--dim); background: #060509; border-top: 1px solid rgba(204, 168, 115, .18);
}
.necro-brand { color: var(--gold); text-decoration: none; font-family: var(--serif); letter-spacing: .12em; }
.necro-brand:hover { text-decoration: underline; }
#necro-fullscreen { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 12px; background: transparent; }
.necro-hint-keys { margin-right: auto; color: #5d584f; }

#necro-toasts { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; width: min(560px, 92vw); }
.necro-toast { padding: 10px 14px; border-radius: 6px; font-size: 14px; background: rgba(10, 8, 14, .92); border: 1px solid rgba(120, 219, 171, .4); }
.necro-toast-warning { border-color: rgba(204, 168, 115, .7); }

@media (prefers-reduced-motion: reduce) {
  .necro-mist, .necro-emblem, .necro-bar-fill::after { animation: none; }
}
