/* ============================================================
   LifeBoard — グラスモーフィズム×ダッシュボード PWA
   ============================================================ */

:root {
  --bg-deep: #0d0420;
  --bg-mid: #1a0b2e;
  --bg-high: #2d1b4e;
  --bg-glow: #4a1a7a;

  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --glass-blur: 22px;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --text-primary: rgba(255, 255, 255, 0.96);
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-faint: rgba(255, 255, 255, 0.28);

  --accent-todo: #4ECDC4;
  --accent-todo-glow: rgba(78, 205, 196, 0.45);
  --accent-bucket: #FFD93D;
  --accent-bucket-glow: rgba(255, 217, 61, 0.45);
  --accent-wish: #FF6B9D;
  --accent-wish-glow: rgba(255, 107, 157, 0.45);
  --accent-book: #B5E48C;
  --accent-book-glow: rgba(181, 228, 140, 0.45);

  --danger: #FF6B6B;
  --success: #4ECDC4;
  --warning: #FFB627;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 38px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.01em;
}

input, textarea, button { font-family: inherit; user-select: text; -webkit-user-select: text; }

/* 背景：オーロラ風グラデ */
#bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(91, 33, 182, 0.55) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(236, 72, 153, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(34, 211, 238, 0.30) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 50%, var(--bg-high) 100%);
  animation: aurora-shift 24s ease-in-out infinite;
}

@keyframes aurora-shift {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.1) translateY(-10px); }
}

#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

/* ガラスパネル基本クラス */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
  position: relative;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* メインレイアウト */
#app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(env(safe-area-inset-top), 12px) 16px max(env(safe-area-inset-bottom), 100px);
  max-width: 720px;
  margin: 0 auto;
}

/* 画面切り替え */
.screen { display: none; animation: screen-in 0.35s var(--ease); }
.screen.active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ホーム画面
   ============================================================ */

.hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 4px 20px;
}

.greeting { display: flex; flex-direction: column; gap: 4px; }
.greeting__time {
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.greeting__date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ヒーローカード */
.hero-card {
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(78, 205, 196, 0.25) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.hero-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent-todo);
  text-transform: uppercase;
}
.hero-card__count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.hero-card__list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.hero-card__list li {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hero-card__list li:last-child { border-bottom: none; }
.hero-card__list li::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-todo);
  box-shadow: 0 0 12px var(--accent-todo-glow);
  flex-shrink: 0;
}
.hero-card__list .hero-card__empty {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 14px;
  justify-content: center;
}
.hero-card__list .hero-card__empty::before { display: none; }
.hero-card__list li .hero-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* 4分割サマリーグリッド */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-card {
  position: relative;
  padding: 20px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--bounce), box-shadow 0.25s var(--ease);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.summary-card:active { transform: scale(0.97); }
.summary-card:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(0,0,0,0.4); }

.summary-card__icon {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 32px;
  opacity: 0.85;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.summary-card__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.summary-card__main {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: auto;
}
.summary-card__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.summary-card--todo .summary-card__main { color: var(--accent-todo); }
.summary-card--bucket .summary-card__main { color: var(--accent-bucket); }
.summary-card--wish .summary-card__main { color: var(--accent-wish); }
.summary-card--book .summary-card__main { color: var(--accent-book); }

.summary-card--todo::after,
.summary-card--bucket::after,
.summary-card--wish::after,
.summary-card--book::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.4;
  pointer-events: none;
}
.summary-card--todo::after { background: var(--accent-todo); }
.summary-card--bucket::after { background: var(--accent-bucket); }
.summary-card--wish::after { background: var(--accent-wish); }
.summary-card--book::after { background: var(--accent-book); }

/* ============================================================
   画面ヘッダー（戻る + タイトル）
   ============================================================ */

.screen__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 20px;
}
.screen__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--settings { margin-top: 6px; }

/* ============================================================
   タブ（共通）
   ============================================================ */

.todo-tabs, .wish-tabs, .book-status-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  overflow-x: auto;
  scrollbar-width: none;
}
.todo-tabs::-webkit-scrollbar, .wish-tabs::-webkit-scrollbar, .book-status-tabs::-webkit-scrollbar { display: none; }

