:root {
  --clock-size: 200px;
  --city-size: 13px;
  --ring-outer: #111111;
  --ring-inner: #2f3238;
  --face-fill: #ffffff;
  --face-stroke: #d8d8d8;
  --tick-major: #111111;
  --tick-minor: #111111;
  --number-color: #000000;
  --city-color: #000000;
  --hand-main: #171012;
  --second-color: #c0132f;
  --center-outer: #191919;
  --center-inner: #d8d8d8;
  --clock-shadow: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  --bg-top: #0d6ad8;
  --bg-bottom: #5a2aa8;
  --ampm-color: #f7f9ff;
  --ampm-font: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --footer-fg: #f6faff;
  --footer-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --note-fg: #ffffff;
  --note-bg: rgba(8, 12, 22, 0.86);
  --note-border: rgba(255, 255, 255, 0.55);
  --note-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  padding: 20px 20px 84px;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

.app {
  width: 100%;
  max-width: 1220px;
  margin: 72px auto 0;
}

.page-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: clamp(42px, 8vw, 88px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff 0%, #8de7ff 30%, #ffd2ff 60%, #fff4a8 80%, #ffffff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.65));
  animation: title-shift 6s linear infinite;
}

.page-title.compact {
  position: fixed;
  top: 22px;
  left: 66px;
  margin: 0;
  width: max-content;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.04em;
  z-index: 22;
  animation: title-shrink-steps 0.85s steps(8, end) forwards, title-shift 6s linear infinite;
}

@keyframes title-shift {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

@keyframes title-shrink-steps {
  0% {
    transform: scale(4.6);
    transform-origin: top left;
    opacity: 1;
  }

  100% {
    transform: scale(1);
    transform-origin: top left;
    opacity: 1;
  }
}

.menu-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  background: rgba(10, 20, 40, 0.35);
  backdrop-filter: blur(3px);
  cursor: pointer;
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
}


.utc-digital {
  position: fixed;
  top: 22px;
  right: 16px;
  z-index: 22;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ampm-color);
  font-family: var(--ampm-font);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.55);
}

.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 86vw);
  height: 100vh;
  background: rgba(8, 15, 30, 0.92);
  color: #ffffff;
  padding: 66px 18px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  z-index: 25;
  overflow-y: auto;
}

.settings-panel.open {
  transform: translateX(0);
}

.settings-panel h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
}


.help-link {
  display: block;
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
}

.control {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.control span {
  font-size: 14px;
  font-weight: 700;
}

.control input[type="range"],
.control input[type="color"],
.control select {
  width: 100%;
}

.control output {
  font-size: 13px;
  opacity: 0.9;
}

.reset-layout {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, var(--clock-size)));
  column-gap: 20px;
  row-gap: 34px;
  justify-content: center;
}

.clock-grid.single-mode {
  grid-template-columns: minmax(160px, var(--clock-size));
  justify-content: start;
}

.clock-wrap {
  width: min(var(--clock-size), 100%);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.clock-wrap.is-hidden {
  display: none;
}

.clock {
  width: 100%;
  height: auto;
  display: block;
  filter: var(--clock-shadow);
}

.ampm-indicator {
  color: var(--ampm-color);
  font-family: var(--ampm-font);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.alarm-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dd1414;
  border: 2px solid #ffd534;
  display: none;
  box-shadow: 0 0 8px rgba(245, 28, 28, 0.55);
}

.alarm-indicator.active {
  display: inline-block;
}

.alarm-indicator.ringing {
  animation: alarm-pulse 0.8s ease-in-out infinite;
}

@keyframes alarm-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(245, 28, 28, 0.55);
  }

  50% {
    transform: scale(1.45);
    box-shadow: 0 0 20px rgba(255, 30, 30, 0.95);
  }
}

