:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  background: #3d160d;
  color: #fff8e7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #3d160d;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

#unity-container {
  position: relative;
  width: min(calc(100vw - 24px), calc((100vh - 24px) * 9 / 16), 720px);
  width: min(calc(100vw - 24px), calc((100dvh - 24px) * 9 / 16), 720px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #2b0e08;
  border: 3px solid #f0a320;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgb(15 3 1 / 55%);
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #3d160d;
}

#loading-screen,
#initialization-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: clamp(28px, 8vw, 64px);
  text-align: center;
  background: #3d160d;
}

#loading-screen[hidden],
#initialization-error[hidden] {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: clamp(72px, 22vw, 112px);
  aspect-ratio: 1;
  color: #fff8e7;
  background: #bd1f13;
  border: 4px solid #f0a320;
  border-radius: 28%;
  box-shadow: 0 9px 0 #7d150e;
  font-size: clamp(28px, 9vw, 48px);
  font-weight: 900;
  letter-spacing: -0.08em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #fff8e7;
  font-size: clamp(34px, 10vw, 58px);
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  color: #fff8e7;
  font-size: clamp(28px, 8vw, 44px);
}

p {
  max-width: 34rem;
  color: #f5ddb0;
  font-size: clamp(16px, 4.5vw, 22px);
  line-height: 1.45;
}

.progress-track {
  width: min(78%, 360px);
  height: 18px;
  margin-top: 8px;
  overflow: hidden;
  background: #260b06;
  border: 2px solid #f5ddb0;
  border-radius: 999px;
}

#loading-progress {
  width: 0;
  height: 100%;
  background: #f0a320;
  transition: width 180ms ease-out;
}

#initialization-error {
  background: #57180f;
}

a {
  color: #ffd366;
  font-weight: 800;
}

#unity-warning {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  left: 12px;
  padding: 12px 16px;
  color: #2b0e08;
  background: #ffd366;
  border-radius: 10px;
  font-weight: 700;
}

#unity-warning[hidden]:empty,
#unity-warning:empty {
  display: none;
}

#unity-warning[data-type="error"] {
  color: #fff8e7;
  background: #bd1f13;
}

@media (max-width: 520px) {
  body {
    padding: 0;
  }

  #unity-container {
    width: min(100vw, calc(100dvh * 9 / 16));
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #loading-progress {
    transition: none;
  }
}
