@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Share+Tech&display=swap');

:root {
  --bg-outer: #030603;
  --bg-screen: #060c06;
  --phosphor: #3dff6a;
  --phosphor-mid: rgba(61, 255, 106, 0.55);
  --phosphor-dim: rgba(61, 255, 106, 0.22);
  --phosphor-glow: rgba(61, 255, 106, 0.35);
  --curve: 18px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  background: var(--bg-outer);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 50%, #0a120a 0%, #030603 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
}

.clock-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 4rem 6rem 3.5rem;
  background: var(--bg-screen);
  border-radius: var(--curve);
  box-shadow:
    0 0 0 1px rgba(61, 255, 106, 0.12),
    0 0 80px rgba(61, 255, 106, 0.06),
    0 0 200px rgba(61, 255, 106, 0.03),
    inset 0 0 140px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(61, 255, 106, 0.05);
  overflow: hidden;
}

/* CRT scanlines */
.clock-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
  pointer-events: none;
  z-index: 10;
  border-radius: var(--curve);
}

/* Slow scan line sweep */
.clock-container::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(61, 255, 106, 0.025),
    transparent
  );
  animation: scanSweep 8s linear infinite;
  pointer-events: none;
  z-index: 11;
}

@keyframes scanSweep {
  0%   { top: -60px; }
  100% { top: calc(100% + 60px); }
}

/* Corner brackets */
.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(61, 255, 106, 0.28);
  border-style: solid;
  z-index: 12;
}
.corner.tl { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.corner.tr { top: 14px; right: 14px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: 14px; left: 14px; border-width: 0 0 1px 1px; }
.corner.br { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }

/* Label */
.label {
  font-family: 'Share Tech', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.45em;
  color: var(--phosphor-dim);
  text-transform: uppercase;
  position: relative;
  z-index: 5;
}

/* Time display */
#clock {
  font-size: clamp(4.5rem, 13vw, 11rem);
  color: var(--phosphor);
  letter-spacing: 0.04em;
  text-shadow:
    0 0 6px var(--phosphor-glow),
    0 0 16px var(--phosphor-glow),
    0 0 40px rgba(61, 255, 106, 0.18);
  line-height: 1;
  position: relative;
  z-index: 5;
  white-space: nowrap;
}

.colon {
  animation: blinkColon 1s step-end infinite;
  display: inline-block;
  opacity: 0.9;
}

@keyframes blinkColon {
  0%, 45% { opacity: 0.9; }
  50%, 95% { opacity: 0.12; }
  100% { opacity: 0.9; }
}

.seconds-tick {
  display: inline-block;
  animation: secondPulse 0.08s ease-out forwards;
}

@keyframes secondPulse {
  0%   { opacity: 0.35; text-shadow: none; }
  100% { opacity: 1; text-shadow: 0 0 6px var(--phosphor-glow), 0 0 16px var(--phosphor-glow); }
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--phosphor-dim),
    rgba(61, 255, 106, 0.45),
    var(--phosphor-dim),
    transparent
  );
  position: relative;
  z-index: 5;
}

/* Date display */
#date {
  font-family: 'Share Tech', sans-serif;
  font-size: clamp(0.8rem, 2.2vw, 1.1rem);
  color: var(--phosphor-mid);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(61, 255, 106, 0.25);
  position: relative;
  z-index: 5;
}

/* Subtle vignette on the screen interior */
.clock-container > *:not(.corner)::selection {
  background: transparent;
}

@media (max-width: 520px) {
  .clock-container {
    padding: 2.5rem 1.8rem 2.2rem;
    margin: 1.5rem;
    gap: 1.2rem;
  }
}
