/* =========================================
   House On Chaos — Modern Unity WebGL Shell
   Drop-in replacement for TemplateData/style.css
   ========================================= */

/* ---- Base / Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: rgba(255, 255, 255, 0.92);

  /* Soft dark gradient background */
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(59, 130, 246, 0.25), transparent 55%),
    radial-gradient(900px 600px at 40% 90%, rgba(16, 185, 129, 0.18), transparent 60%),
    linear-gradient(180deg, #070A12 0%, #0B1020 45%, #070A12 100%);
}

/* Optional: reduce animations for people who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Layout container ---- */
#unity-container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
}

#unity-container.unity-desktop,
#unity-container.unity-mobile {
  width: 100%;
}

/* Card-like stage around the canvas + footer */
#unity-container::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.12) 1px, transparent 0);
  background-size: 22px 22px;
}

/* ---- Canvas ---- */
#unity-canvas {
  width: min(960px, 92vw);
  aspect-ratio: 16 / 10; /* keeps it sane before JS sets fixed px */
  height: auto;
  border-radius: 18px;

  /* Card frame */
  background: rgba(10, 14, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;

  outline: none;
}

/* Slight hover “lift” on desktop */
@media (hover: hover) and (pointer: fine) {
  #unity-canvas {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  }
  #unity-canvas:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.60),
      0 1px 0 rgba(255, 255, 255, 0.08) inset;
  }
}

/* ---- Loading Bar ---- */
#unity-loading-bar {
  width: min(960px, 92vw);
  margin-top: 14px;
  padding: 14px 16px 16px;
  border-radius: 16px;

  background: rgba(8, 12, 22, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 14px 45px rgba(0,0,0,0.45);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#unity-logo {
  height: 0; /* hide default */
  margin: 0;
}

/* Progress bar track */
#unity-progress-bar-empty {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

/* Progress bar fill */
#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  border-radius: 999px;

  background: linear-gradient(90deg,
    rgba(124, 58, 237, 0.95),
    rgba(59, 130, 246, 0.95),
    rgba(16, 185, 129, 0.90)
  );

  box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
  transition: width 120ms ease;
}

/* Subtle “shimmer” while loading */
#unity-progress-bar-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255,255,255,0.28) 40%,
    transparent 80%
  );
  transform: translateX(-100%);
  animation: hoc-shimmer 1.25s infinite;
}

@keyframes hoc-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(120%); }
}

/* ---- Warning / Error banners ---- */
#unity-warning {
  width: min(960px, 92vw);
  margin-top: 14px;
}

#unity-warning > div {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  font-size: 14px;
  line-height: 1.35;
}

/* If your JS sets inline background colors (red/yellow), keep text readable */
#unity-warning > div[style*="background: red"] {
  color: white;
  border-color: rgba(255, 255, 255, 0.22);
}
#unity-warning > div[style*="background: yellow"] {
  color: rgba(0,0,0,0.85);
}

/* ---- Footer ---- */
#unity-footer {
  width: min(960px, 92vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;

  border-radius: 16px;
  background: rgba(8, 12, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 12px 40px rgba(0,0,0,0.40);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#unity-build-title {
  font-weight: 650;
  letter-spacing: 0.2px;
  font-size: 14px;
  opacity: 0.92;
}

/* Hide default footer logo area (unless you add your own background image) */
#unity-logo-title-footer {
  width: 0;
  height: 0;
}

/* Fullscreen button as a nice pill */
#unity-fullscreen-button {
  width: auto;
  height: auto;
  cursor: pointer;
  user-select: none;

  padding: 10px 12px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);

  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

#unity-fullscreen-button::before {
  content: "⛶ Fullscreen";
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.95;
}

@media (hover: hover) and (pointer: fine) {
  #unity-fullscreen-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.20);
  }
  #unity-fullscreen-button:active {
    transform: translateY(0px);
  }
}

/* ---- Mobile tweaks ---- */
#unity-container.unity-mobile {
  padding: 12px;
}

#unity-container.unity-mobile #unity-footer,
#unity-container.unity-mobile #unity-loading-bar,
#unity-container.unity-mobile #unity-warning {
  width: min(960px, 96vw);
}

#unity-container.unity-mobile #unity-canvas {
  width: 100%;
  border-radius: 14px;
}

/* ---- Small screens ---- */
@media (max-width: 520px) {
  #unity-footer {
    flex-direction: column;
    align-items: stretch;
  }
  #unity-fullscreen-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
