.vn-card{
  --vn-accent:#73416a;
  --vn-tint:#f8f1f9;
  --vn-edge:#c9a9d0;
  --vn-card-ink:#1d3557;
  --vn-nav-clearance:0px;
  scroll-margin-top:16px;
  min-width:0;
  margin:0 0 27px;
  padding:clamp(12px,3vw,28px);
  border:1px solid #cbdcf1;
  border-radius:24px;
  background:linear-gradient(140deg,#fff,#f3f7ff 66%,#fff3fa);
  box-shadow:0 10px 26px #365b841b;
}
.vn-card[data-vn="high-school"]{
  --vn-accent:#295b4e;
  --vn-tint:#eff7f5;
  --vn-edge:#9dc5b6;
  background:linear-gradient(145deg,#fff,#eef8ff 66%,#edf9ef);
}
.vn-card [hidden]{display:none!important}
.vn-heading,.vn-shell{max-width:1080px;margin-inline:auto}
.vn-heading{margin-bottom:12px}
.vn-kicker{margin:0 0 4px;color:var(--vn-accent);font:800 10px/1.55 var(--mono);letter-spacing:.085em}
.vn-heading h3{margin:0 0 5px;color:var(--vn-card-ink);font-size:clamp(22px,5.5vw,34px);font-weight:850;letter-spacing:-.035em;line-height:1.25}
.vn-heading p:not(.vn-kicker){margin:0;color:#42607b;font-size:14px;line-height:1.6}

.vn-shell{display:grid;gap:8px;padding:8px;border:1px solid #35506d;border-radius:17px;background:#172c46;box-shadow:0 6px 0 #0f22384d}
.vn-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"scene affection actions";align-items:center;gap:8px;min-width:0;color:#eff6ff;padding-inline:3px}
.vn-scene-meta{grid-area:scene;display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.vn-scene-meta span{color:#c4d9ee;font:750 11px/1.25 var(--sans)}
.vn-scene-meta strong{font-size:15px;line-height:1.35}
.vn-actions{grid-area:actions;display:flex;gap:5px}
.vn-affection{
  grid-area:affection;
  display:grid;
  grid-template: "label level value" auto "meter meter change" auto / auto minmax(0,1fr) auto;
  align-items:center;
  gap:2px 6px;
  width:clamp(165px,28vw,218px);
  min-width:0;
  padding:3px 7px;
  border:1px solid #7289a9;
  border-radius:9px;
  background:#10243a;
  color:#f2f7ff;
  font-size:11px;
  font-weight:750;
  line-height:1.25;
}
.vn-affection-label{grid-area:label;white-space:nowrap}
.vn-affection-label b{color:var(--vn-edge)}
.vn-affection-level{grid-area:level;overflow:hidden;color:#d4e0f2;text-overflow:ellipsis;white-space:nowrap}
.vn-affection-value{grid-area:value;min-width:6.5ch;font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap}
.vn-affection-meter{grid-area:meter;appearance:none;width:100%;min-width:0;height:6px;border:0;border-radius:999px;background:#415979;color:var(--vn-edge)}
.vn-affection-meter::-webkit-progress-bar{border-radius:inherit;background:#415979}
.vn-affection-meter::-webkit-progress-value{border-radius:inherit;background:linear-gradient(90deg,#86b9ee,var(--vn-edge))}
.vn-affection-meter::-moz-progress-bar{border-radius:inherit;background:linear-gradient(90deg,#86b9ee,var(--vn-edge))}
.vn-affection-change{grid-area:change;min-width:3.5ch;min-height:1.25em;text-align:right;color:#d1ddef;font-variant-numeric:tabular-nums;white-space:nowrap}
.vn-affection-change[data-vn-change="gain"]{color:#b2f6cd}
.vn-affection-change[data-vn-change="loss"]{color:#ffd4ce}
.vn-affection-change[data-vn-change="neutral"]{color:#a8bad1;font-weight:500}
.vn-actions button,.vn-menu-panel button,.vn-ending button{
  min-height:44px;
  min-width:44px;
  padding:5px 11px;
  border:1px solid #7896b8;
  border-radius:9px;
  background:#294864;
  color:#fff;
  font:750 13px/1.35 var(--sans);
  touch-action:manipulation;
}
.vn-actions button:is(:hover,[aria-pressed="true"],[aria-expanded="true"]),.vn-menu-panel button:hover,.vn-ending button:hover{background:#3b5d86}

.vn-reader{display:grid;gap:8px;min-width:0;min-height:0}
.vn-stage{display:grid;place-items:center;min-width:0;min-height:0;aspect-ratio:16/9;overflow:hidden;border-radius:11px;background:#0d1e31;touch-action:manipulation}
.vn-art{display:block;width:100%;height:100%;min-height:0;object-fit:contain;color:#c6d5e8;font-size:13px}
.vn-deck{
  display:grid;
  align-content:start;
  min-width:0;
  min-height:0;
  border:1px solid #cfdef0;
  border-radius:11px;
  background:#f4f8fd;
  color:#172d49;
}
.vn-play-panel{min-width:0}
.vn-affection-feedback{margin:0;padding:8px 11px;border-bottom:1px solid #d7e2ee;border-inline-start:3px solid #9bb7d6;background:#eef4fb;color:#405a78;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
.vn-affection-feedback[data-vn-change="gain"]{border-inline-start-color:#7bab9a;background:#edf7f2;color:#2b5a4c}
.vn-affection-feedback[data-vn-change="loss"]{border-inline-start-color:#bf93a2;background:#fbf1f5;color:#77475a}
.vn-affection-feedback[data-vn-change="neutral"]{color:#5a6d84;background:#f1f5fa}
.vn-dialogue{
  display:grid;
  grid-template-rows:auto auto 1fr;
  gap:5px;
  width:100%;
  min-height:118px;
  padding:11px 13px;
  border:0;
  border-inline-start:4px solid #86add4;
  border-radius:10px;
  background:#fbfdff;
  color:#162c4c;
  text-align:start;
  touch-action:manipulation;
}
.vn-dialogue[data-vn-side="right"]{border-inline-start-color:var(--vn-edge);background:var(--vn-tint)}
.vn-dialogue[data-vn-side="center"]{border-inline-start-color:#a2b3cb}
.vn-speaker,.vn-context [data-vn-context-speaker]{color:var(--vn-accent);font-size:13px;font-weight:850;line-height:1.35}
.vn-text,.vn-context [data-vn-context-text]{font-size:clamp(15px,2vw,18px);line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.vn-next{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:end;
  justify-self:end;
  gap:12px;
  min-height:34px;
  padding:4px 10px;
  border-radius:7px;
  background:#e3eefb;
  color:#24476c;
  font-size:13px;
  font-weight:800;
}
.vn-next b{font-size:20px;line-height:1}
.vn-dialogue:hover .vn-next{background:#d7e7fa}
.vn-decision{display:grid;gap:7px;padding:8px}
.vn-context{
  display:grid;
  gap:2px;
  padding:7px 9px;
  border-inline-start:3px solid var(--vn-edge);
  border-radius:6px;
  background:var(--vn-tint);
}
.vn-context [data-vn-context-text]{font-size:clamp(14px,1.8vw,16px);line-height:1.46}
.vn-choices{display:grid;gap:6px}
.vn-choices button{
  width:100%;
  min-height:44px;
  padding:7px 10px;
  border:1px solid #acc5e2;
  border-radius:8px;
  background:#fff;
  color:#203858;
  font:750 14px/1.36 var(--sans);
  text-align:start;
  overflow-wrap:anywhere;
  touch-action:manipulation;
}
.vn-choices button:hover{background:#e4ecff;border-color:#9388bd}
.vn-ending{display:flex;justify-content:space-between;align-items:center;gap:9px 16px;flex-wrap:wrap;padding:11px 12px;background:var(--vn-tint);border-radius:10px}
.vn-ending strong{font-size:clamp(17px,4vw,23px);line-height:1.3}
.vn-ending button{background:var(--vn-accent);border-color:var(--vn-edge)}
.vn-ending-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;min-width:0}
.vn-ending-actions [data-vn-replay]{background:#fff;color:var(--vn-accent)}
.vn-ending-actions button{min-height:44px}
.vn-menu-panel{padding:9px 10px}
.vn-menu-panel p{margin:7px 0 0;font-size:13px;line-height:1.55}
.vn-menu-panel .vn-affection-help{padding:7px 9px;border-inline-start:3px solid var(--vn-edge);border-radius:6px;background:var(--vn-tint)}
.vn-menu-panel .vn-rules-note{padding:8px 9px;border:1px solid #c8d8e9;border-radius:7px;background:#f7fbff;color:#496582}
.vn-menu-panel button{margin-inline-end:4px}
.vn-dossier{margin-top:5px;font-size:13px}
.vn-dossier summary{display:flex;align-items:center;min-height:44px;color:#375982;cursor:pointer;font-weight:750}
.vn-dossier img{display:block;width:100%;max-width:320px;height:auto;border-radius:7px}
.vn-hint,.vn-status{margin:0;padding:1px 4px;color:#d7e5f8;font-size:12px;line-height:1.35;overflow-wrap:anywhere}
.vn-hint{color:#ffe6a7}
.vn-card :is(button,summary,[data-vn-stage],[data-vn-choices],[data-vn-ending]):focus-visible{outline:3px solid #a472d4;outline-offset:2px}
.vn-deck :is(button,summary,[data-vn-choices],[data-vn-ending]):focus-visible{outline-offset:-3px}

.vn-view-open{overflow:hidden}
.vn-card[data-vn-fullscreen="expanded"] .vn-shell{
  position:fixed;
  inset:0;
  z-index:10000;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  align-content:stretch;
  justify-items:center;
  max-width:none;
  height:100vh;
  height:100dvh;
  width:100%;
  margin:0;
  padding:8px;
  padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  overflow:auto;
  overscroll-behavior:contain;
  border:0;
  border-radius:0;
  background:radial-gradient(ellipse at top,#2a435e,#101d31 72%);
}
.vn-card[data-vn-fullscreen="expanded"] .vn-shell>*{width:min(100%,1280px)}
.vn-card[data-vn-fullscreen="expanded"] .vn-reader{grid-template-rows:minmax(0,auto) minmax(0,1fr);align-content:start}
.vn-card[data-vn-fullscreen="expanded"] .vn-deck{align-self:start;max-height:100%;overflow:auto;overscroll-behavior:contain}

@media(max-width:760px){
  .vn-card{--vn-nav-clearance:calc(74px + env(safe-area-inset-bottom));margin-inline:-12px;padding:8px;border-radius:16px}
  .vn-shell{padding:5px;border-radius:12px;gap:6px}
  .vn-reader{gap:6px}
  .vn-stage,.vn-deck{border-radius:8px}
  .vn-actions button{padding-inline:7px}
  .vn-scene-meta strong{font-size:13px}
  .vn-card:not([data-vn-fullscreen="expanded"]) :is(.vn-toolbar button,.vn-dialogue,.vn-choices,.vn-ending button){scroll-margin-block-end:var(--vn-nav-clearance)}
}
@media(max-width:440px){
  .vn-choices:is([data-vn-choice-count="4"],[data-vn-choice-count="5"],[data-vn-choice-count="6"]){grid-template-columns:repeat(2,minmax(0,1fr))}
  .vn-ending-actions{width:100%}
  .vn-ending-actions button{flex:1 1 125px}
}
@media(orientation:portrait) and (max-width:600px){
  .vn-toolbar{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"scene actions" "affection affection";row-gap:5px}
  .vn-affection{
    grid-template:"label level meter value change" auto / auto minmax(0,auto) minmax(25px,1fr) auto auto;
    width:100%;
    min-height:27px;
  }
}
@media(orientation:landscape){
  .vn-reader{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);align-items:start}
  .vn-choices:is([data-vn-choice-count="4"],[data-vn-choice-count="5"],[data-vn-choice-count="6"]){grid-template-columns:repeat(2,minmax(0,1fr))}
  .vn-card[data-vn-fullscreen="expanded"] .vn-shell{grid-template-rows:auto minmax(0,1fr) auto}
  .vn-card[data-vn-fullscreen="expanded"] .vn-stage{aspect-ratio:auto;height:100%;place-items:stretch}
  .vn-card[data-vn-fullscreen="expanded"] .vn-reader{grid-template-rows:minmax(0,1fr);align-items:stretch}
  .vn-card[data-vn-fullscreen="expanded"] .vn-hint{display:none}
}
@media(orientation:landscape) and (max-height:440px){
  .vn-card[data-vn-fullscreen="expanded"] .vn-shell{gap:5px}
  .vn-dialogue{padding:9px 10px}
  .vn-decision{padding:6px;gap:5px}
  .vn-context{padding:5px 7px}
  .vn-choices{gap:5px}
  .vn-choices button{padding:5px 7px}
}
@media(orientation:landscape) and (max-height:350px) and (max-width:640px){
  .vn-reader{grid-template-columns:repeat(2,minmax(0,1fr))}
  .vn-choices button{font-size:13px;padding-inline:6px}
}
@media(max-width:359px){
  .vn-choices:is([data-vn-choice-count="4"],[data-vn-choice-count="5"],[data-vn-choice-count="6"]){grid-template-columns:minmax(0,1fr)}
}