.todo-tab, .wish-tab, .book-status-tab {
  flex: 1;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.todo-tab.active, .wish-tab.active, .book-status-tab.active {
  background: var(--glass-bg-strong);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.bucket-tabs, .book-genre-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.bucket-tabs::-webkit-scrollbar, .book-genre-tabs::-webkit-scrollbar { display: none; }
.bucket-tab, .book-genre-tab {
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
}
.bucket-tab.active { background: rgba(255, 217, 61, 0.18); border-color: var(--accent-bucket); color: var(--accent-bucket); }
.book-genre-tab.active { background: rgba(181, 228, 140, 0.18); border-color: var(--accent-book); color: var(--accent-book); }

/* ============================================================
   To-Do 一覧
   ============================================================ */

.todo-list { display: flex; flex-direction: column; gap: 10px; }

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.todo-item.completed { opacity: 0.55; }
.todo-item.completed .todo-item__title { text-decoration: line-through; color: var(--text-muted); }

.todo-checkbox {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all 0.3s var(--bounce);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
}
.todo-checkbox:active { transform: scale(0.85); }
.todo-item.completed .todo-checkbox {
  background: var(--accent-todo);
  border-color: var(--accent-todo);
  box-shadow: 0 0 16px var(--accent-todo-glow);
}
.todo-checkbox svg { width: 14px; height: 14px; color: var(--bg-deep); opacity: 0; transition: opacity 0.25s; }
.todo-item.completed .todo-checkbox svg { opacity: 1; }

.todo-item__body { flex: 1; min-width: 0; }
.todo-item__title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.todo-item__meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.todo-quadrant-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.todo-quadrant-badge.q1 { background: rgba(255, 107, 107, 0.18); color: #FF8888; }
.todo-quadrant-badge.q2 { background: rgba(78, 205, 196, 0.18); color: var(--accent-todo); }
.todo-quadrant-badge.q3 { background: rgba(255, 217, 61, 0.18); color: var(--accent-bucket); }
.todo-quadrant-badge.q4 { background: rgba(255,255,255,0.08); color: var(--text-muted); }

.todo-due {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.todo-due.overdue { color: var(--danger); }
.todo-due.today { color: var(--accent-todo); }

.todo-calendar-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s;
}
.todo-calendar-btn:active { transform: scale(0.9); color: var(--accent-todo); }
.todo-calendar-btn.synced { color: var(--accent-todo); }

/* マトリクス表示 */
.todo-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: calc(100vh - 280px);
  min-height: 480px;
}
.matrix-cell {
  padding: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.matrix-cell__header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
}
.matrix-cell.q1 .matrix-cell__header { color: #FF8888; }
.matrix-cell.q2 .matrix-cell__header { color: var(--accent-todo); }
.matrix-cell.q3 .matrix-cell__header { color: var(--accent-bucket); }
.matrix-cell.q4 .matrix-cell__header { color: var(--text-muted); }

.matrix-cell.q1 { background: linear-gradient(135deg, rgba(255,107,107,0.12), var(--glass-bg)); }
.matrix-cell.q2 { background: linear-gradient(135deg, rgba(78,205,196,0.12), var(--glass-bg)); border-color: rgba(78,205,196,0.3); }
.matrix-cell.q3 { background: linear-gradient(135deg, rgba(255,217,61,0.10), var(--glass-bg)); }
.matrix-cell.q4 { background: var(--glass-bg); }

.matrix-task {
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.2s;
  word-break: break-word;
}
.matrix-task:active { transform: scale(0.97); }
.matrix-task.completed { opacity: 0.4; text-decoration: line-through; }

/* ============================================================
   バケットリスト
   ============================================================ */

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.bucket-card {
  position: relative;
  padding: 16px;
  min-height: 160px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bucket-card:active { transform: scale(0.97); }
.bucket-card.unachieved { filter: saturate(0.4) brightness(0.85); }
.bucket-card.unachieved:hover { filter: saturate(0.6) brightness(0.95); }
.bucket-card.achieved::before {
  content: '✨';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 22px;
  filter: drop-shadow(0 0 8px var(--accent-bucket-glow));
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(1.2) rotate(15deg); opacity: 0.8; }
}

.bucket-card__icon { font-size: 36px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
.bucket-card__category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bucket-card__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: auto;
}
.bucket-card__date {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.bucket-card.achieved {
  border-color: rgba(255, 217, 61, 0.35);
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.10), var(--glass-bg));
}

/* ============================================================
   欲しいものリスト
   ============================================================ */

.wish-summary {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 14px;
  gap: 12px;
}
.wish-summary__item { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.wish-summary__item .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.wish-summary__item .value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.wish-summary__item:first-child .value { color: var(--accent-wish); }
.wish-summary__divider {
  width: 1px;
  align-self: stretch;
  background: var(--glass-border);
}

.wish-list { display: flex; flex-direction: column; gap: 10px; }

.wish-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
}
.wish-item:active { transform: scale(0.98); }

.wish-item__image {
  width: 70px; height: 70px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1px solid rgba(255,255,255,0.06);
}

.wish-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wish-item__title { font-size: 14px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wish-item__price {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-wish);
  font-variant-numeric: tabular-nums;
}

.want-slider-wrap { display: flex; align-items: center; gap: 8px; }
.want-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  outline: none;
}
.want-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-wish);
  box-shadow: 0 0 12px var(--accent-wish-glow);
  cursor: pointer;
}
.want-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-wish);
  box-shadow: 0 0 12px var(--accent-wish-glow);
  cursor: pointer;
  border: none;
}
.want-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-wish);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
}

