/* ============================================================
   전체화면 시계·온라인 알람 전용 스타일
   - 시계가 놓이는 "무대(stage)"는 사이트 테마와 별개의 자체 색을 가진다.
     (어두운 방·강의실 스크린에서 시계만 또렷하게 보이도록)
   - 무대 색: 먹(ink) / 완전한 검정(black) / 종이(paper)
   ============================================================ */

.tool-intro { padding: var(--space-6) 0 var(--space-5); }
.tool-intro h1 { word-break: keep-all; }
.tool-intro .lead { max-width: 62ch; color: var(--color-text-sub); }
.tool-intro .lead strong { color: var(--color-text); }
.tool-intro .lead-note { font-size: .88rem; color: var(--color-text-sub); }

/* ---- 무대 공통 ---- */
.clk-stage {
  --stage-bg: #1c1712;
  --stage-bg2: #120e09;
  --stage-ink: #f2ead8;          /* 어두운 무대 위 따뜻한 종이색 글자 */
  --stage-sub: rgba(242, 234, 216, .48);
  --stage-line: rgba(242, 234, 216, .16);
  --stage-accent: #e0574a;       /* 초침·강조는 사이트의 주묵색 */
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: radial-gradient(115% 130% at 50% 8%, var(--stage-bg), var(--stage-bg2));
  color: var(--stage-ink);
  box-shadow: var(--shadow);
  min-height: clamp(340px, 46vw, 500px);
  display: flex;
  flex-direction: column;
}
.clk-stage[data-skin="black"] {
  --stage-bg: #000;
  --stage-bg2: #000;
  --stage-ink: #e8e1d2;
  --stage-sub: rgba(232, 225, 210, .42);
  --stage-line: rgba(232, 225, 210, .14);
}
.clk-stage[data-skin="paper"] {
  --stage-bg: #faf6ec;
  --stage-bg2: #f0e9d8;
  --stage-ink: #26221c;
  --stage-sub: rgba(38, 34, 28, .52);
  --stage-line: rgba(38, 34, 28, .14);
  --stage-accent: #c23b30;
}
/* 종이 무대에는 사이트 정체성인 옅은 점 격자를 은은하게 깐다 */
.clk-stage[data-skin="paper"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(194, 59, 48, .22) 1.2px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(90% 90% at 50% 45%, transparent 42%, #000 100%);
          mask-image: radial-gradient(90% 90% at 50% 45%, transparent 42%, #000 100%);
  pointer-events: none;
}

.clk-face {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5) var(--space-4);
  position: relative;
}

/* ---- 디지털 ---- */
.clk-digital { text-align: center; }
.clk-timeline {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .35em;
}
.clk-time {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: clamp(3.4rem, 11.5vw, 7.2rem);
  line-height: 1;
  letter-spacing: .015em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}
.clk-time .clk-colon { transition: opacity .18s ease; }
.clk-time .clk-colon.is-dim { opacity: .22; }
.clk-time .clk-sec {
  font-size: .48em;
  font-weight: 300;
  color: var(--stage-sub);
  margin-left: .12em;
}
.clk-ampm {
  font-size: clamp(.9rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--stage-accent);
  letter-spacing: .1em;
}
.clk-date {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--stage-sub);
  margin: clamp(10px, 2vw, 20px) 0 0;
  letter-spacing: .04em;
}

/* ---- 아날로그 ---- */
.clk-analog { text-align: center; }
.clk-analog svg {
  width: clamp(230px, 34vw, 340px);
  height: auto;
  display: block;
  margin: 0 auto;
}
.ca-rim   { fill: none; stroke: var(--stage-line); stroke-width: 1.5; }
.ca-tick  { stroke: var(--stage-sub); stroke-width: 1; }
.ca-tick-h{ stroke: var(--stage-ink); stroke-width: 2.4; }
.ca-num {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  fill: var(--stage-ink);
  text-anchor: middle;
  dominant-baseline: middle;
}
.ca-hand-h { fill: var(--stage-ink); }
.ca-hand-m { fill: var(--stage-ink); opacity: .92; }
.ca-hand-s { fill: var(--stage-accent); }
#caHour, #caMin, #caSec { transform-origin: 100px 100px; }
.ca-cap     { fill: var(--stage-accent); }
.ca-cap-dot { fill: var(--stage-bg); }
.clk-date-analog { margin-top: 14px; font-size: clamp(.95rem, 1.8vw, 1.1rem); }

