/* Printed-paper margins, cut panels and spot colour frame the existing pixel illustrations. */
:root {
  --print-paper:#f4f0e6;
  --print-ink:#1a191c;
  --print-red:#e84936;
  --print-tones:radial-gradient(circle,#302c313d 0 .8px,transparent 1px);
  --comic-title:"Noto Serif TC","Songti TC","PMingLiU",serif;
}
.soul-station {background:var(--print-paper); color:var(--print-ink); --vermilion:var(--print-red); --chalk:var(--print-paper);}
.soul-station::before {
  background:linear-gradient(115deg,transparent 0 80%,#a79b8821 80% 80.2%,transparent 80.2%),
    radial-gradient(circle,#8f857724 0 .65px,transparent .85px) 0 0 / 5px 5px,var(--print-paper);
}
.station-bar { border-bottom:3px double #3b3636; }
.station-brand canvas {background:var(--print-ink);border:1px solid var(--print-ink);}
.station-bar nav button {color:#3c3636;}
.station-bar #speaker {filter:brightness(.32);}
.station-bar nav button:is(:hover,:focus-visible) {color:#a62c24;}
.station-mast {
  min-height:0;border:2px solid var(--print-ink);border-left-width:6px;
  box-shadow:3px 3px var(--print-ink);background:var(--print-paper);
  align-items:center;
}
.station-mast::before {
  content:"";position:absolute;z-index:-1;inset:0 0 0 auto;width:35%;
  background:var(--print-tones) 0 0/4px 4px;
  clip-path:polygon(71% 0,100% 0,100% 100%,0 100%);
}
.station-mast::after {
  inset:-8% 5% -10% auto;width:18%;background:var(--print-ink);
  clip-path:polygon(42% 0,49% 0,17% 81%,68% 0,73% 0,8% 100%,0 100%);
}
.station-mast h1 {z-index:1;font-style:normal;line-height:.93;letter-spacing:-.065em;transform:skew(-7deg);}
.station-mast h1 span {color:#ce392f;}
.station-mast h1 em {letter-spacing:-.075em;}
.game-subtitle {
  z-index:1;align-self:center;background:var(--print-ink);color:var(--print-paper);
  padding:.29em .23em;font-family:var(--comic-title);font-size:clamp(.84rem,1.24vw,1.06rem);line-height:1.1;letter-spacing:.13em;
}
.station-deck {gap:clamp(13px,1.55vw,24px);}
.scene-deck {border:2px solid var(--print-ink);box-shadow:3px 3px var(--print-ink);}
.scene-window {background:var(--print-ink);}
.scene-window #cover {width:78%;object-position:62% 58%;}
.scene-cutaway {
  position:absolute;inset:0 0 0 auto;width:35%;overflow:hidden;isolation:isolate;
  background:var(--print-paper);clip-path:polygon(30% 0,100% 0,100% 100%,0 100%);
}
.scene-cutaway::before {
  content:"";position:absolute;z-index:-1;inset:0 0 0 4px;
  clip-path:polygon(30% 0,100% 0,100% 100%,0 100%);
  background:var(--print-ink);
}
.scene-cutaway::after {
  content:"";position:absolute;z-index:-1;inset:0 0 0 8px;
  clip-path:polygon(30% 0,100% 0,100% 100%,0 100%);
  background:radial-gradient(ellipse at 75% 54%,transparent 23%,#e6ded100 44%,#f5e6d759 81%),
    repeating-conic-gradient(from 9deg at 69% 48%,transparent 0deg 11deg,#1c171c6b 11.1deg 11.45deg,transparent 11.75deg 19deg),
    radial-gradient(circle at 68% 53%,#ed543c 0 clamp(55px,7.8vw,110px),transparent calc(clamp(55px,7.8vw,110px) + 1px)),var(--print-tones) 0 0/4px 4px,var(--print-paper);
}
.scene-window #coverStrike {
  inset:1% auto auto -2%;width:134%;height:106%;object-fit:contain;object-position:center;
  image-rendering:pixelated;filter:drop-shadow(2px 2px 0 #f4e9d9);
}
.scene-caption {border-top:3px solid var(--print-ink);}
.scene-caption h2,.screen-head h2,.dossier-id h3,.map-sheet h3,.scroll-heading h3,.slot-copy strong {font-family:var(--comic-title);font-weight:900;}
.scene-caption small,.slot-copy small {letter-spacing:.07em;}
.stamp-button,.back-stamp,#rotate {min-height:44px;border:1.5px solid var(--print-ink);color:var(--print-ink);font-weight:800;}
.stamp-button:hover,.back-stamp:hover,#rotate:hover {background:var(--print-ink);color:var(--print-paper);}
.sortie-menu {justify-content:space-between;gap:clamp(9px,1.4vh,17px);}
.fighter-slot {
  border:2px solid var(--print-ink);border-left:5px solid var(--print-ink);color:var(--print-paper);background:#212023;
  box-shadow:2px 2px var(--print-ink);
}
.slot-art {background:var(--print-tones) 0 0/4px 4px,#e3d8c9;border-bottom:3px solid var(--print-red);}
.slot-copy small {color:#efb8a8;}
.slot-copy>span {color:#e3d9cf;}
.slot-action {border-bottom:2px solid var(--print-red);color:var(--print-paper);}
.sortie-tools {background:var(--print-ink);border:2px solid var(--print-ink);gap:2px;}
.sortie-tools button,.sortie-tools button+button {border:0;color:var(--print-ink);background:#e9e1d2;}
.sortie-tools button:hover {background:#fff9eb;}
.sortie-tools small,.sortie-tools b {color:#534442;}
.sortie-tools .ticket-icon {filter:brightness(.66);}
.sortie-tools .satchel-icon {filter:brightness(.55);}
.sortie-start,.station-commit:not(:disabled) {
  color:#181418;background-color:#f15840;border:2px solid var(--print-ink);
}
.sortie-start {clip-path:none;box-shadow:3px 3px var(--print-ink);}
.sortie-start::after {
  width:42%;opacity:.7;
  background:repeating-linear-gradient(120deg,transparent 0 5px,#662618 6px,transparent 7px 10px);
  clip-path:polygon(52% 0,100% 0,58% 100%,0 100%);
}
.sortie-start span {font-family:var(--comic-title);font-style:italic;letter-spacing:.01em;}
.sortie-start small {background:var(--print-ink);color:var(--print-paper);padding:.26em .46em;}
.sortie-foot,.sortie-foot .station-record,.practice-link {color:#4d4340;}
.practice-link {border-bottom-color:#6f5e54;}
.soul-station :focus-visible {outline-color:#bd2f26;}
.fighter-slot:focus-visible,.sortie-start:focus-visible {outline:3px solid #e77544;outline-offset:-5px;}
.screen-head {border-bottom:3px solid var(--print-ink);}
.screen-head h2 {color:var(--print-ink);}
.screen-head>span {color:#7b352e;font-weight:700;}
.roster-filters button,.faction-select,.roster-search {color:var(--print-paper);background:var(--print-ink);}
.roster-filters button[aria-pressed="true"] {background:#fff9ec;color:var(--print-ink);border-color:var(--print-ink);box-shadow:inset 0 -3px var(--print-red);}
#rosterEmpty,.theater-index h3 {color:var(--print-ink);}
.fighter-card,.scroll-card,.map-file-list .map-card {
  border:1.5px solid var(--print-ink);
  background:#282629;color:var(--print-paper);
}
.fighter-card {background:linear-gradient(115deg,transparent 0 77%,#ffffff06 77% 86%,transparent 86%),#29272a;}
.fighter-card[aria-pressed="true"] {background:#3c2b2a;border-color:var(--print-ink);box-shadow:inset 0 0 0 2px #f07958,inset 0 -4px #f07958;}
.dossier,.map-sheet,.scroll-paper {border:2px solid var(--print-ink);border-top-width:4px;background-color:#fff9ed;}
.dossier-demo,.map-thumbnail {border-bottom:2px solid var(--print-ink);}
.dossier-id .dossier-demo canvas {background:var(--print-tones) 0 0 / 4px 4px,#e3daca;}
.map-commands {border-top:2px solid var(--print-ink);background-color:#eee7d8;}
.shop-counter {
  isolation:isolate;position:relative;border:2px solid var(--print-ink);
  background:radial-gradient(circle,#a487741f 0 1px,transparent 1.15px) 0 0 / 4px 4px,#262326;
}
.shop-counter>div {position:relative;flex:1;margin-block:7px;padding:7px 11px;background:var(--print-paper);color:var(--print-ink);border-radius:4px;}
.shop-counter>div::before {content:"";position:absolute;top:46%;left:-7px;border-block:4px solid transparent;border-right:8px solid var(--print-paper);}
.shop-counter strong {color:#862c22;}
.shop-counter p {color:#272325;}
/* Keep all battle marks on the edges; captions and splash panels carry the print treatment. */
.fighter-status,.foe-hud {background:#1b181df5;border-top:2px solid #ede6d8;}
.fighter-seal {background:var(--print-tones) 0 0 / 4px 4px,#e9dfce;border-bottom:2px solid var(--print-red);}
.combat-time {color:var(--print-ink);background:#f4eddfee;border-bottom-color:#292427;}
.combat-time span,.combat-time .hud-gold {color:#4e3a2e;}
.combat-time b {font-weight:900;}
.battle-notice {
  background:#f7f0e2ec;color:var(--print-ink);border:2px solid #211b20;clip-path:none;
}
.battle-notice strong {color:#8c2e25;font-family:var(--comic-title);}
.battle-notice span {color:#292328;}
.boss-alarm {
  background:linear-gradient(111deg,#e84736 0 26%,transparent 26.5%),repeating-linear-gradient(112deg,#30262a 0 2px,#211d21 3px 11px);
  border-block:2px solid var(--print-paper);
}
.boss-alarm-tag {color:var(--print-ink);background:var(--print-paper);transform:skew(-7deg);font-family:var(--comic-title);}
.boss-alarm strong,.foe-technique strong {font-family:var(--comic-title);}
.veil:not(:is([data-menu="recruit"],[data-menu="draw"],[data-menu="trialDraw"])) {
  background:radial-gradient(circle,#0006 0 1px,transparent 1.3px) 0 0/5px 5px,#101014bd;
}
.veil:not(:is([data-menu="recruit"],[data-menu="draw"],[data-menu="trialDraw"])) .dialog {
  color:var(--print-paper);border:2px solid var(--print-ink);border-top:5px solid var(--print-paper);
  outline:1px solid #d0c7b9;outline-offset:0;box-shadow:5px 5px #171519;
  background:linear-gradient(116deg,transparent 0 90%,#fff4 90% 90.2%,transparent 90.4%),#201e22;
}
.veil:not(:is([data-menu="recruit"],[data-menu="draw"],[data-menu="trialDraw"])) #dialogTag {
  padding:2px 7px;color:var(--print-ink);background:var(--print-paper);border-bottom:0;
}
.veil:not(:is([data-menu="recruit"],[data-menu="draw"],[data-menu="trialDraw"])) #dialogTitle {
  border-bottom:2px solid #caa492;padding-bottom:5px;letter-spacing:.01em;
}
.veil:is([data-menu="bossVictory"],[data-menu="riftVictory"]) .dialog #dialogTag {background:var(--seal);}
.victory-portrait {border:2px solid var(--print-paper);}
@media(min-width:721px) and (min-height:620px) {
  .sortie-menu {justify-content:center;gap:clamp(10px,2vh,20px);}
  .fighter-slot {min-height:clamp(100px,18vh,156px);}
  .sortie-tools button {min-height:clamp(64px,10vh,89px);align-content:center;}
}
@media(max-width:720px) {
  .soul-station {padding-bottom:max(9px,env(safe-area-inset-bottom));}
  .station-mast {padding-block:7px;}
  .station-mast h1 {line-height:.84;}
  .station-mast::after {width:25%;right:14%;}
  .scene-deck {box-shadow:2px 2px var(--print-ink);}
  .station-deck {gap:9px;}
  .scene-window #cover {object-position:62% 65%;}
  .scene-window #coverStrike {left:-45%;width:208%;height:113%;top:2%;}
  .sortie-menu {gap:8px;}
  .sortie-start {min-height:50px;}
  .shop-counter>div {margin-block:5px;padding:5px 7px;}
}
@media(max-height:620px) and (max-width:720px) {
  .scene-window {height:clamp(95px,21vh,135px);}
  .sortie-menu,.station-home {gap:6px;}
  .scene-caption {min-height:46px;}
}
@media(orientation:landscape) and (max-height:500px) {
  .station-mast {padding-block:3px;}
  .sortie-menu {gap:5px;}
  .scene-window {height:auto;}
}
