/* ===== DOC03 AR 지도 애니메이션 (js/terminal/views/doc03.js, js/doc03/cinema.js) =====
 * 종이지도가 주인공. 얇은 홀로그램, 녹색 경로 + 청백색 보조 발광, 종이에 붙은 그림자.
 * 화면 버튼은 작게, 지도를 가리지 않게.
 */
.c3 { display: flex; flex-direction: column; gap: 12px; }

.c3-stage {
  position: relative;
  overflow: hidden;
  height: min(70vh, 620px);
  min-height: 320px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, rgba(0, 183, 255, .1), #000a14 72%);
  contain: layout paint;
  touch-action: manipulation;
}
.c3-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.c3.is-digital .c3-video { display: none; }

/* 탐색 중 안내 모서리 (인식되면 사라짐) */
.c3-reticle { position: absolute; inset: 14% 10%; pointer-events: none; opacity: 0; transition: opacity .3s; }
.c3-stage[data-status="scanning"] .c3-reticle { opacity: .7; }
.c3-reticle i { position: absolute; width: 26px; height: 26px; border: 2px solid rgba(160, 235, 255, .85); }
.c3-reticle i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.c3-reticle i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.c3-reticle i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.c3-reticle i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }

.c3-status {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 10, 20, .62);
  color: #eaf6ff;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.c3-status:empty, .c3-stage[data-status="tracking"] .c3-status { display: none; }

