/* Dark editorial surfaces, with a warm paper directory for dense controls. */
:root[data-home-design="theatre"] {
  --theatre-ink: #faf0de;
  --theatre-muted: #c9b9a4;
  --theatre-copper: #e3b27c;
  --theatre-bg: #181613;
  --theatre-panel: #27211a;
  --theatre-rule: #faf0de37;
  --theatre-hover: #3f3024;
  --theatre-pressed: #c98f58;
  --theatre-focus: #f5cf99;
  --theatre-control-line: #8f6f55;
  --theatre-paper: #f5efe3;
  --theatre-paper-surface: #fffaf2;
  --theatre-paper-hover: #f2e5d5;
  --theatre-paper-active: #efdbc1;
  --theatre-paper-line: #a88467;
  --theatre-paper-focus: #8d532a;
  --theatre-paper-ink: #442e20;
  --theatre-serif: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --page-gutter: clamp(20px, 5.7vw, 84px);
  --page-left: max(var(--page-gutter), env(safe-area-inset-left));
  --page-right: max(var(--page-gutter), env(safe-area-inset-right));
}
html[data-home-design="theatre"] body { background: var(--theatre-paper); accent-color: var(--theatre-pressed); }
html[data-home-design="theatre"] ::selection { color: #201811; background: var(--theatre-focus); }
html[data-home-design="theatre"] :is(button,a,summary) { -webkit-tap-highlight-color: #e3b27c32; }
html[data-home-design="theatre"] body::before, html[data-home-design="theatre"] body::after { content: none; }
html[data-home-design="theatre"] .launchpad-shell {
  max-width: min(100%, 1720px);
  padding-inline: var(--page-left) var(--page-right);
}
.theatre-skip {
  position: fixed;
  z-index: 90;
  top: max(10px, env(safe-area-inset-top));
  left: var(--page-left);
  padding: 12px;
  color: #201811;
  background: var(--theatre-copper);
  transform: translateY(-200%);
}
.theatre-skip:focus { transform: none; }
#homeMain { margin: 0; }
#homeMain:focus { outline: none; }
html[data-home-design="theatre"] #appHeader {
  min-height: calc(72px + env(safe-area-inset-top));
  padding: max(10px, env(safe-area-inset-top)) var(--page-right) 10px var(--page-left);
  margin: 0 calc(-1 * var(--page-right)) 0 calc(-1 * var(--page-left));
  border-color: var(--theatre-rule);
  background: var(--theatre-bg);
  color: var(--theatre-ink);
  gap: 22px;
  backdrop-filter: none;
}
#appHeader .brand-lockup { min-height: 44px; color: inherit; }
html[data-home-design="theatre"] #appHeader .brand-copy b {
  color: var(--theatre-ink);
  font: 800 22px/1 var(--ui-sans);
  letter-spacing: .13em;
}
html[data-home-design="theatre"] .brand-copy > [data-h="kicker"],
html[data-home-design="theatre"] .topbar-motto,
html[data-home-design="theatre"] .topbar-count { display: none; }
.theatre-nav { display: flex; flex: 1; justify-content: center; gap: clamp(10px, 3vw, 42px); }
.theatre-nav a, .theatre-menu a {
  min-height: 44px;
  padding-inline: 5px;
  display: inline-flex;
  align-items: center;
  color: var(--theatre-ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.theatre-nav a:hover, .theatre-menu a:hover { color: var(--theatre-copper); }
html[data-home-design="theatre"] #appHeader :is(.language-switch, .ctrl-btn, .tools-menu summary) {
  min-height: 44px;
  border-color: var(--theatre-rule);
  color: var(--theatre-ink);
  background: var(--theatre-panel);
}
.theatre-shell {
  background: var(--theatre-bg);
  color: var(--theatre-ink);
  margin-inline: calc(-1 * var(--page-left)) calc(-1 * var(--page-right));
  padding-bottom: clamp(32px, 5vw, 64px);
}
.theatre-shell a { color: inherit; text-decoration: none; }
.theatre-shell :is(h1,h2,h3,p,figure,ol) { margin: 0; }
#theatreHero { margin: 0; }
.theatre-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(490px, 47vw, 694px);
  border-bottom: 1px solid var(--theatre-rule);
}
.theatre-copy {
  position: relative;
  z-index: 2;
  width: 55%;
  padding: 32px 0 36px var(--page-left);
}
.theatre-shell .theatre-label {
  color: var(--theatre-copper);
  font-size: 13px;
  font-weight: 710;
  letter-spacing: .14em;
}
.theatre-copy h1 {
  margin-block: 20px 23px;
  color: var(--theatre-ink);
  font: 650 clamp(45px, 6.1vw, 110px)/1.06 var(--theatre-serif);
  letter-spacing: -.06em;
}
.theatre-copy h1 span { display: block; }
html[lang="en"] .theatre-copy h1 { font-size: clamp(46px, 6.15vw, 103px); }
.theatre-copy .theatre-intro {
  color: var(--theatre-muted);
  max-width: 38ch;
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.65;
}
.theatre-actions { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 25px; }
.theatre-shell :is(.theatre-primary, .theatre-link) {
  min-height: 48px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 710;
}
.theatre-shell .theatre-primary { padding: 0 16px; background: var(--theatre-copper); color: #201811; border-radius: 2px; }
.theatre-shell .theatre-primary:hover { background: var(--theatre-focus); }
.theatre-shell .theatre-primary:active { background: var(--theatre-pressed); }
.theatre-shell .theatre-link { border-bottom: 1px solid var(--theatre-rule); }
.theatre-shell .theatre-link:hover { color: var(--theatre-copper); }
.theatre-shell svg, .app-dock [data-theatre-menu] svg { flex: 0 0 auto; }
.theatre-visual { position: absolute; inset: 0 0 0 25%; overflow: hidden; }
.theatre-visual picture, .theatre-visual img { display: block; width: 100%; height: 100%; }
.theatre-visual img { object-fit: cover; object-position: 53% 52%; animation: theatre-arrive .45s ease-out both; }
.theatre-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #181613, #181613e5 17%, #1816133b 49%, transparent 72%), linear-gradient(0deg, #1816137a, transparent 35%);
}
.theatre-visual figcaption {
  position: absolute;
  z-index: 1;
  right: var(--page-right);
  bottom: 17px;
  padding: 6px 10px;
  background: #18120edb;
  color: var(--theatre-ink);
  font-size: 12px;
}
@keyframes theatre-arrive { from { opacity: .67; } to { opacity: 1; } }
.theatre-gallery, .theatre-clockbox {
  margin-inline: var(--page-left) var(--page-right);
  scroll-margin-top: calc(88px + env(safe-area-inset-top));
}
.theatre-gallery { padding-top: clamp(34px, 6vw, 82px); }
.theatre-section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 28px; margin: 0 0 26px; }
.theatre-shell h2 { color: var(--theatre-ink); font: 630 clamp(30px, 3.9vw, 53px)/1.22 var(--theatre-serif); letter-spacing: -.044em; }
.theatre-section-head h2 { margin-top: 8px; }
.theatre-series { border-top: 1px solid var(--theatre-rule); margin-bottom: 29px; }
.theatre-series h3 { color: var(--theatre-muted); font-size: 14px; font-weight: 660; letter-spacing: .05em; padding: 14px 0; }
.theatre-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: clamp(15px, 2.8vw, 38px); }
.theatre-series:first-of-type .theatre-cards { grid-template-columns: 1.3fr 1fr; }
.theatre-card { display: block; border-bottom: 1px solid var(--theatre-rule); }
.theatre-card picture { display: block; aspect-ratio: 1.9; overflow: hidden; background: var(--theatre-panel); }
.theatre-card-tcg picture { aspect-ratio: 2.5; }
.theatre-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .23s ease; }
.theatre-card:hover img { transform: scale(1.024); }
.theatre-card-caption { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 60px; padding-block: 11px 14px; }
.theatre-card-caption strong { display: block; color: var(--theatre-ink); font: 680 clamp(19px,2vw,26px)/1.26 var(--ui-sans); }
.theatre-card-caption small { display: block; margin-top: 4px; color: var(--theatre-muted); font-size: 13px; }
.theatre-card-caption svg, .theatre-beat-icon { color: var(--theatre-copper); }
.theatre-clockbox {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.1fr);
  gap: 26px;
  padding: clamp(20px,4vw,56px);
  margin-top: clamp(34px,6vw,86px);
  background: var(--theatre-panel);
  border: 1px solid var(--theatre-rule);
}
.theatre-clockbox h2 { font-size: clamp(27px,3.8vw,44px); margin: 9px 0; }
.theatre-clockbox p { color: var(--theatre-muted); font-size: 15px; line-height: 1.55; }
.theatre-clockbox button {
  min-width: 44px;
  min-height: 46px;
  padding: 7px 9px;
  color: var(--theatre-ink);
  background: var(--theatre-bg);
  border: 1px solid var(--theatre-rule);
  font: 670 14px/1.25 var(--ui-sans);
  cursor: pointer;
}
.theatre-clockbox button:disabled { opacity: .6; cursor: default; }
.theatre-clockbox button:disabled[data-playing] { opacity: .85; cursor: progress; }
.theatre-clockbox button:hover:not(:disabled) { border-color: var(--theatre-copper); }
.theatre-primary:active, .theatre-clockbox button:active:not(:disabled) { transform: translateY(1px); }
.theatre-slots, .theatre-moves { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.theatre-slots { list-style: none; padding: 0 0 8px; }
.theatre-slots li { display: grid; min-height: 46px; place-items: center; border-bottom: 2px solid var(--theatre-rule); color: var(--theatre-muted); }
.theatre-slots [data-recorded] { background: var(--theatre-bg); color: var(--theatre-copper); border-color: var(--theatre-copper); animation: theatre-tap .2s ease-out both; }
@keyframes theatre-tap { from { transform: translateY(3px); opacity: .52; } to { transform: none; opacity: 1; } }
.theatre-clockbox .theatre-status { min-height: 3.35em; padding: 8px 0 2px; }
.theatre-clock-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.theatre-clock-actions [data-rhythm-listen]:not(:disabled) { color: #201811; background: var(--theatre-copper); }
html[data-home-design="theatre"] .hall-explore-heading { margin-top: clamp(26px,4.8vw,62px); scroll-margin-top: calc(78px + env(safe-area-inset-top)); }
html[data-home-design="theatre"] .hall-heading h2 { color: #33241a; font-family: var(--theatre-serif); }
html[data-home-design="theatre"] .language-note { color: #62503e; padding-block: 6px; }
html[data-home-design="theatre"] .directory-controls .search-box { min-height: 44px; }
html[data-home-design="theatre"] .directory-controls .search-box input { min-height: 44px; font-size: max(16px, 1em); }
html[data-home-design="theatre"] .hall-footer { color: #665542; }
html[data-home-design="theatre"] .hall-footer :is(a,b) { color: #4c3524; }
html[data-home-design="theatre"] #appDock {
  padding: 5px;
  border-color: #7c6351;
  background: var(--theatre-panel);
  color: var(--theatre-ink);
  backdrop-filter: none;
}
html[data-home-design="theatre"] #appDock button {
  color: var(--theatre-ink);
  transition-property: transform, box-shadow;
}
html[data-home-design="theatre"] #appDock button:hover { background: var(--theatre-hover); }
html[data-home-design="theatre"] #appDock button[aria-current="page"],
html[data-home-design="theatre"] #appDock button[aria-expanded="true"] { background: var(--theatre-copper); color: #201811; }
#appDock [data-theatre-menu] { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; gap: 3px; }
#appDock [data-theatre-menu] svg { width: 16px; height: 16px; }
.theatre-menu {
  position: fixed;
  z-index: 38;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 68px);
  width: min(230px, calc(100vw - 32px));
  max-height: calc(100svh - 97px);
  padding: 6px 11px;
  overflow: auto;
  background: var(--theatre-panel);
  border: 1px solid #7c6351;
  border-radius: 10px;
  box-shadow: 0 8px 28px #0006;
}
.theatre-menu a { display: flex; }
.theatre-menu a + a { border-top: 1px solid var(--theatre-rule); }
.app-offline .theatre-menu { bottom: calc(112px + env(safe-area-inset-bottom)); }
.app-keyboard .theatre-menu { display: none; }
.theatre-shell :focus-visible, #appHeader :focus-visible, #appDock :focus-visible, .theatre-menu :focus-visible {
  outline: 2px solid var(--theatre-focus);
  outline-offset: 3px;
}
@media (max-width: 820px) { .theatre-nav { display: none; } }
@media (max-width: 650px) {
  :root[data-home-design="theatre"] { --page-gutter: clamp(17px,5.2vw,27px); }
  html[data-home-design="theatre"] #appHeader { min-height: calc(58px + env(safe-area-inset-top)); padding-block: max(6px, env(safe-area-inset-top)) 6px; gap: 10px; }
  .theatre-hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .theatre-copy { width: 100%; padding: 7px var(--page-right) 25px var(--page-left); }
  .theatre-copy h1, html[lang="en"] .theatre-copy h1 { font-size: clamp(37px, 11vw, 61px); margin-block: 12px 13px; }
  .theatre-copy .theatre-intro { font-size: 16px; line-height: 1.55; }
  .theatre-actions { margin-top: 15px; gap: 6px 13px; }
  .theatre-visual { position: relative; inset: auto; order: -1; height: clamp(215px, 67vw, 325px); }
  .theatre-visual::after { background: linear-gradient(0deg, #181613, transparent 23%); }
  .theatre-visual figcaption { right: var(--page-right); bottom: 15px; }
  .theatre-section-head { margin-bottom: 16px; }
  .theatre-cards, .theatre-series:first-of-type .theatre-cards { grid-template-columns: 1fr; }
  .theatre-card picture { aspect-ratio: 1.85; }
  .theatre-card-tcg picture { aspect-ratio: 2.5; }
  .theatre-clockbox { grid-template-columns: 1fr; gap: 14px; }
  html[data-home-design="theatre"] .hall-explore-heading, .theatre-gallery, .theatre-clockbox { scroll-margin-top: calc(65px + env(safe-area-inset-top)); }
  html[data-home-design="theatre"] #appDock button { font-size: 12px; }
}
@media (max-width: 650px) and (max-height: 620px) {
  .theatre-visual { height: clamp(160px, 36svh, 212px); }
  .theatre-shell :is(.theatre-primary, .theatre-link) { min-height: 44px; }
}
@media (max-width: 650px) and (max-height: 480px) and (orientation: landscape) {
  html[data-home-design="theatre"] body.app-ready #appDock {
    display: flex;
    position: static;
    transform: none;
    width: auto;
    margin-inline: calc(-1 * var(--page-left)) calc(-1 * var(--page-right));
    padding: 2px var(--page-right) 2px var(--page-left);
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }
  html[data-home-design="theatre"] #appDock button { min-height: 44px; border-radius: 6px; }
  .theatre-menu:not([hidden]) {
    position: static;
    width: auto;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    margin: 4px 0;
    box-shadow: none;
  }
  .theatre-menu a + a { border-top: 0; }
  html[data-home-design="theatre"] .hall-explore-heading, .theatre-gallery, .theatre-clockbox { scroll-margin-top: .65rem; }
  .theatre-hero {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1.05fr);
    gap: 10px;
    align-items: center;
    padding: 8px var(--page-right) 12px var(--page-left);
  }
  .theatre-copy { width: 100%; padding: 0; }
  .theatre-copy h1, html[lang="en"] .theatre-copy h1 { font-size: clamp(29px, 5.7vw, 37px); margin-block: 7px 8px; }
  .theatre-copy .theatre-intro { font-size: 14px; }
  .theatre-actions { gap: 5px 9px; margin-top: 9px; }
  .theatre-shell :is(.theatre-primary, .theatre-link) { font-size: 13px; }
  .theatre-visual { order: 0; height: clamp(145px, 51svh, 200px); }
  .theatre-visual::after { background: linear-gradient(0deg,#18161388,transparent 28%); }
  .theatre-visual figcaption { right: 8px; bottom: 8px; }
  html[data-home-design="theatre"] .hall-footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}
@media (horizontal-viewport-segments: 2) and (min-width: 651px) {
  .theatre-hero {
    display: grid;
    grid-template-columns: minmax(0, env(viewport-segment-width 0 0, 45vw)) minmax(0,1fr);
    column-gap: max(0px, calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw)));
  }
  .theatre-copy { width: 100%; padding-inline: var(--page-left) 20px; }
  .theatre-copy h1, html[lang="en"] .theatre-copy h1 { font-size: clamp(38px,6vw,72px); }
  .theatre-visual { position: relative; inset: auto; height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .theatre-visual img, .theatre-slots [data-recorded] { animation: none; }
  .theatre-card img { transition: none; }
  .theatre-card:hover img, .theatre-primary:active, .theatre-clockbox button:active { transform: none; }
}
@media print { .theatre-skip, .theatre-menu, .theatre-shell { display: none !important; } }
html[data-home-design="theatre"] #appHeader .brand-copy b span { color: inherit; font: inherit; letter-spacing: inherit; }
html[data-home-design="theatre"] body:not(.admin) #appHeader [data-h="titleEm"] { display: none; }
html[data-home-design="theatre"] #appHeader [data-h="titlePre"] { display: inline; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .theatre-card picture { animation: theatre-card-in linear both; animation-timeline: view(); animation-range: entry 0% cover 19%; }
    @keyframes theatre-card-in { from { opacity: .72; } to { opacity: 1; } }
  }
}

/* Match the interaction colors across the dark entrance and the paper catalog. */
html[data-home-design="theatre"] #appHeader :is(.language-switch, .ctrl-btn, .tools-menu summary):hover,
html[data-home-design="theatre"] #appHeader .tools-menu[open] summary {
  background: var(--theatre-hover);
  border-color: var(--theatre-control-line);
}
html[data-home-design="theatre"] #appHeader .tools-pop {
  background: var(--theatre-panel);
  color: var(--theatre-ink);
  border-color: var(--theatre-control-line);
}
html[data-home-design="theatre"] #appHeader .tools-pop button { color: var(--theatre-ink); }
html[data-home-design="theatre"] #appHeader .tools-pop button:hover { background: var(--theatre-hover); }
html[data-home-design="theatre"] :is(.directory-layout button, .entry-nav .nav-button, .overview-pin, .overview-detail):hover:not(:disabled) {
  background: var(--theatre-paper-hover);
  border-color: var(--theatre-paper-line);
  color: var(--theatre-paper-ink);
}
html[data-home-design="theatre"] :is(.directory-layout button[aria-pressed="true"], .entry-nav .nav-button.on, .overview-pin.on, .category-more-toggle[aria-expanded="true"]) {
  background: var(--theatre-paper-active);
  color: var(--theatre-paper-ink);
  border-color: var(--theatre-paper-line);
}
html[data-home-design="theatre"] :is(.entry-nav .nav-button.on, .directory-layout button[aria-pressed="true"]) small { color: #65462d; }
html[data-home-design="theatre"] .directory-controls .search-box:focus-within { border-color: var(--theatre-paper-focus); box-shadow: 0 0 0 1px var(--theatre-paper-focus); }
html[data-home-design="theatre"] :is(.library-panel, .app-dialog, .hall-footer, .app-companion, .home-updates) :focus-visible {
  outline: 2px solid var(--theatre-paper-focus);
  outline-offset: 2px;
}
html[data-home-design="theatre"] .app-dialog { background: var(--theatre-paper-surface); color: var(--theatre-paper-ink); }
html[data-home-design="theatre"] .app-dialog-head { background: var(--theatre-paper); }
html[data-home-design="theatre"] :is(.app-dialog .app-primary, .intent-choices button[aria-pressed="true"]) { background: #624126; border-color: #624126; color: var(--theatre-ink); }
html[data-home-design="theatre"] :is(.app-dialog .app-primary, .intent-choices button[aria-pressed="true"]):hover { background: #503221; }
html[data-home-design="theatre"] .detail-browse button {
  background: var(--theatre-panel);
  color: var(--theatre-ink);
  border-color: var(--theatre-control-line);
}
html[data-home-design="theatre"] .detail-browse button:hover:not(:disabled) { background: var(--theatre-hover); }
html[data-home-design="theatre"] .detail-browse button:focus-visible { outline: 2px solid var(--theatre-focus); }
html[data-home-design="theatre"] #detailPosition { color: var(--theatre-muted); }
@media (max-width: 699px), (pointer: coarse) {
  html[data-home-design="theatre"] { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  html[data-home-design="theatre"]:has(body.app-offline) { scroll-padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
}
@media (max-width: 650px) and (max-height: 480px) and (orientation: landscape) {
  html[data-home-design="theatre"], html[data-home-design="theatre"]:has(body.app-offline) { scroll-padding-bottom: env(safe-area-inset-bottom); }
}

/* Shared palette and spacing used below the entrance and on detail pages. */
:root[data-home-design="theatre"] {
  --theatre-surface: #211b15;
  --theatre-elevated: #2d241c;
  --theatre-recess: #15120f;
  --theatre-type: var(--ui-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif);
  --theatre-gap: clamp(10px, 1.65vw, 24px);
  --theatre-radius: 8px;
  --theatre-touch: 44px;
  --theatre-edge: #775a43;
}
html[data-home-design="theatre"] body { background: var(--theatre-bg); color: var(--theatre-ink); }
html[data-home-design="theatre"] .language-switch { gap: 6px; }
