/* 색 기억 테스트 (color-memory.js) */
.cm-hud {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 22px 4px 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.cm-hud b {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 2px;
}
.cm .timebar {
  margin-top: 8px;
}
.cm .timebar span {
  transform: scaleX(1);
}

/* 색 칸: 정답(a) · 내 색(b) 두 칸. data-view 로 하나만 또는 나란히 보여 준다. */
/* 넓은 화면: 색 칸(왼쪽)과 슬라이더(오른쪽)를 나란히 두어 한 화면에 다 들어오게 한다 */
@media (min-width: 760px) {
  .cm-main {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
    align-items: stretch;
    margin-top: 12px;
  }
  .cm-left {
    display: flex;
    flex-direction: column;
  }
  .cm-main .cm-stage {
    flex: 1;
    height: auto;
    min-height: 260px;
    margin-top: 0;
  }
  .cm-main .cm-picker {
    margin-top: 0;
  }
}
.cm-stage {
  position: relative;
  display: flex;
  height: clamp(170px, 30vh, 300px);
  margin-top: 12px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.cm-half {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  transition: background-color 0.15s linear;
}
.cm-half-label {
  font-weight: 800;
  font-size: 0.95rem;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.08);
}
.cm-half-text {
  align-self: center;
  font-weight: 800;
  font-size: clamp(0.85rem, 3.6vw, 1.05rem);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.cm-stage[data-view='one-a'] .cm-half.b,
.cm-stage[data-view='one-b'] .cm-half.a,
.cm-stage[data-view='mask'] .cm-half {
  display: none;
}
.cm-stage[data-view='one-a'] .cm-half-text {
  font-size: clamp(1.6rem, 8vw, 2.4rem);
}
.cm-stage[data-view='split'] .cm-half.b {
  border-left: 3px solid var(--surface);
}
/* 가린 동안: 무늬 있는 회색 판 */
.cm-stage[data-view='mask']::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 14px, var(--surface) 14px 28px);
}
.cm-stage.is-idle .cm-half {
  filter: blur(6px) saturate(0.8);
  opacity: 0.55;
}
.cm-start.pad {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--brand) 88%, transparent);
}
.cm-detail {
  min-height: 3em;
  margin: 10px 4px 0;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* 슬라이더 3개 */
.cm-picker {
  margin-top: 6px;
  padding: 14px 16px 16px;
}
.cm-row + .cm-row {
  margin-top: 12px;
}
.cm-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 2px 6px;
  font-weight: 700;
}
.cm-row label small {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  margin-left: 8px;
}
.cm-row output {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  min-width: 3em;
  text-align: right;
}
.cm-range {
  --thumb: #888;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--line);
  cursor: pointer;
  touch-action: none; /* 막대 위에서 끌 때 화면이 같이 움직이지 않게 */
  -webkit-tap-highlight-color: transparent;
}
/* 손잡이 지름 36px: color-memory.js 의 THUMB 와 같게 */
.cm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--thumb);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.cm-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--thumb);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.cm-range::-moz-range-track {
  background: transparent;
}
.cm-range:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.cm-range:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  filter: grayscale(0.6);
}
.cm-submit {
  display: block;
  width: min(100%, 320px);
  margin: 18px auto 0;
  min-height: 52px;
  font-size: 1.05rem;
}
.cm-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 결과: 라운드별 정답 · 내 색 */
.cm-trend {
  margin: 10px auto 0;
  max-width: 30em;
  font-weight: 700;
}
.cm-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.cm-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.cm-list li.best {
  border-color: var(--go);
}
.cm-pair {
  display: flex;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.cm-pair i {
  display: block;
  width: 26px;
  height: 40px;
}
.cm-li-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.cm-li-text b {
  font-size: 0.95rem;
}
.cm-li-text small {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
  .cm-half {
    transition: none;
  }
}
