:root {
  --zero-bg: #040914;
  --zero-card: rgba(8, 17, 36, 0.88);
  --zero-border: rgba(94, 178, 255, 0.34);
  --zero-gold: #e6c36e;
  --zero-cyan: #57c7ff;
  --zero-text: #eaf3ff;
  --zero-muted: #8ea9cc;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, #0c1d3d 0%, var(--zero-bg) 72%);
  color: var(--zero-text);
  font-family: "Segoe UI", "Noto Sans Thai", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#zero-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zero-bg);
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
  background: var(--zero-bg);
}

#zero-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 35%, rgba(16, 40, 82, 0.92), rgba(4, 9, 20, 0.98));
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

#zero-loader.zero-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.zero-loader-card {
  width: min(460px, 92vw);
  padding: 26px 24px 22px;
  border-radius: 16px;
  background: var(--zero-card);
  border: 1px solid var(--zero-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
}

.zero-emblem {
  font-size: 11px;
  letter-spacing: 0.28em;
  font-weight: 700;
  color: var(--zero-gold);
  margin-bottom: 6px;
}

.zero-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.zero-subtitle {
  font-size: 13px;
  color: var(--zero-muted);
  margin-bottom: 16px;
  min-height: 18px;
}

.zero-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(87, 199, 255, 0.25);
  overflow: hidden;
}

.zero-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b8cff 0%, var(--zero-cyan) 60%, var(--zero-gold) 100%);
  box-shadow: 0 0 12px rgba(87, 199, 255, 0.65);
  transition: width 0.14s linear;
}

.zero-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--zero-muted);
}

#zero-progress-pct {
  color: var(--zero-text);
  font-weight: 600;
}

#zero-banner {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
  word-break: break-word;
}

.zero-banner-err {
  background: rgba(185, 28, 28, 0.28);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.zero-banner-warn {
  background: rgba(202, 138, 4, 0.25);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: #fef08a;
}

#zero-retry {
  margin-top: 12px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--zero-gold);
  background: rgba(230, 195, 110, 0.16);
  color: var(--zero-gold);
  font-weight: 600;
  cursor: pointer;
}

#zero-fs-btn, #zero-diag-btn {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 10;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 12, 28, 0.55);
  color: rgba(234, 243, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

#zero-fs-btn {
  right: max(10px, env(safe-area-inset-right));
}

#zero-diag-btn {
  right: calc(max(10px, env(safe-area-inset-right)) + 42px);
}
