:root {
  color-scheme: light;
  --bg1: #eef3f8;
  --bg2: #dfe8f3;

  --fg: #11233f;
  --fg-soft: rgba(17, 35, 63, 0.05);

  --icon: #22385a;
  --icon-hover: rgba(17, 35, 63, 0.08);

  --glow-strong: rgba(17, 35, 63, 0.08);
  --glow-soft: rgba(17, 35, 63, 0.03);
}

body.dark {
  color-scheme: dark;
  --bg1: #020917;
  --bg2: #07162f;

  --fg: #f7fbff;
  --fg-soft: rgba(255, 255, 255, 0.045);

  --icon: #eef4ff;
  --icon-hover: rgba(255, 255, 255, 0.06);

  --glow-strong: rgba(255, 255, 255, 0.11);
  --glow-soft: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at left center, rgba(45, 110, 255, 0.12), transparent 26%),
    radial-gradient(circle at right center, rgba(37, 180, 255, 0.09), transparent 24%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg1) 100%);
  color: var(--fg);
}

.stage {
  min-height: 100vh;
  position: relative;
}

.clock-area {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px 18px 112px;
}

.clock {
  display: grid;
  gap: 42px;
  justify-items: center;
  transform: translateY(-12px);
}

.clock-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: nowrap;
}

.number-group {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.digit-box {
  width: 146px;
  height: 214px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.digit-svg {
  width: 114px;
  height: 184px;
  display: block;
  overflow: visible;
}

.seg {
  fill: var(--fg-soft);
  opacity: 0.72;
  transition: fill 0.18s ease, opacity 0.18s ease;
}

.seg.on {
  fill: var(--fg);
  opacity: 1;
  filter:
    drop-shadow(0 0 2px var(--glow-strong))
    drop-shadow(0 0 5px var(--glow-soft));
}

.op-wrap {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline: 1px;
}

.suffix-wrap {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
  transform: translateY(4px);
}

.matrix-char {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.suffix-wrap .matrix-char {
  width: 28px;
  height: 42px;
}

.matrix-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.matrix-cell {
  fill: var(--fg-soft);
}

.matrix-cell.on {
  fill: var(--fg);
  filter:
    drop-shadow(0 0 3px var(--glow-strong))
    drop-shadow(0 0 8px var(--glow-soft));
}

.controls {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--icon);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
}

.icon-btn:hover,
.icon-btn:focus {
  background: var(--icon-hover);
  outline: none;
}

.icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon {
  display: none;
}

body.dark .icon-sun {
  display: none;
}

body.dark .icon-moon {
  display: block;
}

body:not(.dark) .seg.on,
body:not(.dark) .matrix-cell.on {
  filter:
    drop-shadow(0 0 2px rgba(17, 35, 63, 0.05))
    drop-shadow(0 0 6px rgba(17, 35, 63, 0.025));
}

@media (max-width: 1200px) {
  .digit-box {
    width: 126px;
    height: 186px;
  }

  .digit-svg {
    width: 100px;
    height: 160px;
  }

  .clock-line {
    gap: 14px;
  }

  .number-group {
    gap: 8px;
  }
}

@media (max-width: 900px) {
  .clock {
    gap: 26px;
    transform: none;
  }

  .clock-line {
    gap: 10px;
  }

  .number-group {
    gap: 6px;
  }

  .digit-box {
    width: 94px;
    height: 140px;
  }

  .digit-svg {
    width: 74px;
    height: 118px;
  }

  .op-wrap,
  .matrix-char {
    width: 30px;
    height: 30px;
  }

  .suffix-wrap .matrix-char {
    width: 20px;
    height: 30px;
  }
}

@media (max-width: 680px) {
  .clock-area {
    padding: 16px 10px 86px;
  }

  .clock {
    gap: 16px;
  }

  .clock-line {
    gap: 7px;
  }

  .number-group {
    gap: 4px;
  }

  .digit-box {
    width: 66px;
    height: 98px;
  }

  .digit-svg {
    width: 52px;
    height: 82px;
  }

  .op-wrap,
  .matrix-char {
    width: 20px;
    height: 20px;
  }

  .suffix-wrap {
    margin-left: 4px;
    gap: 3px;
    transform: translateY(2px);
  }

  .suffix-wrap .matrix-char {
    width: 14px;
    height: 22px;
  }

  .controls {
    bottom: 14px;
    gap: 14px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .icon {
    width: 19px;
    height: 19px;
  }
}