/* 11/26 使用者：「整個畫面都太大，不符合手機版面；首頁字太多；舊約新約分開；跳轉、筆記、遊戲看不懂」
   這個檔放在最後面，同名的設定以這裡為準。 */

/* ───────── 首頁 ───────── */
.hm { padding-bottom: 8px; }
.hm-hero { position: relative; display: grid; align-items: end; min-height: clamp(300px, 52svh, 520px); overflow: hidden; isolation: isolate; }
.hm-art { position: absolute; inset: 0; z-index: -1; }
.hm-art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 30%; }
.hm-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--night-1) 3%, rgba(10, 17, 32, .72) 34%, rgba(10, 17, 32, .08) 66%, rgba(10, 17, 32, .42)); }
.hm-body { width: 100%; max-width: 40rem; margin-inline: auto; padding: 56px 16px 4px; }
.hm-title { font-family: var(--serif); font-weight: 900; font-size: clamp(2.1rem, 10vw, 4rem); line-height: 1.2; letter-spacing: .07em; text-shadow: 0 4px 26px rgba(0, 0, 0, .6); }
.hm-title span { display: inline-block; }
.hm-verse { margin-top: 4px; font-family: var(--serif); font-size: .95rem; line-height: 1.8; color: var(--light-hi); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hm-verse cite { margin-left: .5em; font-style: normal; font-size: .82em; color: var(--text-2); white-space: nowrap; }
.hm-go { width: 100%; margin-top: 14px; }

.hm-find-wrap, .hm-quick { max-width: 40rem; margin-inline: auto; padding-inline: 16px; }
.hm-find-wrap { padding-top: 10px; }
.hm-find {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; border-radius: 16px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--light), transparent 45%); text-align: left; color: var(--text);
}
.hm-find .icon { flex: none; color: var(--light); }
.hm-find > span:last-child { display: grid; line-height: 1.35; }
.hm-find b { font-size: 1.02rem; }
.hm-find small { font-size: .8rem; color: var(--text-3); }
.hm-quick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.hm-quick-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; padding: 6px 2px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); font-size: .78rem; color: var(--text); text-align: center; line-height: 1.35;
}
.hm-quick-item .icon { color: var(--light-hi); }
.hm-quick-item .icon svg { width: 23px; height: 23px; }

