/* 1日の時計 — iPhoneで片手で使うための画面 */
:root {
  --bg: #0f1420;
  --panel: #171e2e;
  --line: #26304a;
  --text: #eaf0ff;
  --muted: #93a0bd;
  /* 3人の色（担当する時間帯の色） */
  --kaho: #34a853;    /* 本業 */
  --tomo: #5b8def;    /* 副業 */
  --hitomi: #f4a2b6;  /* 生活 */
  --sleep: #4a5578;   /* 睡眠 */
  --done: #4ade80;   /* ボタンの色 */
  --finished: #fbbf24; /* やり終えた区間の色（金） */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  font-size: 16px;
  overscroll-behavior-y: contain;
}
#app {
  max-width: 460px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}

.top { display: flex; align-items: center; justify-content: space-between; }
.date { display: flex; flex-direction: column; gap: 2px; }
#date-text { font-size: 14px; color: var(--muted); font-weight: 700; }
.now { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.mode-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 18px; font-size: 13.5px; font-weight: 800;
}
.mode-btn:active { transform: scale(.96); }

/* 時計 */
.clock-wrap { position: relative; display: grid; place-items: center; }
#clock { width: min(88vw, 380px); height: auto; display: block; }
.dial-bg { fill: #121828; stroke: var(--line); stroke-width: 1; }
.dial-inner { fill: var(--bg); }
.arc { fill: none; stroke-width: 46; stroke-linecap: butt; opacity: .95; }
.arc.past { opacity: .34; }
.sub-arc { fill: none; stroke-width: 13; stroke-linecap: round; opacity: .95; }
.sub-arc.past { opacity: .3; }
.sub-arc.done { stroke: var(--finished) !important; }
.arc.done { stroke: var(--finished) !important; opacity: .95; }
.tick { stroke: #3a466b; stroke-width: 1; }
.tick.major { stroke: #5f6d97; stroke-width: 1.6; }
.tick-label { fill: #7a88ad; font-size: 9.5px; font-weight: 700; text-anchor: middle; }
.hand-line { stroke: #fff; stroke-width: 3; stroke-linecap: round; filter: url(#soft); }
.hand-pin { fill: #fff; }

/* 時計の中央（文字だけ） */
.center {
  position: absolute; display: grid; place-items: center; gap: 3px;
  pointer-events: none; text-align: center;
}
.center-role {
  font-size: 12px; font-weight: 800; letter-spacing: .14em;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line);
}

/* 右下にいる担当キャラ */
.mascot {
  position: fixed; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none;
}
.mascot-btn {
  pointer-events: auto; background: none; border: 0; padding: 0;
  display: grid; place-items: center; gap: 3px;
}
.mascot-btn:active { transform: scale(.95); }
.mascot-name {
  font-size: 11px; font-weight: 800; color: var(--text);
  background: rgba(15,20,32,.86); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px;
}
.avatar {
  width: auto; height: 132px;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.55));
  animation: breathe 4.4s ease-in-out infinite;
}
.avatar.cheer { animation: cheer .9s cubic-bezier(.22,1.4,.4,1); }
@keyframes breathe {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-3px) scale(1.015); }
}
@keyframes cheer {
  0%   { transform: scale(1) rotate(0); }
  25%  { transform: scale(1.16) rotate(-6deg); }
  55%  { transform: scale(1.06) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.center-label { font-size: 13.5px; font-weight: 800; margin-top: 4px; max-width: 104px; line-height: 1.4; }
.center-sub { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* 吹き出し（キャラの上に出る） */
.bubble {
  pointer-events: none;
  max-width: min(66vw, 260px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px 16px 4px 16px; padding: 10px 14px;
  font-size: 13.5px; font-weight: 700; line-height: 1.55;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(8px) scale(.96);
  transition: opacity .3s, transform .3s;
}
.bubble.show { opacity: 1; transform: translateY(0) scale(1); }

/* 次にやること */
.next-cap, .list-cap { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; display: grid; gap: 6px;
}
.card-time { font-size: 13px; color: var(--muted); font-weight: 800; }
.card-title { font-size: 19px; font-weight: 800; line-height: 1.45; }
.done {
  margin-top: 8px; border: 0; border-radius: 14px; padding: 15px;
  background: var(--done); color: #08301a; font-size: 16.5px; font-weight: 800;
}
.done:active { transform: scale(.98); }
.card.finished .card-title { text-decoration: line-through; color: var(--muted); }

/* 一覧 */
.list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li {
  display: grid; grid-template-columns: 54px 10px 1fr; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 14.5px; font-weight: 700;
}
.list li .t { color: var(--muted); font-size: 12.5px; font-weight: 800; }
.list li .dot { width: 10px; height: 10px; border-radius: 50%; }
.list li.finished .n { text-decoration: line-through; color: var(--muted); }
.list li:active { transform: scale(.99); }

.list { padding-bottom: 96px; }
.foot { text-align: center; color: #5d6a8c; font-size: 11.5px; font-weight: 700; margin-top: 2px; }

/* 上のボタン並び */
.top-btns { display: flex; gap: 8px; }
.mode-btn.ghost { background: transparent; color: var(--muted); }

/* 1日の型の編集 */
.editor {
  position: fixed; inset: 0; z-index: 100;
  background: #0b0f1a;
  overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
}
.editor[hidden] { display: none; }
.editor-inner { max-width: 460px; margin: 0 auto; display: grid; gap: 14px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; }
.editor-head strong { font-size: 19px; }
.editor-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.type-tab {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 800;
}
.type-tab.on { background: #21304e; color: var(--text);  }
.type-tab.on { border-color: #4a6296; }
.edit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.edit-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: grid; gap: 8px;
}
.edit-times { display: flex; align-items: center; gap: 8px; }
.edit-row input[type="time"], .edit-row input[type="text"], .edit-row select {
  background: #0e1422; color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; font-size: 15px; font-family: inherit;
}
.edit-row input[type="text"] { width: 100%; }
.edit-bottom { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.edit-row select { min-width: 104px; }
.del-btn {
  background: transparent; border: 1px solid #6b2436; color: #f19ab0;
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 800;
}
.editor-actions { display: grid; gap: 8px; }
.add-btn {
  background: #21304e; color: var(--text); border: 1px solid #3f5480;
  border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 800;
}
.add-btn.ghost { background: transparent; color: var(--muted); }
.editor-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0; }
