/* The game's Theme.axaml: black, warm off-white serif type, rust-red focus. */
:root { color-scheme: dark; --ink: #000; --paper: #e6e0d2; --muted: #a39b8e; --accent: #b4482a; --focus: #17130e; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: Georgia, Cambria, "Times New Roman", serif; line-height: 1.6; }
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 400; }
button, select { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: #b4482a66; color: #fff; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 18px; z-index: 100; padding: 10px 18px; background: var(--focus); border-left: 3px solid var(--accent); }
.skip-link:focus { top: 10px; }

.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #000; }
.backdrop-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.backdrop-image.visible { opacity: 1; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #000000df, #000000b8 30%, #000000c4 70%, #000000ed); }
.site-header { position: fixed; z-index: 20; top: 0; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 24px 4%; background: linear-gradient(#000000ee, #000000bb 65%, #00000000); }
.wordmark { display: flex; flex-direction: column; gap: 2px; font-size: 16px; letter-spacing: .19em; }
.author-credit { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.current-chapter { color: var(--muted); font-size: 14px; letter-spacing: .06em; }
.header-tools { display: flex; align-items: center; gap: 30px; }
.language-switch { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; }
.language-switch button { border: 0; background: transparent; padding: 10px 4px; min-height: 44px; color: var(--muted); }
.language-switch button[aria-pressed="true"] { color: var(--paper); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 7px; }
.language-switch > span { color: #5e5a51; }
main { position: relative; z-index: 1; }
.start-page { min-height: 100svh; padding: 140px 4% 130px; display: flex; justify-content: center; align-items: center; text-align: center; position: relative; }
.start-content { width: 100%; }
.start-content h1 { font-size: clamp(42px, 7.5vw, 120px); letter-spacing: .12em; line-height: 1.25; }
html[lang="nb"] .start-content h1 { font-size: clamp(27px, 5.3vw, 85px); letter-spacing: .08em; }
.start-author { color: var(--muted); font-size: clamp(16px, 1.6vw, 23px); letter-spacing: .15em; margin-top: 25px; }
.start-description { color: var(--muted); font-size: 14px; letter-spacing: .08em; margin-top: 25px; }
.paragraph-panel { min-height: 100svh; padding: 145px 4% 135px; display: flex; align-items: center; }
.paragraph-content { width: 100%; }
.chapter-heading { font-size: 19px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 30px; }
.novel-paragraph { font-size: clamp(22px, 2.1vw, 32px); line-height: 1.8; text-wrap: pretty; overflow-wrap: break-word; }
.reader-toolbar { position: fixed; z-index: 15; bottom: 0; width: 100%; display: flex; align-items: center; justify-content: flex-end; padding: 15px 4% calc(16px + env(safe-area-inset-bottom)); background: #000000e8; border-top: 1px solid #e6e0d217; backdrop-filter: blur(15px); }
.reading-progress-track { position: absolute; height: 2px; top: -1px; left: 0; width: 100%; }
.reading-progress-track span { height: 100%; display: block; background: var(--accent); transition: width .25s; }
.vote-buttons { display: flex; gap: 10px; }
.vote-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 16px; border: 1px solid #e6e0d22a; background: transparent; font-size: 14px; font-variant-numeric: tabular-nums; }
.vote-button:hover, .vote-button.selected { background: var(--focus); border-color: var(--accent); }
.vote-button svg { width: 19px; height: 19px; }
.chapter-ending { min-height: 100svh; padding: 135px 4% 145px; display: flex; justify-content: center; align-items: center; text-align: center; }
.eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--muted); }
.chapter-ending h2 { font-size: clamp(32px, 4vw, 50px); margin: 18px 0 30px; }
.chapter-ending .vote-buttons { justify-content: center; }
.chapter-ending .vote-button { min-width: 100px; padding: 13px 24px; }
.vote-note { color: var(--muted); font-size: 12px; margin: 16px 0 35px; }
.release-message, .final-message { color: var(--muted); font-size: 17px; line-height: 1.8; margin: 25px 0; }
.primary-button { display: inline-flex; justify-content: space-between; align-items: center; gap: 30px; border: 1px solid #b4482a30; border-left: 3px solid var(--accent); background: var(--focus); color: var(--paper); padding: 16px 25px; font-size: 17px; }
.primary-button:hover { background: #2b1c13; }
.locked-page, .error-page, .loading-state { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 25px; padding: 135px 4% 110px; text-align: center; }
.locked-page h1, .error-page h1 { font-size: 42px; }
.locked-page p, .error-page p, .loading-state p { font-size: 19px; color: var(--muted); }
.toast { position: fixed; z-index: 40; bottom: 102px; left: 50%; transform: translate(-50%, 12px); width: max-content; max-width: calc(100% - 36px); padding: 12px 23px; background: var(--focus); border-left: 3px solid var(--accent); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; z-index: 50; bottom: 0; width: 100%; background: var(--focus); color: var(--paper); padding: 20px; text-align: center; }

@media (max-width: 700px) {
  .site-header { padding: 18px 5%; gap: 12px; }
  .wordmark { font-size: 11px; letter-spacing: .1em; }
  .author-credit { font-size: 10px; letter-spacing: .03em; }
  .current-chapter { font-size: 11px; }
  .header-tools { gap: 12px; }
  .header-tools .current-chapter { display: none; }
  .language-switch { font-size: 11px; gap: 3px; }
  .language-switch button { padding: 8px 3px; }
  .start-content h1 { font-size: clamp(34px, 10.8vw, 68px); letter-spacing: .08em; }
  html[lang="nb"] .start-content h1 { font-size: clamp(21px, 6.3vw, 44px); letter-spacing: .06em; }
  .start-author { font-size: 15px; letter-spacing: .09em; }
  .paragraph-panel { padding: 110px 5% 120px; }
  .novel-paragraph { font-size: 21px; line-height: 1.8; }
  .chapter-heading { font-size: 15px; margin-bottom: 24px; }
  .reader-toolbar { padding: 12px 5% calc(13px + env(safe-area-inset-bottom)); gap: 12px; }
  .vote-buttons { gap: 6px; }
  .vote-button { padding: 8px 12px; gap: 8px; font-size: 12px; }
  .vote-button svg { width: 17px; height: 17px; }
  .toast { bottom: 94px; font-size: 12px; }
}
@media (max-width: 360px) {
  .wordmark { font-size: 10px; }
  .author-credit { font-size: 9px; }
  .novel-paragraph { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
