/* The library is a game launcher: framed scenes, quiet brass, readable controls.
   Player geometry and PiP live in player-layout.css; this file owns portal chrome. */
#main-content:focus { outline: none; }
:root {
  --shell-night: #101c2b;
  --shell-panel: #26344b;
  --shell-panel-deep: #1b293d;
  --shell-gold: #b8a16c;
  --shell-paper: #e6dcc5;
  --shell-copper: #b27957;
  --shell-muted: #b1bbca;
  --shell-border: #b8a16c59;
  --display-font: 'Iowan Old Style', 'AppleMyungjo', 'Batang', Georgia, serif;
  --night: var(--shell-night);
  --deep: var(--shell-panel-deep);
  --fog: var(--shell-paper);
  --paper: var(--shell-night);
  --metal: var(--shell-muted);
  --warm: var(--shell-gold);
  --water: #526581;
  --ink: var(--shell-paper);
  --focus: #ebcc8c;
}

html { scroll-padding-top: 80px; }
body {
  background: var(--shell-night);
  color: var(--shell-paper);
  font-size: 14px;
  line-height: 1.65;
}
body:not([data-current-view=play]) {
  background-image: radial-gradient(ellipse at 50% 0, #26344b90, transparent 75%);
}
.page-width { width: min(1264px, calc(100% - 64px)); }
.section-space { padding-block: 48px; }
.view:not(.player-view) { min-height: calc(100svh - 124px); }
.site-header,
body[data-current-view=catalog] .site-header,
body[data-current-view=library] .site-header,
body[data-current-view=play] .site-header {
  position: relative;
  height: 64px;
  padding-inline: 32px;
  gap: 28px;
  color: var(--shell-paper);
  background: #101c2bf5;
  border-bottom: 1px solid var(--shell-border);
  box-shadow: 0 1px 0 #050c173d;
  --focus: #ebcc8c;
}
.wordmark,
body[data-current-view=play] .wordmark {
  gap: 10px;
  font-family: var(--display-font);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.04em;
}
.brand-mark {
  width: 19px;
  height: 23px;
  color: var(--shell-gold);
  border-radius: 1px 5px 5px 1px;
  transform: none;
}
.site-header nav,
body[data-current-view=play] .site-header nav { gap: 6px; font-size: 13px; }
.site-header nav a {
  min-width: 72px;
  padding: 8px 17px;
  border: 1px solid transparent;
  text-align: center;
  color: #bcc7d6;
}
.site-header nav a:hover { color: #f0e7d4; background: #26344b80; }
.site-header nav a[aria-current=page] {
  color: #eddcb4;
  background: #b8a16c12;
  border-color: #b8a16c66;
  box-shadow: inset 0 0 0 2px #101c2b;
}
.site-header nav a[aria-current=page]:after { content: none; }
.header-account,
body[data-current-view=catalog] .header-account,
body[data-current-view=library] .header-account {
  min-width: 82px;
  padding: 7px 15px;
  border: 1px solid #b8a16c8c;
  border-radius: 2px;
  background: #26344b;
  color: #ede1c7;
  font-size: 12px;
  box-shadow: inset 0 1px 0 #ffffff0d;
}
.header-account:hover:not(:disabled) { background: #35435b; }
.button {
  min-height: 43px;
  padding: 10px 19px;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 650;
}
.button.dark,
.button.light {
  background: #c2ac78;
  color: #172033;
  border-color: #e3cd97;
  box-shadow: inset 0 0 0 2px #b19a66, 0 2px 0 #080f1a;
}
.button.outline {
  background: #26344b;
  border-color: #b8a16c80;
  color: var(--shell-paper);
  box-shadow: inset 0 1px 0 #ffffff0a;
}
.button:hover:not(:disabled) { filter: brightness(1.1); }
.text-link { color: #ddd2b8; border-bottom-color: #b8a16c70; font-size: 13px; }
.text-link:hover { color: #fff0c9; border-bottom-color: #d8bc7b; }
.genre { color: #c3ad7e; font-size: 11px; font-weight: 500; margin-bottom: 12px; }
.small-note { color: var(--shell-muted); }
.actions { gap: 20px; margin-top: 24px; }

/* A complete shelf at normal desktop height: four scenes, four clear starts. */
.catalog-view { padding-bottom: 24px; }
.catalog-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 32px;
  padding-block: 24px 20px;
  align-items: end;
}
.catalog-heading .genre { margin-bottom: 6px; grid-column: 1; }
.catalog-heading h1 {
  grid-column: 1;
  margin: 0;
  font-family: var(--display-font);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.035em;
}
.catalog-heading > p:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 440px;
  font-size: 12px;
  line-height: 1.85;
  color: var(--shell-muted);
  padding-bottom: 2px;
}
.catalog-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.catalog-view > .catalog-grid { padding-block: 0; }
.catalog-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  background: var(--shell-panel-deep);
  border: 1px solid var(--shell-border);
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px #080f1a45, 0 4px 12px #060e1726;
  overflow: hidden;
}
.catalog-story:focus-within { border-color: #d2b879; }
.catalog-photo { height: clamp(260px, calc(100dvh - 410px), 420px); aspect-ratio: 2 / 3; width: auto; max-width: 100%; justify-self: center; position: relative; display: grid; grid-template-rows: 16px minmax(0, 1fr); background: #05090e; }
.catalog-photo img { grid-area: 2 / 1; width: 100%; height: 100%; min-height: 0; aspect-ratio: 2 / 3; object-fit: contain; }
.cover-edition { grid-area: 1 / 1; color: #d4c59e; font: 600 7px/16px var(--body-font, sans-serif); letter-spacing: .16em; text-align: center; background: #141c29; }
.cover-title { position: absolute; inset: auto 8px 16px; color: #fff3d7; font-family: var(--display-font); font-size: 24px; font-weight: 650; line-height: 1.25; text-align: center; letter-spacing: -.05em; text-shadow: 0 2px 8px #000, 0 0 15px #000; }
.catalog-photo:after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 4px solid #08142336;
  box-shadow: inset -1px 0 0 #b8a16c55;
}
.catalog-copy { display: flex; flex-direction: column; padding: 14px 17px; min-width: 0; border-top: 1px solid #b8a16c30; }
.catalog-copy .genre { font-size: 11px; margin-bottom: 8px; }
.catalog-copy h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  font-family: var(--display-font);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
  letter-spacing: -.045em;
}
.catalog-copy h2 a:hover { color: #f4e4bd; }
.catalog-copy > p:not(.genre) { font-size: 12px; line-height: 1.8; color: #b9c3d0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 3.6em; }
.catalog-actions { gap: 18px; margin-top: auto; padding-top: 12px; flex-wrap: wrap; }
.catalog-actions .text-link { font-size: 12px; white-space: nowrap; }
.catalog-actions button {
  min-height: 35px;
  padding: 6px 13px;
  border: 1px solid #b8a16c9c;
  border-radius: 2px;
  background: #b8a16c16;
  color: #f1dfb6;
  box-shadow: inset 0 0 0 2px #101c2b8c;
}
.catalog-actions button:hover { background: #b8a16c30; }

.hero {
  min-height: 480px;
  height: min(720px, calc(100svh - 64px));
  border-bottom: 1px solid var(--shell-border);
}
.hero-image { object-position: center 56%; }
.hero:after {
  background: linear-gradient(90deg, #101c2bf2 0%, #101c2b9c 38%, #101c2b05 78%), linear-gradient(0deg, #101c2be6, transparent 45%);
  box-shadow: inset 0 0 0 12px #101c2b33;
}
.hero-content { padding-block: 36px 60px; }
.hero-opening { font-size: 14px; line-height: 1.85; margin-bottom: 18px; color: #c7cbd2; }
.hero h1 { font-family: var(--display-font); font-size: clamp(42px, 4.8vw, 68px); font-weight: 600; line-height: 1.2; }
.hero-description { font-size: 14px; line-height: 1.85; margin-top: 22px; color: #c7cbd2; }
.hero-footnote { font-size: 11px; color: #b1bdcc; margin-top: 16px; }
.hero-caption { left: 32px; right: 32px; bottom: 20px; font-size: 10px; color: #c5c9cf; }
.section-intro { margin-bottom: 22px; gap: 24px; }
.section-intro h2 { font-family: var(--display-font); font-size: 25px; font-weight: 600; }
.section-intro p { font-size: 12px; color: var(--shell-muted); }
.people-section { background: #172437; border-block: 1px solid #b8a16c33; }
.cast-strip { gap: 18px; }
.portrait, .detail-people .portrait { height: 300px; background: #26344b; border: 1px solid var(--shell-border); }
.portrait:after { height: 80px; background: linear-gradient(transparent, #172437b3); }
.cast-strip figcaption { padding-top: 12px; gap: 2px; }
.cast-strip strong { font-family: var(--display-font); font-size: 19px; }
.cast-strip span { font-size: 12px; color: var(--shell-muted); }
.studio-preview { gap: 72px; }
.studio-preview h2 { font-family: var(--display-font); font-size: 34px; margin-bottom: 18px; }
.studio-preview p { font-size: 14px; color: var(--shell-muted); }
.studio-preview img { aspect-ratio: 1.7; border: 1px solid var(--shell-border); }
.studio-preview .text-link { margin-top: 22px; }
.site-footer {
  min-height: 60px;
  padding: 17px 32px;
  gap: 24px;
  background: #0d1826;
  border-top: 1px solid #b8a16c33;
  font-size: 11px;
}
.site-footer .wordmark { font-size: 16px; }
.site-footer p { font-size: 11px; color: #a8b3c4; }

.detail-hero { min-height: 330px; }
.detail-hero #detail-backdrop { opacity: .44; object-fit: cover; }
.detail-hero #detail-cover { left: auto; right: max(32px, calc((100vw - 1400px) / 2)); top: 16px; width: 205px; height: calc(100% - 32px); object-fit: contain; object-position: center; z-index: 1; filter: drop-shadow(0 12px 24px #0008); }
.detail-title { padding-right: 245px; }
.detail-hero:after { background: linear-gradient(90deg, #101c2be0, #101c2b14 85%), linear-gradient(0deg, #101c2b, transparent 80%); }
.detail-title { padding-block: 72px 35px; }
.detail-title .genre { color: #ddc894; margin-bottom: 14px; }
.detail-title h1 { font-family: var(--display-font); font-size: 43px; margin-bottom: 16px; }
.detail-title > p:last-child { font-size: 15px; color: #d0d2d5; }
.detail-body { gap: 64px; grid-template-columns: minmax(0, 1fr) 320px; padding-top: 32px; }
.detail-introduction h2 { font-family: var(--display-font); font-size: 25px; margin-bottom: 20px; }
.detail-introduction > p, #detail-paragraphs > p { font-size: 14px; line-height: 1.9; color: var(--shell-muted); margin-top: 14px; }
.play-invitation {
  padding: 23px;
  border: 1px solid var(--shell-border);
  background: var(--shell-panel-deep);
  box-shadow: inset 0 0 0 3px #101c2b70;
}
.play-invitation h3 { font-size: 18px; margin-bottom: 18px; }
.play-invitation > p { font-size: 12px; color: var(--shell-muted); line-height: 1.8; margin-top: 12px; }
.play-invitation .detail-save-note { font-size: 11px; margin-top: 16px; }
.detail-scene img { max-height: 550px; border: 1px solid var(--shell-border); }
.detail-scene figcaption { color: var(--shell-muted); font-size: 11px; }
.detail-people .cast-strip[data-count="3"] { gap: 20px; }
.detail-closing { border-top: 1px solid #b8a16c38; }
.detail-closing h2 { font-family: var(--display-font); font-size: 30px; }

.library-view { padding-block: 32px 40px; }
.library-heading { margin-bottom: 26px; }
.library-heading h1 { font-family: var(--display-font); font-size: 30px; line-height: 1.35; }
.library-heading .genre { margin-bottom: 8px; }
.guest-invitation {
  margin-bottom: 24px;
  padding: 22px 26px;
  background: #26344b6e;
  border: 1px solid var(--shell-border);
}
.guest-invitation > p:first-child { font-size: 14px; color: #c0c8d3; margin-bottom: 18px; }
.guest-invitation .small-note { margin-top: 12px; }
.library-stories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.library-stories .library-story,
.library-stories .library-story:last-child {
  grid-template-columns: 36% minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--shell-border);
  background: var(--shell-panel-deep);
  overflow: hidden;
  border-radius: 3px;
}
.library-cover { display: grid; place-items: center; background: #080e18; }
.library-cover img { height: 100%; min-height: 215px; max-height: 285px; aspect-ratio: 2 / 3; object-fit: contain; }
.library-story-copy { min-width: 0; padding: 19px; }
.library-story-copy h2 { font-family: var(--display-font); font-size: 21px; line-height: 1.4; margin-bottom: 12px; }
.library-story-copy .genre { font-size: 11px; margin-bottom: 7px; }
.library-story-copy > p:not(.genre) { font-size: 11px; color: var(--shell-muted); line-height: 1.8; }
.library-story-copy .library-progress { color: #e5d5ae !important; }
.library-story-copy .actions { margin-top: 18px; gap: 17px; }
.library-story-copy .button { padding: 8px 14px; min-height: 37px; font-size: 12px; }
.library-story-copy .text-link { font-size: 11px; }
.library-error { color: #f1d8bf; background: #b2795726; border: 1px solid #b2795770; }
.studio-hero { height: 380px; }
.studio-hero:after { background: linear-gradient(0deg, #101c2be6, transparent 90%), linear-gradient(90deg, #101c2b80, transparent 80%); }
.studio-hero > div { padding-bottom: 42px; }
.studio-hero h1 { font-family: var(--display-font); font-size: 43px; line-height: 1.35; }
.studio-description { gap: 64px; }
.studio-description h2 { font-family: var(--display-font); font-size: 30px; }
.studio-description p { font-size: 14px; color: var(--shell-muted); }

.auth-dialog, .restore-dialog {
  background: #1b293d;
  color: var(--shell-paper);
  border: 1px solid #b8a16c8c;
  border-radius: 3px;
  box-shadow: inset 0 0 0 4px #101c2b66, 0 24px 90px #020814a6;
}
.auth-dialog::backdrop, .restore-dialog::backdrop { background: #060e1acf; backdrop-filter: blur(3px); }
.auth-layout { min-height: 535px; }
.auth-art { border-right: 1px solid var(--shell-border); }
.auth-art:after { background: linear-gradient(0deg, #101c2bf0, transparent 100%); }
.auth-art > p { font-family: var(--display-font); font-size: 20px; color: #e5d9be; }
.auth-content { padding: 42px 40px 30px; }
.auth-content h2, .restore-dialog h2 { font-family: var(--display-font); font-size: 27px; }
.auth-content > p:first-of-type, .restore-dialog p, .auth-record-note, .field-hint { color: var(--shell-muted); }
.dialog-close { color: #c6d0dc; border: 1px solid #b8a16c40; border-radius: 2px; }
.dialog-close:hover { background: #35435b; }
.field input { background: #101c2b; color: #f0e9dc; border-color: #657084; }
.field input[aria-invalid=true] { border-color: #edb197; }
.field-error, .auth-error { color: #edb197; }
.password-input > button { color: #c5ceda; }
.auth-switch { color: var(--shell-muted); }
.toast { background: #26344b; color: #f0e3c5; border: 1px solid #b8a16c99; box-shadow: 0 8px 30px #03091470; }
.noscript-message { color: var(--shell-paper); border-color: var(--shell-border); }

@media (min-width: 1600px) {
  .page-width { width: min(1420px, calc(100% - 112px)); }
  .site-header { padding-inline: 56px; }
  .catalog-story { min-height: 0; }
  .catalog-copy { padding: 25px; }
  .catalog-copy h2 { font-size: 26px; }
  .catalog-copy > p:not(.genre) { font-size: 14px; }
}
@media (max-width: 1100px) {
  .page-width { width: calc(100% - 40px); }
  .site-header { padding-inline: 20px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-copy { padding: 17px; }
  .catalog-copy h2 { font-size: 20px; }
  .catalog-actions { gap: 12px; }
  .catalog-heading > p:last-child { max-width: 375px; font-size: 11px; }
  .detail-body { gap: 36px; grid-template-columns: minmax(0, 1fr) 300px; }
  .portrait, .detail-people .portrait { height: 270px; }
  .studio-preview, .studio-description { gap: 36px; }
  .library-story-copy { padding: 16px; }
  .library-story-copy h2 { font-size: 20px; }
}
@media (max-width: 800px) {
  .catalog-photo { min-height: 0; height: 320px; }
  .catalog-copy { padding: 20px; }
  .catalog-copy h2 { font-size: 24px; }
  .catalog-copy > p:not(.genre) { font-size: 13px; }
  .catalog-actions { padding-top: 20px; }
  .library-stories { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 68px; }
  .site-header,
  body[data-current-view=catalog] .site-header,
  body[data-current-view=library] .site-header,
  body[data-current-view=play] .site-header { height: 60px; padding-inline: 16px; gap: 14px; }
  .wordmark, body[data-current-view=play] .wordmark { font-size: 18px; gap: 8px; }
  .brand-mark { width: 16px; height: 21px; }
  .site-header nav, body[data-current-view=play] .site-header nav { gap: 2px; font-size: 11px; }
  .site-header nav a { min-width: 0; padding: 8px 10px; }
  .header-account { min-width: 60px; padding: 7px 11px; max-width: 90px; font-size: 11px; }
  .page-width { width: calc(100% - 32px); }
  .section-space { padding-block: 32px; }
  .catalog-heading { padding-block: 22px; grid-template-columns: 1fr; }
  .catalog-heading .genre { margin-bottom: 7px; }
  .catalog-heading h1 { font-size: 26px; }
  .catalog-heading > p:last-child { grid-column: 1; grid-row: auto; margin-top: 14px; max-width: none; font-size: 12px; }
  .catalog-grid { gap: 16px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-view > .catalog-grid { padding-block: 0; }
  .catalog-copy { padding: 17px; }
  .catalog-copy h2 { font-size: 21px; }
  .catalog-actions { gap: 13px; }
  .hero { height: calc(100svh - 60px); min-height: 500px; }
  .hero-content { padding-block: 32px 66px; }
  .hero-opening { margin-bottom: 20px; font-size: 13px; }
  .hero h1 { font-size: clamp(39px, 8vw, 52px); }
  .hero-description { font-size: 13px; margin-top: 22px; }
  .hero-caption { left: 16px; right: 16px; bottom: 20px; font-size: 10px; }
  .hero-footnote { max-width: 280px; }
  .hero:after { background: linear-gradient(90deg, #101c2bde, #101c2b40 90%), linear-gradient(0deg, #101c2be6, transparent 50%); }
  .section-intro { margin-bottom: 20px; }
  .section-intro h2 { font-size: 24px; }
  .section-intro p { margin-top: 8px; }
  .cast-strip { gap: 22px 16px; }
  .portrait, .detail-people .portrait { height: 290px; }
  .cast-strip span { font-size: 11px; }
  .studio-preview { gap: 26px; }
  .studio-preview h2 { font-size: 31px; }
  .site-footer { min-height: 64px; padding: 19px 16px; gap: 16px; }
  .site-footer .wordmark { font-size: 16px; }
  .site-footer > a:last-child { font-size: 11px; }
  .detail-hero { min-height: 315px; }
  .detail-hero #detail-cover { width: 38%; right: 16px; }
  .detail-title { padding-right: 40%; }
  .detail-title { padding-block: 60px 30px; }
  .detail-title h1 { font-size: 36px; }
  .detail-title > p:last-child { font-size: 13px; }
  .detail-body { grid-template-columns: 1fr; gap: 26px; }
  .detail-introduction h2 { font-size: 24px; }
  .play-invitation { padding: 22px; }
  .play-invitation .button { max-width: none; }
  .detail-people .cast-strip[data-count="3"] { gap: 22px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-closing h2 { font-size: 27px; }
  .detail-closing .button { margin-top: 23px; }
  .library-view { padding-top: 26px; }
  .library-heading h1 { font-size: 27px; }
  .library-heading .text-link { font-size: 12px; }
  .guest-invitation { padding: 20px; }
  .guest-invitation > p:first-child { font-size: 13px; }
  .library-story-copy h2 { font-size: 22px; }
  .library-story-copy { padding: 20px; }
  .library-stories .library-story { grid-template-columns: 36% minmax(0, 1fr); }
  .studio-hero { height: 310px; }
  .studio-hero > div { padding-bottom: 32px; }
  .studio-hero h1 { font-size: 34px; }
  .studio-description { gap: 24px; }
  .studio-description h2 { font-size: 27px; }
  .auth-layout { min-height: 0; }
  .auth-content { padding: 44px 27px 28px; }
  .auth-content h2 { font-size: 25px; }
}
@media (max-width: 540px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .catalog-photo { min-height: 0; height: auto; width: 100%; }
  .catalog-copy { padding: 13px 11px; }
  .catalog-copy h2 { font-size: 20px; margin-bottom: 10px; }
  .catalog-copy > p:not(.genre) { font-size: 12px; line-height: 1.65; }
  .catalog-actions { gap: 10px; padding-top: 12px; }
  .catalog-actions button { width: 100%; }
  .catalog-copy .genre { font-size: 10px; }
  .cover-title { font-size: 16px; bottom: 18px; }
  .cover-edition { font-size: 6px; }
  .detail-title h1 { font-size: 29px; }
  .catalog-heading > p:last-child br { display: none; }
  .library-stories .library-story,
  .library-stories .library-story:last-child { grid-template-columns: 30% minmax(0, 1fr); }
  .library-story-copy { padding: 17px; }
  .library-story-copy h2 { font-size: 20px; }
  .library-story-copy .actions { gap: 12px; }
  .portrait, .detail-people .portrait { height: 240px; }
  .site-footer p { display: none; }
  .restore-dialog { padding: 28px 22px; }
}
@media (max-width: 390px) {
  .site-header,
  body[data-current-view=catalog] .site-header,
  body[data-current-view=library] .site-header,
  body[data-current-view=play] .site-header { padding-inline: 12px; gap: 8px; }
  .wordmark, body[data-current-view=play] .wordmark { font-size: 17px; gap: 6px; }
  .site-header nav a { padding-inline: 8px; }
  .header-account { min-width: 54px; padding-inline: 8px; }
  .brand-mark { width: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-story, .catalog-photo img, .button, .site-header nav a { animation: none; transition: none; }
}
