/* NOCHNIK — reading-mode UI, warm dark palette, print-ready season book */

:root {
  --bg: #171126;
  --bg2: #211838;
  --card: #271d40;
  --ink: #f3ead7;
  --dim: #ab9fc4;
  --accent: #f6c86a;
  --accent2: #8fb2f8;
  --ok: #86ddab;
  --line: #372c5c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(ellipse at 50% -20%, #2e2a5e 0%, rgba(0, 0, 0, 0) 55%),
    radial-gradient(ellipse at 85% 110%, #2c1f3a 0%, rgba(0, 0, 0, 0) 50%),
    var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  padding: 24px 16px 80px;
}

main { max-width: 720px; margin: 0 auto; }

h1 {
  font-size: 2rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 0 24px rgba(246, 200, 106, 0.25);
}

.sub {
  text-align: center;
  color: var(--dim);
  margin-bottom: 28px;
  font-style: italic;
}

/* ---- cards / view transitions ---- */

.card {
  background: linear-gradient(180deg, var(--card) 0%, #221a39 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.view { animation: viewIn 0.45s ease both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hidden { display: none; }

/* ---- forms (onboarding) ---- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

label {
  display: block;
  color: var(--dim);
  font-size: 0.9rem;
  margin: 12px 0 5px;
}

input, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  font-size: 1.1rem;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(246, 200, 106, 0.18);
}

button {
  background: var(--accent);
  color: #1a1503;
  border: none;
  border-radius: 12px;
  padding: 13px 22px;
  font-size: 1.05rem;
  font-family: inherit;
  cursor: pointer;
  margin: 10px 8px 0 0;
  transition: transform 0.15s ease, filter 0.2s ease;
}

button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }
button.secondary { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); }
button:disabled { opacity: 0.4; cursor: default; }

/* ---- reading mode ---- */

.scene {
  margin-bottom: 38px;
  animation: sceneIn 0.6s ease both;
}

.scene:nth-of-type(2) { animation-delay: 0.08s; }
.scene:nth-of-type(3) { animation-delay: 0.16s; }
.scene:nth-of-type(4) { animation-delay: 0.24s; }
.scene:nth-of-type(5) { animation-delay: 0.32s; }
.scene:nth-of-type(6) { animation-delay: 0.4s; }

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.scene svg {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  margin-bottom: 16px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.scene p {
  font-size: 21px;
  line-height: 1.6;
  text-align: left;
  letter-spacing: 0.01em;
}

.chapter-title {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 20px;
  text-align: center;
}

.branch { border-top: 1px dashed var(--line); padding-top: 20px; margin-top: 10px; }
.branch h3 { font-size: 1.25rem; margin-bottom: 12px; color: var(--accent2); }

.pill {
  display: inline-block;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.85rem;
  color: var(--dim);
  margin: 2px;
}

.note { color: var(--dim); font-size: 0.95rem; font-style: italic; margin-top: 10px; }

/* ---- ledger ---- */

#ledgerPanel { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
#ledgerPanel table { width: 100%; border-collapse: collapse; margin-top: 8px; }
#ledgerPanel td, #ledgerPanel th {
  padding: 3px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--dim);
}
#ledgerPanel th { color: var(--ink); }
#ledgerCount { color: var(--ok); font-size: 1.1rem; font-weight: bold; }

/* ---- season book ---- */

.bookChapter { border-bottom: 1px solid var(--line); padding: 16px 0; }

/* ---- accessibility ---- */

@media (prefers-reduced-motion: reduce) {
  .view, .scene { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- print: season book as a keepsake ---- */

@media print {
  body { background: #fff; color: #111; padding: 0; font-size: 13pt; }
  h1, .sub, #setupView, #homeView, #readerView, #ledgerPanel, button, .no-print {
    display: none !important;
  }
  #bookView {
    display: block !important;
    background: #fff;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
  .view, .scene { animation: none; }
  .chapter-title { color: #111; page-break-after: avoid; }
  .bookChapter { border: none; page-break-after: always; padding: 0 0 12pt; }
  .bookChapter:last-child { page-break-after: auto; }
  .scene { page-break-inside: avoid; margin-bottom: 18pt; }
  .scene svg { box-shadow: none; border-radius: 0; max-height: 60mm; width: auto; margin: 0 auto 8pt; }
  .scene p { color: #111; font-size: 13pt; line-height: 1.5; }
  .note { color: #444; }
}