.clock-context-menu {
  position: fixed;
  z-index: 60;
  width: min(280px, 88vw);
  background: rgba(12, 18, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  padding: 10px;
  display: none;
  color: #ffffff;
}

.clock-context-menu.open {
  display: grid;
  gap: 8px;
}

.clock-context-menu button,
.clock-context-menu select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
}

.clock-context-menu input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  padding: 8px 10px;
}

.clock-context-menu input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.alarm-row {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 8px;
}

.clock-context-menu button {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 8px 10px;
}

.clock-context-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.clock-context-menu label {
  font-size: 12px;
  opacity: 0.92;
}

.clock-context-menu select {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  padding: 8px 10px;
}

.clock-context-menu select option {
  background: #ffffff;
  color: #111111;
}

.timed-note {
  position: fixed;
  top: 58px;
  left: 66px;
  max-width: min(440px, calc(100vw - 90px));
  padding: 8px 11px;
  border: 1px solid var(--note-border);
  border-radius: 8px;
  background: var(--note-bg);
  color: var(--note-fg);
  font-size: 15px;
  line-height: 1.35;
  z-index: 80;
  opacity: 0;
  display: none;
  pointer-events: none;
  transition: opacity 0.7s ease;
  text-shadow: var(--note-shadow);
}

.timed-note.show {
  display: block;
  opacity: 1;
}

.timed-note.alert-foreground {
  max-width: min(560px, calc(100vw - 80px));
  font-size: clamp(17px, 2.1vw, 24px);
  font-weight: 700;
  line-height: 1.25;
  border-width: 2px;
  border-color: #ffd84b;
  box-shadow: 0 0 14px rgba(255, 214, 58, 0.6);
}

.page-footer {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  z-index: 15;
  font-size: 17.6px;
}

.footer-left,
.footer-right {
  display: grid;
  gap: 3px;
}

.footer-left {
  justify-items: start;
}

.footer-right {
  justify-items: end;
  text-align: right;
}

.page-footer small,
.page-footer a {
  color: var(--footer-fg);
  text-decoration: none;
  text-shadow: var(--footer-shadow);
}

.page-footer a:hover {
  text-decoration: underline;
}

.page-footer img {
  width: 144px;
  height: auto;
  display: block;
}

.outer-ring {
  fill: var(--ring-outer);
}

.inner-ring {
  fill: var(--ring-inner);
}

.face {
  fill: var(--face-fill);
  stroke: var(--face-stroke);
  stroke-width: 0.7;
}

