:root {
  color-scheme: dark;
  background: #091315;
  font-family: system-ui, sans-serif;
}

html, body, #unity-container {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #091315;
}

#gate {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 34%, #17383a, #091315 68%);
  color: #f4d08b;
}

#gate[hidden] { display: none; }

.gate-card {
  width: min(100%, 380px);
  text-align: center;
}

.gate-emblem {
  color: #d77834;
  font-size: 38px;
  line-height: 1;
}

.gate-card h1 {
  margin: 10px 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .16em;
}

.gate-prompt {
  margin: 0;
  color: #abc2b9;
  font-size: 14px;
}

#gesture-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: min(76vw, 300px);
  height: min(76vw, 300px);
  margin: 28px auto 10px;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.gesture-dot {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid #8db7a7;
  border-radius: 50%;
  background: #183537;
  box-shadow: 0 0 0 16px transparent;
}

.gesture-dot.selected {
  border-color: #ffd68d;
  background: #e18a45;
  box-shadow: 0 0 0 8px #d7783433;
}

#gesture-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: #d77834;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#gesture-tail { visibility: hidden; opacity: .55; }
#gesture-grid.invalid #gesture-lines { stroke: #e25c59; }
#gesture-grid.invalid .gesture-dot.selected { border-color: #e25c59; background: #e25c59; }

#gesture-status {
  min-height: 22px;
  margin: 0;
  color: #abc2b9;
  font-size: 14px;
}

#unity-container {
  position: fixed;
  inset: 0;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: {{{ BACKGROUND_COLOR }}};
  touch-action: none;
}

#unity-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  background: #091315;
  color: #f4d08b;
}

.artifact-mark {
  font-size: 52px;
  color: #d77834;
}

.loading-label {
  font-size: 16px;
  letter-spacing: .16em;
}

.loading-track {
  width: min(58vw, 320px);
  height: 8px;
  overflow: hidden;
  border: 1px solid #2c6664;
  border-radius: 99px;
}

#unity-progress {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2aa09a, #e18138);
}

#unity-warning {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  max-width: 82%;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #f2c96b;
  color: #25180a;
  font-size: 13px;
}

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