:root {
  --ink: #f2eee6;
  --ink-soft: #aaa79f;
  --paper: #090909;
  --paper-deep: #141414;
  --cream: #f8f3e9;
  --sage: #777b72;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #c99a62;
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", "Noto Sans Thai", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 9%, rgba(96, 89, 79, 0.2), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
  }
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

ruby {
  ruby-align: center;
  ruby-position: over;
}

rt {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.43em;
  font-weight: 400;
  letter-spacing: 0;
}

.page-shell {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 17px;
  font-style: normal;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  gap: clamp(18px, 3vw, 38px);
}

.main-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.main-nav a.active {
  color: var(--ink);
}

.main-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: -13px;
  left: 0;
  height: 1px;
  background: var(--ink);
  content: "";
}

.menu-button {
  display: none;
  justify-self: end;
  width: 36px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
}

.header-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 14px;
}

.install-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

.install-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.install-toast {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: min(390px, calc(100% - 40px));
  padding: 18px 20px;
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 12px;
  color: var(--cream);
  background: #181818;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.44);
}

.install-toast[hidden] {
  display: none;
}

.install-toast strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.install-toast p {
  margin: 5px 0 0;
  color: rgba(255, 250, 242, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.install-toast > button {
  margin-left: auto;
  padding: 0;
  border: 0;
  color: rgba(255, 250, 242, 0.68);
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.menu-button span {
  display: block;
  height: 1px;
  margin: 6px 0;
  background: var(--ink);
}

.hero {
  padding: 92px 0 70px;
  text-align: center;
}

.app-page[hidden] {
  display: none;
}

.bible-cover {
  display: grid;
  width: 100vw;
  min-height: calc(100dvh - 100px);
  margin-left: calc(50% - 50vw);
  padding: 0;
  place-items: center;
  background: #050505;
}

.cover-frame {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: calc(100dvh - 100px);
  padding: 54px 38px 46px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(110deg, rgba(255,255,255,0.045), transparent 10%, transparent 90%, rgba(255,255,255,0.03)),
    #050505;
  box-shadow: none;
}

.cover-frame::before,
.cover-frame::after {
  position: absolute;
  border: 1px solid rgba(201, 154, 98, 0.18);
  content: "";
}

.cover-frame::before { inset: 24px; }
.cover-frame::after { inset: 31px; }

.cover-kicker {
  z-index: 1;
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.cover-action {
  position: absolute;
  bottom: 45px;
  left: 50%;
  z-index: 2;
  padding: 12px 3px 8px;
  border-bottom: 1px solid var(--accent);
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.cover-action:hover { color: var(--accent); }

.cover-controls {
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 56px;
}

.reader-size-buttons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.82);
}

.reader-size-buttons button {
  min-width: 38px;
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.reader-size-buttons button.selected {
  color: #111;
  background: var(--cream);
}

.bible-language-select {
  max-width: 100%;
  min-height: 44px;
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  background: #151311;
  color-scheme: dark;
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.bible-language-select:hover, .bible-language-select:focus-visible { border-color: var(--accent); }

.bible-toc {
  min-height: 100dvh;
  padding: 110px 0;
}

.bible-toc h2 {
  margin: 16px 0 58px;
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.toc-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
}

.testament-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.testament-links a {
  display: grid;
  min-height: 260px;
  padding: 34px;
  color: var(--ink);
  text-decoration: none;
  transition: background 180ms ease;
}

.testament-links a + a { border-left: 1px solid var(--line); }
.testament-links a:hover { background: #121212; }
.testament-links span { color: var(--accent); font-family: var(--serif); font-style: italic; }
.testament-links strong { align-self: end; font-family: var(--serif); font-size: 34px; font-weight: 400; }
.testament-links small { margin-top: 8px; color: var(--ink-soft); }

.index-header-nav {
  justify-self: center;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.index-header-nav:hover { color: var(--cream); }

.index-main .bible-toc {
  min-height: calc(100dvh - 100px);
}

.index-main .bible-toc h1 {
  margin: 16px 0 58px;
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.testament-section {
  min-height: 100dvh;
  padding: 105px 0 120px;
  scroll-margin-top: 20px;
}

.back-to-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 80px;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.back-to-index:hover { color: var(--cream); }

.testament-heading {
  margin-bottom: 48px;
}

.testament-heading h2 {
  margin: 16px 0 12px;
  font-family: var(--serif);
  font-size: clamp(52px, 7vw, 92px);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.testament-heading > p:last-child { margin: 0; color: var(--ink-soft); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.book-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  min-height: 86px;
  padding: 18px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease;
}

.book-link:hover { background: #151515; }
.book-link.available { text-decoration: none; }
.book-link[disabled] { cursor: default; opacity: 0.38; }
.book-link[disabled]:hover { background: transparent; }
.book-link > span:first-child { color: var(--accent); font-family: var(--serif); font-size: 12px; font-style: italic; }
.book-link > span:last-child { color: #67635d; }
.book-link strong { font-size: 14px; font-weight: 500; line-height: 1.5; }

.reader-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  width: min(1080px, calc(100% - 32px));
  height: auto;
  padding: 8px 14px 10px;
  margin: 0 auto;
  border: 1px solid rgba(255, 248, 232, 0.11);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(16, 13, 11, 0.56);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(20px) saturate(118%);
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.reader-back:hover { color: var(--cream); }
.reader-brand { justify-self: end; }
.reader-brand > span:not(.brand-mark) { display: none; }

.reader-language-picker {
  display: flex;
  justify-content: center;
  gap: 4px;
  justify-self: stretch;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.reader-language-picker .bible-language-select { min-width: 0; }

.reader-language-picker button {
  flex: 1;
  min-width: 56px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.reader-language-picker button.selected {
  color: #111;
  background: var(--cream);
}

.reader-main {
  width: min(940px, calc(100% - 56px));
  margin: 0 auto;
  padding: 10px 0 24px;
}

.reader-title-block {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 42px;
}

.reader-title-block h1 {
  margin: 14px 0 8px;
  font-family: var(--serif);
  font-size: clamp(54px, 9vw, 96px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.16;
}

.reader-title-block h1 rt,
.scripture-heading h2 rt {
  font-size: 0.24em;
}

.reader-translation {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.reader-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 0;
}

.reader-select-label {
  display: grid;
  gap: 5px;
  width: auto;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.reader-select-label select {
  width: 100%;
  min-height: 40px;
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(17, 17, 17, 0.62);
  font: inherit;
  font-size: 14px;
}

.reader-size-field {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
}

.reader-size-buttons { min-height: 40px; padding: 3px; border-radius: 8px; }
.reader-size-buttons button { min-width: 31px; min-height: 32px; padding: 5px 7px; }

.chapter-strip {
  display: flex;
  overflow-x: auto;
  gap: 7px;
  padding: 0 0 18px;
  scrollbar-color: #47433e transparent;
  scrollbar-width: thin;
}

.chapter-strip a {
  display: grid;
  flex: 0 0 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  text-decoration: none;
}

.chapter-strip a.current {
  border-color: var(--accent);
  color: #111;
  background: var(--accent);
}

.scripture-panel {
  margin-top: 0;
  padding: 8px clamp(0px, 6vw, 74px) 52px;
  border-bottom: 1px solid var(--line);
}

.scripture-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
  text-align: center;
}

.scripture-heading .font-select-label { justify-self: start; width: min(165px, 100%); text-align: left; }
.scripture-heading .reader-size-field { justify-self: end; text-align: left; }
.reader-heading-title { min-width: 0; }

.scripture-heading p {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scripture-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 400;
  line-height: 1.15;
}

.reader-heading-picker {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em;
  max-width: 100%;
}

.reader-heading-picker button {
  max-width: 100%;
  padding: 2px 5px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.reader-heading-picker button:hover,
.reader-heading-picker button:focus-visible {
  border-bottom-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.reader-heading-picker button::after {
  margin-left: 0.28em;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.48em;
  content: "▾";
  vertical-align: middle;
}

.book-select-label { width: auto; }

html[lang="ja"] .scripture-heading h2,
html[lang="ja"] .passage-heading { padding-top: 0.5em; }

.scripture-heading h2 rt,
.passage-heading rt {
  position: relative;
  top: -0.34em;
  line-height: 1;
}

.passage-heading rt { font-size: 0.32em; }

.passage-heading-row {
  display: block;
  margin: 0;
}

#passage-heading-slot:empty { display: none; }

.passage-heading-row .passage-heading { margin-bottom: 0; }

.verse-list p {
  display: block;
  margin: 0 0 26px;
  font-family: "Noto Sans Thai", "Noto Sans JP", var(--serif);
  font-size: clamp(18px, 2.1vw, 21px);
  font-weight: 400;
  line-height: 1.9;
}

.scripture-reader-page[data-reader-font="serif"] .verse-list p {
  font-family: "Noto Serif Thai", "Noto Serif JP", Georgia, serif;
}

.scripture-reader-page[data-reader-font="modern"] .verse-list p {
  font-family: system-ui, "Noto Sans Thai", "Noto Sans JP", sans-serif;
  letter-spacing: -0.01em;
}

.scripture-reader-page[data-reader-size="medium"] .verse-list p {
  font-size: clamp(16px, 1.8vw, 18px);
}

.scripture-reader-page[data-reader-size="large"] .verse-list p {
  font-size: clamp(18px, 2.1vw, 21px);
}

.scripture-reader-page[data-reader-size="xlarge"] .verse-list p {
  font-size: clamp(25px, 3vw, 30px);
}

.verse-list sup {
  margin-right: 0.38em;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 0.58em;
  line-height: 1;
  vertical-align: super;
}

.verse-unit { display: inline; }

.verse-list .verse-pair { margin: 0 0 1.15em; padding-bottom: 1.05em; border-bottom: 1px solid rgba(255, 248, 232, 0.08); }
.verse-pair-line { display: block; padding-left: 1em; text-indent: -1em; overflow-wrap: anywhere; }
.verse-pair-line + .verse-pair-line { margin-top: 0.35em; color: #d2ccc4; }

.passage-heading {
  margin: 0 0 30px;
  color: var(--cream);
  font-family: var(--serif);
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 400;
  line-height: 1.3;
}

.passage-heading::after {
  display: block;
  width: 34px;
  height: 1px;
  margin-top: 8px;
  background: var(--accent);
  content: "";
}

.verse-list rt { color: #b9b5ae; }
.verse-list ruby { ruby-position: over; }
.verse-list rt { font-size: 0.5em; }
.verse-list .verse-pair-line[lang="ja"] { line-height: 2.15; }
html[lang="ja"] .verse-list p { line-height: 2.15; }
.verse-list.reader-status { padding: 60px 0; color: var(--ink-soft); text-align: center; }

.reader-external-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fdfcf9;
  color: #201e1a;
}

.reader-external-notice {
  margin: 0;
  padding: 13px 18px 10px;
  color: #716b61;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.reader-external-panel > a {
  display: inline-flex;
  margin: 0 18px 13px;
  color: #8f642d;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.reader-external-frame {
  display: block;
  width: 100%;
  min-height: 72vh;
  border: 0;
  background: #fdfcf9;
}

.chapter-navigation {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 36px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 15px;
  background: rgba(20, 16, 13, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px) saturate(116%);
}

.chapter-navigation a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 18px 24px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}

.chapter-navigation a + a { border-left: 1px solid var(--line); }
.chapter-navigation a:hover { background: #151515; }
.chapter-navigation a.disabled { color: #4e4b47; pointer-events: none; }

.reader-footer {
  display: flex;
  justify-content: space-between;
  width: min(940px, calc(100% - 56px));
  margin: 0 auto;
  padding: 0 0 20px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.reader-footer p { margin: 0; }

.reader-offline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.025); }
.reader-offline h2 { margin: 0 0 5px; color: var(--cream); font-size: 15px; }
.reader-offline p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.reader-offline .offline-status { color: var(--accent); }
.reader-offline button { flex: 0 0 auto; min-height: 42px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; color: var(--cream); background: rgba(255,255,255,0.04); cursor: pointer; }
.reader-offline button:disabled { opacity: 0.6; cursor: wait; }
.online-required { margin: 8px 0; color: #caa879; font-size: 12px; line-height: 1.5; }

.reader-main { touch-action: pan-y pinch-zoom; overscroll-behavior-x: contain; }
.verse-list { transition: transform 200ms cubic-bezier(.2, .8, .2, 1); }
.verse-list.is-dragging { transition: none; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .verse-list { transition: none; } }

@media (max-width: 1024px) {
  .page-shell { width: min(100% - 40px, 920px); }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gospel-layout { gap: 28px; }
  .gospel-profile h1 { font-size: clamp(48px, 7vw, 70px); }
}

.cover-cross {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 190px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 45px rgba(201, 154, 98, 0.18);
}

.cover-cross span {
  position: absolute;
  top: 48px;
  left: 50%;
  width: 118px;
  height: 22px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.cover-title {
  z-index: 1;
  text-align: center;
}

.cover-title span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

.cover-title strong {
  font-family: var(--serif);
  font-size: clamp(52px, 9vw, 74px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.eyebrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.eyebrow p,
.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(60px, 8.5vw, 116px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.hero-copy {
  max-width: 520px;
  margin: 26px auto 38px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.language-picker {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.language-picker button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 118px;
  padding: 11px 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.language-picker button:hover {
  transform: translateY(-1px);
}

.language-picker button.selected {
  color: #111;
  background: var(--cream);
}

.lang-native {
  flex: 1;
  text-align: left;
}

.lang-code {
  opacity: 0.56;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.reader-card {
  overflow: hidden;
  border-radius: 3px;
  color: var(--cream);
  background: #151515;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.reader-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 34px 42px 29px;
  border-bottom: 1px solid rgba(255, 250, 242, 0.14);
}

.reader-topline h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 400;
}

.date-pill {
  padding: 7px 12px;
  border: 1px solid rgba(255, 250, 242, 0.2);
  border-radius: 999px;
  color: rgba(255, 250, 242, 0.7);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reader-body {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1.3fr;
  min-height: 325px;
}

.chapter-number {
  display: flex;
  align-items: flex-end;
  padding: 25px 40px 7px;
  color: rgba(255, 250, 242, 0.07);
  font-family: var(--serif);
  font-size: clamp(140px, 21vw, 250px);
  line-height: 0.7;
}

.passage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 570px;
  padding: 58px 60px 58px 20px;
}

.passage p {
  margin: 0 0 30px;
  color: rgba(255, 250, 242, 0.77);
  font-family: var(--serif);
  font-size: clamp(23px, 2.8vw, 34px);
  line-height: 1.55;
}

.primary-action {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 13px 19px;
  border: 1px solid rgba(255, 250, 242, 0.24);
  border-radius: 2px;
  color: var(--cream);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.primary-action:hover {
  color: #111;
  background: var(--cream);
}

.inner-page {
  min-height: calc(100dvh - 100px);
  padding: 92px 0 110px;
}

.inner-hero {
  max-width: 820px;
  margin: 0 auto 38px;
  text-align: center;
}

.inner-hero h1,
.gospel-profile h1 {
  margin: 18px 0 24px;
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

#encourage { padding-top: 56px; }
#encourage .inner-hero h1 { font-size: clamp(34px, 4.5vw, 58px); }

.inner-hero > p,
.gospel-profile > p:last-child {
  max-width: 560px;
  margin: 0 auto;
  color: var(--ink-soft);
  line-height: 1.8;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 690px;
  margin: 0 auto 24px;
}

.mood-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 104px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #111;
  cursor: pointer;
}

.mood-grid button:hover {
  border-color: rgba(201, 154, 98, 0.65);
  background: #171512;
}

.mood-grid button span {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 24px;
}

.encouragement-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 54px;
  border: 1px solid var(--line);
  background: #151515;
}

.encouragement-card blockquote {
  margin: 26px 0 34px;
  font-family: var(--serif);
  font-size: clamp(25px, 3.3vw, 38px);
  line-height: 1.55;
}

.gospel-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(380px, 1.3fr);
  gap: clamp(28px, 4vw, 54px);
  align-items: center;
}

.gospel-daily-scripture {
  margin: 0 0 30px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(201, 154, 98, 0.3);
  border-radius: 22px;
  background: linear-gradient(120deg, rgba(201, 154, 98, 0.1), rgba(255, 255, 255, 0.025));
}
.daily-scripture-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.daily-scripture-heading h2 { margin: 0; color: var(--accent); font-size: 16px; font-weight: 500; }
.daily-scripture-heading time { color: var(--ink-soft); font-size: 12px; }
.daily-scripture-reference { margin: 16px 0 8px; font-size: clamp(21px, 3vw, 27px); font-weight: 500; }
.gospel-daily-scripture blockquote { margin: 0; font-size: clamp(18px, 2.4vw, 22px); line-height: 1.85; overflow-wrap: anywhere; }
.daily-scripture-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.daily-scripture-actions a, .daily-scripture-actions button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 24px; background: rgba(0, 0, 0, 0.15); color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.daily-scripture-actions button[hidden] { display: none; }
.daily-scripture-actions a:hover, .daily-scripture-actions button:hover { border-color: var(--accent); }

.gospel-profile {
  text-align: center;
}

.church-online-card {
  display: flex;
  width: min(100%, 236px);
  min-height: 76px;
  margin: 0 auto 12px;
  padding: 7px 16px 7px 9px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(201, 154, 98, 0.34);
  border-radius: 14px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(24, 22, 19, 0.96), rgba(13, 13, 13, 0.9));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease;
}

.church-online-card:hover {
  border-color: rgba(201, 154, 98, 0.72);
  transform: translateY(-2px);
}

.church-online-card img {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(201, 154, 98, 0.2));
}

.church-online-card span {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-align: left;
}

.church-online-page {
  padding: 36px 0 90px;
}

.church-online-body {
  min-height: 100dvh;
  background: #090909;
}

.church-online-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 max(40px, env(safe-area-inset-bottom));
}

.church-room-header {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: end;
  margin-bottom: 22px;
}

.church-room-header > a {
  align-self: start;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.church-room-header > div {
  grid-column: 2;
  text-align: center;
}

.church-room-header h1 {
  margin: 8px 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 400;
  line-height: 1;
}

.church-room-header > div > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.church-language-picker {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.68);
}

.church-language-picker button {
  min-width: 34px;
  padding: 5px 7px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.church-language-picker button.selected {
  color: #1b150d;
  background: var(--gold-soft);
}

.church-world {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid rgba(201, 154, 98, 0.38);
  border-radius: 16px;
  outline: none;
  background-color: #15130f;
  background-image: linear-gradient(rgba(12, 10, 7, 0.05), rgba(12, 10, 7, 0.12)), url("images/church-interior-map.png");
  background-position: center;
  background-size: 106% 106%;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  cursor: crosshair;
  touch-action: manipulation;
}

.church-world:focus-visible {
  box-shadow: 0 0 0 2px var(--accent), 0 28px 80px rgba(0, 0, 0, 0.42);
}

.hikari-stage {
  position: absolute;
  top: 13.5%;
  left: 50%;
  z-index: 330;
  width: 8.4%;
  min-width: 40px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.hikari-stage img {
  display: block;
  width: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.48));
  animation: hikari-sermon 4.8s ease-in-out infinite;
}

.hikari-stage span,
.avatar-name {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fffaf0;
  background: rgba(12, 10, 8, 0.72);
  font-size: clamp(7px, 1vw, 10px);
  line-height: 1.2;
  white-space: nowrap;
}

@keyframes hikari-sermon {
  0%, 100% { transform: translateY(0) rotate(-0.3deg); }
  50% { transform: translateY(-2px) rotate(0.3deg); }
}

.hikari-stage.is-speaking img {
  animation: hikari-preaching 1.15s ease-in-out infinite;
  transform-origin: 58% 78%;
}

@keyframes hikari-preaching {
  0%, 100% { transform: translateY(0) rotate(-1deg) scale(1); }
  50% { transform: translateY(-4px) rotate(1.4deg) scale(1.07); }
}

.seat-hotspot {
  position: absolute;
  z-index: 900;
  width: 25%;
  height: 7%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.seat-hotspot:hover,
.seat-hotspot:focus-visible {
  border-color: rgba(255, 224, 155, 0.72);
  background: rgba(255, 220, 142, 0.12);
  outline: none;
}

.seat-l1 { top: 45%; left: 24%; }
.seat-r1 { top: 45%; left: 53%; }
.seat-l2 { top: 54%; left: 24%; }
.seat-r2 { top: 54%; left: 53%; }
.seat-l3 { top: 63%; left: 24%; }
.seat-r3 { top: 63%; left: 53%; }

.room-avatar {
  position: absolute;
  width: clamp(62px, 11.5%, 116px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  transition: transform 160ms ease;
  pointer-events: none;
}

.room-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.45));
}

.avatar-name {
  position: absolute;
  z-index: 980;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.player-name {
  top: 88%;
  left: 50%;
  transition: none;
}

.npc-name-one { top: 66.5%; left: 31%; }
.npc-name-two { top: 57.5%; left: 67%; }
.npc-name-three { top: 77.5%; left: 70%; }

.hikari-stage span {
  position: relative;
  z-index: 981;
}

.player-avatar {
  top: 84%;
  left: 50%;
  width: clamp(88px, 15%, 156px);
  aspect-ratio: 1;
  will-change: left, top;
}

.visitor-walk-sprite {
  --walk-x: 21.836%;
  --walk-y: 0%;
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("images/church-visitor-red-walk-v3.png");
  background-repeat: no-repeat;
  background-size: 600% 400%;
  background-position: var(--walk-x) var(--walk-y);
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.52));
  transform-origin: 50% 82%;
}

.player-avatar.is-walking .visitor-walk-sprite {
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.58));
}

.player-avatar.seated {
  transform: translate(-50%, -50%) scale(0.94, 0.78);
}

.npc-one { top: 61%; left: 31%; z-index: 610; transform: translate(-50%, -50%) scale(0.82); }
.npc-two { top: 52%; left: 67%; z-index: 520; transform: translate(-50%, -50%) scale(0.82); }
.npc-three { top: 72%; left: 70%; z-index: 720; transform: translate(-50%, -50%) scale(0.82); }
.npc-two img { filter: hue-rotate(35deg) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.45)); }
.npc-three img { filter: hue-rotate(-24deg) saturate(0.86) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.45)); }

.scene-depth {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(12, 10, 7, 0.05), rgba(12, 10, 7, 0.12)), url("images/church-interior-map.png");
  background-position: center;
  background-size: 106% 106%;
  pointer-events: none;
}

.pulpit-depth {
  z-index: 350;
  clip-path: polygon(41% 21%, 59% 21%, 59% 31%, 41% 31%);
}

.pew-depth-l1,
.pew-depth-r1 { z-index: 500; }
.pew-depth-l2,
.pew-depth-r2 { z-index: 590; }
.pew-depth-l3,
.pew-depth-r3 { z-index: 680; }
.pew-depth-l1 { clip-path: polygon(23% 47%, 49% 47%, 49% 53%, 23% 53%); }
.pew-depth-r1 { clip-path: polygon(52% 47%, 78% 47%, 78% 53%, 52% 53%); }
.pew-depth-l2 { clip-path: polygon(23% 56%, 49% 56%, 49% 62%, 23% 62%); }
.pew-depth-r2 { clip-path: polygon(52% 56%, 78% 56%, 78% 62%, 52% 62%); }
.pew-depth-l3 { clip-path: polygon(23% 65%, 49% 65%, 49% 71%, 23% 71%); }
.pew-depth-r3 { clip-path: polygon(52% 65%, 78% 65%, 78% 71%, 52% 71%); }

.church-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 18px;
}

.hikari-sermon-card {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(201, 154, 98, 0.34);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(32, 27, 21, 0.96), rgba(16, 16, 16, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.sermon-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.sermon-card-heading h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(27px, 4vw, 42px);
  font-weight: 400;
}

.sermon-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.sermon-actions button {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  cursor: pointer;
}

.sermon-actions button:disabled { cursor: wait; opacity: 0.5; }

#sermon-voice {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--accent);
  font-size: 14px;
}

#sermon-voice[aria-pressed="true"] { color: var(--cream); }

.sermon-theme,
.sermon-scripture-summary,
.sermon-prayer {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.sermon-theme {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sermon-prayer { color: rgba(245, 240, 231, 0.8); }

.sermon-verse {
  margin: 28px 0 12px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(19px, 2.7vw, 28px);
  line-height: 1.55;
}

.sermon-message {
  max-width: 780px;
  margin: 0;
  color: var(--cream);
  font-size: 15px;
  line-height: 1.85;
}

.sermon-message.is-typing::after {
  display: inline-block;
  width: 0.5em;
  margin-left: 0.18em;
  color: var(--accent);
  content: "▮";
  animation: sermon-cursor 620ms steps(1) infinite;
}

@keyframes sermon-cursor {
  50% { opacity: 0; }
}

.sermon-status {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.hikari-sermon-card.is-loading .sermon-message,
.hikari-sermon-card.is-loading .sermon-verse,
.hikari-sermon-card.is-loading .sermon-scripture-summary { opacity: 0.52; }

.church-controls > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.church-control-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #151515;
  font-size: 11px;
  cursor: pointer;
}

.music-toggle > span:first-child {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 17px;
}

.music-toggle[aria-pressed="true"] {
  border-color: rgba(201, 154, 98, 0.62);
  color: var(--cream);
  background: rgba(201, 154, 98, 0.12);
}

.movement-pad {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-template-rows: repeat(2, 38px);
  gap: 5px;
}

.movement-pad button {
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #151515;
  cursor: pointer;
}

.movement-pad button[data-move="up"] { grid-column: 2; }
.movement-pad button[data-move="left"] { grid-column: 1; grid-row: 2; }
.movement-pad button[data-move="down"] { grid-column: 2; grid-row: 2; }
.movement-pad button[data-move="right"] { grid-column: 3; grid-row: 2; }

.hikari-portrait {
  width: min(100%, 310px);
  height: clamp(300px, 46dvh, 470px);
  margin: 0 auto 18px;
}

.hikari-character {
  position: relative;
  width: 100%;
  height: 100%;
  animation: hikari-idle 5.8s ease-in-out infinite;
  transform-origin: 50% 78%;
}

.hikari-character img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.hikari-base {
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.5));
}

@keyframes hikari-idle {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-0.12deg) scale(1); }
  50% { transform: translate3d(0, -4px, 0) rotate(0.12deg) scale(1.006); }
}

.gospel-profile .section-label {
  font-size: 9px;
}

.gospel-profile h1 {
  margin: 10px 0 14px;
  font-size: clamp(38px, 4.7vw, 58px);
}

.gospel-profile > p:last-child {
  max-width: 330px;
  font-size: 14px;
  line-height: 1.65;
}

.chat-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121212;
}

.chat-messages {
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  gap: 12px;
  max-height: min(48dvh, 430px);
  padding-right: 4px;
  scrollbar-color: #47433e transparent;
  scrollbar-width: thin;
}

.chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border-radius: 4px 18px 18px 18px;
  background: #1c1a17;
}

.chat-bubble p { margin: 0; line-height: 1.7; }

.user-message {
  align-self: flex-end;
  max-width: 86%;
  border-radius: 18px 4px 18px 18px;
  color: #181512;
  background: var(--cream);
}

.assistant-message { align-self: flex-start; max-width: 92%; }
.chat-bubble.pending { color: var(--ink-soft); }

.chat-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(201, 154, 98, 0.5);
  border-radius: 50%;
  background-color: #181310;
  background-image: url("images/hikari.png");
  background-position: 50% 16%;
  background-size: 245% auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.prompt-chips button {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #74716c;
  font-size: 13px;
}

.chat-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.chat-input input::placeholder { color: #74716c; }
.chat-input button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #111;
  background: var(--cream);
  cursor: pointer;
}

.chat-input button:disabled,
.chat-input input:disabled { opacity: 0.52; cursor: wait; }

.song-stage {
  width: min(100%, 920px);
  margin: 0 auto;
}

.song-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 68px);
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.song-disc {
  display: grid;
  width: clamp(132px, 22vw, 190px);
  aspect-ratio: 1;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(201, 154, 98, 0.48);
  border-radius: 50%;
  background: radial-gradient(circle at center, #c99a62 0 4%, #151515 5% 34%, #29231d 35% 36%, #111 37% 66%, #201b17 67% 68%, #0b0b0b 69%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.song-disc span {
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(38px, 7vw, 62px);
  transform: translateY(-2px);
}

.song-stage h1 {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(54px, 8vw, 88px);
  font-weight: 400;
  line-height: 1;
}

.song-intro > div:last-child > p:last-child {
  max-width: 460px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.song-list {
  display: grid;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.song-track {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(240px, 360px);
  align-items: center;
  gap: 18px;
  min-height: 94px;
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
}

.song-track-number {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}

.song-track-copy h2 {
  margin: 0 0 4px;
  color: var(--cream);
  font-family: "Noto Serif Thai", "Noto Serif JP", var(--serif);
  font-size: clamp(18px, 2.3vw, 24px);
  font-weight: 400;
  line-height: 1.25;
}

.song-track-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.song-track audio {
  width: 100%;
  height: 38px;
  color-scheme: dark;
}

.song-variant-list {
  display: grid;
  gap: 8px;
}

.song-variant-list label {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.song-variant-list audio { min-width: 0; }

.mobile-tabbar { display: none; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 86px 0 100px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.features article {
  min-height: 210px;
  padding: 35px 38px;
}

.features article + article {
  border-left: 1px solid var(--line);
}

.feature-number {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}

.features h3 {
  margin: 40px 0 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.features p {
  max-width: 260px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 0 0 34px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.12em;
}

footer p {
  margin: 0;
}

footer span {
  margin-left: 12px;
  opacity: 0.6;
}

@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  body.church-online-body { padding-bottom: 0; }

  .church-online-shell {
    width: min(100% - 20px, 640px);
    padding-top: 18px;
  }

  .church-room-header {
    position: relative;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .church-room-header > div { grid-column: 1; }
  .church-language-picker {
    position: absolute;
    top: -3px;
    right: 0;
  }
  .church-room-header h1 { font-size: 42px; }
  .church-room-header > div > p:last-child { font-size: 12px; }
  .church-world { border-radius: 10px; }
  .hikari-stage { width: 8.8%; min-width: 36px; }
  .room-avatar { transform: translate(-50%, -50%) scale(0.78); }
  .player-avatar.seated { transform: translate(-50%, -50%) scale(0.7, 0.58); }

  .church-controls {
    align-items: flex-start;
    margin-top: 14px;
  }

  .church-control-actions { align-items: flex-end; flex-direction: column-reverse; }

  .sermon-card-heading { display: block; }
  .sermon-actions { justify-content: flex-start; margin-top: 12px; }

  .church-controls > p { max-width: 210px; line-height: 1.6; }

  .page-shell {
    width: min(100% - 32px, 640px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    height: 78px;
  }

  .main-nav { display: none; }

  .main-nav a {
    padding: 13px 12px;
  }

  .main-nav a.active::after {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .install-button {
    width: auto;
    height: 38px;
    justify-content: center;
    padding: 0 10px;
  }

  .install-button span {
    position: static;
    overflow: visible;
    width: auto;
    height: auto;
    clip: auto;
    white-space: nowrap;
  }

  .hero {
    padding: 70px 0 54px;
  }

  .bible-cover {
    min-height: calc(100dvh - 78px - 78px);
    padding: 0;
  }

  .cover-frame {
    width: 100%;
    min-height: calc(100dvh - 78px - 78px);
    padding: 38px 28px 34px;
  }

  .cover-cross { height: 145px; width: 17px; }
  .cover-cross span { top: 38px; width: 90px; height: 17px; }
  .cover-action { bottom: 32px; }
  .cover-controls { gap: 8px; margin-bottom: 50px; }
  .cover-language-picker button { padding-inline: 8px; }

  .bible-toc { min-height: calc(100dvh - 78px); padding: 72px 0 50px; }
  .bible-toc h2 { margin-bottom: 38px; }
  .toc-heading-row { display: block; }
  .testament-links { grid-template-columns: 1fr; }
  .testament-links a { min-height: 180px; padding: 26px; }
  .testament-links a + a { border-top: 1px solid var(--line); border-left: 0; }

  .testament-section { padding: 72px 0 75px; }
  .back-to-index { margin-bottom: 48px; }
  .testament-heading { margin-bottom: 34px; }
  .book-grid { grid-template-columns: 1fr; }
  .book-link { min-height: 72px; padding: 14px 16px; }

  .language-picker {
    width: 100%;
  }

  .language-picker button {
    justify-content: center;
    min-width: 0;
    padding-inline: 10px;
    flex: 1;
  }

  .lang-native {
    flex: initial;
    text-align: center;
  }

  .lang-code {
    display: none;
  }

  .reader-topline {
    padding: 27px 25px 24px;
  }

  .date-pill {
    display: none;
  }

  .reader-body {
    display: block;
    min-height: 0;
  }

  .chapter-number {
    height: 82px;
    padding: 16px 24px 0;
    font-size: 95px;
    overflow: hidden;
  }

  .passage {
    padding: 34px 25px 42px;
  }

  .features {
    grid-template-columns: 1fr;
    margin: 60px 0 70px;
  }

  .features article {
    min-height: 170px;
  }

  .features article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .features h3 {
    margin-top: 28px;
  }

  .inner-page {
    min-height: calc(100dvh - 156px);
    padding: 60px 0 55px;
  }

  .inner-hero { margin-bottom: 30px; }
  #encourage { padding-top: 38px; }
  #encourage .inner-hero { margin-bottom: 24px; }
  #encourage .inner-hero h1 { font-size: clamp(32px, 10vw, 44px); }

  .mood-grid {
    grid-template-columns: 1fr;
  }

  .mood-grid button {
    min-height: 70px;
    flex-direction: row;
  }

  .encouragement-card { padding: 34px 25px; }

  .gospel-layout { grid-template-columns: 1fr; gap: 30px; }
  .church-online-card { width: min(76vw, 226px); min-height: 70px; }
  .church-online-card img { width: 54px; height: 54px; }
  .hikari-portrait { width: min(74vw, 270px); height: 300px; margin-bottom: 12px; }
  .gospel-profile h1 { font-size: clamp(38px, 12vw, 52px); }
  .gospel-profile > p:last-child { max-width: 310px; font-size: 13px; }
  .chat-card { padding: 18px; }
  .prompt-chips { flex-direction: column; }
  .prompt-chips button { text-align: left; }

  .song-intro {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 26px;
  }

  .song-disc { width: 88px; }
  .song-stage h1 { font-size: clamp(42px, 13vw, 58px); }
  .song-intro > div:last-child > p:last-child { font-size: 12px; line-height: 1.55; }

  .song-track {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 16px 4px 18px;
  }

  .song-track audio {
    grid-column: 2;
    margin-top: 5px;
  }

  .song-variant-list { grid-column: 2; }
  .song-variant-list label { grid-template-columns: 68px minmax(0, 1fr); }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(9, 9, 9, 0.94);
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 7px 3px;
    border-radius: 8px;
    color: #77746e;
    font-size: 10px;
    text-decoration: none;
  }

  .mobile-tabbar a.active { color: var(--cream); }
  .tab-icon { color: var(--accent); font-family: var(--serif); font-size: 19px; }

  footer { display: none; }

  .index-header {
    grid-template-columns: 1fr auto auto;
    gap: 14px;
  }

  .index-header-nav {
    overflow: hidden;
    max-width: 120px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .index-main .bible-toc h1 { margin-bottom: 38px; }
}

@media (max-width: 760px) {
  body.scripture-reader-page { padding-bottom: env(safe-area-inset-bottom); }

  .reader-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
    height: auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .reader-brand { display: inline-flex; }
  .reader-brand .brand-mark { width: 30px; height: 30px; }

  .reader-language-picker {
    grid-column: 2;
    justify-self: stretch;
    margin-top: 0;
  }

  .reader-language-picker button { flex: 1; min-width: 0; min-height: 38px; padding: 7px 4px; }
  .reader-language-picker .bible-language-select { flex: 1 1 55%; padding: 5px 7px; min-height: 38px; }

  .reader-main {
    width: min(100% - 32px, 640px);
    padding: 6px 0 16px;
  }

  .reader-title-block {
    display: block;
    margin-bottom: 32px;
  }

  .reader-title-block h1 { font-size: clamp(50px, 18vw, 76px); }
  .reader-select-label { width: auto; min-width: 0; flex: 1; }
  .chapter-strip { margin-right: -16px; padding-right: 16px; }
  .scripture-panel { margin-top: 0; padding: 8px 0 36px; }
  .scripture-heading { margin-bottom: 7px; }

  .passage-heading-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    margin-bottom: 18px;
  }

  .reader-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .reader-size-field { min-width: 0; }
  .reader-size-buttons { width: max-content; }
  .reader-offline { align-items: stretch; flex-direction: column; }

  .verse-list p {
    margin-bottom: 24px;
    font-size: 18px;
    line-height: 1.95;
  }

  html[lang="ja"] .verse-list p { font-size: 17px; line-height: 2.25; }
  .passage-heading { font-size: 17px; }
  .chapter-navigation a { min-height: 66px; padding: 14px; }
  .chapter-navigation a span:not([aria-hidden="true"]) { max-width: 92px; }

  .reader-footer {
    width: min(100% - 32px, 640px);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .reader-footer span { display: none; }
}

/* Portrait sanctuary scene and scheduled-service foundation */
.church-world {
  width: min(100%, 760px);
  aspect-ratio: 941 / 1671;
  margin-inline: auto;
  border-radius: 20px;
  background-image:
    linear-gradient(180deg, rgba(9, 8, 6, 0.03), rgba(9, 8, 6, 0.08)),
    url("images/church-online-sanctuary-v2.png");
  background-position: center;
  background-size: cover;
}

.church-world::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  content: "";
  transition: opacity 900ms ease, background 900ms ease;
}

.church-world[data-scene-time="dawn"]::before {
  opacity: 0.36;
  background: linear-gradient(128deg, transparent 0 33%, rgba(66, 43, 48, 0.26) 34% 38%, transparent 39% 50%, rgba(66, 43, 48, 0.18) 51% 55%, transparent 56%), radial-gradient(ellipse 52% 27% at 15% 16%, rgba(255, 180, 112, 0.48), transparent 74%), linear-gradient(138deg, rgba(104, 87, 165, 0.42), rgba(255, 182, 104, 0.16) 56%, rgba(255, 239, 187, 0.1));
  mix-blend-mode: multiply;
}

.church-world[data-scene-time="morning"]::before {
  opacity: 0.28;
  background: linear-gradient(232deg, transparent 0 33%, rgba(68, 49, 39, 0.23) 34% 38%, transparent 39% 50%, rgba(68, 49, 39, 0.16) 51% 55%, transparent 56%), radial-gradient(ellipse 50% 31% at 82% 16%, rgba(255, 227, 162, 0.54), transparent 72%), linear-gradient(222deg, rgba(255, 227, 162, 0.08), rgba(255, 183, 91, 0.26));
  mix-blend-mode: multiply;
}

.church-world[data-scene-time="day"]::before {
  opacity: 0.12;
  background: radial-gradient(ellipse 60% 30% at 50% 7%, rgba(255, 249, 213, 0.4), transparent 72%), linear-gradient(180deg, rgba(226, 244, 255, 0.18), rgba(255, 247, 214, 0.06));
  mix-blend-mode: screen;
}

.church-world[data-scene-time="afternoon"]::before {
  opacity: 0.34;
  background: linear-gradient(132deg, transparent 0 33%, rgba(81, 46, 31, 0.27) 34% 38%, transparent 39% 50%, rgba(81, 46, 31, 0.18) 51% 55%, transparent 56%), radial-gradient(ellipse 54% 31% at 20% 22%, rgba(255, 205, 128, 0.5), transparent 74%), linear-gradient(138deg, rgba(255, 205, 128, 0.12), rgba(170, 93, 52, 0.38));
  mix-blend-mode: multiply;
}

.church-world[data-scene-time="evening"]::before {
  opacity: 0.48;
  background: radial-gradient(ellipse 38% 22% at 12% 28%, rgba(249, 157, 92, 0.34), transparent 72%), linear-gradient(138deg, rgba(66, 60, 115, 0.32), rgba(18, 23, 57, 0.62));
  mix-blend-mode: multiply;
}

.church-world[data-scene-time="night"]::before {
  opacity: 0.72;
  background: linear-gradient(180deg, rgba(8, 20, 56, 0.56), rgba(3, 8, 26, 0.84));
  mix-blend-mode: multiply;
}

/* The background tint sets the time of day; this separate layer is the visible
   origin of the light, so a bright window or lamp remains alive after dusk. */
.church-world::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  content: "";
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 900ms ease, background 900ms ease;
}

.church-world[data-scene-time="dawn"]::after {
  opacity: 0.56;
  background: radial-gradient(ellipse 39% 19% at 14% 15%, rgba(255, 180, 108, 0.78), transparent 72%), linear-gradient(128deg, rgba(255, 177, 104, 0.22) 8%, transparent 38%);
}

.church-world[data-scene-time="morning"]::after {
  opacity: 0.6;
  background: radial-gradient(ellipse 38% 21% at 84% 16%, rgba(255, 231, 162, 0.82), transparent 72%), linear-gradient(228deg, rgba(255, 213, 127, 0.23) 8%, transparent 39%);
}

.church-world[data-scene-time="day"]::after {
  opacity: 0.44;
  background: radial-gradient(ellipse 48% 24% at 50% 7%, rgba(255, 249, 219, 0.68), transparent 74%), linear-gradient(180deg, rgba(255, 251, 224, 0.14), transparent 42%);
}

.church-world[data-scene-time="afternoon"]::after {
  opacity: 0.58;
  background: radial-gradient(ellipse 42% 23% at 19% 21%, rgba(255, 194, 111, 0.78), transparent 72%), linear-gradient(132deg, rgba(255, 179, 96, 0.24) 9%, transparent 39%);
}

.church-world[data-scene-time="evening"]::after {
  opacity: 0.5;
  background: radial-gradient(ellipse 25% 13% at 50% 26%, rgba(255, 196, 112, 0.48), transparent 74%), radial-gradient(ellipse 18% 10% at 12% 42%, rgba(255, 180, 94, 0.34), transparent 72%), radial-gradient(ellipse 18% 10% at 88% 42%, rgba(255, 180, 94, 0.34), transparent 72%);
}

.church-world[data-scene-time="night"]::after {
  opacity: 0.88;
  background: radial-gradient(ellipse 26% 14% at 50% 26%, rgba(255, 215, 137, 0.78), transparent 74%), radial-gradient(ellipse 18% 10% at 12% 42%, rgba(255, 184, 96, 0.6), transparent 70%), radial-gradient(ellipse 18% 10% at 88% 42%, rgba(255, 184, 96, 0.6), transparent 70%), radial-gradient(ellipse 16% 9% at 17% 58%, rgba(255, 174, 83, 0.42), transparent 72%), radial-gradient(ellipse 16% 9% at 83% 58%, rgba(255, 174, 83, 0.42), transparent 72%);
}

.church-world[data-scene-time="dawn"] .scene-depth { filter: brightness(0.98) saturate(1.1); }
.church-world[data-scene-time="morning"] .scene-depth { filter: brightness(1.04) saturate(1.08); }
.church-world[data-scene-time="day"] .scene-depth { filter: brightness(1.1) saturate(1.03); }
.church-world[data-scene-time="afternoon"] .scene-depth { filter: brightness(0.94) saturate(1.08); }
.church-world[data-scene-time="evening"] .scene-depth { filter: brightness(0.78) saturate(0.84) hue-rotate(8deg); }
.church-world[data-scene-time="night"] .scene-depth { filter: brightness(0.58) saturate(0.68) hue-rotate(12deg); }

.church-scene-clock {
  position: absolute;
  top: 1.4%;
  right: 2.4%;
  z-index: 1100;
  display: grid;
  min-width: 112px;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 238, 194, 0.42);
  border-radius: 10px;
  color: #fff9e9;
  background: rgba(15, 12, 8, 0.72);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  text-align: right;
  backdrop-filter: blur(9px);
}

.scene-clock-label,
.church-scene-clock small {
  color: rgba(255, 249, 233, 0.72);
  font-size: 7px;
  line-height: 1.35;
}

.church-scene-clock strong {
  color: #fff9e9;
  font-family: var(--serif);
  font-size: clamp(16px, 2.35vw, 24px);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hikari-stage {
  top: 25.7%;
  z-index: 970;
  width: auto;
  min-width: 0;
}

.hikari-stage span {
  padding: 3px 8px;
  border: 1px solid rgba(255, 238, 194, 0.42);
  background: rgba(35, 22, 12, 0.68);
}

.hikari-stage.is-speaking span {
  color: #2a190b;
  background: #f3d69b;
  animation: hikari-label-speaking 1.1s ease-in-out infinite;
}

@keyframes hikari-label-speaking {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.seat-hotspot { width: 25%; height: 5.5%; }
.seat-l1 { top: 36.8%; left: 21%; }
.seat-r1 { top: 36.8%; left: 54%; }
.seat-l2 { top: 43.8%; left: 20%; }
.seat-r2 { top: 43.8%; left: 55%; }
.seat-l3 { top: 50.8%; left: 19%; }
.seat-r3 { top: 50.8%; left: 56%; }

.room-avatar {
  width: clamp(46px, 10.5%, 82px);
}

.player-avatar {
  top: 88%;
  left: 50%;
  width: clamp(76px, 14.5%, 132px);
}
.player-name { top: 93%; left: 50%; }
.avatar-name { z-index: 1600; }

.timed-visitor,
.npc-name {
  opacity: 0;
  transition: top 3.8s ease, left 3.8s ease, opacity 700ms ease;
}

.npc-one { top: 76%; left: 49%; z-index: 390; transform: translate(-50%, -50%) scale(0.88); }
.npc-two { top: 83%; left: 52%; z-index: 460; transform: translate(-50%, -50%) scale(0.88); }
.npc-three { top: 91%; left: 48%; z-index: 530; transform: translate(-50%, -50%) scale(0.88); }
.npc-name-one { top: 42%; left: 34%; }
.npc-name-two { top: 49%; left: 67%; }
.npc-name-three { top: 56%; left: 34%; }

.service-live .npc-one { top: 38.8%; left: 34%; opacity: 1; }
.service-live .npc-two { top: 45.8%; left: 67%; opacity: 1; transition-delay: 700ms; }
.service-live .npc-three { top: 52.8%; left: 34%; opacity: 1; transition-delay: 1.4s; }
.service-live .npc-name { opacity: 1; transition-delay: 3.2s; }

.scene-depth {
  background-image: url("images/church-online-sanctuary-v2.png");
  background-position: center;
  background-size: cover;
}

.pulpit-depth {
  z-index: 340;
  clip-path: polygon(35% 28%, 65% 28%, 65% 34%, 35% 34%);
}

.pew-depth-l1,
.pew-depth-r1 { z-index: 420; }
.pew-depth-l2,
.pew-depth-r2 { z-index: 490; }
.pew-depth-l3,
.pew-depth-r3 { z-index: 560; }
.pew-depth-l1 { clip-path: polygon(20% 39%, 47% 39%, 47% 44%, 20% 44%); }
.pew-depth-r1 { clip-path: polygon(53% 39%, 80% 39%, 80% 44%, 53% 44%); }
.pew-depth-l2 { clip-path: polygon(19% 46%, 47% 46%, 47% 51%, 19% 51%); }
.pew-depth-r2 { clip-path: polygon(53% 46%, 81% 46%, 81% 51%, 53% 51%); }
.pew-depth-l3 { clip-path: polygon(18% 53%, 47% 53%, 47% 58%, 18% 58%); }
.pew-depth-r3 { clip-path: polygon(53% 53%, 82% 53%, 82% 58%, 53% 58%); }

.scene-sermon-card {
  position: absolute;
  bottom: 2.2%;
  left: 50%;
  z-index: 1200;
  width: 91%;
  max-height: 42%;
  margin: 0;
  padding: clamp(15px, 3.2vw, 26px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-50%);
  border-color: rgba(255, 238, 194, 0.5);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(22, 17, 12, 0.9), rgba(10, 10, 10, 0.88));
  backdrop-filter: blur(11px);
}

.scene-sermon-card .sermon-card-heading { align-items: center; }
.scene-sermon-card .sermon-card-heading h2 {
  margin-top: 3px;
  font-size: clamp(18px, 3.2vw, 28px);
}
.scene-sermon-card #service-test { color: #fff9e9; font-size: 9px; }
.scene-sermon-card #sermon-voice { width: 32px; height: 32px; font-size: 11px; }
.scene-sermon-card .sermon-theme { margin-top: 8px; font-size: 8px; }
.scene-sermon-card .sermon-verse {
  margin: 8px 0 3px;
  font-size: clamp(15px, 2.5vw, 21px);
  line-height: 1.45;
}
.scene-sermon-card .sermon-scripture-summary,
.scene-sermon-card .sermon-prayer {
  margin-top: 4px;
  font-size: clamp(9px, 1.55vw, 12px);
  line-height: 1.55;
}
.scene-sermon-card .sermon-message {
  margin-top: 7px;
  font-size: clamp(11px, 1.8vw, 14px);
  line-height: 1.65;
}
.scene-sermon-card .sermon-status { margin-top: 8px; font-size: 9px; }

.church-controls,
.sermon-archive {
  width: min(100%, 760px);
  margin-inline: auto;
}

.sermon-archive {
  margin-top: 42px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.sermon-archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sermon-archive-heading h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 400;
}

.sermon-archive-heading > span {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.sermon-archive-item { border-bottom: 1px solid var(--line); }
.sermon-archive-item:last-child { border-bottom: 0; }
.sermon-archive-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 0;
  color: var(--cream);
  cursor: pointer;
  list-style: none;
}
.sermon-archive-item summary::-webkit-details-marker { display: none; }
.sermon-archive-item summary strong { font-size: 14px; font-weight: 500; line-height: 1.55; }
.sermon-archive-item time { color: var(--ink-soft); font-size: 10px; }
.sermon-archive-item p {
  max-width: 650px;
  margin: -2px 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.sermon-archive-item .archive-theme {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.sermon-archive-item .archive-scripture,
.sermon-archive-item .archive-prayer { color: rgba(245, 240, 231, 0.76); }

.sermon-archive-empty {
  margin: 0;
  padding: 22px 0 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

/* Illustrated Jesus story reader */
.story-body {
  min-height: 100dvh;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 0%, rgba(201, 154, 98, 0.13), transparent 34%),
    #090909;
}

.story-shell {
  width: min(calc(100% - 24px), 1180px);
  margin: 0 auto;
  padding: 0 0 70px;
}

.story-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.story-header .brand { justify-self: start; }

.story-back {
  color: var(--ink-soft);
  font-size: 11px;
  text-decoration: none;
}

.story-back:hover { color: var(--cream); }

.story-language {
  display: flex;
  justify-self: end;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.story-language button {
  min-width: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.story-language button.selected {
  color: #15120f;
  background: var(--cream);
}

.story-intro {
  padding: clamp(16px, 2.4vw, 26px) 0 clamp(14px, 2vw, 22px);
  text-align: center;
}

.story-intro .section-label {
  font-size: 9px;
}

.story-intro h1 {
  margin: 5px 0 4px;
  font-family: var(--serif);
  font-size: clamp(28px, 4.8vw, 44px);
  font-weight: 400;
  line-height: 1.04;
}

.story-intro > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.story-reader {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid rgba(201, 154, 98, 0.35);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.story-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  padding: 0 4px 14px;
}

.story-progress-row strong {
  font-family: var(--serif);
  font-size: clamp(23px, 3.6vw, 31px);
  font-weight: 400;
  line-height: 1.25;
}

.story-progress-row span {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.story-track {
  display: flex;
  overflow-x: auto;
  margin: 0;
  padding: 0;
  border-radius: 16px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  list-style: none;
  /* Let a vertical gesture begun on artwork scroll the page. Horizontal
     swiping is handled in stories.js so both gestures remain natural. */
  touch-action: pan-y;
  overscroll-behavior-x: contain;
}

.story-track::-webkit-scrollbar { display: none; }

.story-track.is-dragging {
  scroll-behavior: auto;
  scroll-snap-type: none;
  cursor: grabbing;
}

.story-slide {
  display: grid;
  flex: 0 0 100%;
  place-items: center;
  box-sizing: border-box;
  padding: 0 10px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.story-panel {
  position: relative;
  overflow: hidden;
  width: min(100%, 760px);
  border-radius: 22px;
  background-image: url("images/jesus-story-art-v2.png");
  background-position: var(--story-x) var(--story-y);
  background-size: var(--story-x-size, 400%) var(--story-y-size);
  background-repeat: no-repeat;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3);
}

.story-panel.has-individual-art {
  background-image: none;
}

.story-illustration {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.story-panel-header {
  /* The active chapter title already sits above the illustration. Keeping a
     second title here hid too much of the story artwork on mobile. */
  display: none;
}

.story-panel-number {
  display: grid;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #263b5a;
  font-size: 12px;
  font-weight: 600;
}

.story-panel-header strong {
  min-width: 0;
  font-size: clamp(17px, 2.3vw, 22px);
  font-weight: 600;
  line-height: 1.22;
}

.story-panel-caption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  min-height: 30%;
  margin: 0;
  padding: clamp(20px, 3.6vw, 30px);
  color: #382923;
  border-top: 1px solid rgba(88, 59, 36, 0.08);
  background: rgba(255, 252, 244, 0.975);
  font-size: clamp(17px, 2.35vw, 21px);
  font-weight: 500;
  line-height: 1.52;
}

html[lang="ja"] .story-panel-caption {
  font-size: clamp(16px, 2.15vw, 20px);
  line-height: 1.58;
}

/* Keep each painting visible beneath a dialogue-like caption instead of
   reserving a solid lower block for copy. */
.story-panel--game-caption .story-panel-caption {
  align-items: flex-end;
  min-height: 0;
  padding: clamp(24px, 5vw, 42px) clamp(22px, 5vw, 44px) clamp(22px, 4vw, 34px);
  color: #fffdf8;
  border-top: 0;
  background: linear-gradient(
    to top,
    rgba(18, 12, 9, 0.82) 0%,
    rgba(18, 12, 9, 0.64) 48%,
    rgba(18, 12, 9, 0.26) 78%,
    transparent 100%
  );
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  line-height: 1.55;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.72);
}

html[lang="ja"] .story-panel--game-caption .story-panel-caption,
html[lang="en"] .story-panel--game-caption .story-panel-caption {
  font-size: clamp(20px, 3.1vw, 27px);
}

.story-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.story-controls > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  cursor: pointer;
}

.story-controls > button:disabled { opacity: 0.28; cursor: default; }

.story-dots {
  display: flex;
  overflow-x: auto;
  gap: 5px;
  padding: 4px;
  scrollbar-width: none;
}

.story-dots::-webkit-scrollbar { display: none; }

.story-dots button {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.story-dots button.active {
  border-color: var(--accent);
  color: #17120e;
  background: var(--accent);
}

.story-overview {
  width: min(100%, 860px);
  margin: 24px auto 0;
  border-bottom: 1px solid var(--line);
}

.story-overview summary {
  padding: 17px 2px;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}

.story-overview img {
  display: block;
  width: 100%;
  margin: 0 0 22px;
  border-radius: 12px;
}

.story-note {
  width: min(100%, 860px);
  margin: 18px auto 0;
  color: #77736c;
  font-size: 10px;
  line-height: 1.65;
  text-align: center;
}

@media (max-width: 760px) {
  .church-world { width: 100%; border-radius: 12px; }
  .church-scene-clock { min-width: 98px; padding: 5px 6px; }
  .church-scene-clock strong { font-size: 16px; }
  .scene-clock-label, .church-scene-clock small { font-size: 6.5px; }
  .hikari-stage { top: 25.7%; }
  .hikari-stage span, .avatar-name { font-size: 7px; }
  .room-avatar { width: 11.5%; }
  .scene-sermon-card { width: 94%; max-height: 50%; padding: 12px; }
  .scene-sermon-card .section-label { font-size: 8px; }
  .scene-sermon-card .sermon-card-heading { align-items: flex-start; gap: 8px; }
  .scene-sermon-card .sermon-card-heading h2 { font-size: 15px; }
  .scene-sermon-card #service-test { max-width: 92px; padding: 7px 9px; line-height: 1.25; }
  .scene-sermon-card .sermon-verse { font-size: 13px; }
  .scene-sermon-card .sermon-scripture-summary,
  .scene-sermon-card .sermon-prayer { font-size: 9px; }
  .scene-sermon-card .sermon-message { font-size: 10px; }
  .sermon-archive { margin-top: 28px; border-radius: 12px; }
  .sermon-archive-item summary { grid-template-columns: 1fr; gap: 5px; }
  .story-shell { width: 100%; padding-bottom: 34px; }
  .story-header { grid-template-columns: 1fr auto; min-height: 68px; padding-inline: 14px; }
  .story-header .brand { grid-column: 1; }
  .story-back { display: none; }
  .story-language { grid-column: 2; }
  .story-language button { min-width: 36px; padding: 7px 8px; }
  .story-intro { padding: 10px 16px 8px; }
  .story-intro h1 { margin-block: 3px; font-size: clamp(27px, 8vw, 35px); }
  .story-intro > p:last-child { font-size: 12px; }
  .story-reader { padding: 5px 0 0; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .story-progress-row { min-height: 46px; padding: 0 16px 7px; }
  .story-progress-row strong { font-size: 23px; }
  .story-slide { padding: 0 10px; }
  .story-panel { width: 100%; border-radius: 20px; }
  .story-panel-header { display: none; }
  .story-panel-number { width: 29px; height: 29px; font-size: 12px; }
  .story-panel-header strong { font-size: 18px; }
  .story-panel-caption { min-height: 32%; padding: 18px 20px 20px; font-size: 18px; line-height: 1.62; }
  .story-panel--game-caption .story-panel-caption { min-height: 0; padding: 28px 24px 23px; font-size: 22px; line-height: 1.56; }
  html[lang="ja"] .story-panel-caption { font-size: 17px; }
  .story-controls { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 7px; margin-top: 12px; }
  .story-controls > button { justify-content: center; min-width: 42px; padding: 8px; }
  .story-controls > button span:not([aria-hidden="true"]) { display: none; }
  .story-dots { gap: 4px; }
  .story-dots button { flex-basis: 23px; width: 23px; height: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hikari-character {
    animation: none;
  }
}

/* Hikari sprite-system prototype */
.sprite-lab-body {
  min-height: 100dvh;
  color: var(--cream);
  background: radial-gradient(circle at 50% 0%, rgba(201, 154, 98, 0.14), transparent 36%), #080808;
}

.sprite-lab-shell {
  width: min(calc(100% - 28px), 1120px);
  margin: 0 auto;
  padding-bottom: 52px;
}

.sprite-lab-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.sprite-lab-back {
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.sprite-lab-header .story-language { justify-self: end; }

.sprite-lab-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 4px 18px;
}

.sprite-lab-intro h1 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 400;
  line-height: 1;
}

.sprite-lab-intro > p {
  width: min(100%, 430px);
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.sprite-lab-stage {
  position: relative;
  overflow: hidden;
  width: min(100%, 520px);
  aspect-ratio: 941 / 1671;
  min-height: 0;
  margin-inline: auto;
  border: 1px solid rgba(201, 154, 98, 0.42);
  border-radius: 18px;
  outline: none;
  background-color: #17130e;
  background-image:
    linear-gradient(180deg, rgba(9, 8, 6, 0.02), rgba(9, 8, 6, 0.08)),
    url("images/church-online-sanctuary-v2.png");
  background-position: center;
  background-size: cover;
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.42);
  cursor: crosshair;
  touch-action: manipulation;
}

.sprite-lab-stage:focus-visible { box-shadow: 0 0 0 2px var(--accent), 0 28px 84px rgba(0, 0, 0, 0.42); }

.sprite-lab-stage::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  content: "";
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 900ms ease, background 900ms ease;
}

.sprite-lab-stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, rgba(10, 22, 55, 0.42), rgba(5, 10, 25, 0.7));
  content: "";
  pointer-events: none;
  mix-blend-mode: multiply;
  backdrop-filter: brightness(0.72) saturate(0.72) hue-rotate(8deg);
  transition: opacity 900ms ease;
}

.sprite-lab-stage.is-night::after { opacity: 1; }

.sprite-lab-stage[data-scene-time="dawn"]::after {
  opacity: 0.4;
  background: linear-gradient(128deg, transparent 0 33%, rgba(66, 43, 48, 0.26) 34% 38%, transparent 39% 50%, rgba(66, 43, 48, 0.18) 51% 55%, transparent 56%), linear-gradient(180deg, rgba(102, 83, 160, 0.34), rgba(255, 180, 111, 0.18) 54%, rgba(255, 231, 165, 0.12));
  mix-blend-mode: multiply;
  backdrop-filter: brightness(0.98) saturate(1.12);
}

.sprite-lab-stage[data-scene-time="dawn"]::before {
  opacity: 0.62;
  background: radial-gradient(ellipse 39% 18% at 14% 15%, rgba(255, 180, 108, 0.82), transparent 72%), linear-gradient(128deg, rgba(255, 177, 104, 0.24) 8%, transparent 38%);
}

.sprite-lab-stage[data-scene-time="morning"]::after {
  opacity: 0.3;
  background: linear-gradient(232deg, transparent 0 33%, rgba(68, 49, 39, 0.23) 34% 38%, transparent 39% 50%, rgba(68, 49, 39, 0.16) 51% 55%, transparent 56%), linear-gradient(180deg, rgba(255, 222, 152, 0.08), rgba(255, 181, 90, 0.26));
  mix-blend-mode: multiply;
  backdrop-filter: brightness(1.04) saturate(1.08);
}

.sprite-lab-stage[data-scene-time="morning"]::before {
  opacity: 0.66;
  background: radial-gradient(ellipse 38% 20% at 84% 16%, rgba(255, 231, 162, 0.86), transparent 72%), linear-gradient(228deg, rgba(255, 213, 127, 0.24) 8%, transparent 39%);
}

.sprite-lab-stage[data-scene-time="day"]::after {
  opacity: 0.14;
  background: linear-gradient(180deg, rgba(230, 244, 255, 0.2), rgba(255, 244, 204, 0.08));
  mix-blend-mode: screen;
  backdrop-filter: brightness(1.1) saturate(1.03);
}

.sprite-lab-stage[data-scene-time="day"]::before {
  opacity: 0.5;
  background: radial-gradient(ellipse 48% 22% at 50% 7%, rgba(255, 249, 219, 0.74), transparent 74%), linear-gradient(180deg, rgba(255, 251, 224, 0.15), transparent 42%);
}

.sprite-lab-stage[data-scene-time="afternoon"]::after {
  opacity: 0.38;
  background: linear-gradient(132deg, transparent 0 33%, rgba(81, 46, 31, 0.27) 34% 38%, transparent 39% 50%, rgba(81, 46, 31, 0.18) 51% 55%, transparent 56%), linear-gradient(180deg, rgba(255, 204, 126, 0.13), rgba(177, 98, 54, 0.42));
  mix-blend-mode: multiply;
  backdrop-filter: brightness(0.94) saturate(1.08);
}

.sprite-lab-stage[data-scene-time="afternoon"]::before {
  opacity: 0.64;
  background: radial-gradient(ellipse 42% 22% at 19% 21%, rgba(255, 194, 111, 0.82), transparent 72%), linear-gradient(132deg, rgba(255, 179, 96, 0.25) 9%, transparent 39%);
}

.sprite-lab-stage[data-scene-time="evening"]::after {
  opacity: 0.5;
  background: linear-gradient(180deg, rgba(63, 58, 112, 0.36), rgba(18, 22, 55, 0.66));
  mix-blend-mode: multiply;
  backdrop-filter: brightness(0.78) saturate(0.85) hue-rotate(8deg);
}

.sprite-lab-stage[data-scene-time="evening"]::before {
  opacity: 0.54;
  background: radial-gradient(ellipse 25% 13% at 50% 26%, rgba(255, 196, 112, 0.52), transparent 74%), radial-gradient(ellipse 18% 10% at 12% 42%, rgba(255, 180, 94, 0.38), transparent 72%), radial-gradient(ellipse 18% 10% at 88% 42%, rgba(255, 180, 94, 0.38), transparent 72%);
}

.sprite-lab-stage[data-scene-time="night"]::after {
  opacity: 0.78;
  background: linear-gradient(180deg, rgba(9, 20, 56, 0.6), rgba(3, 8, 26, 0.86));
  mix-blend-mode: multiply;
  backdrop-filter: brightness(0.58) saturate(0.68) hue-rotate(12deg);
}

.sprite-lab-stage[data-scene-time="night"]::before {
  opacity: 0.94;
  background: radial-gradient(ellipse 26% 14% at 50% 26%, rgba(255, 215, 137, 0.84), transparent 74%), radial-gradient(ellipse 18% 10% at 12% 42%, rgba(255, 184, 96, 0.66), transparent 70%), radial-gradient(ellipse 18% 10% at 88% 42%, rgba(255, 184, 96, 0.66), transparent 70%), radial-gradient(ellipse 16% 9% at 17% 58%, rgba(255, 174, 83, 0.5), transparent 72%), radial-gradient(ellipse 16% 9% at 83% 58%, rgba(255, 174, 83, 0.5), transparent 72%);
}

.sprite-grid {
  position: absolute;
  inset: 48% 0 0;
  opacity: 0;
  background-image:
    linear-gradient(rgba(201, 154, 98, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 154, 98, 0.3) 1px, transparent 1px);
  background-size: 46px 28px;
  transform: perspective(340px) rotateX(54deg) scale(1.8);
  transform-origin: center top;
  pointer-events: none;
}

.sprite-lab-stage.show-grid .sprite-grid { opacity: 0.72; }

.sprite-scene-picker {
  display: grid;
  gap: 10px;
  width: min(100%, 760px);
  margin: 16px auto 0;
  padding: 13px 15px;
  border: 1px solid rgba(201, 154, 98, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.sprite-scene-picker p { margin: 0; color: var(--ink); font-weight: 600; }
.sprite-scene-picker small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 12px; }

.hikari-sprite-actor {
  position: absolute;
  top: 70%;
  left: 50%;
  width: 104px;
  height: 146px;
  transform: translate(-50%, -88%);
  pointer-events: none;
  z-index: 4;
  will-change: left, top;
}

.hikari-sprite-frame {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 88px;
  height: 132px;
  background-image: url("images/hikari-sprite-sheet-v2.png");
  background-repeat: no-repeat;
  background-size: 1536px 1024px;
  image-rendering: pixelated;
  mix-blend-mode: normal;
  transform: translateX(-50%) scale(0.64);
  transform-origin: center bottom;
}

.hikari-sprite-bubble {
  position: absolute;
  bottom: 151px;
  left: 50%;
  z-index: 8;
  width: max-content;
  min-width: 118px;
  max-width: 220px;
  padding: 10px 13px;
  border: 1px solid rgba(240, 195, 121, 0.58);
  border-radius: 15px;
  color: #fff8e9;
  background: rgba(24, 17, 13, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  transform: translateX(-50%);
}

.hikari-sprite-bubble::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(240, 195, 121, 0.58);
  border-bottom: 1px solid rgba(240, 195, 121, 0.58);
  background: rgba(24, 17, 13, 0.96);
  content: "";
  transform: translate(-50%, -5px) rotate(45deg);
}

.hikari-sprite-bubble.thought {
  border-style: dashed;
  color: rgba(255, 248, 233, 0.8);
}

.hikari-sprite-bubble[hidden] { display: none; }

.hikari-sprite-actor[data-state="rest"] .hikari-sprite-frame,
.hikari-sprite-actor[data-state="pray"] .hikari-sprite-frame {
  bottom: 18px;
}

.hikari-sprite-actor span {
  position: absolute;
  right: 50%;
  bottom: 126px;
  z-index: 4;
  padding: 3px 10px;
  border: 1px solid rgba(240, 195, 121, 0.52);
  border-radius: 999px;
  color: #fff8e9;
  background: rgba(18, 12, 9, 0.86);
  font-size: 12px;
  transform: translateX(50%);
}

.sprite-target {
  position: absolute;
  width: 20px;
  height: 10px;
  border: 1px solid rgba(241, 197, 126, 0.86);
  border-radius: 50%;
  opacity: 0;
  z-index: 5;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease;
  pointer-events: none;
}

.sprite-target.visible { opacity: 1; }

.sprite-stage-hint {
  position: absolute;
  top: 15px;
  left: 18px;
  margin: 0;
  color: rgba(245, 240, 231, 0.58);
  font-size: 12px;
  pointer-events: none;
  z-index: 5;
}

.sprite-character-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 520px);
  margin: 14px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 14, 11, 0.78);
}

.sprite-character-picker > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.sprite-engine-panel {
  width: min(100%, 900px);
  margin: 16px auto 0;
  padding: 18px;
  border: 1px solid rgba(201, 154, 98, 0.38);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(201, 154, 98, 0.09), rgba(255, 255, 255, 0.025));
}

.sprite-engine-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.sprite-engine-heading h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
}

.sprite-engine-heading > p {
  max-width: 320px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.sprite-engine-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px 16px;
  margin-top: 17px;
}

.sprite-range-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  color: var(--cream);
  font-size: 12px;
}

.sprite-range-control output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.sprite-range-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
  cursor: ew-resize;
}

.sprite-engine-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sprite-engine-action {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  cursor: pointer;
}

.sprite-engine-action.selected {
  border-color: var(--accent);
  color: #20150d;
  background: var(--accent);
}

.sprite-engine-status {
  min-height: 18px;
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
}

.sprite-lab-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 18px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.sprite-life-toggle {
  align-self: end;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.sprite-life-toggle.selected {
  border-color: rgba(201, 154, 98, 0.72);
  color: #20150d;
  background: var(--accent);
}

.sprite-control-group > p {
  margin: 0 0 9px;
  color: var(--ink-soft);
  font-size: 12px;
}

.sprite-button-row { display: flex; flex-wrap: wrap; gap: 7px; }

.sprite-button-row button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  cursor: pointer;
}

.sprite-button-row button.selected {
  border-color: var(--accent);
  color: #1b130d;
  background: var(--accent);
}

.sprite-status {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(201, 154, 98, 0.08);
  font-size: 12px;
  white-space: nowrap;
}

.sprite-lab-link {
  display: inline-block;
  margin-top: 5px;
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
}

.sprite-lab-link:hover { color: var(--cream); }

@media (max-width: 760px) {
  .sprite-lab-shell { width: calc(100% - 10px); padding-bottom: 26px; }
  .sprite-lab-header { grid-template-columns: 1fr auto; min-height: 72px; padding-inline: 7px; }
  .sprite-lab-back { display: none; }
  .sprite-lab-intro { display: block; padding: 18px 9px 13px; }
  .sprite-lab-intro h1 { font-size: 31px; }
  .sprite-lab-intro > p { margin-top: 9px; font-size: 12px; }
  .sprite-lab-stage { width: 100%; min-height: 0; border-radius: 12px; }
  .sprite-character-picker { width: 100%; padding: 11px; border-radius: 12px; }
  .sprite-engine-panel { width: 100%; padding: 13px; border-radius: 12px; }
  .sprite-engine-heading { display: block; }
  .sprite-engine-heading > p { margin-top: 7px; }
  .sprite-engine-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 13px; }
  .sprite-engine-actions { gap: 7px; }
  .sprite-engine-status { width: 100%; margin-left: 0; }
  .hikari-sprite-actor { width: 92px; height: 132px; }
  .hikari-sprite-frame { transform: translateX(-50%) scale(0.56); }
  .sprite-lab-controls { grid-template-columns: 1fr; gap: 15px; padding: 13px; border-radius: 12px; }
  .sprite-button-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .sprite-button-row button { flex: 0 0 auto; min-height: 42px; }
  .sprite-status { justify-self: start; }
}

/* Hikari's scheduled and autonomous life inside Church Online */
.church-world .hikari-stage {
  position: absolute;
  width: 70px;
  height: 94px;
  min-width: 0;
  transform: translate(-50%, -88%);
  transition: none;
  text-align: center;
  pointer-events: none;
  will-change: left, top;
}

.church-hikari-frame {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 88px;
  height: 132px;
  background-image: url("images/hikari-sprite-sheet-v2.png");
  background-repeat: no-repeat;
  background-size: 1536px 1024px;
  image-rendering: pixelated;
  opacity: 0;
  transform: translateX(-50%) scale(0.384);
  transform-origin: center bottom;
  transition: opacity 160ms ease;
}

.church-hikari-frame.is-ready { opacity: 1; }

.church-world .hikari-stage > span {
  position: absolute;
  bottom: 70px;
  left: 50%;
  z-index: 12;
  transform: translateX(-50%);
}

.church-hikari-bubble {
  position: absolute;
  bottom: 86px;
  left: 50%;
  z-index: 14;
  width: max-content;
  min-width: 118px;
  max-width: 205px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 232, 178, 0.64);
  border-radius: 13px;
  color: #fff9e9;
  background: rgba(25, 17, 11, 0.94);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.34);
  font-size: 10px;
  line-height: 1.45;
  transform: translateX(-50%);
}

.church-hikari-bubble::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(255, 232, 178, 0.64);
  border-bottom: 1px solid rgba(255, 232, 178, 0.64);
  background: rgba(25, 17, 11, 0.94);
  content: "";
  transform: translate(-50%, -4px) rotate(45deg);
}

.church-hikari-bubble[hidden] { display: none; }

.church-hikari-bubble.is-dialogue {
  width: min(280px, 70vw);
  max-width: min(280px, 70vw);
  min-height: 3em;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.church-hikari-bubble.is-dialogue.is-typing::before {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f3d69b;
  animation: sermon-cursor 620ms steps(1) infinite;
}

.church-world .hikari-stage.is-speaking .church-hikari-frame {
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.44));
}

@media (max-width: 760px) {
  .church-world .hikari-stage { width: 66px; height: 88px; }
  .church-hikari-frame { transform: translateX(-50%) scale(0.336); }
  .church-world .hikari-stage > span { bottom: 63px; }
  .church-hikari-bubble { bottom: 78px; max-width: 165px; font-size: 9px; }
}

/* Scripture selection stays on this device and never changes the verse text. */
.reader-picker {
  width: min(420px, calc(100% - 36px));
  padding: 24px;
  border: 1px solid rgba(226, 192, 137, .35);
  border-radius: 18px;
  color: var(--ink);
  background: #191714;
}
.reader-picker::backdrop { background: rgba(0, 0, 0, .72); }
.reader-picker h2 { margin: 0 0 20px; font-size: 19px; }
#reader-picker-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
#reader-picker-done, .reader-marks-bar button {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid rgba(232, 208, 170, .28);
  border-radius: 999px;
  color: #faf5eb;
  background: rgba(255, 255, 255, .07);
  font: inherit;
  cursor: pointer;
}
#reader-picker-done { margin-top: 20px; }
.reading-history-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0 0 4px; }
#reader-settings-open { font-size: .875rem; }
.reader-language-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
.reader-language-settings legend {
  margin: 0 0 10px;
  padding: 0;
  font-size: .875rem;
  color: var(--muted);
}
#reader-settings .reader-select-label select { font-size: 1rem; }
#reader-settings .reading-history-note { font-size: .875rem; }
#reader-settings { max-height: calc(100dvh - 32px); overflow: auto; }
.reader-online-editions { margin: 18px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
#reader-online-open { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; text-decoration: none; }
#reader-settings form { display: flex; justify-content: flex-end; }
#reader-settings form button { min-height: 44px; font-size: .875rem; }
.reader-source-link { color: inherit; }
.reading-history-open { min-height: 36px; padding: 4px 12px; border: 1px solid rgba(232,208,170,.25); border-radius: 999px; color: var(--ink-soft); background: rgba(255,255,255,.035); font: 11px var(--sans); cursor: pointer; }
.reading-history-open:hover, .reading-history-open:focus-visible { color: var(--cream); border-color: var(--accent); }
#home-profile-link, #reading-profile-link {
  display: block;
  max-width: min(14rem, 29vw);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  align-content: center;
}
.reading-history { width: min(490px, calc(100% - 28px)); max-height: min(80dvh, 620px); overflow-y: auto; }
.reading-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reading-history-heading h2 { margin: 0; }
.reading-history-heading button, .reading-history-remove { min-height: 40px; padding: 8px 13px; border: 1px solid rgba(232,208,170,.28); border-radius: 999px; color: var(--cream); background: rgba(255,255,255,.07); font: inherit; cursor: pointer; }
.reading-history-note, #reading-history-status { color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.reading-history-list { display: grid; gap: 7px; list-style: none; padding: 0; margin: 18px 0 0; }
.reading-history-list li { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(232,208,170,.12); border-radius: 12px; background: rgba(255,255,255,.025); }
.reading-history-link { display: block; flex: 1; min-width: 0; padding: 12px 14px; color: var(--cream); text-decoration: none; }
.reading-history-link strong, .reading-history-link small { display: block; }
.reading-history-link strong { font-size: 14px; font-weight: 500; }
.reading-history-link small { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.reading-history-link:focus-visible, .reading-history-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reading-history-remove { flex: none; width: 40px; margin-right: 8px; padding: 0; color: var(--ink-soft); font-size: 20px; }
@media (max-width: 600px) {
  .scripture-heading { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
  .reader-heading-title { grid-column: 1 / -1; grid-row: 1; }
  .scripture-heading .font-select-label { grid-column: 1; grid-row: 2; }
  .scripture-heading .reader-size-field { grid-column: 2; grid-row: 2; }
}
.verse-unit, .verse-pair-line { cursor: pointer; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.verse-unit.is-highlighted, .verse-pair-line.is-highlighted { background: rgba(227, 188, 110, .22); }
.verse-unit.is-selected, .verse-pair-line.is-selected { outline: 2px solid rgba(239, 208, 150, .7); outline-offset: 2px; }
.verse-unit:focus-visible, .verse-pair-line:focus-visible { outline: 2px solid #f1d19a; outline-offset: 3px; }
.reader-marks-bar {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(232, 208, 170, .3);
  border-radius: 18px;
  color: #faf5eb;
  background: rgba(24, 22, 19, .96);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .45);
  font-size: 13px;
}
.reader-marks-bar[hidden] { display: none; }
.reader-marks-bar button:disabled { opacity: .5; cursor: default; }
#reader-marks-status:not(:empty) { flex-basis: 100%; text-align: center; }

/* Keep the Bible index compact without changing the main cover page. */
.index-main .bible-toc { min-height: 0; padding: 32px 0 26px; }
.index-main .bible-toc h1 { margin: 8px 0 24px; font-size: clamp(34px, 5vw, 60px); }
.index-main .toc-heading-row { align-items: flex-end; gap: 18px; }
.index-main .bible-language-select { margin: 0 0 24px; }
.index-main .testament-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.index-main .testament-links a { min-height: 130px; padding: 18px 20px; }
.index-main .testament-links a + a { border-top: 0; border-left: 1px solid var(--line); }
.index-main .testament-links strong { font-size: clamp(20px, 2.5vw, 28px); line-height: 1.3; }
.index-main .testament-links small { margin-top: 4px; }
.index-main .testament-section { min-height: 0; padding: 32px 0 42px; }
.index-main .back-to-index { margin-bottom: 22px; }
.index-main .testament-heading { margin-bottom: 20px; }
.index-main .testament-heading h2 { margin: 8px 0 6px; font-size: clamp(34px, 5vw, 56px); }
@media (max-width: 760px) {
  .index-main .bible-language-select { margin: 0 0 20px; }
  .index-main .testament-links a { min-height: 112px; padding: 14px; }
  .index-main .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-main .book-link { grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; min-height: 64px; padding: 10px 9px; }
  .index-main .book-link strong { overflow-wrap: anywhere; font-size: 13px; }
}
