:root {
  --bg1: #0f1724;
  --bg2: #071229;
  --glass: rgba(255, 255, 255, 0.06);
  --accent: #6ee7b7;
  --accent-2: #7c5cff;
  --muted: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-glow: 0 8px 30px rgba(113, 84, 255, 0.08);
  --size: 360px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(
      1200px 600px at 10% 10%,
      rgba(124, 92, 255, 0.12),
      transparent 6%
    ),
    radial-gradient(
      900px 400px at 90% 90%,
      rgba(110, 231, 183, 0.06),
      transparent 6%
    ),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  color: white;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 32px;
}

.stage {
  width: var(--size);
  max-width: 92vw;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
}

.clock-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 20px;
  padding: 22px;
  position: relative;
  overflow: visible;
  box-shadow: var(--glass-glow), 0 6px 18px rgba(2, 6, 23, 0.6);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px) saturate(120%);
}

.clock-card::before,
.clock-card::after {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  transform: translate(20%, -20%);
  filter: blur(36px);
  opacity: 0.28;
  pointer-events: none;
}
.clock-card::before {
  background: radial-gradient(
    circle at 30% 30%,
    var(--accent),
    transparent 25%
  );
}
.clock-card::after {
  background: radial-gradient(
    circle at 70% 70%,
    var(--accent-2),
    transparent 25%
  );
}

.clock-wrap {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.analog {
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  position: relative;
}

.dial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.06)
  );
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.glass-center {
  width: 74%;
  height: 74%;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025),
    rgba(255, 255, 255, 0.01)
  );
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transform: translateZ(0);
}

.ticks {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.tick {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 2px;
  height: 12px;
  background: var(--muted);
  transform-origin: center 110px;
  border-radius: 6px;
  opacity: 0.9;
}
.tick.min {
  height: 8px;
  opacity: 0.7;
}

.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(0deg);
}
.hand .needle {
  border-radius: 10px;
}
.hand.hour {
  width: 8px;
  height: 60px;
}
.hand.min {
  width: 6px;
  height: 84px;
}
.hand.sec {
  width: 3px;
  height: 94px;
}

.hand .needle {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.6)
  );
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  transform: translateY(0);
}
.hand.sec .needle {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.16);
  filter: drop-shadow(0 6px 12px rgba(124, 92, 255, 0.08));
}

.pivot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #ddd);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.14);
}

.digital {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  min-width: 180px;
}
.time-large {
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ampm {
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}
.date {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.line {
  margin-top: 8px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  margin-top: 6px;
  color: var(--muted);
}
.btn {
  padding: 8px 15px;
  border-radius: 12px;
  background: rgb(8, 8, 8);
  border: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-weight: 400;
  color: #fff;
}

@media (max-width: 420px) {
  :root {
    --size: 340px;
  }
  .time-large {
    font-size: 28px;
  }
  .analog {
    width: 200px;
    height: 200px;
  }
}


.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: bottom center; /* rotate around pivot */
  transform: translate(-50%, -50%) rotate(0deg);
}

.hand .needle {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.hand.hour {
  width: 6px;
  height: 70px;
}
.hand.min {
  width: 4px;
  height: 100px;
}
.hand.sec {
  width: 2px;
  height: 115px;
}

.hand.hour .needle {
  background: linear-gradient(180deg, #fff, #ccc);
}
.hand.min .needle {
  background: linear-gradient(180deg, #eee, #aaa);
}
.hand.sec .needle {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.4);
}
