/* === 共通スタイル === */
body {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background: #c3ba9d;
  color: #333;
  overflow: hidden;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3em 0.6em;
}

.hidden {
  display: none;
}

#site-title {
  color: #e74c3c;
  font-weight: bold;
  font-size: 1.1em;
  white-space: nowrap;
  margin-right: 1.2em;
}

/* === メニューバー === */
#menu-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #ccc;
  font-size: 0.9rem;
  padding: 4px 12px;
  flex-wrap: nowrap;
}
#menu-bar-upper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  padding: 4px 8px;
  gap: 0.5em;
}
#menu-bar-lower {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  width: 100%;
  background: none;
  padding: 2px 0 4px 0;
}
#menu-icons {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

#menu-bar i.fa-solid,
#menu-bar i.fa-regular,
#menu-bar i.fa-location-dot,
#menu-bar i.fa-note-sticky,
#menu-bar i.fa-heart,
#menu-bar i.fa-circle-info {
  color: #e74c3c;
}

/* === タイマーエリア === */
#main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 32px);
  text-align: center;
}

#timer {
  font-size: 3.5rem;
  margin-bottom: 1em;
}

#task-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1em;
}

#task-label {
  font-weight: bold;
  margin-bottom: 0.2em;
  font-size: 1.05em;
  letter-spacing: 0.02em;
  text-align: center;
}

#task-subtext {
  font-size: 0.92em;
  color: #888;
  margin-top: 0.2em;
  text-align: center;
}

#task-input {
  font-size: 1rem;
  padding: 0.4em;
  border: 1px solid #aaa;
  border-radius: 6px;
  margin-bottom: 1em;
  text-align: center;
}
#task-input:focus {
  border-color: #aab6e6;
  box-shadow: 0 0 8px #e0e7ff;
  background: #f8faff;
  transition: all 0.2s;
}

#mode-indicator {
  min-height: 1.8em;
  display: block;
  color: #7a7a7a;
  font-weight: normal;
}

#controls button {
  margin: 0 0.3em;
  font-size: 1.1rem;
}

/* === ポストイットリスト === */
#history-toggle {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 10;
  background: #eeeeee84;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  padding: 0;
  cursor: pointer;
}

#history-panel {
  background: #f9f5e8;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(180, 150, 80, 0.18);
  padding: 1.2em 1em 1em 1em;
  width: 260px;
  min-height: 120px;
  font-size: 0.95em;
  position: fixed;
  right: 16px;
  bottom: 60px;
  z-index: 20;
  border: 1.5px solid #e2d6b5;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}

#history-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

#done-list li {
  padding: 0.4em 0.2em;
  border-bottom: 1px dashed #e2d6b5;
  font-size: 1em;
  color: #7a6a3a;
  background: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  transition: background 0.2s;
  word-break: break-word;
}

#done-list li:last-child {
  border-bottom: none;
}

#history-panel ul:empty::before {
  content: "まだ記録はありません";
  color: #b8b09a;
  font-size: 0.95em;
  display: block;
  text-align: center;
  padding: 1.5em 0;
}

/* === アニメーション・オーバーレイ === */
#white-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
  z-index: 999;
}

#white-overlay.show {
  opacity: 1;
}

#end-message {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  text-align: center;
}

#end-message.visible {
  opacity: 1;
}

/* === モーダル・パネル === */
#info-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  padding: 2em 1.5em 1.5em 1.5em;
  z-index: 2100;
  min-width: 260px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  transition: opacity 0.8s, transform 0.8s;
  opacity: 1;
  pointer-events: auto;
}
#info-modal small a{text-decoration: none;color:#824c46;}
#info-modal.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -48%);
}
#close-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eee;
  color: #e74c3c;
  font-size: 1.1em;
  border: none;
  box-shadow: 0 1px 4px rgba(80,90,120,0.10);
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}
#close-info:hover {
  background: #f9d3ce;
  color: #c0392b;
}
#close-info i {
  font-size: 1.2em;
  pointer-events: none;
}

#donate-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  padding: 2em 1.5em 1.5em 1.5em;
  z-index: 2100;
  min-width: 260px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  transition: opacity 0.8s, transform 0.8s;
  opacity: 1;
  pointer-events: auto;
}
#donate-modal.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -48%);
}
#close-donate {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eee;
  color: #e74c3c;
  font-size: 1.1em;
  border: none;
  box-shadow: 0 1px 4px rgba(80,90,120,0.10);
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}
#close-donate:hover {
  background: #f9d3ce;
  color: #c0392b;
}
#close-donate i {
  font-size: 1.2em;
  pointer-events: none;
}

#modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.85);
  z-index: 2000;
  transition: opacity 0.8s;
  opacity: 1;
  pointer-events: auto;
}
#modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* === プレイリスト・ミュージック === */
#playlist-options {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  padding: 0.5em 1em;
  z-index: 1200;
  display: flex;
  gap: 0.7em;
  align-items: center;
  font-size: 0.7em;
  padding: 0.3em 0.5em;
  min-height: unset;
}
#playlist-options.hidden {
  display: none;
}
.playlist {
  font-size: 1em;
  padding: 0.3em 1.2em;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f7f7fa;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-width: 0;
}
.playlist.selected, .playlist:active {
  background: #f9d3ce;
  color: #e74c3c;
  border-color: #f5b7b1;
}
#music-player-container {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1300;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  padding: 0.7em 0.7em 0.3em 0.7em;
  min-width: 320px;
  max-width: 90vw;
  transition: opacity 0.4s;
}
#music-player-container.hidden {
  display: none;
}
#music-player {
  width: 300px;
  height: 120px;
  border: none;
  border-radius: 8px;
}
#playlist-close {
  display: inline-block;
  margin-left: 1em;
  font-size: 1.2em;
  color: #888;
  cursor: pointer;
  user-select: none;
  padding: 0 0.3em;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
#playlist-close:hover {
  background: #eee;
  color: #c00;
}

/* === コントロールボタン状態 === */
#start-btn.inactive {
  opacity: 0.7;
  pointer-events: auto;
}
#pause-btn.highlight, #start-btn.highlight {
  background: none;
  color: inherit;
  text-shadow: 0 1px 4px rgba(80,90,120,0.18);
  border: none;
}

/* === ユーティリティ === */
.highlight {
  box-shadow: 0 0 10px rgba(255, 128, 0, 0.6);
  border: 1px solid rgba(255, 128, 0, 0.8);
}

#history-panel.hidden {
  display: none !important;
}

