/* RNA Hero, 1-bit Macintosh skin (kit KIT_VERSION 1.0.0). Flat black and white, hard edges, dithered water.
   Game layout only; tokens and chrome come from kit/retro.css. */
:root{
  color-scheme:light;
  --bg:#fff; --ink:#000; --dim:#000; --edge:#000;
  --pl-font:var(--body); --pl-topbar-bg:#fff; --pl-topbar-text:#000; --pl-control-text:#000; --pl-control-bg:#fff; --pl-control-border:#000;
  --pl-focus:#000; --pl-overlay:rgb(0 0 0 / .55); --pl-card-bg:#fff; --pl-card-text:#000; --pl-card-muted:#000; --pl-card-border:#000;
  --pl-primary:#000; --pl-primary-text:#fff; --pl-shadow:#000; --pl-radius-control:8px; --pl-radius-card:0; --pl-radius-picture:0;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{margin:0;height:100%;overscroll-behavior:none;user-select:none;-webkit-user-select:none}
body{overflow:hidden;font:15px/1.4 var(--body);-webkit-font-smoothing:none;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1'/%3E%3Crect x='1' y='1' width='1' height='1'/%3E%3C/svg%3E") 0 0 / 2px 2px}
button{font-family:inherit}
[data-pl="topbar"]{display:none}
#app{display:flex;flex-direction:column;height:100vh;height:100svh;max-width:620px;margin-inline:auto;
  padding:0 max(0px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(0px,env(safe-area-inset-left))}
.hide{display:none!important}

/* menu bar */
.menubar{display:flex;align-items:center;gap:2px;height:46px;flex:none;background:#fff;border-bottom:2px solid #000;padding:0 6px}
.menubar .m{min-height:44px;min-width:44px;padding:0 10px;display:flex;align-items:center;gap:8px;background:none;border:0;color:#000;font:700 20px/1 var(--body);cursor:pointer}
.menubar .brand{padding:0 10px 0 4px;margin-right:4px;border-right:2px solid #000}
.menubar .m:active,.menubar .m.open{background:#000;color:#fff}
.brand [data-px] svg{height:auto}

/* the window */
.win{margin:10px 8px 0;display:flex;flex-direction:column;background:#fff;flex:1;min-height:0;border:1px solid #000;box-shadow:2px 2px 0 #000}
.win>.title{display:flex;align-items:center;justify-content:center;position:relative;height:22px;flex:none;border-bottom:1px solid #000;
  background:repeating-linear-gradient(#fff 0 2px,#000 2px 3px);background-clip:content-box;padding:6px 4px;font-size:18px;font-weight:700}
.win>.title span{background:#fff;padding:0 8px;max-width:calc(100% - 44px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.win>.title i{position:absolute;left:10px;top:5px;width:12px;height:12px;border:1px solid #000;background:#fff}
.goalrow{padding:8px 12px 2px;font:700 18px/1.25 var(--body);min-height:36px;flex:none}
.goalrow.bad{text-decoration:underline}
.load{display:flex;align-items:center;gap:10px;padding:2px 12px 8px;flex:none;min-height:26px}
#loadNum{display:inline-flex;align-items:center;min-width:70px;color:#000}
.meter{flex:1;height:18px;border:1px solid #000;position:relative}
.meter i{position:absolute;left:0;top:0;bottom:0;background:#000;width:0}
.meter b{position:absolute;top:-4px;bottom:-4px;right:-1px;width:2px;background:#000}
.meter.ready{box-shadow:0 0 0 2px #fff,0 0 0 4px #000}
.scene{display:block;width:100%;flex:1;min-height:200px;border-top:1px solid #000;border-bottom:1px solid #000;touch-action:none;cursor:grab;background:#fff}
.scene.grabbing{cursor:grabbing}
.legend{display:flex;gap:10px;justify-content:center;padding:6px 4px 2px;font:400 18px/1 var(--body);flex:none;flex-wrap:nowrap}
.legend span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.legend b{font-weight:400;white-space:pre;margin-left:-6px}
.legend svg{display:block}
.tools{display:flex;gap:10px;padding:6px 10px 10px;flex:none}
.tools .key{flex:1;height:48px;font-weight:700;white-space:nowrap;padding:0 4px;font-size:20px}
.tools #driveBtn{flex:1.4}
.key{min-height:44px;min-width:44px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#fff;color:#000;border:2px solid #000;border-radius:8px;cursor:pointer;font:700 15px/1 var(--body);touch-action:manipulation}
.key:active{background:#000;color:#fff}
.key[disabled]{opacity:1;color:#000;border-style:dashed;cursor:default;background:#fff}
.key.default{box-shadow:0 0 0 2px #fff,0 0 0 5px #000}
.key.ready{box-shadow:0 0 0 2px #fff,0 0 0 5px #000;animation:readyBlink 1.1s steps(2) infinite}
#driveBtn[disabled]{color:rgb(0 0 0 / .45);border-color:rgb(0 0 0 / .45)}
@keyframes readyBlink{50%{box-shadow:0 0 0 2px #fff,0 0 0 7px #000}}
.key:focus-visible,.menubar .m:focus-visible{outline:3px solid #000;outline-offset:2px}
@media (prefers-reduced-motion: reduce){.key.ready{animation:none}}
@media (max-height:640px){
  .win{margin-top:6px}
  .goalrow{padding-top:4px;min-height:30px;font-size:18px}
  .load{padding-bottom:4px}
  .tools{padding:4px 8px 8px}.tools .key{height:46px}
}
@media (max-width:359px){.menubar .m{padding:0 7px;font-size:18px}.tools{gap:6px}.tools .key{font-size:18px}.legend{gap:8px}.legend b{display:none}}

/* overlay windows: strands menu, help, result */
.over-screen{position:fixed;inset:46px 0 0 0;z-index:30;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1'/%3E%3Crect x='1' y='1' width='1' height='1'/%3E%3C/svg%3E") 0 0 / 2px 2px;overflow-y:auto;
  padding:0 0 max(16px,env(safe-area-inset-bottom))}
.over-screen .in{max-width:560px;margin:0 auto}
.sheetwin{margin:10px 8px;background:#fff;border:1px solid #000;box-shadow:2px 2px 0 #000;padding:0 0 12px}
.sheetwin>.title{display:flex;align-items:center;justify-content:center;position:relative;height:22px;border-bottom:1px solid #000;margin-bottom:10px;
  background:repeating-linear-gradient(#fff 0 2px,#000 2px 3px);background-clip:content-box;padding:6px 4px;font-size:13px;font-weight:700}
.sheetwin>.title span{background:#fff;padding:0 8px}
.sheetwin>.title i{position:absolute;left:10px;top:5px;width:12px;height:12px;border:1px solid #000;background:#fff}
.sheetwin .body{padding:0 12px;display:flex;flex-direction:column;gap:8px}
.sheetwin h3{margin:10px 0 0;font:700 13px/1.2 var(--body);letter-spacing:.06em;text-transform:uppercase}
.sheetwin p{margin:2px 0;font-size:15px;line-height:1.5}
.sheetwin a{color:#000;text-decoration:underline}
.sheetwin details{border-top:1px solid #000;padding-top:6px;margin-top:6px}
.sheetwin summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:700}
.list{display:grid;grid-template-columns:1fr;gap:8px}
.list .key{justify-content:space-between;text-align:left;width:100%}
.list .key small{font-weight:400;font-size:13px}
.list .key.done::after{content:"done";font-weight:400;font-size:13px}
.row{display:flex;gap:8px;flex-wrap:wrap}.row .key{flex:1;min-width:8.5rem}
.toggle{display:flex;gap:8px}.toggle .key{flex:1}.toggle .key.on{background:#000;color:#fff}
.credit{font-size:13px;margin:8px 0 0}
.credit a{display:inline-flex;align-items:center;min-height:44px}

/* result: a fan-fold printout */
.printout{position:relative;background:#fff;color:#000;padding:10px 28px 14px;font:14px/20px var(--body);border:1px solid #000;
  background-image:repeating-linear-gradient(#fff 0 40px,#e6e6e6 40px 80px)}
.printout::before,.printout::after{content:"";position:absolute;top:0;bottom:0;width:22px;background:radial-gradient(circle at 11px 10px,#fff 0 4px,transparent 4.5px) 0 0 / 22px 20px}
.printout::before{left:0;border-right:1px dashed #000}.printout::after{right:0;border-left:1px dashed #000}
.printout .p-brand{display:flex;align-items:center;gap:8px}
.printout hr{border:0;border-top:2px dashed #000;margin:8px 0;height:0}
.printout .big{font:400 40px/1 var(--term)}
.printout h3{font:700 13px/1.3 var(--body);letter-spacing:.04em;margin:10px 0 2px;text-transform:uppercase}
.printout svg.fold{display:block;width:100%;height:auto;max-height:260px;background:#fff;border:1px solid #000}
#shareLine{overflow-wrap:anywhere;word-break:break-word;border:2px dashed #000;padding:6px 8px;font:14px/1.35 var(--body);white-space:pre-wrap;user-select:text;-webkit-user-select:text;margin-top:8px;background:#fff}
.sheetbtns{display:flex;gap:8px;flex-wrap:wrap;margin:10px 8px 0}.sheetbtns .key{flex:1;min-width:8.5rem}
@media (max-width:359px){.printout{padding:10px 16px 12px}.printout .big{font-size:34px}
  .printout::before,.printout::after{width:12px;background:radial-gradient(circle at 6px 10px,#fff 0 3px,transparent 3.5px) 0 0 / 12px 20px}}
.enlrow{margin-top:6px}.enlrow .key{display:flex;width:100%;min-height:44px;font-size:20px}
.enlarged{display:flex;flex-direction:column;gap:8px;flex:1 1 auto;min-height:0}
.enlscroll{flex:1 1 auto;min-height:120px;max-height:60svh;overflow:auto;touch-action:pan-x pan-y;border:1px solid #000;background:#fff;-webkit-overflow-scrolling:touch}
.enlscroll svg{display:block;max-width:none}
.enlarged .key{flex:none;font-size:20px}
#sheet.enl .printout{display:none}

/* how-to pager: bigger deck pictures, square card */
[data-pl="howto-card"]{border:2px solid #000;border-radius:0;box-shadow:4px 4px 0 #000;font-family:var(--body)}
[data-pl="howto-card"] h2{font:700 20px/1.1 var(--body)}
[data-pl="howto-pictures"] svg,[data-pl="howto-pictures"] img{width:min(calc(100vw - 80px),300px)!important;height:auto!important;min-height:0!important;border:1px solid #000;border-radius:0;background:#fff}
[data-pl="howto-lines"]{font:700 16px/1.4 var(--body);color:#000}
[data-pl="howto-pager"] button,.pl-howto-footer button{border:2px solid #000;border-radius:8px;background:#fff;color:#000;font:700 15px/1 var(--body)}
.pl-howto-footer .pl-howto-start{background:#000;color:#fff}
.hide-honest{display:none}

[data-pl="howto-credit"]{margin:0 0 10px!important}

/* result sheet: the printout scrolls inside the window, the buttons stay pinned at its bottom edge */
#sheet:not(.hide){display:flex;overflow:hidden;padding-bottom:max(8px,env(safe-area-inset-bottom))}
#sheet .in{display:flex;flex-direction:column;width:100%;min-height:0}
#sheet .sheetwin{display:flex;flex-direction:column;min-height:0;flex:0 1 auto;margin-bottom:0;padding-bottom:10px}
#sheet .sheetwin>.body{min-height:0;flex:0 1 auto}
#sheet .printout{min-height:0;flex:0 1 auto;overflow-y:auto;overscroll-behavior:contain}
#sheet .toggle,#sheet .sheetbtns{flex:none}
#sheet .sheetbtns{margin:0}
