body {
  overflow-x: hidden;
  overflow-y: auto;
}

.app {
  position: relative;
  z-index: 2;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.topbar {
  gap: 2rem;
  padding: 1.2rem 2rem;
  margin-bottom: 1rem;
}

.search-wrap {
  position: relative;
  width: 420px;
  max-width: 100%;
}
.search-wrap input {
  width: 100%;
  height: 62px;
  border: none;
  outline: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 1.2rem;
  font-size: 0.94rem;
  font-family: "IBM Plex Mono", monospace;
  backdrop-filter: blur(18px);
  transition: 0.18s ease;
}
.search-wrap input:focus {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.03);
}
.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  overflow: hidden;
  display: none;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  z-index: 30;
}
.search-results.visible {
  display: block;
}
.search-item {
  padding: 1rem 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: 0.15s ease;
}
.search-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.search-item strong {
  font-size: 0.95rem;
  font-weight: 600;
}
.search-item small {
  font-family: "IBM Plex Mono", monospace;
  color: #888;
  font-size: 0.72rem;
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.86;
  letter-spacing: -0.09em;
}
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.14em;
  backdrop-filter: blur(18px);
}
.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}
.hero-time {
  text-align: right;
}
.hero-time h2 {
  font-size: 3rem;
  letter-spacing: -0.08em;
}
.hero-time p {
  margin-top: 0.4rem;
  color: #777;
  font-size: 0.95rem;
}
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(420px, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.panel {
  border-radius: 34px;
  padding: 1.5rem;
}
.clock-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 2rem;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.92),
      #dcdc2d
    );
}
.clock-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.label {
  font-family: "IBM Plex Mono", monospace;
  margin-bottom: 0.7rem;
}
.clock-header h2 {
  font-size: 2.8rem;
  letter-spacing: -0.08em;
  line-height: 0.88;
}
.timezone-chip {
  padding: 0.78rem 1rem;
  border-radius: 16px;
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}
.analog-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
  overflow: hidden;
}
.clock-face {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at top,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.58)
  );
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.tick {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 14px;
  background: rgba(0, 0, 0, 0.12);
}
.tick.major {
  height: 24px;
  background: rgba(0, 0, 0, 0.24);
}
.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  border-radius: 999px;
}
.hour {
  width: 8px;
  height: 82px;
  background: #111;
  margin-left: -4px;
  z-index: 4;
}
.minute {
  width: 5px;
  height: 118px;
  background: #222;
  margin-left: -2.5px;
  z-index: 5;
}
.second {
  width: 2px;
  height: 140px;
  background: var(--accent);
  margin-left: -1px;
  z-index: 6;
}
.center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111;
  border: 4px solid #fff;
  z-index: 10;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.stat-card {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.03);
}
.stat-card span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  color: #777;
  margin-bottom: 0.7rem;
}
.stat-card strong {
  font-size: 1.25rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.compare-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 760px;
}
.compare-top h2 {
  font-size: 2rem;
  letter-spacing: -0.06em;
}
.compare-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}
.compare-controls select {
  height: 58px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
}
.compare-separator {
  font-size: 1.5rem;
  font-weight: 700;
  opacity: 0.5;
}
.compare-result {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}
.compare-box,
.difference-box {
  padding: 1.2rem;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.03);
  text-align: center;
}
.compare-box span,
.difference-box span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  color: #777;
  margin-bottom: 0.7rem;
}
.compare-box h3 {
  font-size: 2rem;
  letter-spacing: -0.06em;
  margin-bottom: 0.35rem;
}
.compare-box p {
  color: #666;
  font-size: 0.92rem;
}
.difference-box h2 {
  font-size: 2.3rem;
  letter-spacing: -0.08em;
}
.city-list-wrap {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: 720px;
}
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
#cityCount {
  font-size: 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  color: #777;
}
.city-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.3rem;
  flex: 1;
}
.city-list::-webkit-scrollbar {
  width: 8px;
}
.city-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}
.city-card {
  padding: 1rem;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.16s ease;
}
.city-card:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.05);
}
.city-card.active {
  background: rgba(36, 83, 255, 0.08);
  border-color: rgba(36, 83, 255, 0.16);
}
.city-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.city-card h3 {
  font-size: 1.15rem;
  letter-spacing: -0.05em;
  margin-bottom: 0.35rem;
}
.city-card small {
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  color: #777;
}
.city-card-time {
  font-size: 1rem;
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .app {
    padding: 1rem;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .clock-panel {
    position: relative;
    top: 0;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-side {
    align-items: flex-start;
  }
  .compare-controls {
    grid-template-columns: 1fr;
  }
  .compare-result {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .clock-face {
    max-width: 320px;
  }
  .city-list-wrap {
    max-height: none;
    min-height: unset;
  }
  .hero h1 {
    font-size: clamp(2.8rem, 12vw, 5rem);
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-time h2 {
    font-size: 2.2rem;
  }
  .clock-header {
    flex-direction: column;
  }
  .compare-panel {
    min-height: auto;
  }
  .compare-box h3,
  .difference-box h2 {
    font-size: 1.7rem;
  }
}
