:root {
  color-scheme: dark;
  background: #000;
  font-family: Rubik, Arial, sans-serif;
  overscroll-behavior: none;
}

* { box-sizing: border-box; }

html, body, #game-shell {
  width: 100%;
  height: var(--game-height, 100%);
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-shell {
  position: relative;
  contain: strict;
}

#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  outline: 0;
  background: #89bde7;
}

#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  background: #000;
  opacity: 1;
  transition: opacity .32s ease, visibility .32s ease;
}

#loading.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.brand-logo {
  width: min(58vw, 285px);
  max-height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 7px 24px rgba(255, 188, 30, .18));
  animation: logo-in .72s cubic-bezier(.18, .9, .24, 1.18) both;
}

.presents {
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  animation: copy-in .42s .38s both;
}

.studio-logo {
  width: min(32vw, 148px);
  max-height: 42px;
  object-fit: contain;
  opacity: .92;
  animation: copy-in .52s .48s both;
}

.game-title {
  color: #fff4d7;
  font-size: clamp(23px, 6vw, 36px);
  font-weight: 800;
  text-shadow: 0 3px 0 #06101d;
  animation: copy-in .52s .66s both;
}

.track {
  width: min(72vw, 330px);
  height: 13px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  background: rgba(1, 7, 14, .7);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .35);
  animation: copy-in .42s .78s both;
}

#progress {
  width: 100%;
  height: 100%;
  transform: scaleX(.035);
  transform-origin: right center;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9b22, #ffe261);
  transition: transform .14s ease-out;
}

.loading-copy {
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  font-weight: 600;
  animation: copy-in .42s .86s both;
}

#unity-warning {
  position: absolute;
  z-index: 5;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  width: min(92%, 560px);
  transform: translateX(-50%);
}

#unity-warning:empty { display: none; }

#sound-unlock {
  position: absolute;
  z-index: 8;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  padding: 11px 16px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 999px;
  color: #071a2d;
  background: linear-gradient(180deg, #ffe66a, #ffad22);
  box-shadow: 0 6px 0 #9e5b0c, 0 10px 24px rgba(0,0,0,.34);
  font: 800 15px Rubik, Arial, sans-serif;
  cursor: pointer;
}

#sound-unlock.show { display: block; animation: copy-in .3s both; }
#sound-unlock:active { transform: translateY(4px); box-shadow: 0 2px 0 #9e5b0c; }

#unity-warning > div {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #102033;
  background: #ffe364;
  box-shadow: 0 7px 22px rgba(0, 0, 0, .28);
  font-size: 13px;
  font-weight: 700;
}

#unity-warning > .error { color: #fff; background: #d83c3c; }

@keyframes logo-in {
  from { opacity: 0; transform: translateY(14px) scale(.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes copy-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