/* ---- 무대 하단 조작줄 ---- */
.clk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--stage-line);
  transition: opacity .35s ease;
}
.clk-bar-group { display: inline-flex; gap: 6px; align-items: center; }
.clk-bar-right { margin-left: auto; }

.clk-chip {
  font: inherit;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--stage-line);
  background: transparent;
  color: var(--stage-sub);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.clk-chip:hover { color: var(--stage-ink); border-color: var(--stage-sub); }
.clk-chip.is-on {
  color: var(--stage-ink);
  border-color: var(--stage-accent);
  background: color-mix(in srgb, var(--stage-accent) 16%, transparent);
}
.clk-chip[disabled] { opacity: .35; cursor: not-allowed; }
.clk-chip-strong {
  color: var(--stage-ink);
  border-color: var(--stage-sub);
  font-weight: 700;
}
/* 화면 색 선택 칩 안의 색 견본 */
.clk-swatch i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid var(--stage-sub);
}
#skinInk i   { background: #1c1712; }
#skinBlack i { background: #000; }
#skinPaper i { background: #faf6ec; }

.clk-stage-note {
  font-size: .85rem;
  color: var(--color-text-sub);
  margin: var(--space-2) 0 var(--space-6);
}
.clk-stage-note kbd,
.prose kbd {
  font: inherit;
  font-size: .82em;
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--color-surface);
}

/* ---- 전체화면 상태 ----
   브라우저 전체화면(:fullscreen)과 iOS용 유사 전체화면(.is-pseudo-fs)
   모두 JS가 .is-fs 클래스를 붙여 같은 스타일을 탄다 */
.clk-stage.is-fs {
  border-radius: 0;
  border: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
.clk-stage.is-pseudo-fs {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.clk-stage.is-fs .clk-time { font-size: min(19vw, 42vh); }
.clk-stage.is-fs.no-sec .clk-time { font-size: min(26vw, 50vh); }
.clk-stage.is-fs .clk-date { font-size: clamp(1.1rem, 2.6vw, 1.9rem); }
.clk-stage.is-fs .clk-analog svg { width: min(78vmin, 86vh); }
/* 전체화면에서 잠시 가만히 있으면 조작줄이 스르르 사라진다 */
.clk-stage.is-fs.is-idle .clk-bar { opacity: 0; pointer-events: none; }
.clk-stage.is-fs.is-idle { cursor: none; }
.clk-fs-hint {
  display: none;
  position: absolute;
  top: 14px; right: 18px;
  font-size: .8rem;
  color: var(--stage-sub);
  margin: 0;
}
.clk-stage.is-fs .clk-fs-hint { display: block; animation: clkFadeOut 4s ease forwards; }
@keyframes clkFadeOut { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ============================================================
   알람 카드
   ============================================================ */
.clk-alarm { margin-top: var(--space-5); }
.clk-alarm-head h2 {
  margin: 0 0 2px;
  font-size: 1.3rem;
}
.clk-alarm-sub {
  margin: 0 0 var(--space-4);
  font-size: .88rem;
  color: var(--color-text-sub);
}

.clk-add {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: var(--space-3);
  align-items: end;
}
.clk-add label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.clk-lab {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-text-sub);
  letter-spacing: .02em;
}
.clk-lab small { font-weight: 400; }
.clk-add input[type="time"],
.clk-add input[type="text"],
.clk-add select {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  min-width: 0;
}
.clk-add input[type="time"] {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
}
.clk-add input:focus-visible,
.clk-add select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.clk-sound-row { display: flex; gap: 6px; }
.clk-preview { padding: 8px 10px; font-size: .82rem; white-space: nowrap; }
.clk-add-vol input[type="range"] { width: 96px; accent-color: var(--color-primary); }
.clk-add-btn { padding: 10px 18px; font-weight: 700; white-space: nowrap; }

.clk-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border);
}
.clk-quick-lab { font-size: .82rem; color: var(--color-text-sub); }
.clk-quick-btn { font-size: .85rem; padding: 6px 12px; border-radius: 999px; }

