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

body {
  background-color: #ebe3d5;
  font-family: "Plus Jakarta Sans", sans-serif;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 720px;
  margin: 60px auto;
  padding: 32px;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.app-header,
.hero-card,
.city-select,
.city-card {
  border: 1px solid rgba(31, 35, 48, 0.08);
  border-radius: 12px;
  box-shadow:
    rgba(31, 35, 48, 0.12) 0px 6px 16px,
    rgba(31, 35, 48, 0.06) 0px 2px 4px;
}

.app-header,
.hero-card,
.city-select {
  background-color: rgba(255, 255, 255, 0.85);
}

.app-header {
  margin-bottom: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px;
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.14)),
    rgb(216, 27, 134);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 18px rgba(216, 27, 134, 0.12),
    0 6px 14px rgba(31, 35, 48, 0.16);
  margin-bottom: 10px;
}

.app-emoji {
  display: block;
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.12));
  transform: translateY(-1px);
}

.app-emoji circle,
app-emoji path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-title {
  position: relative;
  display: inline-block;
  margin: 0;
  color: #1f2330;
  font-size: 36px;
  font-weight: 700;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 8px 18px rgba(31, 35, 48, 0.09);
  letter-spacing: -0.02em;
}

.app-title::after {
  content: "";
  display: block;
  height: 4px;
  width: 92px;
  margin: 10px auto 0;
  border-radius: 999px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.12)),
    rgb(216, 27, 134);
}

.hero-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-right {
  text-align: right;
}

.hero-right .time-row {
  justify-content: flex-end;
}

.hero-card p,
.hero-card time {
  margin: 0;
}

.local-time-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(31, 35, 48, 0.55);
}

.local-timezone {
  font-size: 26px;
  opacity: 0.9;
  color: rgb(31, 35, 48);
  font-weight: 600;
}

.time-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.local-time {
  font-size: 52px;
  color: rgba(31, 35, 48, 0.9);
  line-height: 1;
}

.am-pm {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: #a8afbf;
}

.date {
  font-size: 14px;
  color: rgba(31, 35, 48, 0.7);
  font-weight: 600;
  line-height: 1.3;
}

.local-timezone:empty::before {
  content: "Loading timezone...";
  opacity: 0.7;
}

.local-time:empty::before {
  content: "--:--";
  opacity: 0.7;
}

.am-pm:empty::before {
  content: "--";
  opacity: 0.7;
}

.date:empty::before {
  content: "Loading date...";
  font-weight: 600;
  opacity: 0.7;
}

.picker {
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 0;
}

.picker-card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.city-select {
  width: 100%;
  display: block;
  padding: 12px 44px 12px 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.65),
      rgba(255, 255, 255, 0)
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(31,35,48,0.65)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position:
    0 0,
    right 14px center;
  background-size:
    100% 100%,
    14px 14px;
  cursor: pointer;
  border: 0;
  font-size: 16px;
  line-height: 24px;
  color: #1f2330;
  background-color: rgba(255, 255, 255, 0.92);
  border-color: rgba(31, 35, 48, 0.1);
}

.cities {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.city-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 14px 22px;
  margin-top: 0;
  color: rgba(31, 35, 48, 0.9);
}

.city-name {
  margin: 0;
  line-height: 1.2;
}

.subtext-city-date {
  margin: 0;
  font-size: 14px;
  color: rgba(31, 35, 48, 0.7);
  font-weight: 600;
  line-height: 1.3;
}

.subtext-city-date:empty::before {
  content: "Loading date...";
  opacity: 0.7;
  color: #a8afbf;
  font-size: 13px;
}

.city-time {
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  color: rgba(31, 35, 48, 0.9);
}

.city-am-pm {
  font-size: 16px;
  font-weight: 600;
  color: #a8afbf;
}

.city-time:empty::before {
  content: "--:--";
  opacity: 0.7;
  color: rgb(31, 35, 48);
  font-weight: 700;
  font-size: 32px;
}

.city-am-pm:empty::before {
  content: "--";
  opacity: 0.7;
  color: #a8afbf;
  font-size: 16px;
  font-weight: 600;
}

.city-card-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.city-card-right {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: auto;
  justify-content: flex-end;
  text-align: right;
}

.back-row {
  text-align: center;
  margin: 12px 0 0;
}

.back-link {
  color: rgb(216, 27, 134);
  display: inline-block;
  font-size: 15px;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 6px;
}
a {
  color: #1f2330;
}

footer {
  margin-top: 20px;
  text-align: center;
  color: #1f2330;
  font-size: 16px;
}

.city-select,
.city-card,
footer a {
  transition:
    box-shadow 160ms ease-in-out,
    transform 160ms ease-in-out,
    background-color 160ms ease-in-out,
    text-decoration-color 160ms ease-in-out,
    color 160ms ease-in-out;
}

.city-select:hover {
  background-color: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
  box-shadow:
    inset 3px 0 0 rgba(216, 27, 134, 0.7),
    rgba(31, 35, 48, 0.14) 0px 10px 22px,
    rgba(31, 35, 48, 0.07) 0px 3px 8px;
  border-color: transparent;
}

.city-select:focus-visible {
  outline: none;
  box-shadow:
    rgba(31, 35, 48, 0.16) 0px 10px 22px,
    rgba(31, 35, 48, 0.08) 0px 3px 8px,
    0 0 0 3px rgba(216, 27, 134, 0.42);
  border-color: transparent;
}

.city-select:hover:focus-visible {
  background-color: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
  box-shadow:
    rgba(31, 35, 48, 0.16) 0px 10px 22px,
    rgba(31, 35, 48, 0.08) 0px 3px 8px,
    0 0 0 3px rgba(216, 27, 134, 0.42);
  border-color: transparent;
}

.city-card:hover {
  transform: translateY(-2px);
  box-shadow:
    rgba(31, 35, 48, 0.16) 0px 10px 22px,
    rgba(31, 35, 48, 0.08) 0px 3px 8px;
}

footer a {
  display: inline-block;
  color: rgb(216, 27, 134);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: transparent;
}

footer a:hover,
footer a:focus-visible {
  text-decoration-color: currentColor;
}

footer a:focus-visible {
  outline: 2px solid rgba(216, 27, 134, 0.5);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (max-width: 520px) {
  .container {
    margin: 28px auto;
    padding: 16px;
  }
  .local-time {
    font-size: 44px;
  }
  .hero-row {
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .hero-right {
    margin-left: auto;
    text-align: right;
  }
}

@media (max-width: 420px) {
  .hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero-right {
    width: 100%;
    text-align: left;
  }

  .hero-right .time-row {
    justify-content: flex-start;
  }

  .local-time {
    font-size: 44px;
  }
}

@media (max-width: 360px) {
  .hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero-right {
    width: 100%;
    text-align: left;
  }

  .hero-card {
    padding: 14px;
  }

  .local-time {
    font-size: 40px;
  }

  .city-card {
    padding: 12px 16px;
  }

  .city-card-right {
    min-width: 0;
    gap: 4px;
  }

  .city-time {
    font-size: 28px;
    line-height: 1;
  }

  .city-time:empty::before {
    font-size: 28px;
    line-height: 1;
  }

  .subtext-city-date:empty::before {
    font-size: 12px;
  }

  .city-am-pm {
    font-size: 14px;
  }

  .city-am-pm:empty::before {
    font-size: 14px;
  }
}

@media (max-width: 340px) {
  .city-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .city-card-right {
    width: 100;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}