/* === 背景グラデーション === */
#bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  /* 有機的な重ねグラデーション＋ぼかし */
  background: 
    radial-gradient(63.44% 82.03% at 55.58% -15.63%, #7ff6ff 0%, rgba(127, 246, 255, 0.26) 53.72%, rgba(127, 246, 255, 0) 100%),
    linear-gradient(26.62deg, rgba(255, 170, 120, 0.8) 20.64%, rgba(255, 170, 120, 0) 49.82%),
    linear-gradient(56.79deg, #e6aaff 33.79%, rgba(230, 170, 255, 0) 72.67%),
    linear-gradient(301.08deg, rgba(255, 210, 120, 0.91) 20.42%, rgba(255, 210, 120, 0) 60.38%),
    linear-gradient(141.57deg, rgba(120, 210, 255, 0.85) 19.08%, rgba(120, 210, 255, 0) 98.72%, #f0f8ff);
  background-blend-mode: normal,normal,darken,normal,normal,normal;
  filter: blur(45px);
}

#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: -1;
  pointer-events: none;
}

/* === ドネーションボタン === */
.donate-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: linear-gradient(90deg, #ff6347 0%, #ff9966 100%);
  color: #fff;
  font-weight: bold;
  font-size: 1.08em;
  padding: 0.7em 1.6em;
  border-radius: 2em;
  box-shadow: 0 2px 8px rgba(255,99,71,0.13);
  text-decoration: none;
  margin: 1.2em auto 0 auto;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  border: none;
  outline: none;
  cursor: pointer;
  position: relative;
  letter-spacing: 0.02em;
}
.donate-link-btn::before {
  content: "\f4b9";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.5em;
  font-size: 1.1em;
  display: inline-block;
  vertical-align: middle;
}
.donate-link-btn:hover, .donate-link-btn:focus {
  background: linear-gradient(90deg, #ff9966 0%, #ff6347 100%);
  box-shadow: 0 4px 16px rgba(255,99,71,0.22);
  transform: translateY(-2px) scale(1.04);
  text-decoration: none;
}

@media (max-width: 600px) {
 
  #menu-bar {
    flex-wrap: wrap;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    width: 100vw;
    background: transparent;
    border-bottom: 0.7rem;
    font-size: 0.8rem;
    padding: 0.2em 0;
    position: relative;
  }
  #menu-bar::before {
    content: "";
    display: block;
    width: 100vw;
    height: 2em;
    background: rgba(255,255,255,0.85);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
  }
  #menu-bar > * {
    position: relative;
    z-index: 2;
  }
  #site-title, #prefecture-select-area, #datetime {
    margin-bottom: 5em;
  }
  #weather, #hydration-alert, #music-button, #info-button, #donation-button {
    margin-top: 0;
  }
  .menu-bar-upper {
    width: 100vw;
    background: rgba(255,255,255,0.85);
    padding: 6px 4vw;
    border-radius: 0 0 16px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5em;
    margin-bottom: 2px;
  }
  #site-title, #prefecture-select-area, #datetime {
    background: none;
    padding: 0;
    border-radius: 0;
    margin: 0 0.5em 0 0;
  }
  #site-title {
    order: 1;
    font-size: 1em;
    margin: 0 0.5em 0 4vw;
    flex-basis: auto;
  }
  #prefecture-select-area {
    order: 2;
    margin: 0 0.5em;
    flex-basis: auto;
  }
  #datetime {
    order: 4;
    font-size: 0.95em;
    min-width: 48px;
    margin: 0 4vw 0 auto;
    flex-basis: auto;
  }
  #weather {
    order: 5;
    margin: 0 0.3em 0 4vw;
    flex-basis: auto;
    margin-top: 1em !important;
  }
  #hydration-alert {
    order: 6;
    margin: 0 0.3em;
    flex-basis: auto;
  }
  #music-button {
    order: 7;
    margin: 0 0.3em;
    flex-basis: auto;
  }
  #info-button {
    order: 8;
    margin: 0 0.3em;
    flex-basis: auto;
  }
  #donation-button {
    order: 9;
    margin: 0 0.3em;
    flex-basis: auto;
  }
  #music-player-container {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    min-width: 0;
    max-width: 100vw;
    margin: 0 auto 0 auto;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
    padding: 0.7em 0.7em 0.3em 0.7em;
    background: #fff;
    z-index: 1300;
  }
  #playlist-options {
    position: static !important;
    transform: none !important;
    bottom: auto !important;
    left: auto !important;
    margin: 8px auto 0 auto;
    box-shadow: none;
    width: auto;
    max-width: 90vw;
    min-width: 180px;
    border-radius: 14px;
    z-index: 1400;
    font-size: 0.7em;
    padding: 0.2em 0.2em;
    min-height: unset;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2em;
  }
  .playlist {
    font-size: 0.95em;
    padding: 0.2em 0.5em;
    min-width: 0;
  }
  #weather,
  #music-button,
  #info-button,
  #donation-button {
    margin-top: 0.7em !important;
  }
#info-modal p,#donate-modal p{text-align: left;}


}

@media (min-width: 601px) {
  #menu-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid #ccc;
    font-size: 0.9rem;
    padding: 4px 16px 4px 12px;
    width: 100%;
  }
  .menu-bar-left {
    display: flex;
    align-items: center;
  }
  .menu-bar-right {
    display: flex;
    align-items: center;
    gap: 0.7em;
    flex-wrap: wrap;
    padding-right: 1.5em;
  }
  #site-title {
    margin-right: 1.2em;
  }
  #datetime {
    margin-right: 0;
    padding-right: 0;
    max-width: 220px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .menu-bar-left > *, .menu-bar-right > * {
    position: relative;
    z-index: 2;
  }
}

@media (max-width: 600px) {
  .menu-bar-left, .menu-bar-right {
    display: contents;
  }
  #site-title, #prefecture-select-area, #datetime {
    margin-bottom: 0;
  }
  .menu-bar-left > *, .menu-bar-right > * {
    position: relative;
    z-index: 2;
  }
  #weather,
  #music-button,
  #info-button,
  #donation-button {
    margin-top: 1em !important;
  }
}

#prefecture-select-area {
  display: flex;
  align-items: center;
  gap: 0.2em;
  margin-right: 0.7em;
}
#datetime {
  font-size: 0.98em;
  color: #888;
  min-width: 60px;
  text-align: right;
}
#hydration-alert {
  color: #1e90ff;
  font-size: 0.95em;
  min-width: 1.5em;
  margin-right: 0.7em;
}
#weather {
  margin-right: 0.7em;
}
#music-button, #info-button, #donation-button {
  margin-right: 0.7em;
}
#donation-button {
  margin-right: 0.7em;
}


