html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0b0908;
}

/* Layered "stone chamber" backdrop: tiled brick tint, warm glow, corner vignette. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(96, 70, 40, 0.22), rgba(0, 0, 0, 0) 62%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, 0.82) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 62px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 118px),
    linear-gradient(160deg, #16110d 0%, #0b0908 58%, #070605 100%);
}

/* Fill the whole browser window; the game scales its own UI to whatever ratio it gets.
   index.html seeds the canvas backing size from this box before Unity starts, so the
   first frame already matches the viewport instead of the hardcoded 1920x1080. */
#unity-container {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #0b0908;
  outline: none;
}

/* -------------------------------------------------------------- loading screen */
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  width: min(560px, 82vw);
  padding: 38px 40px 34px;
  text-align: center;
  border: 1px solid rgba(201, 164, 95, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 26px 70px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 88, 48, 0.18), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #17120e, #0f0c09);
  font-family: Georgia, "Times New Roman", serif;
  color: #e9ddc6;
  z-index: 10;
}

#unity-loading-bar::before,
#unity-loading-bar::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 201, 127, 0.7), transparent);
}
#unity-loading-bar::before { top: 10px; }
#unity-loading-bar::after { bottom: 10px; }

/* Branded hold that covers Unity's mandatory "Made with Unity" splash. */
#unity-loading-bar.is-leaving {
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

.loader-crest {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border: 2px solid #c9a45f;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 4px #0f0c09, inset 0 0 0 5px rgba(201, 164, 95, 0.55);
}

.loader-title {
  font-size: 64px;
  line-height: 1;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #f0d9a0;
  text-shadow: 0 2px 0 #000, 0 0 26px rgba(217, 119, 58, 0.28);
}

.loader-sub {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #8a6b3c;
}

#unity-progress-bar-empty {
  position: relative;
  width: 100%;
  height: 8px;
  margin: 30px 0 0;
  background: #0a0806;
  border: 1px solid rgba(201, 164, 95, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

#unity-progress-bar-full {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #8a6b3c, #e8c97f 55%, #b08a4a);
  box-shadow: 0 0 12px rgba(232, 201, 127, 0.55);
  transition: width 0.18s linear;
}

.loader-line {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #a2917a;
}

/* -------------------------------------------------------------- footer / chrome */
/* Small floating corner badge instead of taking vertical space from the game. */
#unity-footer {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  border: 1px solid rgba(138, 107, 60, 0.35);
  border-radius: 3px;
  background: rgba(11, 9, 8, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8a7f6d;
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.game-ready #unity-footer { opacity: 1; }

#unity-build-title {
  line-height: 24px;
}

#unity-fullscreen-button {
  cursor: pointer;
  pointer-events: auto;
  color: #c9a45f;
  user-select: none;
}

#unity-fullscreen-button:hover { color: #f0d9a0; }

#unity-webgl-logo {
  display: none;
}

/* -------------------------------------------------------------- banners / errors */
#unity-warning {
  position: absolute;
  left: 50%;
  top: 2%;
  transform: translateX(-50%);
  z-index: 30;
  max-width: 90vw;
  display: none;
}

#unity-warning div {
  margin-bottom: 6px;
  padding: 10px 16px;
  border: 1px solid rgba(201, 164, 95, 0.5);
  background: #17120e;
  color: #e9ddc6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
}

#unity-warning .warn-error { border-color: #c0503c; color: #f0c8bd; }
#unity-warning .warn-warning { border-color: #c9a45f; color: #f0d9a0; }

#greed-error {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 5, 4, 0.9);
}

#greed-error[hidden] { display: none; }

.err-card {
  width: min(520px, 86vw);
  padding: 30px 32px;
  text-align: center;
  border: 1px solid #8a6b3c;
  background: linear-gradient(180deg, #17120e, #0f0c09);
  font-family: Georgia, "Times New Roman", serif;
  color: #e9ddc6;
}

.err-title {
  font-size: 20px;
  letter-spacing: 0.18em;
  color: #f0d9a0;
  margin-bottom: 14px;
}

.err-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #a2917a;
  word-break: break-word;
}

.err-card button {
  margin-top: 18px;
  padding: 12px 34px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: #0d0b09;
  background: linear-gradient(180deg, #e8c97f, #b08a4a);
  border: 1px solid #f0d9a0;
}

.err-card button:hover { background: linear-gradient(180deg, #f0d9a0, #c9a45f); }

/* -------------------------------------------------------------- small screens */
@media (max-width: 640px) {
  .loader-title { font-size: 42px; }
  .loader-sub { font-size: 10px; letter-spacing: 0.3em; }
  #unity-loading-bar { padding: 26px 22px 22px; }
  #unity-build-title { display: none; }
  #unity-footer { right: 8px; bottom: 8px; }
}
