/* clock-device.css — one combined time + date unit for the topbar (#topbar-time).
   Replaces the old two-card .clock-pair. IDs (clock-time-val / clock-date-val / clock-day-val)
   are unchanged, so app.js updateClock() needs no edit. The .clock-card rules in app.css stay:
   the slogan canvas (#topbar-slogan) still uses them. */

.clock-device {
  --cd-time: #39ff14;
  --cd-date: #c9d94a;
  --cd-dim:  #7d8373;
  display: flex; align-items: center; gap: 8px;
  height: 40px; box-sizing: border-box;
  padding: 4px 6px 4px 4px;
  border-radius: 12px;
  background: linear-gradient(160deg, #2c2d28 0%, #1a1b17 55%, #10110e 100%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 4px 12px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -2px 3px rgba(0,0,0,0.5);
  position: relative;
  flex-shrink: 0;
  user-select: none; -webkit-user-select: none;
}
/* fine brushed grain on the housing */
.clock-device::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* recessed LCD window holding both readouts */
.cd-screen {
  position: relative; z-index: 1;
  height: 100%; box-sizing: border-box;
  display: flex; align-items: center; gap: 9px;
  padding: 0 10px 0 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #0b0c0a 0%, #151613 100%);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.75),
    inset 0 0 0 1px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}
/* faint glass glare across the top of the screen */
.cd-screen::after {
  content: ""; position: absolute; inset: 0 0 55% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
}

.cd-led {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
  background: var(--cd-time); box-shadow: 0 0 5px var(--cd-time);
  animation: cdPulse 2s ease-in-out infinite;
}
@keyframes cdPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.cd-seg { display: flex; flex-direction: column; justify-content: center; line-height: 1; gap: 3px; }
.cd-value {
  font-family: 'Digital Numbers', 'Courier New', monospace;
  font-weight: 400; letter-spacing: 1px; white-space: nowrap;
  transition: color .25s ease, text-shadow .25s ease;
}
.cd-time .cd-value { font-size: 16px; color: var(--cd-time); text-shadow: 0 0 6px rgba(57,255,20,0.35); }
.cd-date .cd-value { font-size: 13px; color: var(--cd-date); text-shadow: 0 0 6px rgba(201,217,74,0.3); }
.cd-label {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 7.5px; font-weight: 600; letter-spacing: 1.2px; line-height: 1;
  color: var(--cd-dim); text-transform: uppercase;
}
.cd-date { align-items: flex-start; }

/* thin etched divider between time and date */
.cd-rule {
  width: 1px; align-self: stretch; margin: 7px 0; flex-shrink: 0;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.14) 25%, rgba(255,255,255,0.14) 75%, transparent);
  box-shadow: 1px 0 0 rgba(0,0,0,0.6);
}

/* single control knob on the housing */
.cd-knob {
  position: relative; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 32% 28%, #ffffff, #cfd2c9 45%, #8b9086 100%);
  box-shadow:
    0 2px 3px rgba(0,0,0,0.55),
    0 0 0 1px rgba(0,0,0,0.2),
    inset 0 1px 1px rgba(255,255,255,0.8),
    inset 0 -2px 2px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: box-shadow .25s ease, transform .25s ease;
  overflow: hidden;
}
.cd-knob::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 14%, rgba(15,15,15,0.7) 0 1.3px, transparent 1.6px);
  animation: knobSpin 6s linear infinite; /* keyframes defined in app.css */
}
@media (hover: hover) {
  .cd-knob:hover {
    transform: rotate(35deg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.8), 0 0 7px rgba(57,255,20,0.7);
  }
  .clock-device:has(.cd-knob:hover) .cd-time .cd-value { color: #7bff5c; text-shadow: 0 0 9px rgba(57,255,20,0.75); }
  .clock-device:has(.cd-knob:hover) .cd-date .cd-value { color: #e0f076; text-shadow: 0 0 9px rgba(224,240,118,0.65); }
}

@media (prefers-reduced-motion: reduce) {
  .cd-led, .cd-knob::before { animation: none; }
}

/* app.css hides .topbar-status at this width; this file loads later, so repeat it */
@media (max-width: 640px) {
  .clock-device { display: none; }
}
