/**
 * Stage 3 Data — chart + cargo + map
 */
:root {
  --s3-ink: #1a2b49;
  --s3-muted: #64748b;
  --s3-bg: #f4f7fb;
  --s3-coral: #ff6b4a;
  --s3-blue: #4a90e2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  color: var(--s3-ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(74, 144, 226, 0.15), transparent 40%),
    radial-gradient(circle at 88% 20%, rgba(80, 227, 194, 0.12), transparent 38%),
    var(--s3-bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.s3-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.s3-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.s3-nav a {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  color: var(--s3-muted);
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(26, 43, 73, 0.08);
}

.s3-hero {
  text-align: center;
  margin-bottom: 14px;
}

.s3-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(26, 43, 73, 0.08);
  margin-bottom: 8px;
}

.s3-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  font-weight: 900;
}

.s3-hero p {
  margin: 0;
  font-size: 14px;
  color: var(--s3-muted);
  line-height: 1.5;
}

.s3-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 14px 40px rgba(26, 43, 73, 0.08);
  padding: 18px 16px 22px;
  border: 1px solid rgba(26, 43, 73, 0.06);
}

.s3-hud {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--s3-muted);
  margin-bottom: 10px;
}

.s3-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.s3-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
}

.s3-dot.on {
  background: var(--s3-blue);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
}

.s3-dot.done { background: #34d399; }

.s3-title {
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 6px;
}

.s3-prompt {
  text-align: center;
  font-size: clamp(0.95rem, 3vw, 1.05rem);
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 14px;
}

.s3-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .s3-grid { grid-template-columns: 1fr; }
}

.s3-panel {
  background: #f8fafc;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid #e2e8f0;
}

.s3-chart-inner {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  min-height: 220px;
}

.s3-y-axis {
  position: relative;
  border-right: 2px solid #94a3b8;
}

.s3-tick {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(50%);
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  text-align: right;
  padding-right: 4px;
}

.s3-tick::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 6px;
  height: 1px;
  background: #94a3b8;
}

.s3-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  border-bottom: 2px solid #94a3b8;
  padding: 0 4px 4px;
  min-height: 200px;
}

.s3-bar {
  appearance: none;
  border: none;
  background: transparent;
  flex: 1;
  max-width: 64px;
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.s3-bar-fill {
  width: 100%;
  height: var(--bar-h);
  min-height: 8px;
  border-radius: 10px 10px 4px 4px;
  background: var(--bar-c);
  border: 2px solid rgba(26, 43, 73, 0.15);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.s3-bar.is-on .s3-bar-fill {
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.35), 0 8px 18px rgba(26, 43, 73, 0.15);
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.s3-bar-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--s3-ink);
}

.s3-bar-val {
  font-size: 12px;
  font-weight: 900;
  color: var(--s3-muted);
}

.s3-x-label {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--s3-muted);
  margin-top: 8px;
}

.s3-gauge-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--s3-ink);
}

.s3-gauge-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #e2e8f0;
}

.s3-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1.5px dashed #cbd5e1;
  background: #f8fafc;
}

.s3-cell.is-filled {
  border-style: solid;
  border-color: rgba(26, 43, 73, 0.2);
}

.s3-cell.is-need {
  border-color: var(--s3-coral);
  background: #fff7ed;
  animation: s3-blink 1s ease infinite;
}

.s3-gauge-track.is-exact {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.s3-gauge-track.is-over {
  border-color: #f43f5e;
  background: #fff1f2;
}

.s3-gauge-track.is-under {
  border-color: #f59e0b;
}

.s3-gauge-track.is-shake {
  animation: s3-shake 0.45s ease;
}

.s3-sum {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--s3-muted);
  margin: 8px 0 0;
}

.s3-map-label {
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.s3-map-stage {
  position: relative;
  height: 200px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #e0f2fe, #ecfdf5);
  border: 2px solid #bae6fd;
  overflow: hidden;
}

.s3-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.s3-route-line {
  stroke: #1a2b49;
  stroke-width: 1.2;
  stroke-dasharray: 3 2;
  opacity: 0.7;
}

.s3-node {
  position: absolute;
  transform: translate(-50%, -50%);
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 900;
  color: var(--s3-ink);
  padding: 4px;
}

.s3-node-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--node-c);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(26, 43, 73, 0.2);
}

.s3-node.is-on .s3-node-dot {
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.35), 0 4px 12px rgba(26, 43, 73, 0.2);
  transform: scale(1.15);
}

.s3-drone {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  transition: left 0.9s cubic-bezier(0.22, 1, 0.36, 1), top 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}

.s3-drone.is-flying {
  opacity: 1;
}

.s3-feedback {
  text-align: center;
  min-height: 2.8em;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 14px;
  margin: 8px 0;
}

.s3-feedback.is-ok {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
}

.s3-feedback.is-bad {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  color: #9f1239;
}

.s3-feedback.is-hint {
  background: #eff6ff;
  color: #1e3a8a;
}

