:root {
  /* 漢字とパネルで変数を分離 */
  --kanji-color: #00ffcc;
  --panel-color: #00ffcc;
  --kanji-font: 'Noto Serif JP', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  height: 100vh;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #121212;
  color: #ffffff;
  overflow: hidden;
}

/* --- 左半分（漢字エリア） --- */
.left-panel {
  flex: 7;
  background-color: #000000;
  border-right: 1px solid #333;
  overflow-y: auto; 
  overflow-x: hidden;
  padding: 20px;
  position: relative;
}

.left-panel::-webkit-scrollbar {
  width: 8px;
}
.left-panel::-webkit-scrollbar-track {
  background: #111;
}
.left-panel::-webkit-scrollbar-thumb {
  background: var(--kanji-color);
  border-radius: 4px;
}

/* --- 設定開閉ボタン --- */
.settings-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: rgba(20, 20, 20, 0.9);
  color: #aaaaaa;
  border: 1px solid #333;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 200;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.settings-toggle:hover {
  border-color: #00ffcc;
  color: #ffffff;
}

/* --- 設定パネル --- */
.settings-panel {
  position: fixed;
  top: 70px;
  left: 20px;
  background-color: rgba(20, 20, 20, 0.95);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #333;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  min-width: 250px;
}

.settings-panel.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.control-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.control-group label {
  color: #aaaaaa;
  font-size: 0.9rem;
}

.control-group input[type="color"] {
  border: none;
  width: 40px;
  height: 30px;
  padding: 0;
  background: none;
  cursor: pointer;
}

.control-group select {
  background-color: #000;
  color: #ffffff;
  border: 1px solid #555;
  padding: 5px;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  flex: 1;
  max-width: 140px;
}

.divider {
  border: 0;
  height: 1px;
  background: #444;
  margin: 5px 0;
}

.rainbow-label {
  color: #fff !important;
  font-weight: bold;
}

/* --- 漢字のテキスト設定 --- */
#kanji-container {
  color: var(--kanji-color);
  font-family: var(--kanji-font);
  font-size: 24px;
  line-height: 1.6;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  word-break: break-all;
  padding-top: 60px;
}

.kanji-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
  cursor: pointer;
}

.kanji-link:hover {
  color: #ffffff;
  text-shadow: 0 0 10px #ffffff, 0 0 20px var(--kanji-color);
}

/* 🌈 レインボーモード時の特殊スタイル */
#kanji-container.rainbow-mode {
  background: linear-gradient(
    90deg,
    #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff, #8b00ff, #ff0000
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-scroll 4s linear infinite;
  text-shadow: none; /* グラデーションを綺麗に見せるため影を消す */
}

/* レインボー中は個別のリンクも透明にして背景を透過させる */
#kanji-container.rainbow-mode .kanji-link {
  color: transparent; 
}

#kanji-container.rainbow-mode .kanji-link:hover {
  color: #ffffff;
  text-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff;
}

@keyframes rainbow-scroll {
  0% { background-position: 0% center; }
  100% { background-position: -200% center; }
}

/* --- 右半分（ダッシュボード） --- */
.right-panel {
  flex: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 30px;
  background-color: #1e1e1e;
  min-width: 300px;
}

.date-container {
  font-size: 1.2rem;
  color: #aaaaaa;
  text-align: center;
  margin-bottom: 5px;
}

/* パネルカラーを変数で制御 */
.clock-container {
  font-family: 'Share Tech Mono', monospace;
  font-size: 4rem;
  color: var(--panel-color);
  text-shadow: 0 0 10px var(--panel-color);
  letter-spacing: 0.1rem;
  text-align: center;
}

.info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 320px;
}

.weather-container {
  width: 100%;
  font-size: 1.1rem;
  padding: 20px;
  background-color: #2a2a2a;
  border-radius: 8px;
}

.calendar-container {
  width: 100%;
  background-color: #2a2a2a;
  padding: 20px;
  border-radius: 8px;
}

.cal-month {
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #dddddd;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
}

.cal-header {
  font-size: 0.9rem;
  color: #888;
  padding-bottom: 5px;
}

.cal-cell {
  padding: 8px 0;
  border-radius: 4px;
  font-size: 1rem;
}

/* 今日の日付もパネルカラーで制御 */
.cal-cell.today {
  background-color: var(--panel-color);
  color: #000;
  font-weight: bold;
  box-shadow: 0 0 8px var(--panel-color);
}

.cal-cell.empty {
  background-color: transparent;
}