.wish-item__meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: auto;
}
.wish-cool-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 182, 39, 0.15);
  color: var(--warning);
  font-weight: 700;
}

.wish-archived { opacity: 0.7; }
.wish-archived .wish-item__price { color: var(--text-muted); text-decoration: line-through; }

/* ============================================================
   読書リスト
   ============================================================ */

.book-list { display: flex; flex-direction: column; gap: 10px; }

.book-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.book-item:active { transform: scale(0.98); }

.book-cover {
  width: 56px; height: 80px;
  border-radius: 4px;
  background: linear-gradient(135deg, #3a2a5a, #5a3a8a);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 22px;
}

.book-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.book-item__title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.book-item__author { font-size: 11px; color: var(--text-muted); }
.book-item__meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 11px;
  margin-top: auto;
  flex-wrap: wrap;
}
.book-status-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.book-status-badge.wantToRead { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.book-status-badge.reading { background: rgba(78, 205, 196, 0.18); color: var(--accent-todo); }
.book-status-badge.finished { background: rgba(181, 228, 140, 0.18); color: var(--accent-book); }

.book-rating { color: var(--accent-bucket); font-size: 11px; letter-spacing: 0.1em; }
.book-progress {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 本棚ビジュアル */
.bookshelf {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 12px 0 24px;
}
.bookshelf-row {
  position: relative;
  padding-bottom: 18px;
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, transparent, rgba(139,92,52,0.5), rgba(101,67,33,0.7), rgba(139,92,52,0.5), transparent) 1;
}
.bookshelf-row::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), transparent);
}
.bookshelf-books {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 110px;
  flex-wrap: wrap;
}
.shelf-book {
  width: 28px;
  height: 90px;
  background: linear-gradient(180deg, var(--bg-glow) 0%, #3a2a5a 100%);
  border-radius: 2px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--bounce);
  background-size: cover;
  background-position: center;
}
.shelf-book:hover { transform: translateY(-8px) rotate(-2deg); }
.shelf-book::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.3) 0%, transparent 15%, transparent 85%, rgba(0,0,0,0.3) 100%);
  border-radius: inherit;
  pointer-events: none;
}
.shelf-empty {
  color: var(--text-faint);
  font-size: 12px;
  font-style: italic;
  margin: 0 auto;
  align-self: center;
}

/* 年間統計 */
.book-stats {
  padding: 18px;
  margin-bottom: 14px;
}
.book-stats__progress {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.book-stats__progress-label { font-size: 12px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; }
.book-stats__progress-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-book);
}
.book-stats__bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.book-stats__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-book), #6FCF97);
  box-shadow: 0 0 12px var(--accent-book-glow);
  border-radius: 4px;
  transition: width 0.6s var(--ease);
}

/* ============================================================
   FAB（フローティング追加）
   ============================================================ */

.fab {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom), 16px);
  right: 16px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-todo) 0%, #6FCFC9 100%);
  border: none;
  color: var(--bg-deep);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(78, 205, 196, 0.45), 0 0 0 4px rgba(78, 205, 196, 0.12);
  z-index: 50;
  transition: all 0.25s var(--bounce);
}
.fab:active { transform: scale(0.92); }
.fab:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 36px rgba(78, 205, 196, 0.6); }
.fab svg { width: 26px; height: 26px; }

