/* training.css — '학습의 비밀' 페이지 전용 스타일
   (패널·버튼 등 공용 부품은 components.css를 그대로 사용) */

.learn-sim {
  margin-top: 24px;
}

.dial-panel {
  max-width: 860px;
  margin: 0 auto;
  min-height: 0;
  gap: 16px;
}

.mode-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.mode-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-deep);
}

.dial-board {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 46px 22px 22px;
  overflow: hidden;
}

/* 대화(추론) 모드에서 위쪽을 흘러가는 토큰 칩들 */
.flow-lane {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 26px;
  pointer-events: none;
}

.flow-chip {
  position: absolute;
  top: 0;
  left: -80px;
  background: var(--panel);
  border: 1px solid var(--accent-border);
  color: var(--accent-deep);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 12px;
  white-space: nowrap;
  opacity: 0;
}

.mode-infer .flow-chip {
  animation: flow-move 8.8s linear infinite;
  animation-delay: var(--flow-delay);
}

@keyframes flow-move {
  0%   { transform: translateX(0);                 opacity: 0; }
  4%   { opacity: 1; }
  96%  { opacity: 1; }
  100% { transform: translateX(calc(100vw + 80px)); opacity: 0; }
}

.dial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 12px;
  justify-items: center;
}

.dial {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.2s ease;
  padding: 0;
  cursor: pointer;
}

.dial:hover {
  border-color: var(--accent-border);
}

/* 돋보기로 확대 중인 다이얼 */
.dial.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dial-needle {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 3px;
  height: 17px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--text-dim);
  transform-origin: 50% 100%;
  transform: rotate(var(--a1));
}

/* 훈련 모드: 다이얼이 조금씩 계속 돌아감 */
.mode-train .dial {
  border-color: var(--accent-border);
}

.mode-train .dial-needle {
  background: var(--accent);
  animation: dial-tune 1.4s ease-in-out infinite alternate;
  animation-delay: var(--wobble-delay);
}

@keyframes dial-tune {
  from { transform: rotate(var(--a1)); }
  to   { transform: rotate(var(--a2)); }
}

.mode-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
}

.mode-train .mode-badge {
  border-color: var(--accent-border);
  color: var(--accent-deep);
}

/* ── 다이얼 돋보기: 다이얼 = 수식 속 숫자 ── */
.dial-zoom {
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: center;
}

.zoom-head {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 8px;
}

.zoom-formula {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.15rem;
  background: var(--panel);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: inline-block;
}

.zoom-weight {
  color: var(--accent);
  font-size: 1.25rem;
}

/* 훈련 모드에서 숫자가 바뀌는 중임을 강조 */
.zoom-weight.tuning {
  color: #b45309;                      /* amber-700 */
  background: #fffbeb;                 /* amber-50 */
  border-radius: 6px;
  padding: 0 4px;
}

.zoom-rest {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.zoom-caption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-dim);
  min-height: 1.5em;
}

.zoom-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.mode-caption {
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
  min-height: 3.2em;
}

.dial-note {
  text-align: center;
  font-size: 0.92rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
}

/* ── 모바일 ── */
@media (max-width: 640px) {
  .mode-switch {
    flex-wrap: wrap;
  }

  .dial-board {
    padding: 40px 12px 14px;
  }

  .dial-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 10px;
  }

  .dial {
    width: 40px;
    height: 40px;
  }

  .dial-needle {
    height: 14px;
  }

  .zoom-formula {
    font-size: 0.95rem;
    max-width: 100%;
  }

  .zoom-rest {
    display: block;
    margin-top: 4px;
  }
}
