:root {
  --bg-color: #f6f8fd;
  --text-main: #111111;
  --text-sub: #4b5563;
  --card-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.8);
  --border-color: rgba(255, 255, 255, 0.6);
  --temp-max: #c0392b;
  --temp-min: #0984e3;
  --font-family: 'Inter', 'Noto Sans JP', sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
}

html {
  background-color: #fdfbfb;
}

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

body {
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 20px;
}

@media (max-width: 600px) {
  body {
    align-items: flex-start;
  }
}

.container {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 16px;
}

/* 地域名とリンクの縦中央揃え設定 */
.location-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.location-nav {
  display: flex;
  align-items: center;
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #3b82f6;
  /* Pale blue link color */
  background: rgba(59, 130, 246, 0.1);
  /* Very subtle pale blue tint */
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.date {
  font-size: 1.05rem;
  color: var(--text-sub);
  font-weight: 500;
  margin-bottom: 2px;
}

.clock-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: 8px 0;
}

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

.current-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  min-width: 90px;
  margin-top: 10px;
}

.current-label {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 1px;
  margin-top: -1em;
  margin-left: 1em;
  color: var(--text-sub);
}

.current-main {
  display: flex;
  align-items: center;
  margin-top: -4px;
  height: 36px;
  min-width: 80px;
  justify-content: center;
}

.current-icon-small {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-icon-small img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.current-temp-small {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.current-pop-small {
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 600;
  line-height: 1;
  padding-left: 14px;
  margin-top: -2px;
  min-width: 60px;
  text-align: center;
}

.time {
  font-size: 5.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  white-space: nowrap;
}

.time-part {
  display: inline-block;
}

@keyframes flip-down {
  0% {
    transform: rotateX(90deg);
    opacity: 0;
  }

  100% {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

.time-animate {
  animation: flip-down 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seconds {
  font-size: 2.3rem;
  font-weight: 500;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.weather-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.weather-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-align: center;
}

.card-title {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-weight: 600;
  letter-spacing: 1px;
}

.weather-icon {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-icon img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.weather-desc {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  min-height: 1.5em;
  display: flex;
  align-items: center;
}

.pop {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-weight: 600;
  margin-top: -4px;
  min-width: 60px;
}

.temps {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 4px;
  min-width: 100px;
}

.temp-max {
  color: var(--temp-max);
}

.temp-min {
  color: var(--temp-min);
}

.weekly-section {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 8px;
  min-height: 140px;
  /* 固定高さでカクつき防止 */
}

.weekly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
  gap: 8px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.weekly-day {
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.85rem;
}

.weekly-item img {
  width: 36px;
  height: 36px;
}

.weekly-pop {
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 600;
  margin-top: -4px;
  white-space: nowrap;
}

.weekly-temps {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .container {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: flex-start;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 32px 16px;
    gap: 28px;
  }

  .header {
    padding-bottom: 12px;
  }

  .clock-section {
    margin: 0;
  }

  .time {
    font-size: 4rem;
  }

  .seconds {
    font-size: 1.5rem;
  }

  .weather-card {
    padding: 16px 8px;
  }

  .weather-icon,
  .weather-icon img {
    height: 64px;
    width: 64px;
  }

  .weekly-section {
    gap: 6px;
    padding-top: 16px;
    min-height: 130px;
  }

  .weekly-item {
    min-width: 0;
    flex: 1;
    padding: 12px 4px;
  }

  .weekly-day,
  .weekly-pop,
  .weekly-temps {
    font-size: 0.8rem;
  }
}

/* ==========================================
   天気アイコンのさりげないアニメーション
   ========================================== */

/* 晴れ: ゆっくり回転 */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.anim-sunny {
  animation: spin-slow 45s linear infinite;
  transform-origin: center;
}

/* 曇り: わずかな横漂い */
@keyframes float-cloud {
  0% { transform: translateX(0) translateY(0); }
  33% { transform: translateX(2px) translateY(-1px); }
  66% { transform: translateX(-1.5px) translateY(1px); }
  100% { transform: translateX(0) translateY(0); }
}
.anim-cloudy {
  animation: float-cloud 10s ease-in-out infinite;
}

/* 雨: かすかな縦バウンド */
@keyframes rain-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}
.anim-rainy {
  animation: rain-bounce 4s ease-in-out infinite;
}

/* 雪: フワフワと揺れる */
@keyframes snow-sway {
  0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
  25% { transform: translateX(1.5px) translateY(1.5px) rotate(3deg); }
  75% { transform: translateX(-1.5px) translateY(1.5px) rotate(-3deg); }
}
.anim-snowy {
  animation: snow-sway 7s ease-in-out infinite;
}

/* 雷: たまにビクッと震える（稲妻を表現） */
@keyframes thunder-jitter {
  0%, 94%, 100% { transform: translateX(0) translateY(0) scale(1); }
  95% { transform: translateX(-1.5px) translateY(1.5px) scale(1.02); }
  96% { transform: translateX(1.5px) translateY(-1.5px) scale(0.98); }
  97% { transform: translateX(0) translateY(0) scale(1); }
  98% { transform: translateX(1.5px) translateY(1.5px) scale(1.02); }
  99% { transform: translateX(-1.5px) translateY(-1.5px) scale(0.98); }
}
.anim-thunder {
  animation: thunder-jitter 8s infinite;
}