[data-screen="bucket"].active ~ .fab { background: linear-gradient(135deg, var(--accent-bucket), #FFB627); box-shadow: 0 10px 28px var(--accent-bucket-glow); }
[data-screen="wish"].active ~ .fab { background: linear-gradient(135deg, var(--accent-wish), #FF8FB1); box-shadow: 0 10px 28px var(--accent-wish-glow); }
[data-screen="book"].active ~ .fab { background: linear-gradient(135deg, var(--accent-book), #6FCF97); box-shadow: 0 10px 28px var(--accent-book-glow); }

#app:has([data-screen="home"].active) ~ .fab { display: none; }
#app:has([data-screen="settings"].active) ~ .fab { display: none; }

/* ============================================================
   モーダル
   ============================================================ */

#modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade-in 0.25s var(--ease);
  pointer-events: auto;
}

.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.95), rgba(26, 11, 46, 0.95));
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(90vw, 420px);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
  animation: modal-pop-in 0.3s var(--bounce);
  pointer-events: auto;
}

@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop-in {
  from { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.modal__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="url"],
.field textarea,
.field select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s var(--ease);
  width: 100%;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent-todo);
  box-shadow: 0 0 0 3px var(--accent-todo-glow);
  background: rgba(255,255,255,0.10);
}
.field textarea { min-height: 80px; resize: vertical; font-family: inherit; }

.field-row { display: flex; gap: 8px; }
.field-row > .field { flex: 1; }

/* 選択ボタン群（重要？・緊急？） */
.choice-group {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.choice-btn {
  flex: 1;
  padding: 14px;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.choice-btn:active { transform: scale(0.96); }
.choice-btn.selected {
  background: rgba(78, 205, 196, 0.15);
  border-color: var(--accent-todo);
  box-shadow: 0 0 0 4px rgba(78,205,196,0.15);
}
.choice-btn--no.selected {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
}

.modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent-todo), #6FCFC9);
  color: var(--bg-deep);
  box-shadow: 0 6px 18px var(--accent-todo-glow);
}
.btn--secondary { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn--danger {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* カテゴリ・ジャンル選択 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.category-pick {
  padding: 14px 8px;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  line-height: 1.2;
}
.category-pick .cat-icon { font-size: 24px; line-height: 1; }
.category-pick.selected { background: rgba(255, 217, 61, 0.15); border-color: var(--accent-bucket); }

/* ============================================================
   トースト
   ============================================================ */

#toast-root {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom), 90px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.toast {
  padding: 12px 20px;
  background: rgba(45, 27, 78, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toast-in 0.3s var(--bounce), toast-out 0.3s var(--ease) 2.5s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast--success { border-color: var(--accent-todo); color: var(--accent-todo); }
.toast--error { border-color: var(--danger); color: var(--danger); }

@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateY(-12px); opacity: 0; }
}

/* ============================================================
   設定画面
   ============================================================ */

.settings-view { display: flex; flex-direction: column; gap: 14px; }
.settings-section { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.settings-section__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.settings-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.settings-meta { font-size: 12px; color: var(--text-muted); }

.settings-btn {
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.settings-btn:active { transform: scale(0.98); background: rgba(255,255,255,0.10); }
.settings-btn--danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.3); }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
}
.settings-row input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  width: 140px;
  text-align: right;
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 56px; margin-bottom: 14px; opacity: 0.6; }
.empty-state__title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state__text { font-size: 13px; line-height: 1.5; }

/* ============================================================
   レスポンシブ
   ============================================================ */

@media (min-width: 600px) {
  .greeting__time { font-size: 30px; }
  .summary-card__main { font-size: 32px; }
  .bucket-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (orientation: landscape) and (max-height: 500px) {
  .hero-card { padding: 14px 18px; }
  .summary-card { min-height: 110px; padding: 14px; }
  .summary-card__main { font-size: 22px; }
}

/* ============================================================
   高度なアニメーション
   ============================================================ */

@keyframes strike-out {
  0% { background-size: 0% 100%; }
  100% { background-size: 100% 100%; }
}
.strike-anim {
  background-image: linear-gradient(90deg, transparent, currentColor 5%, currentColor 95%, transparent);
  background-position: left center;
  background-size: 0% 2px;
  background-repeat: no-repeat;
  animation: strike-out 0.4s var(--ease) forwards;
}

@keyframes check-pop {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.2) rotate(0); }
  100% { transform: scale(1) rotate(0); }
}
.check-pop-anim { animation: check-pop 0.5s var(--bounce); }
