/* =============================================================
   CycleMaster – WebGL template stylesheet
   Dark navy + amber theme, matching the in-game UI Toolkit UI.
   ============================================================= */

:root {
  --bg: #06090F;
  --panel: #0F1622;
  --line: #22314A;
  --accent: #FFB703;
  --accent-hi: #FFC94A;
  --on-accent: #0A0E15;
  --text: #E3EAF6;
  --muted: #93A2B8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------- Game canvas ---------------------------- */
/* Fills the whole browser window by default (windowed "fullscreen");
   the player can press F or use the corner button for real fullscreen. */
#unity-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

#unity-canvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  outline: none;
  background: #231F20;
}

/* --------------------------- Loading screen -------------------------- */
#loader {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1100px 640px at 50% 34%, rgba(255, 183, 3, 0.10), rgba(255, 183, 3, 0) 62%),
    radial-gradient(900px 520px at 50% 112%, rgba(22, 34, 54, 0.9), rgba(22, 34, 54, 0) 70%),
    linear-gradient(180deg, #080C14 0%, #06090F 55%, #04070C 100%);
  opacity: 1;
  transition: opacity 0.6s ease;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

.loader-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loader-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(420px, 72vw);
  max-height: 44vh;
  filter: drop-shadow(0 14px 38px rgba(0, 0, 0, 0.6));
}

.loader-tagline {
  margin-top: 38px;
  margin-right: -0.5em;
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--muted);
}

.loader-bar {
  position: relative;
  width: min(460px, 72vw);
  height: 8px;
  margin-top: 46px;
  overflow: hidden;
  background: #131C2B;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.loader-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #E09E00 0%, #FFB703 55%, #FFD264 100%);
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.55);
  transition: width 0.25s ease;
}

.loader-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
  animation: glint 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes glint {
  100% {
    transform: translateX(100%);
  }
}

.loader-meta {
  display: flex;
  justify-content: space-between;
  width: min(460px, 72vw);
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
}

#loader-percent {
  font-weight: 700;
  color: var(--accent);
}

#loader-error {
  display: none;
  max-width: 520px;
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(142, 36, 24, 0.25);
  border: 1px solid rgba(224, 96, 79, 0.6);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
  color: #FF9A8C;
}

.loader-watermark {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.25);
}

/* ---------------------- Fullscreen hint (post-load) ---------------------- */
#fullscreen-hint {
  position: absolute;
  right: 0;
  bottom: 42px;
  left: 0;
  z-index: 10;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#fullscreen-hint.visible {
  opacity: 1;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%,
  100% {
    color: rgba(255, 255, 255, 0.45);
  }
  50% {
    color: var(--accent);
  }
}

/* ------------------------- Warning / banners ------------------------- */
#unity-warning {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: none;
  text-align: center;
}

.banner {
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.banner--error {
  background: #8E2418;
  color: #FFECE8;
}

.banner--warning {
  background: #7A6210;
  color: #FFF6E0;
}

/* ------------------------- HUD around the game ------------------------- */
#unity-build-title {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 15;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.3);
}

.unity-mobile #unity-build-title {
  display: none;
}

#fullscreen-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(10, 15, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.15s ease, border-color 0.15s ease;
}

#fullscreen-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#fullscreen-button:hover {
  background: rgba(16, 24, 38, 0.95);
  border-color: var(--accent);
}

#fullscreen-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #E3EAF6;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s ease;
}

#fullscreen-button:hover svg {
  stroke: var(--accent);
}

#diagnostics-icon {
  position: absolute;
  right: 0;
  bottom: 10px;
  z-index: 25;
  cursor: pointer;
}