.c3-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px;
  z-index: 5;
}
.c3-btn {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(160, 235, 255, .45);
  border-radius: 999px;
  background: rgba(0, 10, 20, .58);
  color: #eaf6ff;
  font: inherit;
  font-size: 15px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.c3-btn:active { transform: scale(.97); }
.c3-btn:focus-visible { outline: 2px solid #00DC84; outline-offset: 2px; }
.c3-btn--primary { background: linear-gradient(135deg, #00DC84, #00b7ff); border-color: transparent; color: #00140b; font-weight: 700; }
.c3-btn[hidden] { display: none; }

.c3-help { padding: 14px 16px; border: 1px solid rgba(0, 183, 255, .28); border-radius: 14px; color: rgba(234, 246, 255, .8); font-size: 14px; }
.c3-help__title { margin: 0 0 6px; color: #eaf6ff; font-weight: 700; }
.c3-help ul { margin: 0 0 12px; padding-left: 18px; line-height: 1.6; }
.c3-help .c3-btn { width: 100%; }

/* ---------- 종이에 붙는 층 (문서 크기, matrix3d) ---------- */
.c3-overlay {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}
.c3-overlay[hidden], .c3-pop[hidden] { display: none; }
.c3-paper { position: absolute; inset: 0; display: none; }
.c3-overlay.is-digital .c3-paper { display: block; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }

.c3-edge {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(160, 240, 255, .9);
  box-shadow: 0 0 22px rgba(0, 183, 255, .8), inset 0 0 26px rgba(0, 183, 255, .5);
  opacity: 0;
}
.c3-scan {
  position: absolute;
  left: 0;
  top: -40px;
  width: 100%;
  height: 80px;
  opacity: 0;
}
.c3-scan i {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 183, 255, .12) 40%, rgba(230, 252, 255, .95) 50%, rgba(0, 220, 132, .14) 60%, transparent);
}

/* 인쇄 도로·선화 마스크 위로 번지는 빛 */
.c3-mask {
  position: absolute;
  overflow: hidden;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.c3-mask .c3-base { position: absolute; inset: 0; opacity: 0; }
.c3-mask .c3-wave { position: absolute; border-radius: 50%; opacity: 0; transform: scale(.001); }
.c3-roads .c3-base { background: rgba(120, 225, 255, .13); }
.c3-roads .c3-wave { background: radial-gradient(circle, transparent 0 55%, rgba(0, 220, 132, .45) 63%, rgba(225, 252, 255, 1) 68%, rgba(0, 183, 255, .5) 71%, transparent 75%); }
.c3-lines .c3-base { background: rgba(170, 230, 255, .16); }
.c3-lines .c3-wave { background: radial-gradient(circle, transparent 0 58%, rgba(220, 248, 255, .95) 67%, rgba(0, 183, 255, .35) 70%, transparent 73%); }
.c3-overlay.is-ambient .c3-roads .c3-base { animation: c3-breathe 5.2s ease-in-out infinite; }
.c3-overlay.is-ambient .c3-lines .c3-base { animation: c3-breathe 6.8s ease-in-out -2s infinite; }
@keyframes c3-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.c3-svg { position: absolute; inset: 0; overflow: visible; }
.c3-shadows polygon, .c3-ship-shadow { fill: #001428; filter: url(#c3-soft); opacity: 0; }
.c3-overlay.is-low .c3-shadows polygon, .c3-overlay.is-low .c3-ship-shadow { filter: none; }
.c3-route, .c3-route-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.c3-route { stroke: #eafff6; stroke-width: 3; }
.c3-route-glow { stroke: #00DC84; stroke-width: 12; opacity: .5; }
.c3-pulse {
  fill: none;
  stroke: #ffffff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: .035 2;
  stroke-dashoffset: .035;
  opacity: 0;
  filter: drop-shadow(0 0 6px #00DC84);
}
.c3-overlay.is-ambient .c3-pulse { opacity: 1; animation: c3-pulse 7s linear infinite; }
.c3-overlay.is-ambient .c3-pulse--2 { animation-delay: -3.6s; animation-duration: 9s; }
@keyframes c3-pulse { 0% { stroke-dashoffset: .035; } 45%, 100% { stroke-dashoffset: -1.05; } }
.c3-overlay.is-low .c3-pulse { filter: none; }

.c3-online { opacity: 0; }
.c3-online rect { fill: rgba(0, 10, 20, .62); stroke: rgba(160, 240, 255, .7); }
.c3-online circle { fill: #00DC84; }
.c3-online text { fill: #eafcff; font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }

/* ---------- 화면 공간: 솟아오른 건물·탐사선 ---------- */
.c3-pop { position: absolute; inset: 0; pointer-events: none; }
.c3-lm { position: absolute; inset: 0; }
.c3-lm[hidden] { display: none; }
.c3-walls, .c3-top, .c3-fly { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.c3-walls polygon { stroke: rgba(170, 236, 255, .75); stroke-width: 1; stroke-linejoin: round; opacity: .94; }
.c3-roof { position: absolute; left: 0; top: 0; overflow: hidden; transform-origin: 0 0; }
.c3-roof img { position: absolute; max-width: none; }
.c3-top polygon { fill: rgba(150, 230, 255, .12); stroke: #bff3ff; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(0, 183, 255, .9)); }
.c3-lm--field .c3-top polygon { fill: rgba(0, 220, 132, .14); stroke: #9dffd6; }
.c3-pop.is-low .c3-top polygon { filter: none; }
.c3-beacon { fill: #00DC84; opacity: 0; }
.c3-pop.is-ambient .c3-beacon { animation: c3-blink 2.6s ease-in-out infinite; }
@keyframes c3-blink { 0%, 62%, 100% { opacity: 0; } 70%, 82% { opacity: 1; } }

.c3-trail { fill: none; stroke-width: 4; stroke-linecap: round; }
.c3-flash { fill: none; stroke: #dffcff; stroke-width: 2; opacity: 0; }
.c3-ship { filter: drop-shadow(0 0 5px rgba(127, 245, 255, .85)); }
.c3-pop.is-low .c3-ship { filter: none; }
.c3-engine { animation: c3-engine .18s ease-in-out infinite alternate; }
@keyframes c3-engine { to { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  .c3-overlay.is-ambient .c3-roads .c3-base,
  .c3-overlay.is-ambient .c3-lines .c3-base,
  .c3-overlay.is-ambient .c3-pulse,
  .c3-pop.is-ambient .c3-beacon,
  .c3-engine { animation: none; }
  .c3-overlay.is-ambient .c3-pulse { opacity: 0; }
}
