/* 全体の基本設定 */
:root {
  --bg-color: #f4f7f6;
  --text-color: #333;
  --border-color: #ccc;
}

body {
  margin: 0;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: sans-serif;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: font-family 0.3s ease;
  overflow: hidden; /* body全体はスクロールさせない */
}

/* 上部エリア */
.top-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 20%;
  width: 100%;
}
.top-left, .top-center, .top-right {
  flex: 1;
}
.top-center {
  display: flex;
  justify-content: center;
}
.top-right {
  display: flex;
  justify-content: flex-end;
}

/* 天気ウィジェット */
.weather-widget {
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: inline-block;
  min-width: 160px;
}
.weather-title { font-size: 12px; color: #666; margin-bottom: 2px; }
.weather-main { font-size: 20px; font-weight: bold; margin-bottom: 4px; }
.weather-sub { font-size: 11px; font-weight: bold; color: #555; line-height: 1.5; }

/* 気温の文字色 */
.temp-max { color: #e74c3c; } /* 赤 */
.temp-min { color: #3498db; } /* 青 */
.precip { color: #2980b9; }   /* 濃い青 */

/* --- アナログ時計 --- */
.analog-clock {
  width: 110px; 
  height: 110px;
  border: 4px solid var(--text-color);
  border-radius: 50%;
  position: relative;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.minute-mark {
  position: absolute;
  top: 2px; 
  left: 50%;
  width: 2px;
  height: 53px; 
  margin-left: -1px;
  transform-origin: bottom center;
  z-index: 0;
}
.minute-mark::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  background-color: #999; 
  border-radius: 50%;
}
.minute-mark.hour-tick::after {
  display: none;
}

.clock-number {
  position: absolute;
  top: 8px; 
  left: 50%;
  width: 20px;
  height: 47px; 
  margin-left: -10px;
  transform-origin: bottom center;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-color);
  z-index: 1;
}
.clock-number span { display: inline-block; }

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  background-color: var(--text-color);
  border-radius: 4px;
  z-index: 2;
}
.hour-hand { width: 4px; height: 28px; margin-left: -2px; }
.minute-hand { width: 3px; height: 40px; margin-left: -1.5px; }
.second-hand { width: 2px; height: 46px; margin-left: -1px; background-color: #e74c3c; z-index: 3; }
.center-dot {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 10px;
  background-color: var(--text-color); border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

/* フォント切り替えプルダウン */
.font-selector select {
  padding: 10px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  max-width: 220px;
}

/* 中央エリア（日付 ＋ 時計） */
.center-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 40%; /* 高さを少し調整 */
}
.current-date {
  font-size: 3vw;
  color: #555;
  margin-bottom: 5px; /* 余白を少し詰める */
  letter-spacing: 2px;
}
.digital-clock {
  font-size: 11vw;
  font-weight: bold;
  letter-spacing: 5px;
  line-height: 1;
}

/* 下部エリア（カレンダー） */
.bottom-area {
  height: 40%; /* 35%から40%に広げて領域を確保 */
  display: flex;
  gap: 15px;
  border-top: 2px solid var(--border-color);
  padding-top: 10px; /* 上の余白を詰める */
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  overflow-y: hidden; /* スクロールバーを完全に隠す */
  padding-bottom: 0px;
}
.bottom-area:active { cursor: grabbing; }

/* 個別のカレンダー */
.calendar-wrapper {
  flex: 1;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px; /* 内側の余白を少し詰める */
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  min-width: 200px;
}
.calendar-label { text-align: center; font-weight: bold; font-size: 14px; margin-bottom: 2px; color: #0056b3; }
.calendar-header { text-align: center; font-size: 16px; margin-bottom: 2px; }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 1px; font-size: 14px; }
.day-name { font-weight: bold; font-size: 12px; color: #666; margin-bottom: 1px; }

.sun { color: #e74c3c; } 
.sat { color: #3498db; } 

/* カレンダーの日付マス */
.day-cell { 
  padding: 1px 0; /* マス内の上下余白を最小化 */
  pointer-events: auto; 
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 30px; /* 高さを縮めて行間を詰める */
  box-sizing: border-box;
}
.day-number { line-height: 1.1; }

.day-cell.today .day-number { 
  background-color: #0056b3; 
  color: white; 
  border-radius: 50%; 
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-cell.holiday { color: #e74c3c; font-weight: bold; }
.holiday-name {
  font-size: 8px; /* 祝日名を少し小さく */
  font-weight: normal;
  color: #e74c3c;
  white-space: normal; 
  line-height: 1;
  transform: scale(0.9);
  margin-top: 1px;
}