.hm-sec { max-width: 52rem; margin-inline: auto; padding: 24px 16px 0; }
.hm-sec h2 { margin-bottom: 10px; font-family: var(--serif); font-size: 1.2rem; letter-spacing: .1em; }
.hm-tabs { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: #16213A; box-shadow: inset 0 0 0 1px var(--line), 0 10px 20px -14px #000; }
.hm-tab { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 44px; padding: 8px; border: 0; border-radius: 12px; background: none; font-family: var(--serif); font-weight: 700; font-size: 1.08rem; letter-spacing: .12em; color: var(--text-2); }
.hm-tab small { font-family: var(--sans); font-weight: 400; font-size: .74rem; letter-spacing: 0; opacity: .8; }
.hm-tab[aria-selected="true"] { background: var(--light); color: var(--on-light); }
.hm-group h3 { margin: 14px 0 7px; font-size: .78rem; font-weight: 600; letter-spacing: .18em; color: var(--text-3); }
.hm-books { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
@media (min-width: 600px) { .hm-books { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 900px) { .hm-books { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.hm-book {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50px; padding: 5px 3px 6px; overflow: hidden;
  border-radius: 12px; background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1px var(--line); text-align: center; color: var(--text-2);
}
.hm-book b { font-weight: 500; font-size: .84rem; line-height: 1.3; }
.hm-book small { font-size: .66rem; line-height: 1.3; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hm-book.is-started { color: var(--text); }
.hm-book.is-started::after { content: ""; position: absolute; left: 0; bottom: 0; width: var(--p); min-width: 6px; height: 3px; background: var(--c); }
.hm-book.is-lit { background: var(--c); color: #10172A; box-shadow: 0 0 20px -4px var(--c); }
.hm-book.is-lit b { font-weight: 700; }
.hm-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .82rem; color: var(--text-3); }
.hm-note i { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--light); box-shadow: 0 0 10px var(--light); }

.hm-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .hm-games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hm-game { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; min-width: 0; padding: 12px 8px; border-radius: 16px; background: rgba(255, 255, 255, .055); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.hm-game-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(242, 196, 109, .14); color: var(--light); }
.hm-game > span:last-child { display: grid; justify-items: center; gap: 1px; max-width: 100%; line-height: 1.4; }
.hm-game b { max-width: 100%; font-size: .92rem; overflow-wrap: anywhere; }
.hm-game small { max-width: 100%; font-size: .74rem; color: var(--text-3); text-wrap: balance; overflow-wrap: anywhere; }
.hm-door { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 104px; padding: 14px 16px; overflow: hidden; isolation: isolate; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.hm-door img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hm-door::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to right, rgba(8, 13, 25, .86), rgba(8, 13, 25, .2) 70%); }
.hm-door > span:not(.icon) { display: grid; }
.hm-door b { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .1em; }
.hm-door small { font-size: .82rem; color: var(--text-2); }
.hm .foot { margin-top: 32px; padding: 20px 16px 32px; }

/* ───────── 跳到經文：一步一步 ───────── */
.jump-sheet.is-jump .jump-panel { height: min(90vh, 780px); max-height: 90vh; }
.jump-panel > .jump-search { position: static; margin: 0; padding: 2px 16px 12px; background: none; border-bottom: 1px solid var(--line); }
.jump-sheet.is-jump .jump-body { flex: 1; padding: 10px 16px 24px; }
.jump-step { display: grid; justify-items: start; gap: 8px; margin-bottom: 10px; }
.jump-step h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.12rem; }
.jump-step h3 i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--light); color: var(--on-light); font-style: normal; font-size: .95rem; font-weight: 700; }
.jump-step h3 i:empty { display: none; }
.jump-back { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .09); font-size: .95rem; color: var(--text); }
.jump-sheet.is-jump .jump-tabs { margin: 0 0 4px; }
.jump-sheet.is-jump .jump-tab { min-height: 42px; font-weight: 700; letter-spacing: .1em; }
.jump-group h4 { margin: 12px 0 7px; font-size: .78rem; font-weight: 600; letter-spacing: .18em; color: var(--text-3); }
.jump-sheet.is-jump .jump-grid.is-books { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
@media (min-width: 520px) { .jump-sheet.is-jump .jump-grid.is-books { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.jump-sheet.is-jump .jump-grid.is-nums { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 7px; }
.jump-sheet.is-jump .jump-cell { color: var(--text); font-size: .9rem; }
.jump-sheet.is-jump .jump-cell.is-num { font-size: 1.2rem; }
.jump-open { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--light); color: var(--on-light); font-size: 1.08rem; font-weight: 700; }
.jump-sheet.is-jump .jump-note { margin: 14px 0 8px; }
.jump-hist { margin-top: 18px; justify-content: center; width: 100%; }

@media (max-width: 760px), (orientation: landscape) and (max-height: 560px), (hover: none) and (max-width: 1100px) {
/* ───────── 我的筆記 ───────── */
.nt-new { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: var(--light); color: var(--on-light); font-size: 1.05rem; font-weight: 700; }
.nt-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nt-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line); text-align: left; color: var(--text); }
.nt-card-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(242, 196, 109, .14); color: var(--light); }
.nt-card-body { flex: 1; display: grid; min-width: 0; line-height: 1.45; }
.nt-card-body b, .nt-card-body span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nt-card-body b { font-size: 1.02rem; }
.nt-card-body span { font-size: .85rem; color: var(--text-2); }
.nt-card-body small { font-size: .74rem; color: var(--text-3); }
.nt-card > .icon { flex: none; color: var(--text-3); }
.nt-home-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--gutter) 0; }
.nt-sheet .nt-home-links { padding-inline: 16px; }
.nt-keep { margin: 28px var(--gutter) 0; }
.nt-keep > summary { min-height: 44px; padding: 10px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-size: .92rem; color: var(--text-2); cursor: pointer; }
.nt-keep .mine-backup { margin-inline: 0; margin-top: 14px; }
.nt-pagehead .topbar { justify-content: space-between; }
.nt-pagetools { justify-content: flex-start; }
.nt-pagetools .nt-iconbtn { margin-left: auto; }
.nt-segs { background: rgba(255, 255, 255, .08); }
.nt-seg { min-height: 40px; padding: 0 18px 0 14px; font-size: .95rem; }
.nt-seg[aria-pressed="true"] { background: var(--light); color: var(--on-light); font-weight: 700; }
.nt-toolwrap { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 4; display: grid; gap: 6px; margin-top: 12px; }
.nt-toolwrap .nt-toolbar { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; overflow: visible; }
.nt-toolbar .nt-tool { flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; font-size: .8rem; }
.nt-more { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 16px; background: #16213A; box-shadow: inset 0 0 0 1px var(--line-strong); }
.nt-more .nt-tool { flex: 1; justify-content: center; min-height: 44px; }
.nt-sheet .nt-toolwrap { bottom: 6px; }
.nm-help { display: none; }
.nm-help.is-open { display: flex; bottom: 58px; right: 10px; }
}

