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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

a { color: #666; text-decoration: none; }
a:hover { color: #aaa; }

/* --- main clock --- */
main {
  text-align: center;
  width: 100%;
  max-width: 900px;
}

#location {
  font-size: 1.2rem;
  color: #666;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

#clock {
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 1;
}

#clock .sep {
  color: #444;
}

#date {
  font-size: 1.1rem;
  color: #666;
  margin-top: 0.6rem;
}

.sun-info {
  font-size: 0.95rem;
  color: #555;
  margin-top: 0.5rem;
}

#sync {
  font-size: 0.75rem;
  color: #333;
  margin-top: 0.4rem;
}

/* --- world cities bar --- */
.cities {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.city {
  text-align: center;
  min-width: 80px;
}

.city-name {
  font-size: 0.8rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.city-time {
  font-size: 1.4rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #aaa;
  margin-top: 0.15rem;
}

.more-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid #222;
  padding-bottom: 2px;
}

.more-link:hover { color: #888; }

.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.nav-links a {
  font-size: 0.85rem;
  color: #444;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 2px;
}

.nav-links a:hover { color: #888; }

/* --- page header --- */
.page-header {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #ccc;
}

/* --- city directory --- */
.directory {
  text-align: left;
  max-width: 700px;
}

.city-search {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #111;
  border: 1px solid #222;
  border-radius: 6px;
  color: #ccc;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.city-search::placeholder { color: #333; }
.city-search:focus { outline: none; border-color: #333; }

.letter-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.letter-index a {
  color: #555;
  font-weight: 600;
  width: 1.6rem;
  text-align: center;
}

.letter-index a:hover { color: #fff; }

.dir-group h2 {
  font-size: 1.4rem;
  color: #444;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 0.3rem;
  margin: 1.5rem 0 0.5rem;
}

.dir-city {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}

.dir-city a {
  flex: 1;
  color: #aaa;
}

.dir-city a:hover { color: #fff; }

.dir-offset {
  color: #444;
  font-size: 0.8rem;
  min-width: 60px;
  text-align: right;
}

.dir-time {
  color: #888;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
}

/* --- footer --- */
footer {
  margin-top: 4rem;
  font-size: 0.75rem;
  color: #2a2a2a;
}

/* --- tools page --- */
.tools {
  max-width: 600px;
  text-align: left;
}

.tool-card {
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tool-card h2 {
  font-size: 1rem;
  color: #888;
  margin-bottom: 1rem;
  font-weight: 500;
}

.tool-display {
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-align: center;
  margin-bottom: 1rem;
}

.tool-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tool-controls input {
  flex: 1;
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.9rem;
}

.tool-controls input::placeholder { color: #333; }

.tool-controls button {
  padding: 0.5rem 1rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
}

.tool-controls button:hover {
  background: #222;
  color: #fff;
}

.tool-hint {
  font-size: 0.8rem;
  color: #444;
  margin-bottom: 0.75rem;
}

.tool-result {
  font-size: 1.1rem;
  color: #888;
  margin-top: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* --- responsive --- */
@media (max-width: 600px) {
  .cities { gap: 1.5rem; }
  .city-time { font-size: 1.1rem; }
  .dir-city { font-size: 0.85rem; }
  .dir-offset { display: none; }
  .tool-display { font-size: 2rem; }
}
