:root {
  /* 全体の背景（宇宙のような暗い色で固定） */
  --bg-color: #121820; 
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  font-family: 'Noto Sans JP', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.header {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 15px;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid #2c3847;
  height: 40px;
  box-sizing: border-box;
  color: #ffffff;
}

.header h1 { margin: 0; font-size: 16px; letter-spacing: 2px; }
.header p { margin: 0; color: #8b9bb4; font-size: 12px; }

/* ダッシュボードグリッド */
.dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  padding: 6px;
  box-sizing: border-box;
}

/* ==========================================
   時間帯ごとのテーマカラー定義
   ========================================== */

/* ☀️ 昼のテーマ（朝7時〜16時59分）：明るい色 */
.card-day {
  --card-bg: #f4f9f9;
  --text-main: #1a2332;
  --text-sub: #54667a;
  --border-color: #cce3f0;
  --accent-color: #0077cc;
  --card-hover-bg: #e2f0f9;
  --shadow-color: rgba(0, 119, 204, 0.2);
}

/* 🌅 間のテーマ（朝5時〜6時、夕方17時〜18時）：夕暮れ/夜明け色 */
.card-twilight {
  --card-bg: #3b4256;
  --text-main: #fdf5e6;
  --text-sub: #b8c2d1;
  --border-color: #555f7a;
  --accent-color: #ffaa00;
  --card-hover-bg: #4a536b;
  --shadow-color: rgba(255, 170, 0, 0.3);
}

/* 🌙 夜のテーマ（夜19時〜朝4時59分）：暗い色 */
.card-night {
  --card-bg: #1e2630;
  --text-main: #ffffff;
  --text-sub: #8b9bb4;
  --border-color: #2c3847;
  --accent-color: #00d2ff;
  --card-hover-bg: #232c38;
  --shadow-color: rgba(0, 210, 255, 0.4);
}

/* 個別の都市カード */
.city-card {
  background-color: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  overflow: hidden;
}

.city-card:hover {
  border-color: var(--accent-color);
  background-color: var(--card-hover-bg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.location-info { overflow: hidden; }
.location-info .city {
  font-size: clamp(12px, 1.2vw, 16px); 
  font-weight: bold;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.location-info .country {
  font-size: 9px;
  color: var(--text-sub);
  margin: 1px 0 0 0;
  white-space: nowrap;
}

.weather-info { text-align: right; min-width: 40px; }
.weather-info .w-icon { font-size: 16px; line-height: 1; }
.weather-info .w-temp {
  font-size: 11px;
  font-weight: bold;
  color: var(--accent-color);
  margin-top: 2px;
}

.time-info { text-align: center; margin-top: auto; }
.time-info .date {
  font-size: 10px;
  color: var(--text-sub);
  margin-bottom: 2px;
}
.time-info .time {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(20px, 2.5vw, 32px);
  color: var(--text-main);
  line-height: 1;
  letter-spacing: 1px;
  text-shadow: 0 0 8px var(--shadow-color);
}

/* フッター */
.footer {
  text-align: center;
  padding: 4px;
  font-size: 10px;
  color: #8b9bb4;
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 1px dashed #2c3847;
  height: 22px;
  box-sizing: border-box;
}
.footer p { margin: 0; }
.footer a { color: #00d2ff; text-decoration: none; }
.footer a:hover { text-decoration: underline; }