/* The page around the game (index.html, from Assets/WebGLTemplates/BattleBros/): the canvas, and
   the loading screen shown until the game has started (boot.js). The logo and colours are the
   game's title screen (Client/Style.cs), so loading ends where the game begins. */

/* Bungee for the logo: our own copy (fonts/, SIL Open Font License, fonts/OFL-Bungee.txt). */
@font-face {
  font-family: 'Bungee';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/bungee-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0b0d12;
  --text: #f2f4f8;
  --muted: rgba(242, 244, 248, 0.62);
  --accent: #ffb020;
  --accent-2: #ff5a3a;
  --gold: #ffd34d;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#unity-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  background: var(--bg);
  outline: none;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(ellipse at center, #171b26 0%, var(--bg) 70%);
  transition: opacity 0.35s ease;
}

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

.logo {
  text-align: center;
  font-family: 'Bungee', Impact, sans-serif;
  transform: rotate(-4deg);
  animation: logo-bob 3s ease-in-out infinite;
}

.logo-top, .logo-bottom {
  line-height: 0.9;
  background: linear-gradient(180deg, #fff3b0 0%, var(--gold) 40%, var(--accent) 70%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 #3a1608) drop-shadow(0 0 2px #3a1608) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}

.logo-top { font-size: clamp(40px, 7vw, 88px); }
.logo-bottom { font-size: clamp(60px, 12vw, 150px); }

.logo-sub {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

#bar {
  margin-top: 36px;
  width: min(70vw, 340px);
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#fill {
  width: 0;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 0.2s ease;
}

#status {
  margin-top: 12px;
  min-height: 1.3em;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#err {
  margin-top: 8px;
  max-width: min(80vw, 480px);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #ff8a7a;
}

#err:empty { display: none; }
#loading.failed #bar { display: none; }

.noscript {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 6;
  text-align: center;
  color: var(--text);
  font: 600 15px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Phones held sideways: everything a bit smaller so it fits. */
@media (max-height: 440px) {
  .logo-top { font-size: clamp(30px, 6vw, 56px); }
  .logo-bottom { font-size: clamp(46px, 10vw, 92px); }
  .logo-sub { margin-top: 10px; }
  #bar { margin-top: 20px; }
}

@keyframes logo-bob {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
}