/* ---- 알람 목록 ---- */
.clk-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.clk-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}
.clk-item.is-off { opacity: .55; }
.clk-item-time {
  font-size: 1.5rem;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  white-space: nowrap;
}
.clk-item-time small {
  font-size: .72rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-right: 4px;
  letter-spacing: .06em;
}
.clk-item-body { flex: 1; min-width: 0; }
.clk-item-label {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clk-item-meta { font-size: .78rem; color: var(--color-text-sub); }
.clk-item-meta .clk-badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  margin-right: 4px;
}
.clk-item-meta .clk-badge.is-snooze {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* 켬/끔 스위치 */
.clk-switch {
  position: relative;
  width: 42px; height: 24px;
  flex: none;
  cursor: pointer;
}
.clk-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.clk-switch i {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--color-border);
  transition: background .18s ease;
}
.clk-switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.clk-switch input:checked + i { background: var(--color-primary); }
.clk-switch input:checked + i::after { transform: translateX(18px); }
.clk-switch input:focus-visible + i { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.clk-del {
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--color-text-sub);
  padding: 6px;
  flex: none;
}
.clk-del:hover { color: var(--color-primary); }

.clk-empty {
  margin: var(--space-4) 0 0;
  padding: var(--space-5);
  text-align: center;
  font-size: .9rem;
  color: var(--color-text-sub);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
}
.clk-alarm-note {
  margin: var(--space-3) 0 0;
  font-size: .82rem;
  color: var(--color-text-sub);
}

/* ============================================================
   알람 울림 화면
   ============================================================ */
.clk-ring {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: radial-gradient(120% 130% at 50% 10%, #241a15, #120c09);
  color: #f2ead8;
  text-align: center;
  padding: 24px;
}
.clk-ring-pulse {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.clk-ring-pulse i {
  position: absolute;
  width: 46vmin; height: 46vmin;
  border-radius: 50%;
  border: 2px solid rgba(224, 87, 74, .5);
  animation: clkPulse 2.4s ease-out infinite;
}
.clk-ring-pulse i:nth-child(2) { animation-delay: .8s; }
.clk-ring-pulse i:nth-child(3) { animation-delay: 1.6s; }
@keyframes clkPulse {
  from { transform: scale(.55); opacity: .9; }
  to   { transform: scale(1.6); opacity: 0; }
}
.clk-ring-time {
  margin: 0;
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.clk-ring-label {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3.4vw, 1.7rem);
  color: rgba(242, 234, 216, .75);
  position: relative;
}
.clk-ring-mute {
  margin: 8px 0 0;
  font-size: .88rem;
  color: #e0574a;
  position: relative;
}
.clk-ring-actions {
  display: flex;
  gap: 10px;
  margin-top: clamp(20px, 5vh, 44px);
  position: relative;
}
.clk-ring-actions .btn {
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(242, 234, 216, .4);
  color: #f2ead8;
}
.clk-ring-actions .btn:hover { border-color: #f2ead8; }
.clk-ring-stop {
  background: #e0574a !important;
  border-color: #e0574a !important;
  color: #fff !important;
  font-weight: 700;
}

/* ============================================================
   반응형·접근성
   ============================================================ */
@media (max-width: 860px) {
  .clk-add {
    grid-template-columns: 1fr 1fr;
  }
  .clk-add-label { grid-column: 1 / -1; }
  .clk-add-btn { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .clk-stage { min-height: 300px; }
  .clk-bar { padding: var(--space-2) var(--space-3); }
  .clk-bar-right { margin-left: 0; }
  .clk-item { flex-wrap: wrap; }
  .clk-item-body { flex-basis: 100%; order: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .clk-ring-pulse { display: none; }
  .clk-time .clk-colon { transition: none; }
  .clk-bar { transition: none; }
}