/* ───────── 手機尺寸：整體縮一點 ───────── */
@media (max-width: 760px), (orientation: landscape) and (max-height: 560px) {
  html { font-size: 15px; }
  input, select, textarea { font-size: 16px !important; } /* 小於 16 iPhone 點下去會自己放大畫面 */

  .topbar a, .nt-topbtn { min-height: 38px; font-size: .9rem; }
  .btn { min-height: 48px; padding: 0 22px; font-size: 1rem; }

  /* 一章 */
  .ch-hero { min-height: clamp(220px, 34svh, 320px); }
  .ch-body { padding: 16px 16px 12px; }
  .ch-kicker { font-size: .78rem; }
  .ch-num { font-size: 3rem; }
  .ch-title-row h1, .chapter.is-read .ch-title-row h1 { font-size: 1.65rem; letter-spacing: .1em; }
  .chapter.is-read .ch-num { font-size: 2.8rem; }
  .ch-sum { margin-top: 6px; font-size: .9rem; line-height: 1.65; }
  .ch-facts { gap: 6px; margin-top: 8px; }
  .ch-facts li { padding: 3px 10px; font-size: .78rem; }
  .tabs { margin-top: 10px; }
  .tabs a { padding: 7px 16px; font-size: .9rem; }
  .filmstrip { grid-auto-columns: clamp(108px, 31vw, 150px); gap: 10px; margin-top: 14px; }
  .frame-ref { margin-top: 4px; font-size: .74rem; }
  .frame-title { font-size: .86rem; }
  .scene-mark { font-size: .82rem; }
  html[data-text="s"] .verses { font-size: 16px; line-height: 1.85; }
  html[data-text="m"] .verses { font-size: 18px; line-height: 1.9; }
  html[data-text="l"] .verses { font-size: 21px; line-height: 1.95; }
  html[data-text="s"] .story-text, html[data-text="s"] .story-key p { font-size: 16px; }
  html[data-text="m"] .story-text, html[data-text="m"] .story-key p { font-size: 17.5px; }
  html[data-text="l"] .story-text, html[data-text="l"] .story-key p { font-size: 20px; }
  .ch-end-btn { min-height: 56px; }

  /* 書卷頁：一章一列，圖小小的在左邊 */
  .bk-hero { min-height: clamp(240px, 38svh, 340px); }
  .bk-body { padding: 24px 16px 16px; }
  .bk-body h1 { font-size: 2.1rem; }
  .bk-tag { font-size: 1rem; }
  .bk-intro { margin-top: 6px; font-size: .88rem; line-height: 1.65; }
  .bk-progress { margin-top: 10px; }
  .ch-index a, .ch-index span { width: 38px; height: 38px; font-size: 1.1rem; }
  .part { margin-top: 24px; }
  .part-head h2 { font-size: 1.1rem; }
  .stops { gap: 10px; padding-left: 24px; }
  .stops::before { left: 6px; }
  .lamp { left: -23px; width: 12px; height: 12px; top: 20px; }
  .stop.is-locked .lamp { left: -22px; width: 10px; height: 10px; }
  .stop-card { grid-template-columns: 96px minmax(0, 1fr); border-radius: 16px; }
  .stop-card .art { height: 100%; min-height: 108px; aspect-ratio: auto; }
  .stop-body { gap: 3px; padding: 10px 12px; }
  .stop-head { gap: 8px; }
  .stop-num { font-size: 1.7rem; }
  .stop-title { font-size: 1.05rem; letter-spacing: .08em; }
  .stop-sum { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .8rem; line-height: 1.55; }
  .stop-marks { gap: 5px; margin-top: 4px; }
  .mark { padding: 1px 8px; font-size: .7rem; }

  .mine-head { padding-top: 14px; }
  .mine-head h1 { font-size: 1.45rem; }
  .nt-title { font-size: 1.4rem; }
  .q-title { font-size: 1.35rem; }
  /* 一章裡面不浮任何按鈕（闖關也一樣）：換章在章末，跳轉在上面返回書卷或底下那一條 */
  body[data-view="chapter"] .jump-fab, body[data-view="chapter"] .notes-fab, .chapter .ch-dock { display: none; }
  .chapter:not(.has-player) { padding-bottom: 32px; }
  .nm-node { max-width: 116px; }
  .nm-node.is-root { max-width: 150px; }
  .q-lede { font-size: .95rem; }

  /* 遊戲：一打開就看得到設定和開始鈕 */
  .game .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
  .p4-bar { gap: 5px; }
  .p4-bar .pill, .pill { min-height: 28px; padding: 1px 9px; font-size: .76rem; }
  .p4-bar .snd-pill span:last-child { display: none; }
  .g-intro { gap: 12px; }
  .g-head { padding-top: 12px; }
  .g-head h1 { font-size: 1.75rem; letter-spacing: .08em; }
  .g-kicker { margin: 0; font-size: .74rem; }
  .g-lede { margin-top: 4px; font-size: .9rem; line-height: 1.65; }
  .g-setup { gap: 14px; padding: 14px; border-radius: 18px; }
  .g-label { font-size: .88rem; }
  .g-field { gap: 6px; }
  .g-field select, .g-name input { min-height: 46px; }
  .g-seg span { min-width: 0; min-height: 42px; padding: 0 6px; border-radius: 12px; font-size: .88rem; text-align: center; white-space: normal; line-height: 1.3; }
  .g-seg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 4px; width: 100%; padding: 4px; border-radius: 16px; }
  .g-seg.is-wrap .g-seg-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-note, .g-best { font-size: .82rem; }
  .g-setup > .btn { order: -1; }
  .g-label { text-wrap: pretty; line-height: 1.5; }
  /* 遊戲上面那一列排成一行 */
  .game .topbar { gap: 6px; }
  .game .topbar > a { flex: none; padding: 0 10px 0 6px; font-size: .8rem; white-space: nowrap; }
  .p4-bar { flex-wrap: nowrap; justify-content: flex-end; min-width: 0; gap: 4px; }
  .p4-bar > * { flex: none; }
  .p4-bar .pill, .p4-bar button { padding-inline: 7px; font-size: .72rem; }
  /* 競技歌牌：整句放在牌裡，字自己縮到放得下（js/games/grab.js） */
  .kt-face { padding: 3px 7px; line-height: 1.35; }
  .kt-face span { display: block; -webkit-line-clamp: none; max-width: 100%; overflow-wrap: anywhere; }
  .p4-ref { font-size: clamp(2rem, 10vw, 3rem); }
  .gb-say b { font-size: 1.05rem; }
}
.g-how > summary { width: fit-content; min-height: 36px; padding: 5px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); font-size: .9rem; color: var(--light-hi); cursor: pointer; list-style: none; }
.g-how > summary::-webkit-details-marker { display: none; }
.g-how > summary::after { content: " ▾"; }
.g-how[open] > summary::after { content: " ▴"; }
.g-how .g-rules { margin-top: 10px; }
@media (max-width: 760px) {
  .g-how { margin-top: 10px; }
  .g-how .g-rules li { padding: 7px 0 7px 2.3em; font-size: .86rem; line-height: 1.6; }
  .g-how .g-rules li::before { top: 8px; width: 22px; height: 22px; font-size: .9rem; }
}
@media (min-width: 900px) { .g-how > summary { display: none; } }

