/* ============================================================
   topdevphone — Clock app styles
   Graphite identity (#0f0f13 → #3a3a41). Analog faces are pure
   CSS (rotating wrappers so hands scale with any face size), the
   timer ring is inline SVG — no images, no external assets.
   Everything uses the base.css vars so dark AND light both work.
   ============================================================ */

/* ---------- analog face ---------- */
.clk-face {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--bg-tertiary) 80%, var(--bg-secondary)), var(--bg-secondary));
  box-shadow: inset 0 0 0 1.5px var(--separator), 0 3px 10px rgba(0, 0, 0, 0.22);
}
.clk-face.sm { width: 44px; height: 44px; }
.clk-face.lg { width: 122px; height: 122px; box-shadow: inset 0 0 0 2px var(--separator), 0 10px 26px rgba(0, 0, 0, 0.32); }

.clk-tickwrap { position: absolute; inset: 0; }
.clk-tickwrap i {
  position: absolute; left: 50%; top: 8%;
  width: 1.5px; height: 8%; margin-left: -0.75px;
  background: var(--text-tertiary); border-radius: 1px; display: block;
}
.clk-tickwrap i.maj { width: 2.5px; height: 11%; margin-left: -1.25px; background: var(--text-secondary); }

.clk-hand { position: absolute; inset: 0; }
.clk-hand::after {
  content: ''; position: absolute; left: 50%; bottom: 50%;
  border-radius: 3px; transform-origin: 50% 100%;
  background: var(--text-primary);
}
.clk-hand.hh::after { width: 3px; margin-left: -1.5px; height: 26%; }
.clk-hand.mh::after { width: 2.5px; margin-left: -1.25px; height: 37%; }
.clk-hand.sh::after { width: 1.5px; margin-left: -0.75px; height: 41%; background: var(--accent-orange); }
.clk-face.lg .clk-hand.hh::after { width: 5px; margin-left: -2.5px; }
.clk-face.lg .clk-hand.mh::after { width: 4px; margin-left: -2px; }

.clk-pin {
  position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: var(--accent-orange);
  box-shadow: 0 0 0 1.5px var(--bg-secondary);
}
.clk-face.lg .clk-pin { width: 10px; height: 10px; margin: -5px 0 0 -5px; }

/* ---------- world clock hero ---------- */
.clk-hero {
  display: flex; align-items: center; gap: 16px;
  border-radius: var(--radius-card-lg);
  padding: 18px 16px;
  margin: 4px 0 18px;
  background:
    radial-gradient(120% 90% at 88% -12%, rgba(255, 255, 255, 0.16), transparent 58%),
    linear-gradient(140deg, #2a2a31, #0f0f13);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
[data-theme='light'] .clk-hero {
  background:
    radial-gradient(120% 90% at 88% -12%, rgba(255, 255, 255, 0.5), transparent 58%),
    linear-gradient(140deg, #4a4a55, #1d1d22);
}
.clk-hero .clk-face {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14), 0 8px 20px rgba(0, 0, 0, 0.4);
}
.clk-hero .clk-tickwrap i { background: rgba(255, 255, 255, 0.35); }
.clk-hero .clk-tickwrap i.maj { background: rgba(255, 255, 255, 0.7); }
.clk-hero .clk-hand::after { background: #fff; }
.clk-hero .clk-hand.sh::after { background: var(--accent-orange); }
.clk-hero .clk-pin { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }

.clk-hero-main { min-width: 0; flex: 1; }
.clk-hero-city { font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; opacity: 0.6; }
.clk-hero-time { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-top: 2px; }
.clk-hero-date { font-size: 12px; opacity: 0.6; margin-top: 2px; }
.clk-hero-tag {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  background: rgba(255, 255, 255, 0.12); border-radius: 12px;
  padding: 3px 9px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
}
.clk-hero-tag .ic { width: 12px; height: 12px; }

/* ---------- city rows ---------- */
.clk-city { gap: 12px; }
.clk-city + .clk-city::before { left: 68px; }
.clk-city-time { font-size: 17px; font-weight: 700; color: var(--text-primary); }

.clk-foot {
  text-align: center; color: var(--text-tertiary);
  font-size: 11px; margin: 4px 0 10px;
}

/* ---------- alarms ---------- */
.clk-next {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary); border-radius: var(--radius-card-lg);
  padding: 14px; margin: 4px 0 16px;
}
.clk-next .ic { width: 22px; height: 22px; color: var(--accent-orange); flex: 0 0 auto; }
.clk-next.muted .ic { color: var(--text-tertiary); }
.clk-next-main { min-width: 0; }
.clk-next-title { font-size: 14.5px; font-weight: 700; }
.clk-next-sub {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.clk-sl-row { display: flex; justify-content: space-between; align-items: baseline; }
.clk-count { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-tertiary); }

.clk-alarm {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary); border-radius: var(--radius-card);
  padding: 12px 14px; margin-bottom: 8px;
  transition: opacity 0.2s;
}
.clk-alarm.off { opacity: 0.45; }
.clk-alarm-main { flex: 1; min-width: 0; text-align: left; padding: 0; }
.clk-alarm-time { font-size: 30px; font-weight: 300; letter-spacing: -0.5px; line-height: 1.1; }
.clk-alarm-time span { font-size: 15px; font-weight: 600; margin-left: 5px; color: var(--text-secondary); }
.clk-alarm-label {
  font-size: 12.5px; color: var(--text-secondary); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- stopwatch / timer stage ---------- */
.clk-stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 18px;
}
.clk-big {
  font-size: 52px; font-weight: 200; letter-spacing: -1.5px;
  color: var(--text-primary); margin: 22px 0 30px;
}
.clk-btnrow { display: flex; gap: 40px; align-items: center; justify-content: center; }
.clk-rbtn {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  background: var(--bg-tertiary); color: var(--text-primary);
  box-shadow: inset 0 0 0 2px var(--separator);
  transition: transform 0.1s, filter 0.15s;
}
.clk-rbtn:active { transform: scale(0.94); filter: brightness(1.25); }
.clk-rbtn:disabled { opacity: 0.35; }
.clk-rbtn.start { background: rgba(48, 209, 88, 0.16); color: var(--accent-green); box-shadow: inset 0 0 0 2px rgba(48, 209, 88, 0.4); }
.clk-rbtn.stop { background: rgba(255, 69, 58, 0.16); color: var(--accent-red); box-shadow: inset 0 0 0 2px rgba(255, 69, 58, 0.4); }

/* laps */
.clk-lap { padding: 9px 14px; }
.clk-lap .lr-title { font-size: 13.5px; color: var(--text-secondary); font-weight: 600; }
.clk-lap-split { font-size: 14px; font-weight: 700; min-width: 86px; text-align: right; }
.clk-lap-split.best { color: var(--accent-green); }
.clk-lap-split.worst { color: var(--accent-red); }
.clk-lap-total { font-size: 12px; color: var(--text-tertiary); min-width: 86px; text-align: right; }

/* ---------- timer ring ---------- */
.clk-ringwrap { position: relative; width: 214px; height: 214px; margin: 6px 0 20px; }
.clk-ring { width: 100%; height: 100%; display: block; }
.clk-ring-bg { fill: none; stroke: var(--bg-tertiary); stroke-width: 5; }
.clk-ring-fg {
  fill: none; stroke: var(--accent-orange); stroke-width: 5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 60px 60px;
  transition: stroke-dashoffset 0.2s linear;
}
.clk-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.clk-ring-time { font-size: 42px; font-weight: 200; letter-spacing: -1px; }
.clk-ring-sub {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-tertiary);
}