.s3-reflect {
  margin: 8px 0;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #ecfdf5);
}

.s3-reflect-q {
  margin: 0 0 10px;
  font-weight: 900;
  font-size: 14px;
  text-align: center;
}

.s3-reflect-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.s3-reflect-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  color: var(--s3-ink);
}

.s3-reflect-btn.is-correct {
  border-color: #34d399;
  background: #ecfdf5;
}

.s3-reflect-btn.is-wrong {
  border-color: #fb7185;
  background: #fff1f2;
}

.s3-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.s3-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #60a5fa, #4a90e2);
  color: #fff;
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.s3-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.s3-btn-ghost {
  background: #fff;
  color: var(--s3-ink);
  border: 2px solid #e2e8f0;
  box-shadow: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.s3-done {
  display: none;
  text-align: center;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbeafe, #d1fae5);
}

.s3-done.show {
  display: block;
  animation: s3-pop 0.4s ease;
}

.s3-done h2 { margin: 0 0 6px; }
.s3-done p { margin: 0 0 12px; font-weight: 700; color: var(--s3-muted); font-size: 14px; }

.s3-note {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--s3-muted);
  line-height: 1.5;
}

.s3-note a { color: #4a90e2; font-weight: 800; }

@keyframes s3-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes s3-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes s3-pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .s3-cell.is-need,
  .s3-gauge-track.is-shake,
  .s3-drone,
  .s3-done.show {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Stage1-style visual boost —— */
.s3-decor{pointer-events:none;position:fixed;inset:0;z-index:0;overflow:hidden}
.s3-decor span{position:absolute;font-size:clamp(1.3rem,3.5vw,2rem);opacity:.5;animation:s3-drift 9s ease-in-out infinite;filter:drop-shadow(0 6px 10px rgba(26,43,73,.12))}
.s3-decor span:nth-child(1){left:4%;top:12%}
.s3-decor span:nth-child(2){left:88%;top:16%;animation-delay:-2s}
.s3-decor span:nth-child(3){left:10%;top:75%;animation-delay:-3.5s}
.s3-decor span:nth-child(4){left:78%;top:70%;animation-delay:-1.2s}
.s3-wrap{position:relative;z-index:1}
.s3-card{border:3px solid #fff!important;box-shadow:0 18px 48px rgba(26,43,73,.12),0 0 0 6px rgba(74,144,226,.14)!important;border-radius:28px!important}
.s3-prompt{font-size:clamp(1.1rem,3.4vw,1.28rem)!important;font-weight:900!important;padding:12px 16px;border-radius:18px;background:linear-gradient(135deg,#ecfeff,#e0f2fe);border:2px dashed #38bdf8;color:#0c4a6e}
.s3-bar{animation:s3-item-pop .45s cubic-bezier(.34,1.56,.64,1) both}
.s3-bar:nth-child(1){animation-delay:.02s}.s3-bar:nth-child(2){animation-delay:.06s}.s3-bar:nth-child(3){animation-delay:.1s}.s3-bar:nth-child(4){animation-delay:.14s}.s3-bar:nth-child(5){animation-delay:.18s}
.s3-bar-fill{transition:height .45s cubic-bezier(.34,1.2,.64,1)!important;box-shadow:inset 0 -4px 0 rgba(0,0,0,.08)}
.s3-bar.is-on{transform:translateY(-4px);filter:brightness(1.08);box-shadow:0 8px 20px rgba(74,144,226,.28)}
.s3-bar.is-on .s3-bar-fill{outline:3px solid rgba(255,107,74,.55)}
.s3-cell.is-filled{animation:s3-item-pop .35s ease both}
.s3-node{transition:transform .2s,box-shadow .2s}
.s3-node.is-on{transform:scale(1.15);box-shadow:0 0 0 4px rgba(255,107,74,.35);animation:s3-pulse-node 1.2s ease-in-out infinite}
.s3-feedback.is-ok{border:2px solid #4ade80;background:linear-gradient(135deg,#dcfce7,#bbf7d0)!important}
.s3-feedback.is-bad{border:2px solid #fb7185;background:linear-gradient(135deg,#ffe4e6,#ffedd5)!important}
.s3-btn{box-shadow:0 10px 24px rgba(255,107,74,.3)!important}
.s3-hero h1{font-size:clamp(1.5rem,5vw,2rem)!important;font-weight:900}
.s3-badge{background:linear-gradient(135deg,#fff,#dbeafe)!important;border:2px solid #93c5fd!important;color:#1d4ed8}
@keyframes s3-drift{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-14px) rotate(7deg)}}
@keyframes s3-item-pop{from{opacity:0;transform:scale(.55) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}
@keyframes s3-pulse-node{0%,100%{transform:scale(1.12)}50%{transform:scale(1.2)}}
@media (prefers-reduced-motion:reduce){.s3-decor span,.s3-bar,.s3-cell.is-filled,.s3-node.is-on{animation:none!important}}
