/* 1440 · 版面照 E（圖錄：大粗字、照片滿版、格子無縫），改成黑底；
   照片上蓋 B 的橘色日期印字；快門是 A 的 iOS 相機樣式；字體 Lexend */
:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --dim: #8e8e93;
  --faint: #48484a;
  --line: #1c1c1e;
  --empty: #0d0d0d;      /* 沒照片的格子、照片還沒載入時的底 */
  --red: #ff453a;
  /* 唯一的強調色：底片相機的日期印字 */
  --accent: #ff8a2b;
  --accent-dim: #5a3312;
  --pad: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 "Lexend", -apple-system, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
body { min-height: 100vh; min-height: 100dvh; }

/* 畫面：淡入 */
.screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
  opacity: 0; transition: opacity .18s ease;
}
.screen.in { opacity: 1; }
.screen.center { align-items: center; justify-content: center; text-align: center; }

h1.logo { font-size: 64px; font-weight: 800; letter-spacing: -.05em; line-height: 1; margin: 40px 0 12px; }
.lead { font-size: 18px; font-weight: 500; margin: 0 0 12px; }
.hint { color: var(--dim); font-size: 14px; margin: 8px 0; }
.bottom { margin-top: auto; }
.msg { min-height: 1.5em; margin: 8px 0; }
.warn { color: var(--accent); font-size: 14px; }

/* ───────── 按鈕：沒有框，做決定的地方才是實心白 ───────── */
button {
  font: inherit; font-weight: 700; color: var(--fg); background: none; border: none;
  border-radius: 999px; padding: 14px 18px; transition: opacity .12s ease;
}
button:active { opacity: .55; }
button:disabled { opacity: .4; }
button.primary { background: var(--fg); color: #000; }
button.danger { color: var(--red); }
.row { display: flex; gap: 12px; margin: 10px 0; }
.row > button { flex: 1; box-shadow: inset 0 0 0 1.5px #3a3a3c; }
.row > button.primary { box-shadow: none; }

/* 導覽：粗體文字 */
.nav { display: flex; justify-content: center; gap: 36px; padding-top: 20px; }
.nav button { padding: 10px 4px; font-size: 17px; }

textarea {
  width: 100%; font: inherit; font-size: 14px; background: #111; color: var(--fg);
  border: none; border-radius: 14px; padding: 14px; margin: 10px 0 16px; word-break: break-all; outline: none;
}
#setup-save { width: 100%; }

/* ───────── 拍照畫面 ───────── */
.clock {
  font-size: min(31vw, 132px); font-weight: 800; letter-spacing: -.06em; line-height: .9;
  -webkit-user-select: none; user-select: none;
}
.minute-status { margin-top: 18px; font-size: 15px; font-weight: 600; color: var(--fg); min-height: 23px; }
.minute-status::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--faint); margin-right: 9px; vertical-align: 1px;
}
.minute-status.free::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.minute-status.owned { color: var(--dim); }
.minute-status:empty::before { width: 120px; height: 10px; border-radius: 5px; background: #1c1c1e; margin: 0; box-shadow: none; animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.hour-progress { margin-top: 4px; font-size: 13px; color: var(--dim); min-height: 20px; }

/* 快門：iOS 相機——白色外圈 + 白色實心圓，按下去內圓縮一下 */
.shoot {
  width: 88px; height: 88px; padding: 0; border-radius: 50%;
  border: 4px solid var(--fg); background: none; margin: 13vh 0 8px; position: relative;
}
.shoot::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--fg);
  transition: transform .12s ease;
}
.shoot:active { opacity: 1; }
.shoot:active::after { transform: scale(.86); }
.shoot:disabled { opacity: .35; }
.cheat-banner { color: var(--accent); font-size: 14px; font-weight: 600; margin: 10px 0 0; }

/* ───────── 照片：3:4 滿版 ───────── */
#scr-today, #scr-pending { padding-top: env(safe-area-inset-top); }
.photo {
  position: relative; align-self: flex-start; left: 50%; transform: translateX(-50%);
  width: min(100vw, calc(64vh * 3 / 4)); aspect-ratio: 3 / 4; background: var(--empty);
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-touch-callout: default; }
.info { margin: 18px 0 10px; }
.title { font-size: 40px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.sub { color: var(--dim); font-size: 14px; margin-top: 6px; }
.ask p { font-size: 17px; font-weight: 500; margin: 8px 0; }
/* 長按存相簿那句：只在上傳失敗、出現「Retry」時才顯示 */
.only-failed { display: none; }
#pending-actions:not([hidden]) ~ .only-failed { display: block; }
.cheat { align-self: flex-end; font-size: 12px; font-weight: 400; color: var(--faint); padding: 10px 0 0; }

/* ───────── 標題列：返回鍵 + 大粗字 ───────── */
.bar { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.bar .back { padding: 0 10px 4px 0; font-size: 36px; font-weight: 300; line-height: 1; }
.bar-spacer { display: none; }
#wall-progress, #book-title, #view-title { font-size: 30px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
#view-sub { margin-top: 14px; }

/* ───────── 總覽：拼貼撐滿整個寬度 ───────── */
#scr-wall, #scr-book { padding-left: 0; padding-right: 0; }
#scr-wall .bar, #scr-book .bar { padding: 0 calc(var(--pad) + env(safe-area-inset-left)); }
.wall-wrap { position: relative; margin: 0 auto; }
#wall { display: block; background: var(--empty); }
#wall-overlay { position: absolute; left: 0; top: 0; pointer-events: none; }
.hour-labels { display: flex; margin: 0 auto 6px; font-size: 11px; color: var(--dim); }
.hour-labels span { flex: 1; text-align: left; padding-left: 2px; }

/* ───────── 小時書：3:4 格子無縫排列 ───────── */
.dots { display: flex; gap: 4px; justify-content: center; margin: 0 0 14px; }
.dots button { flex: 0 0 auto; width: 7px; height: 7px; padding: 0; border-radius: 50%; background: #2c2c2e; transition: transform .15s ease, background .15s ease; }
.dots button:active { opacity: 1; }
.dots button.has { background: var(--accent-dim); }
.dots button.on { background: var(--fg); transform: scale(1.35); }

.pages { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; flex: 1; }
.pages::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; }
.cell { aspect-ratio: 3 / 4; background: var(--empty); position: relative; overflow: hidden; }
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell span { position: absolute; left: 5px; bottom: 3px; font-size: 10px; color: var(--faint); }
.cell.lit span { color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }

#toast {
  position: fixed; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--fg); color: #000; padding: 12px 20px; border-radius: 999px; font-weight: 600;
  max-width: 90vw; text-align: center; z-index: 9;
}