.tick-major {
  stroke: var(--tick-major);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tick-minor {
  stroke: var(--tick-minor);
  stroke-width: 0.65;
  opacity: 0.9;
  stroke-linecap: round;
}

.num {
  fill: var(--number-color);
  font-size: 25px;
  font-weight: 700;
  dominant-baseline: middle;
  text-anchor: middle;
}

.city {
  fill: var(--city-color);
  font-size: var(--city-size);
  font-weight: 400;
  text-anchor: middle;
}

.hand {
  stroke: var(--hand-main);
  stroke-linecap: round;
}

.hand.hour {
  stroke-width: 5.6;
}

.hand.minute {
  stroke-width: 4.4;
}

.hand.second {
  stroke: var(--second-color);
  stroke-width: 1.9;
}

.center-dot-outer {
  fill: var(--center-outer);
}

.center-dot-inner {
  fill: var(--center-inner);
}

body[data-theme="futur-shock"] {
  --ring-outer: #0d2535;
  --ring-inner: #0b3442;
  --face-fill: #071521;
  --face-stroke: #1d4d5d;
  --tick-major: #63f7ff;
  --tick-minor: #2fd2d9;
  --number-color: #9ffaff;
  --city-color: #7fe5ff;
  --hand-main: #d7f8ff;
  --second-color: #ff2f85;
  --center-outer: #6cf1ff;
  --center-inner: #081926;
  --clock-shadow: drop-shadow(0 0 12px rgba(67, 234, 255, 0.5));
  --ampm-color: #89fbff;
  --ampm-font: "Consolas", "Lucida Console", monospace;
}

body[data-theme="gold"] {
  --ring-outer: #4b3305;
  --ring-inner: #805a13;
  --face-fill: #f6ebc8;
  --face-stroke: #d1b06f;
  --tick-major: #5b3b07;
  --tick-minor: #7d5a14;
  --number-color: #4f3508;
  --city-color: #5e4110;
  --hand-main: #3d2906;
  --second-color: #a22f0e;
  --center-outer: #5f410b;
  --center-inner: #f2d799;
  --clock-shadow: drop-shadow(0 6px 12px rgba(55, 33, 6, 0.35));
  --ampm-color: #ffe6a5;
  --ampm-font: Georgia, "Times New Roman", serif;
}

body[data-theme="minimal"] {
  --ring-outer: #121212;
  --ring-inner: #303030;
  --face-fill: #ffffff;
  --face-stroke: #d8d8d8;
  --tick-major: #161616;
  --tick-minor: #222222;
  --number-color: #000000;
  --city-color: #0f0f0f;
  --hand-main: #111111;
  --second-color: #d1112f;
  --ampm-color: #f3f6ff;
}

body[data-theme="minimal"] .num {
  display: none;
}

body[data-theme="egypt"] {
  --ring-outer: #483717;
  --ring-inner: #8b6a2f;
  --face-fill: #ead7a5;
  --face-stroke: #b49355;
  --tick-major: #243e68;
  --tick-minor: #355988;
  --number-color: #243e68;
  --city-color: #3d2f14;
  --hand-main: #3d2f14;
  --second-color: #c1611a;
  --center-outer: #243e68;
  --center-inner: #ead7a5;
  --clock-shadow: drop-shadow(0 6px 12px rgba(39, 25, 7, 0.3));
  --ampm-color: #f9e4a9;
  --ampm-font: Georgia, "Times New Roman", serif;
}

body[data-theme="egypt"] .num,
body[data-theme="egypt"] .city {
  font-family: Georgia, "Times New Roman", serif;
}

body[data-theme="fantastic"] {
  --ring-outer: #2f0d5f;
  --ring-inner: #034a96;
  --face-fill: #f5fbff;
  --face-stroke: #53d7ff;
  --tick-major: #7a16d8;
  --tick-minor: #0e78c9;
  --number-color: #6a15cb;
  --city-color: #0d63b1;
  --hand-main: #171431;
  --second-color: #ff1579;
  --center-outer: #7a16d8;
  --center-inner: #ffffff;
  --clock-shadow: drop-shadow(0 0 14px rgba(80, 120, 255, 0.55));
  --ampm-color: #f6fbff;
  --ampm-font: "Trebuchet MS", "Segoe UI", sans-serif;
}

body[data-theme="fantastic"] .clock {
  animation: fantastic-pulse 2.2s ease-in-out infinite;
}

@keyframes fantastic-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(90, 120, 255, 0.4));
  }

  50% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 18px rgba(252, 56, 196, 0.58));
  }
}

@media (max-width: 1200px) {
  .clock-grid {
    grid-template-columns: repeat(4, minmax(160px, var(--clock-size)));
  }
}

@media (max-width: 980px) {
  .clock-grid {
    grid-template-columns: repeat(3, minmax(160px, var(--clock-size)));
  }
}

@media (max-width: 760px) {
  .page-title.compact {
    display: none;
  }

  .clock-grid {
    grid-template-columns: repeat(2, minmax(160px, var(--clock-size)));
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 10px 118px;
  }

  .app {
    margin-top: 62px;
  }

  
  .utc-digital {
    top: 24px;
    right: 10px;
    font-size: 15px;
  }

  .clock-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .page-footer {
    left: 10px;
    right: 10px;
    bottom: 8px;
    align-items: start;
  }

  .timed-note {
    top: 52px;
    left: 62px;
    font-size: 13px;
  }

  .page-footer img {
    width: 125px;
  }
}


