/* 全体 */
body {
  margin: 0;
  font-family: sans-serif;
  text-align: center;
  background: #fafafa;
  color: #222;
}

/* ヘッダー */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 8px;
  background: #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  border-bottom: 1px solid #ccc;
}

header nav {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

#topMessageControl {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

#topMessageInput {
  padding: 8px 12px;
  font-size: 1.2em;
  border: 1px solid #999;
  border-radius: 6px;
  width: 220px;
}

#setTopMessageBtn {
  padding: 8px 16px;
  font-size: 1.2em;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #f9f9f9;
  color: #222;
  font-weight: normal;
}

#setTopMessageBtn:hover {
  background: #f0f0f0;
}

#clearTopMessageBtn {
  padding: 8px 16px;
  font-size: 1.2em;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #f9f9f9;
  color: #222;
  font-weight: normal;
}

#clearTopMessageBtn:hover {
  background: #f0f0f0;
}

#showPresetsBtn {
  padding: 8px 12px;
  font-size: 1.4em;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #f9f9f9;
  color: #222;
  font-weight: normal;
}

#showPresetsBtn:hover {
  background: #f0f0f0;
}

/* プリセットドロップダウン */
#presetsDropdown {
  position: absolute;
  top: 50px;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  min-width: 250px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
}

.presetItem {
  padding: 12px 16px;
  font-size: 1.3em;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.presetItem:hover {
  background: #f0f0f0;
}

.presetItem:last-child {
  border-bottom: none;
}

#menuBtn {
  font-size: 1.8em;
  padding: 8px 16px;
  cursor: pointer;
  margin-left: auto;
}

/* トップメッセージ表示 */
#topMessageDisplay {
  position: fixed;
  top: 65px;
  left: 0;
  right: 0;
  font-size: 3.5em;
  font-weight: bold;
  color: #e53935;
  text-align: center;
  padding: 15px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(250,250,250,0.95));
  z-index: 999;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* メニュー */
#menu {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 70px;
  right: 10px;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: none;
}

#menu li button {
  display: block;
  width: 180px;
  padding: 14px;
  font-size: 1.4em;
  border: none;
  background: none;
  cursor: pointer;
}

#menu li button:hover {
  background: #f0f0f0;
}

#menu:not(.hidden) { display: block; }

/* メイン表示 */
main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  padding-top: 150px;
  padding-bottom: 50px;
  box-sizing: border-box;
}

/* 年月日 */
#date {
  font-size: 3em;
  margin: 25px 0;
  font-weight: 600;
}

/* 大きい表示 */
.bigDisplay {
  font-size: 5.5em;
  margin: 25px 0;
  font-weight: bold;
}

/* 非表示 */
.hidden { display: none; }

/* 現在時刻セクション */
#clockSection h2 {
  font-size: 3.5em;
  margin-bottom: 20px;
}

#clockSection #clock {
  font-size: 8em;
  margin: 30px 0;
}

#clockSection #statusMessage,
#clockSection #countdownMessage,
#clockSection #currentClass,
#clockSection #nextClass {
  font-size: 2.8em;
  margin: 15px 0;
}

#preEndMessage {
  color: red;
  font-weight: bold;
  font-size: 2.5em;
  margin-bottom: 15px;
}


/* 授業進行バー */
#progressContainer {
  width: 500px;
  height: 24px;
  background: #ddd;
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
}
#progressBar {
  height: 100%;
  width: 0%;
  background: #4caf50;
  transition: width 0.5s;
}

/* タイマー入力横並び */
.timerControls {
  margin: 20px 0;
}
.timerControls label {
  font-size: 1.8em;
}
.timerControls input {
  width: 90px;
  font-size: 1.8em;
  margin: 0 8px;
  text-align: center;
}
.timerButtons, .studyButtons {
  margin-top: 20px;
}
.timerButtons button,
.studyButtons button,
.memoInput button {
  padding: 14px 22px;
  margin: 6px;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 8px;
  background: #f9f9f9;
  font-size: 1.8em;
}
.timerButtons button:hover,
.studyButtons button:hover,
.memoInput button:hover {
  background: #eee;
}

/* ストップウォッチ表示 */
#studySection #studyTimer {
  font-size: 7em;
  margin: 30px 0;
}

/* メモ全体を横並びに */
.memoContainer {
  display: flex;
  gap: 25px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 15px;
}

/* 文字メモ部分 */
.memoText {
  flex: 1;
  max-width: 350px;
}
.memoInput {
  margin-bottom: 10px;
}
#noteInput {
  width: 220px;
  padding: 6px;
  font-size: 1.3em;
}
.memoList {
  max-height: 180px;
  overflow-y: auto;
  text-align: left;
  border: 1px solid #ccc;
  padding: 6px;
  width: 260px;
  margin: 0 auto;
  background: #fff;
  font-size: 1.2em;
}

