body.title-screen{grid-template-rows:0 minmax(0,1fr) 0}
body.opening-screen{grid-template-rows:0 minmax(0,1fr) 52px}
body.title-screen>header,body.title-screen>footer,body.opening-screen>header{visibility:hidden}
.title-panel,.opening-story{position:relative;isolation:isolate;display:grid;align-content:center;justify-items:start;min-height:100%;overflow:hidden;padding:clamp(16px,5vw,70px);background:#14251f}
.title-panel::before,.opening-story::before{content:"";position:absolute;inset:-4%;z-index:-1;background:linear-gradient(90deg,#121e17f5,#142118a8 46%,#17241c30),url("assets/tavern-v1.png") center 52%/cover;animation:title-breath 22s ease-in-out infinite alternate}
@keyframes title-breath{to{transform:translateY(-1%) scale(1.045)}}
@media(prefers-reduced-motion:reduce){.title-panel::before,.opening-story::before{animation:none}}
.title-panel h1,.opening-story h1{font-size:clamp(27px,6.6vw,80px);margin:0 0 .45em;text-shadow:0 3px 14px #121810;color:#f3e5b7}
.title-choices{display:grid;gap:8px;width:min(350px,100%)}
.title-choices button{text-align:left;min-height:42px;padding-inline:16px}
.title-status{font-size:.9rem;color:#efd7a4;margin:.65rem 0 0}
.opening{min-height:100%;height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:radial-gradient(ellipse,#2f4c3a,#172922);overflow:hidden}
.opening-story{display:grid;grid-template-rows:none}
.opening-story::before{background:linear-gradient(110deg,#0b2016,#374d39 65%,#605c3a);animation:none}
.opening-story p{margin:.4em 0;max-width:40em}
.opening-kicker,.opening-impact{color:#ffdd91}
.opening-guide{display:flex;gap:.55rem 1.1rem;align-items:baseline;flex-wrap:wrap;padding:.45rem clamp(8px,3vw,30px);background:#172720;color:#f4ead3;z-index:1}
.opening-board{display:block;width:100%!important;height:100%!important;min-height:0}
.opening-board [tabindex="0"]{cursor:pointer}
.opening-board [tabindex="0"]:focus-visible{outline:none;stroke:#ffeaa5;stroke-width:4}
.opening-screen footer{justify-content:space-between}
.intro-card{display:grid;grid-template-columns:minmax(90px,min(32vw,260px)) minmax(0,1fr);align-items:center;gap:clamp(10px,4vw,40px);min-height:100%;padding:clamp(8px,3vw,35px);background:linear-gradient(90deg,#152822e8,#1d3229bf),url("assets/tavern-v1.png") center/cover}
.intro-card img.portrait{width:100%;height:min(57dvh,300px);object-fit:contain}
.intro-card h1{margin:.25rem 0;color:#f2dfaa}
.intro-card p{margin:.45rem 0}
.first-step{padding:.65rem;border-left:3px solid var(--gold);background:#e1d5ac20}
@media(max-height:470px){.title-panel,.opening-story{padding:12px 5vw}.title-panel h1,.opening-story h1{font-size:clamp(27px,5.5vw,44px)}.opening-guide{font-size:.88rem}}

.opening-screen .opening {
  position:relative;
  isolation:isolate;
  background:#172832;
}
.opening-screen .opening:not(.opening-story)::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(175deg,#12212966,#152a35ad),url("assets/opening-north-road.png") right 56%/max(175%,115vh) auto;
}
.opening-story.opening-arrival::before {
  background:linear-gradient(90deg,#15242e12 36%,#15242e96 55%,#101b26f2 94%),url("assets/opening-north-road.png") 39% center/cover;
}
.opening-story.opening-arrival {
  justify-items:end;
  align-content:end;
  padding:clamp(16px,5vw,68px);
}
.opening-story-copy {
  position:relative;
  width:min(38rem,49vw);
  padding:clamp(12px,2.5vw,28px);
  color:#fff6e5;
  background:linear-gradient(112deg,#18262eee,#12212aee);
  border:1px solid #b9a981b3;
  box-shadow:0 12px 40px #0e141dcc;
}
.opening-story-copy h1 {font-size:clamp(26px,4vw,58px);margin:0 0 .2em}
.opening-story-copy .opening-kicker {font-size:.82rem;letter-spacing:.08em;margin:0 0 .45em}
.opening-dialogue {min-height:5.1em}
.opening-dialogue strong {color:#ebcb92}
.opening-dialogue p {line-height:1.55}
.opening-allen-full {
  position:absolute;
  right:min(51vw,680px);
  bottom:4%;
  height:min(66vh,650px);
  max-width:33%;
  object-fit:contain;
  object-position:bottom;
  filter:drop-shadow(0 12px 9px #111e2a);
}
.opening-allen-portrait {
  float:right;
  width:clamp(64px,10vw,136px);
  margin:0 0 .35em .5em;
  border-bottom:1px solid #ddc289;
}
.opening-aftermath {justify-items:start;align-content:end}
.opening-aftermath::before {background:linear-gradient(90deg,#15252ed6,#233f4ab0),url("assets/opening-north-road.png") 75% center/cover}
.opening-aftermath-board {
  position:absolute;
  right:0;
  top:0;
  width:76%!important;
  height:94%!important;
  pointer-events:none;
}
.opening-goal {margin-inline-start:auto;color:#f4dca5}
.opening-river>polygon:first-child {fill:#2b5767;stroke:#83a59a;stroke-width:2}
.opening-river polyline {fill:none;stroke:#c0dfe2;stroke-width:1.2;opacity:.48}
.opening-shore-stone {fill:#7d8272;stroke:#484f46;stroke-width:.8}
.opening-shore-stone:nth-child(3n) {fill:#a19f86}
.opening-bank-reed {fill:none;stroke:#8d9e61;stroke-width:1.2;stroke-linecap:round}
.opening-board .opening-target-tile {stroke:#94e5dd;stroke-width:2.8}
.opening-cart-shadow {fill:#17130e;opacity:.52}
.opening-cart-label {fill:#ffefd1;paint-order:stroke;stroke:#162830;stroke-width:4;font-size:14px}
@media (max-height:470px) {
  .opening-story.opening-arrival,.opening-story.opening-aftermath {padding:10px 4vw}
  .opening-story-copy {width:min(380px,54vw);padding:8px 15px;font-size:.9rem}
  .opening-story-copy h1 {font-size:clamp(21px,3.4vw,36px)}
  .opening-dialogue {min-height:3.6em}
  .opening-allen-full {right:51vw;height:64vh}
  .opening-allen-portrait {width:62px}
  .opening-goal {margin-inline-start:0}
}
@media (orientation:portrait) {
  .opening-story-copy {width:100%}
  .opening-story.opening-arrival::before {background-position:40% center}
  .opening-allen-full {right:6vw;bottom:37%;height:43vh;max-width:38%}
  .opening-aftermath-board {width:100%!important;height:70%!important}
}

.opening-forecast {
  flex:0 0 100%;
  color:var(--opening-tint,#efdfc0);
  font-size:.83rem;
}
.opening-guide[data-theme="sword"],.opening-board[data-theme="sword"] {--opening-tint:#fff0ad}
.opening-guide[data-theme="blessing"],.opening-board[data-theme="blessing"] {--opening-tint:#fff5c3}
.opening-guide[data-theme="storm"],.opening-board[data-theme="storm"] {--opening-tint:#a9e6ff}
.opening-guide[data-theme="axe"],.opening-board[data-theme="axe"] {--opening-tint:#ffb492}
.opening-board[data-theme] .opening-target-tile {
  stroke:var(--opening-tint,#ffe7a0);
  stroke-width:3.5;
}
.opening-barrier-line {stroke:#fff2b8;stroke-width:2.3;stroke-linecap:round}
.opening-fx {
  --opening-color:#fff6bc;
  --opening-fill:#fff5b647;
  animation:opening-flare var(--opening-effect-ms) ease-out both;
}
.opening-fx-ice {--opening-color:#94e8ff;--opening-fill:#63b9ff77}
.opening-fx-storm {--opening-color:#e2ccff;--opening-fill:#5465f087}
.opening-fx-axe {--opening-color:#ffae7e;--opening-fill:#b8453167}
.opening-fx-blessing,.opening-fx-barrier {--opening-color:#fff6cf;--opening-fill:#ffe78d65}
.opening-fx-ring {fill:var(--opening-fill);stroke:var(--opening-color);stroke-width:3}
.opening-fx-ray {fill:none;stroke:var(--opening-color);stroke-linecap:round;stroke-linejoin:round;stroke-width:5;filter:drop-shadow(0 0 5px var(--opening-color))}
@keyframes opening-flare {0%{opacity:.18}16%{opacity:1}64%{opacity:.8}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.opening-fx{animation:none}}

.title-panel::before {
  background:linear-gradient(90deg,#131b17f3,#141b18ac 46%,#1c261d6e),url("assets/tavern-v1.png") left 53%/cover;
}
.opening-story.opening-visual-map::before {
  background:radial-gradient(ellipse at 24% 30%,#676653,#27393c 78%);
}
.opening-story.opening-visual-warmth::before {
  background:linear-gradient(90deg,#1a231b19,#161b15ed),url("assets/tavern-v1.png") left center/cover;
}
.opening-map {
  position:absolute;
  inset:12% auto 12% 5%;
  width:42%;
  display:grid;
  align-content:space-around;
  justify-items:center;
  background:radial-gradient(ellipse at 23% 27%,#d4c5a2,#8c9b85 48%,#586d6d);
  border:solid 1px #b8a784;
  box-shadow:inset 0 0 2rem #40362690;
  overflow:hidden;
}
.opening-map::before {
  content:"";
  position:absolute;
  inset:-15% 28%;
  transform:rotate(17deg);
  border-right:3px dashed #7b633d;
  border-left:9px solid #66859790;
}
.opening-map span {
  z-index:1;
  background:#f1dfb9;
  color:#2b3027;
  border:1px solid #8b7656;
  padding:.28em .65em;
  box-shadow:0 2px 8px #1c241f60;
}
.opening-map span:nth-child(2) {margin-left:27%}
.opening-map span:nth-child(3) {margin-left:43%}
.opening-hero-card {
  color:#263333;
  position:absolute;
  margin:0;
  width:clamp(80px,17vw,240px);
  aspect-ratio:4/6;
}
.opening-hero-card img {display:block;width:100%;height:100%;object-fit:contain}
.opening-hero-card figcaption {
  position:absolute;inset:0;
  color:#392519;font-weight:800;font-size:clamp(.87rem,2.2vmin,1.7rem);
  visibility:hidden;
}
.opening-hero-card figcaption>* {position:absolute;transform:translate(-50%,-50%);white-space:nowrap}
.opening-hero-card figcaption strong {top:13%;left:79.5%;font-size:1.24em}
.opening-hero-card figcaption span {top:93.4%;left:50%}
.opening-hero-card.is-paper {filter:drop-shadow(0 8px 16px #1015159c)}
.opening-hero-card.is-paper figcaption {visibility:visible}
.opening-visual-pose .opening-hero-card,.opening-visual-paper .opening-hero-card {
  right:13%;bottom:8%;z-index:1;height:min(85%,460px);width:auto;
}
.opening-visual-pose .opening-hero-card img {
  clip-path:inset(4% 40% 15% 11% round 2px);
  transform:scale(1.22);
  transform-origin:43% 45%;
}
.opening-visual-paper .opening-hero-card {animation:opening-paper-reveal .4s ease-out both}
@keyframes opening-paper-reveal {
  from {transform:scale(1.04);opacity:.7}
  to {transform:scale(1);opacity:1}
}
.opening-visual-road .opening-aftermath-board {left:0;right:auto;width:65%!important;height:100%!important}
.opening-visual-road .opening-story-copy {width:min(34vw,29rem);background:#eddeba;color:#242e27;border-color:#a68b5f}
.opening-visual-road .opening-kicker,.opening-visual-road .opening-dialogue strong,.opening-visual-road .opening-story-copy h1 {color:#344736;text-shadow:none}
.opening-visual-road .opening-allen-portrait {width:clamp(38px,7vw,92px)}
.opening-story.opening-visual-road::before {
  background:linear-gradient(130deg,#253e49d9,#24343be9),url("assets/opening-north-road.png") right center/cover;
}
.story-v01 .speech p {line-height:1.45}
.story-v01 .story-acting[data-expression="weary"] {filter:saturate(.79);transform:translateY(3px)}
.story-v01 .story-acting[data-expression="alert"] {filter:brightness(1.08);transform:scale(1.025)}
.story-v01 .story-acting[data-expression="quiet"] {filter:saturate(.92) sepia(.09)}
.story-v01 .story-acting[data-expression="wry"] {transform:rotate(-1deg)}
.story-voice {background:#181c18!important}
.story-voice .speech {background:#252a22;color:#f4e8c9;border-color:#78634a}
.story-shelf {
  background:linear-gradient(180deg,#140d0950,#140d0924 55%,#4d2d1b 56%,#251b12),url("assets/tavern-v1.png") center/cover!important;
}
.story-shelf .opening-hero-card {
  z-index:1;left:53%;bottom:34%;width:clamp(74px,14vw,182px);
  transform:rotate(-3deg);
}
.story-illustrated {
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
  align-items:center;
  gap:clamp(.65rem,2vw,2rem);
  padding:3.3rem clamp(.65rem,3vw,3rem) .6rem;
  background:radial-gradient(ellipse at 24% 55%,#60422c,#29251b 74%);
}
.story-event-art {display:block;width:100%;height:100%;min-height:0;object-fit:contain}
.story-illustrated .speech {
  position:static;min-height:0;max-height:100%;margin:0;overflow:auto;
}
@media (orientation:portrait) {
  .story-illustrated {grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
  .story-illustrated .speech {max-height:36dvh}
  .opening-visual-pose .opening-hero-card,.opening-visual-paper .opening-hero-card {
    top:5%;bottom:auto;right:50%;translate:50% 0;height:min(56%,380px);
  }
}
.story-field,.story-return-field {background:radial-gradient(ellipse at 47% 45%,#697d59,#2d4a39)!important}
.story-door {isolation:isolate;background:#534334!important}
.story-doorframe {
  position:absolute;
  inset:0;
  background:radial-gradient(ellipse at center,#f7e6b6,#cab68a 33%,#807960 72%);
}
.story-doorframe div {
  position:absolute;top:0;bottom:0;width:50%;
  background:repeating-linear-gradient(90deg,#61422e,#826042 7%,#5f412c 11%,#674a33 14%);
  border:5px solid #513b2b;
}
.story-doorframe div:first-child {left:0;transform:translateX(-77%);animation:story-door-left .6s ease-out both}
.story-doorframe div:last-child {right:0;transform:translateX(77%);animation:story-door-right .6s ease-out both}
@keyframes story-door-left {from{transform:translateX(-25%)}to{transform:translateX(-77%)}}
@keyframes story-door-right {from{transform:translateX(25%)}to{transform:translateX(77%)}}
.story-title-call {
  position:absolute;inset:0;display:grid;place-items:center;text-align:center;z-index:1;
  margin:0;padding:1rem;color:#243529;font-size:clamp(24px,6vw,72px);
  text-shadow:0 2px 8px #fbf1d3;
}
@media(orientation:portrait) {
  .opening-map {inset:7% 8% auto;width:auto;height:47%}
  .opening-visual-road .opening-aftermath-board {width:100%!important;height:68%!important}
  .opening-visual-road .opening-story-copy {width:100%}
  .opening-visual-pose .opening-hero-card,.opening-visual-paper .opening-hero-card {top:8%;height:43%}
}
@media(prefers-reduced-motion:reduce) {
  .opening-visual-paper .opening-hero-card,.story-doorframe div:first-child,.story-doorframe div:last-child {animation:none}
}

.opening-board,.opening-aftermath-board {
  filter:drop-shadow(0 12px 9px #101b25a8);
}
:is(.opening-board,.opening-aftermath-board) .board-cliff-face {fill:url(#opening-masonry);stroke:#4b493b}
:is(.opening-board,.opening-aftermath-board) .opening-fort-tile {fill:#b1a48a}
:is(.opening-board,.opening-aftermath-board) .opening-road-tile {fill:#a2916c}
:is(.opening-board,.opening-aftermath-board) .opening-bridge-tile {fill:#c0ae8f;stroke:#746b57}
.opening-bridge-face {fill:url(#opening-masonry);stroke:#584b39;stroke-width:1}
.opening-bridge-arch {fill:#173742;stroke:#4c493c;stroke-width:1}
.opening-stone-front,.opening-stone-side,.opening-stone-top,.opening-stone-step,.opening-step-riser {
  stroke:#5f5749;stroke-width:.85;stroke-linejoin:round;
}
.opening-stone-front,.opening-step-riser {fill:#8d806b}
.opening-stone-side {fill:#706553}
.opening-stone-top,.opening-stone-step {fill:#c6b697}

.opening-screen .opening:not(.opening-story)::before {
  background:radial-gradient(ellipse at 50% 34%,#46564c,#202c29 79%);
}
.opening-story.opening-visual-road::before {
  background:radial-gradient(ellipse at 27% 38%,#47584d,#252e2b 72%);
}
.opening-board,.opening-visual-road .opening-aftermath-board {filter:none}
.opening-landscape>polygon {fill:url(#opening-ground)}
.opening-visual-road .opening-aftermath-board {mask-image:linear-gradient(90deg,#000 89%,transparent)}
.opening-contact {
  fill:url(#opening-foot-shadow);
  stroke:none;
}
.opening-contact-active {stroke:#9de2d9;stroke-width:2.5}

.story-door-party {
  position:absolute;z-index:1;bottom:10%;left:50%;display:flex;align-items:end;
  transform:translateX(-50%);gap:clamp(2px,1vw,16px);
  animation:story-party-steps .6s ease-out both;
}
.story-door-party svg {
  width:clamp(38px,7vw,70px);height:auto;overflow:hidden;
  filter:drop-shadow(0 4px 2px #473b2c80);
}
@keyframes story-party-steps {from{opacity:0;transform:translate(-50%,18px)}to{opacity:1;transform:translate(-50%,0)}}
@media(prefers-reduced-motion:reduce){.story-door-party{animation:none}}

/* K01's outdoor conversation uses the board, without indoor portraits. */
.scene-field-dialogue .scene-field {bottom:100px;opacity:.85;display:flex;justify-content:center}
.scene-field-dialogue .scene-field svg {width:100%!important;height:100%!important}
@media(min-height:501px){.scene-field-dialogue .scene-field{bottom:165px}}

/* CAST04: opening-only full figures; all art remains decorative. */
.opening-cast-portrait{position:absolute;left:5%;bottom:4%;height:88%;width:32%;margin:0;z-index:1;pointer-events:none}
.opening-cast-portrait img{width:100%;height:100%;object-fit:contain;object-position:center bottom;pointer-events:none}
.opening-cast-portrait span{position:absolute;inset:45% 0 auto;text-align:center;background:#172832;color:#fff4ce}
.opening-story:has(.opening-cast-portrait) .opening-story-copy{z-index:2}

.opening-camera-turns {display:flex;gap:4px;margin-inline-start:auto}
@media (orientation:portrait) and (max-width:600px) {
 body {height:100dvh;box-sizing:border-box;min-width:0;--nrank-top:env(safe-area-inset-top,0px);--nrank-bottom:env(safe-area-inset-bottom,0px);padding-block:var(--nrank-top) var(--nrank-bottom)}
 body.fighting {grid-template-rows:0 minmax(0,1fr) 0}
 .mobile-battle {grid-template-rows:46px minmax(0,1fr) 52px}
 .battle-head button,.opening button,header nav button,footer button {min-height:44px}
 .timeline {justify-content:safe center}
 .timeline button {min-width:46px;height:48px;min-height:46px}
 .field .commands {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:auto;left:6px!important;right:6px!important;top:auto!important;bottom:59px;max-height:min(29dvh,175px);overflow:auto;touch-action:pan-y}
 .field .commands.skill-list {grid-template-columns:repeat(2,minmax(0,1fr))}
 .field .commands button {min-height:44px;padding:3px 5px;font-size:16px}
 .target-confirm {top:auto!important;bottom:5px;left:50%!important;transform:translateX(-50%);touch-action:manipulation}
 .target-confirm button {min-width:88px}
 .confirm-leader {display:none}
 .field .prediction {left:5px;right:5px;top:4px;max-height:24dvh!important;overflow:auto}
 .field .combat-person {bottom:59px;width:26%;max-height:26dvh;overflow:hidden}
 .field .combat-person .portrait.large {height:min(11dvh,80px)}
 .field .tools {left:4px;right:4px;max-width:100%;max-height:30dvh;display:flex;gap:3px;flex-wrap:wrap;align-content:start;overflow:auto;z-index:18}
 .field .tools button {min-height:44px}
 .opening-guide {gap:3px 8px;padding:4px 8px;font-size:15px}
 .opening-camera-turns button {padding:3px 9px}
 .board-list {display:grid;grid-template-columns:1fr;grid-template-rows:minmax(85px,32%) minmax(0,1fr);padding:4px}
 .board-list .list,.board-list .detail {overflow:auto;min-height:0}
 .facilities {grid-template-columns:repeat(2,minmax(0,1fr))}
 dialog {max-width:calc(100vw - 16px);max-height:calc(100dvh - var(--nrank-top) - var(--nrank-bottom) - 12px);overflow:auto}
 .marc-folio[open] {max-width:none;max-height:none;background-size:cover}
 dialog.marc-folio>img {left:3%;top:calc(var(--nrank-top) + 4%);width:38%;height:27%}
 dialog.marc-folio section {left:7%;right:7%;top:32%;bottom:calc(12% + var(--nrank-bottom))}
 dialog.marc-folio .marc-folio-actions {bottom:calc(3% + var(--nrank-bottom))}
 dialog.marc-folio button {min-height:44px}
}

.story-door .door-illustration {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.story-door .story-title-call {inset:auto 6% 9%;display:block;text-align:left;font-size:clamp(29px,6vw,79px);color:#fff4db;text-shadow:0 2px 7px #1e201a,0 0 22px #1e201a}
.story-door.chapter-plate .story-title-call {top:12%;bottom:auto}
@media(orientation:portrait){
 .story-door .door-illustration {inset:8% 0 auto;height:59%;object-position:52% center}
 .story-door.chapter-plate .door-illustration {inset:auto 0 4%;height:61%;object-position:50% center}
 .story-door .story-title-call {inset:auto 6% 13%;font-size:clamp(27px,8vw,46px)}
 .story-door.chapter-plate .story-title-call {inset:16% 6% auto}
}

.leader-sighting {position:absolute;z-index:2;right:8%;top:12%;height:45%;width:min(50%,400px);pointer-events:none;background:#29342d;overflow:hidden;border:1px solid #ac9367}
.leader-sighting svg {height:100%!important;width:100%!important}

.opening-selection {font-weight:bold;color:#ffe192}
.target-caption {font: bold 12px sans-serif;fill:#fff9d8;stroke:#24221c;stroke-width:3;paint-order:stroke fill}
.opening-viewport {min-width:0;overscroll-behavior:contain}
.deployment-grid {display:grid;gap:1px;width:min(100%,39vh,340px);margin:auto;background:#252c24;color:white}
.deployment-grid>* {min-width:0;min-height:0!important;aspect-ratio:1;border:0;padding:0;line-height:1;display:grid;place-items:center;background:hsl(80,16%,var(--ground-light));font:700 clamp(9px,2vh,15px) system-ui}
.deployment-grid [data-kind=water] {background:#334f57}.deployment-grid [data-kind=ally] {background:#427462;color:white}
.deployment-grid [data-kind=enemy] {color:#ffac8c}.deployment-grid [data-kind=objective] {color:#ffe29a}
.deployment-roster {display:flex;flex-wrap:wrap;gap:4px}.deployment-roster button {min-height:38px}
@media(orientation:portrait) {
 .scene .scene-portraits {position:absolute;inset:5% 6% 32%;display:flex;align-items:end;justify-content:center;width:auto;height:auto}
 .scene .scene-portraits .portrait.large:not(.silent){width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center bottom;transform:none}
 .scene .scene-portraits .silent,.scene[data-onscreen=false] .scene-portraits {display:none}
 .opening-story .opening-cast-portrait,.opening-story .opening-allen-full {inset:4% 9% 36%;width:auto;height:auto}
 .opening-story:has(.opening-cast-portrait) .opening-story-copy {align-self:end}
 .opening-story .opening-cast-portrait img {object-position:center bottom}
 .opening-story .opening-allen-portrait {width:min(60vw,280px);max-height:32dvh;object-fit:contain}
}

body.title-screen #main {padding:0; margin:0; max-width:none; overflow:hidden}
.title-panel {height:100%; min-height:0; padding:0; display:block; background:#384638 url("assets/opening-title-still.jpg") center/cover}
.title-panel::before {content:none}
.title-film {position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none}
.title-panel::after {content:""; pointer-events:none; position:absolute; inset:0; background:linear-gradient(90deg,#101d21b8,#17221b75 36%,transparent 68%)}
.title-panel h1,.title-panel .title-prompt,.title-panel .title-choices {position:absolute; z-index:1; left:max(6.2%,env(safe-area-inset-left)); margin:0}
.title-panel h1 {bottom:50%; font:700 clamp(28px,5.7vw,94px)/1.32 NRankSerif,"Yu Mincho",serif; letter-spacing:.025em; color:#fff2ce; text-shadow:0 2px 3px #32271d,0 4px 18px #1c160f90}
.title-panel .title-prompt,.title-panel .title-choices {top:54%}
.title-panel .title-prompt {position:absolute; inset:0; display:block; width:100%; height:100%; background:transparent; border:0; color:#fff5d9; padding:0; font:500 clamp(13px,1.45vw,19px)/1.5 NRankSerif,serif; letter-spacing:.16em; text-shadow:0 1px 5px #151714; text-align:left; outline-offset:-5px}
.title-prompt span {position:absolute; top:54%; left:max(6.2%,env(safe-area-inset-left)); display:flex; align-items:center; gap:12px}
.title-prompt span::before {content:""; width:2em; height:1px; background:#ecd398}
.title-panel .title-choices {width:min(225px,45%); gap:3px}
.title-choices[hidden] {display:none}
.title-panel .title-choices button {background:#15221fbd; border:1px solid #dbc99580; border-radius:2px; color:#fff1cc; min-height:36px; padding:5px 16px; font:500 clamp(15px,1.45vw,20px)/1.4 NRankSerif,serif}
.title-panel .title-choices button:disabled {opacity:.62}
.title-panel .title-status {font-size:12px; color:#fff0cd; text-shadow:0 1px 3px #000; margin:3px 0 0}
@media(max-height:420px){.title-panel .title-choices {top:51%}}
@media(max-aspect-ratio:1/1){.title-film,.title-panel {object-position:74% center;background-position:74% center}.title-panel::after {background:linear-gradient(0deg,#18211ccd,transparent 90%)}}

/* Keep the counter and the hostess visible while the facilities list scrolls. */
.home:has(vera-host) {padding:0; position:relative; isolation:isolate; overflow:hidden; background:linear-gradient(90deg,#13231ff0 0%,#1c2720c9 33%,#37271822 65%),url('assets/tavern-day-work-v1.png') center 52%/cover}
.tavern-menu {position:relative; width:49%; height:100%; overflow:auto; padding:clamp(12px,4vh,48px) 2% 12px max(4%,env(safe-area-inset-left)); scrollbar-width:thin}
.home .tavern-menu h1 {font:700 clamp(25px,4.6vw,66px)/1.2 NRankSerif,serif; color:#ffebbd; margin:0 0 .18em}
.home .tavern-menu p {font-size:clamp(12px,1.4vw,18px); line-height:1.45; margin:.2em 0; color:#f6e8cc}
.home .tavern-menu .facilities {margin-top:clamp(7px,2vh,22px); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-height:none; overflow:visible; gap:clamp(4px,1vh,12px)}
.home .tavern-menu button {min-height:44px; padding:6px 7px; font-size:clamp(14px,1.55vw,22px); background:#20332ce8; color:#ffeecf; border:1px solid #b8a27899; box-shadow:inset 0 0 0 2px #28372e; border-radius:2px}
.home .tavern-menu button:focus-visible,.home .tavern-menu button:hover {background:#526044}
vera-host {display:block;position:absolute;inset:0 0 0 49%}
.home button.vera-portrait {display:block; position:absolute; inset:0; width:100%; height:100%; background:none; padding:0; border:0; box-shadow:none; border-radius:0; overflow:hidden; color:#fff2d7}
.vera-portrait img,.vera-portrait canvas {position:absolute; height:min(132%,72vw); width:auto; aspect-ratio:1122/1402; max-width:none; top:0; left:51%; transform:translateX(-50%); pointer-events:none}
.vera-portrait canvas[hidden] {display:none}
.vera-name {position:absolute; right:max(6%,env(safe-area-inset-right)); bottom:5%; min-width:6em; text-align:center; padding:.35em 1em; background:linear-gradient(110deg,#1a2825df,#23352ce8); border-block:1px solid #c2ac77; font:600 clamp(18px,2.3vw,34px)/1.2 NRankSerif,serif; letter-spacing:.13em}
.vera-name small {font-size:.47em; letter-spacing:.11em; color:#eadab0; margin-bottom:.25em}
.vera-line {position:absolute; left:3%; right:5%; bottom:26%; width:fit-content; max-width:92%; color:#372b22; background:#fff1d7f5; border-left:3px solid #b39158; border-radius:3px; padding:.6em 1em; font:550 clamp(13px,1.55vw,19px)/1.5 NRankSerif,serif; box-shadow:0 4px 16px #281d1633; pointer-events:none}
.vera-line:empty {display:none}
@media(max-aspect-ratio:4/5){.home:has(vera-host){display:flex;flex-direction:column}.home vera-host{position:relative;inset:auto;flex:1;min-height:0}.vera-portrait img,.vera-portrait canvas{height:139%;top:0}.home .tavern-menu{width:100%;height:auto;max-height:59%;background:#17271fea;padding:10px 5%}.home .tavern-menu h1{font-size:24px}.home .tavern-menu p{display:inline-block;margin-right:10px}}
