:root {
  color-scheme: dark;
  --background: #080b10;
  --surface: #141922;
  --surface-strong: #1d2530;
  --line: rgba(255, 255, 255, 0.16);
  --text: #f6f7fb;
  --muted: #b8c0cf;
  --cyan: #63d4ff;
  --mint: #8cffbf;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--text); }
.site-header, main, footer { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.site-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 800; }
.brand img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }
.app-link, .dialog-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border-radius: 6px; background: var(--cyan); color: #061016; font-weight: 800; text-decoration: none; }
main { padding: 54px 0 70px; }
.intro { max-width: 760px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 10px; color: var(--mint); font-weight: 800; text-transform: uppercase; font-size: 13px; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 64px; line-height: 1; letter-spacing: 0; overflow-wrap: anywhere; }
.intro > p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
.catalogue { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.story-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.story-open { width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.story-open:focus-visible { outline: 3px solid var(--cyan); outline-offset: -3px; }
.cover { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-strong); }
.cover img, .dialog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font: 800 48px Georgia, serif; color: var(--cyan); }
.rating { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; border-radius: 4px; background: rgba(8, 11, 16, 0.88); color: var(--text); font-size: 12px; font-weight: 800; text-transform: capitalize; }
.card-copy { min-height: 210px; display: flex; flex-direction: column; padding: 18px; }
.series { margin: 0 0 7px; color: var(--mint); font-size: 13px; font-weight: 800; }
.story-title { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 700; line-height: 1.15; }
.synopsis { margin-top: 12px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.details-label { margin-top: auto; padding-top: 18px; color: var(--cyan); font-weight: 800; }
.empty-state { padding: 40px 0; color: var(--muted); font-size: 18px; }
footer { padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.story-dialog { width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); overflow: auto; }
.story-dialog::backdrop { background: rgba(0, 0, 0, 0.78); }
.dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(8, 11, 16, 0.9); color: var(--text); font-size: 28px; cursor: pointer; }
.dialog-cover { aspect-ratio: 16 / 7; background: var(--surface-strong); overflow: hidden; }
.dialog-copy { padding: 26px; }
.dialog-copy h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 34px; letter-spacing: 0; }
.dialog-synopsis { color: var(--muted); font-size: 17px; line-height: 1.6; }
dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
dl div { padding: 12px; background: var(--surface-strong); border-radius: 6px; }
dt { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; }
dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.dialog-copy h3 { margin-bottom: 8px; }
.requirements { margin: 0 0 24px; padding-left: 20px; color: var(--muted); }
@media (max-width: 850px) { .catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { main { padding-top: 36px; } h1 { font-size: 42px; } .catalogue { grid-template-columns: 1fr; } .card-copy { min-height: 180px; } dl { grid-template-columns: 1fr; } .story-dialog { width: calc(100% - 20px); max-height: calc(100vh - 20px); } }