/* 正在打開下一個畫面 */
html.is-loading::after {
  content: ""; position: fixed; z-index: 200; left: 50%; top: 45%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  border: 4px solid rgba(242, 196, 109, .25); border-top-color: var(--light); background: rgba(8, 13, 25, .6); box-shadow: 0 0 0 14px rgba(8, 13, 25, .6);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 手機上不浮「跳轉」「筆記」兩顆圓鈕（會蓋字）：首頁有大按鈕、書卷頁在上面、讀經在底下那一條 */
.tb-find { display: none; }
@media (max-width: 760px), (orientation: landscape) and (max-height: 560px) {
  .jump-fab, .notes-fab { display: none !important; }
  .tb-find { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px 0 11px; border: 0; border-radius: 999px; background: rgba(10, 17, 32, .6); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: .9rem; color: var(--text); }
}

/* 「更多」裡的字體大小 */
.more-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.more-speed.is-size-s { font-size: .85rem; }
.more-speed.is-size-m { font-size: 1.05rem; }
.more-speed.is-size-l { font-size: 1.35rem; }

/* 舊手機（不認得新的調色寫法） */
@supports not (background: color-mix(in oklab, red, blue)) {
  .hm-find { box-shadow: inset 0 0 0 1.5px rgba(242, 196, 109, .6); }
}