.clk-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 24px; }
.clk-chip {
  padding: 8px 16px; border-radius: 16px;
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 13px; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--separator);
  transition: transform 0.1s, filter 0.15s;
}
.clk-chip:active { transform: scale(0.95); filter: brightness(1.3); }
.clk-chip.alt { color: var(--accent-orange); }

/* ---------- in-app sheet (alarm / custom timer) ---------- */
.clk-sheet-host { position: absolute; inset: 0; z-index: 20; display: none; align-items: flex-end; }
.clk-sheet-host.show { display: flex; }
.clk-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.clk-sheet {
  position: relative; width: 100%;
  background: var(--bg-elevated); color: var(--text-primary);
  border-radius: 22px 22px 0 0; padding: 18px 18px 26px;
  max-height: 92%; overflow-y: auto;
  animation: clkSheetUp 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
.clk-sheet::-webkit-scrollbar { width: 0; }
@keyframes clkSheetUp { from { transform: translateY(60%); } }
.clk-sheet-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 16px; }
.clk-mt { margin-top: 10px; }

.clk-pickers {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 16px;
}
.clk-colon { font-size: 24px; font-weight: 800; color: var(--text-tertiary); }
.clk-picker-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.clk-picker-col span {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-tertiary);
}
.clk-select {
  -webkit-appearance: none; appearance: none;
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 0; border-radius: 12px; padding: 10px 16px;
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
  text-align: center; outline: none; cursor: pointer;
}
.clk-select.ampm { font-size: 16px; padding: 13px 12px; }
.clk-select option { background: var(--bg-secondary); color: var(--text-primary); font-size: 15px; }

.clk-sheet-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary); border-radius: var(--radius-card);
  padding: 10px 14px; margin-top: 12px;
  font-size: 14.5px; font-weight: 500;
}

/* ---------- home-screen widget ---------- */
.clk-w { display: flex; align-items: center; gap: 12px; }
.clk-w .clk-face {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.18);
}
.clk-w .clk-tickwrap i { background: rgba(255, 255, 255, 0.35); }
.clk-w .clk-tickwrap i.maj { background: rgba(255, 255, 255, 0.65); }
.clk-w .clk-hand::after { background: currentColor; }
.clk-w .clk-hand.sh::after { background: var(--accent-orange); }
[data-theme='light'] .clk-w .clk-face {
  background: radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.03));
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.12);
}
[data-theme='light'] .clk-w .clk-tickwrap i { background: rgba(0, 0, 0, 0.3); }
[data-theme='light'] .clk-w .clk-tickwrap i.maj { background: rgba(0, 0, 0, 0.55); }
.clk-w-main { min-width: 0; }
.clk-w-time { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.clk-w-sub { font-size: 11.5px; opacity: 0.65; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