/* 手書きメモ部分 */
.memoDraw {
  flex: 1;
  text-align: center;
}
#drawCanvas {
  border: 2px solid #333;
  background: #fff;
  cursor: crosshair;
  width: 400px;
  height: 250px;
}
.drawControls {
  margin-top: 10px;
  font-size: 1.2em;
}

/* 計算機 */
#calcDisplay {
  width: 260px;
  height: 50px;
  font-size: 24px;
  margin-bottom: 10px;
  text-align: right;
  padding: 5px;
  border: 1px solid #888;
  border-radius: 6px;
}
.calcRow {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.calcRow button {
  width: 60px;
  height: 50px;
  margin: 3px;
  font-size: 20px;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #fafafa;
}
.calcRow button:hover {
  background: #eee;
}

/* --- 太さ3段階 --- */
.thin   { font-weight: 300; }
.normal { font-weight: 500; }
.bold   { font-weight: 700; }

/* 設定画面 */
#settingsSection {
  width: 100%;
  overflow-y: auto;
  padding: 20px 0;
}

.settingsWrapper {
  max-width: 700px;
  width: 90%;
  margin: 0 auto;
  padding: 20px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  text-align: center;
}

.settingsBox {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settingsBox h3 {
  font-size: 1.4em;
  margin: 0 0 15px 0;
  color: #333;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 8px;
}

.settingsBox p {
  font-size: 1.1em;
  margin-bottom: 15px;
  color: #666;
}

/* 設定項目 */
.settingItem {
  margin-bottom: 12px;
  font-size: 1.1em;
  text-align: left;
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  padding: 12px 15px;
}

.settingItem label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.settingItem input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.settingItem input[type="range"] {
  width: 200px;
  vertical-align: middle;
  margin-left: 10px;
}

/* プリセットリスト */
#presetsList {
  margin-bottom: 15px;
}

.presetListItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1.2em;
}

.presetListItem span {
  flex: 1;
}

.presetListItem button {
  padding: 6px 12px;
  font-size: 1em;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #f9f9f9;
  color: #222;
  font-weight: normal;
}

.presetListItem button:hover {
  background: #f0f0f0;
}

/* プリセット追加フォーム */
.addPresetForm {
  display: flex;
  gap: 10px;
  align-items: center;
}

#newPresetInput {
  flex: 1;
  padding: 8px 12px;
  font-size: 1.1em;
  border: 1px solid #999;
  border-radius: 6px;
  max-width: 300px;
}

.addPresetForm button {
  padding: 8px 16px;
  font-size: 1.1em;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #4caf50;
  color: white;
  font-weight: normal;
}

.addPresetForm button:hover {
  background: #45a049;
}

/* テストボタン */
.testBtn {
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 1.1em;
  cursor: pointer;
  border: 1px solid #888;
  border-radius: 6px;
  background: #2196F3;
  color: white;
}

.testBtn:hover {
  background: #1976D2;
}

/* 折りたたみボタン */
.toggleBtn {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1em;
  padding: 0;
  color: #333;
  text-align: left;
  width: 100%;
  font-weight: normal;
}

.toggleBtn:hover {
  color: #4caf50;
}

/* ... (中略) ... */

/* 時間割設定 */
.scheduleSettings {
  margin-top: 15px;
  text-align: left;
  font-size: 1.1em;
}

.scheduleSettings .scheduleItem {
  /* 既存のスタイルを維持または調整 */
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 10px;
  transition: transform 0.2s;
}

.scheduleSettings .scheduleItem:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.scheduleSettings .scheduleItem label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  cursor: pointer;
}

.scheduleSettings .scheduleTime {
  font-family: monospace;
  font-size: 0.95em;
  color: #666;
  min-width: 110px;
}

.scheduleSettings .scheduleSubject {
  font-weight: 600;
  color: #333;
}

.scheduleSettings input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* 登校時間 */
.schedule-登校時間 {
  background-color: #e3f2fd; /* Light Blue */
  border-left: 5px solid #2196f3;
}

/* 朝の会, 終わりの会 */
.schedule-会 {
  background-color: #fffde7; /* Light Yellow */
  border-left: 5px solid #ffeb3b;
}

/* PBL, 基礎学習, プログラミング, 自由選択 (メイン授業) */
.schedule-メイン授業 {
  background-color: #e8f5e9; /* Light Green */
  border-left: 5px solid #4caf50;
}

/* 休憩, 昼休憩 */
.schedule-休憩 {
  background-color: #fce4ec; /* Light Pink */
  border-left: 5px solid #e91e63;
}

/* 放課後 */
.schedule-放課後 {
  background-color: #f3e5f5; /* Light Purple */
  border-left: 5px solid #9c27b0;
}