/* nikoladenic.dev/play: a desk at night (play.js draws it in ASCII), and on its old CRT a Linux desktop with a browser.
   The screen is real HTML laid exactly over the monitor's glass. */
/* the night itself is the page's background, the same as on the other pages, so nothing flashes between them */
html{height:100%;background:#04070f linear-gradient(#04070f,#16203a) fixed}
body{margin:0;height:100%;overflow:hidden;-webkit-font-smoothing:antialiased}
#scene{position:fixed;left:0;top:0;width:100%;height:100%;display:block;pointer-events:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.js .screen:not(.placed),.arriving .screen{visibility:hidden}

/* the tmux status line and the command line above it, as on the other pages */
.tmux{position:fixed;left:0;right:0;bottom:0;z-index:6;display:flex;align-items:center;gap:1ch;margin:0;box-sizing:border-box;
  height:calc(26px + env(safe-area-inset-bottom,0px));padding:0 max(12px,env(safe-area-inset-right)) env(safe-area-inset-bottom,0px) max(12px,env(safe-area-inset-left));
  font:500 12px/26px "IBM Plex Mono",ui-monospace,Menlo,monospace;color:#aea69c;background:rgba(6,9,16,.92);border-top:1px solid #1f2a40}
.tmux .sess{color:#7fbf7a;margin-right:.5ch}
.tmux .win{color:#aea69c;text-decoration:none;padding:0 .7ch;white-space:nowrap}
.tmux .win:hover{color:#ece5d4}
.tmux .win.on{background:#7fbf7a;color:#0b0d12}
.tmux .win:focus-visible{outline:2px solid #e2ad55;outline-offset:1px}
.tmux .clock{margin-left:auto;white-space:nowrap}
@media (max-width:420px){.tmux .date{display:none}}
.cmdline{position:fixed;z-index:6;left:max(20px,env(safe-area-inset-left));bottom:calc(env(safe-area-inset-bottom,0px) + 36px);margin:0;pointer-events:none;
  font:400 12px/18px "IBM Plex Mono",ui-monospace,Menlo,monospace;color:#7fbf7a;text-shadow:0 1px 10px #060a14,0 0 2px #060a14;white-space:pre}

/* the CRT's glass: dark, faintly green-lit, with scan lines and darker corners like a curved tube */
.screen{position:fixed;z-index:2;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;
  background:#0a0e12;color:#d9d1c1;font:400 13px/20px "IBM Plex Mono",ui-monospace,Menlo,monospace}
.screen::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:repeating-linear-gradient(rgba(0,0,0,.22) 0 1px,transparent 1px 3px),radial-gradient(ellipse at center,transparent 58%,rgba(0,0,0,.55) 100%)}
/* the desktop's top bar */
.topbar{display:flex;gap:2ch;align-items:center;padding:0 1.2ch;height:22px;flex:none;background:#151b23;color:#aea69c;font-size:12px;line-height:22px;white-space:nowrap}
.topbar .sclock{margin-left:auto;color:#ece5d4}
/* the browser window, framed in ASCII like every window on the site */
.box{position:relative;box-sizing:border-box}
.box>canvas.frame{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none}
.desk{flex:1 1 auto;min-height:0;display:flex;gap:12px;padding:10px 12px 12px}
.browser{flex:1 1 auto;min-width:0;min-height:0;padding:22px 16px 16px;display:flex;flex-direction:column;background:#0d1218}
.toolbar{display:flex;gap:1.5ch;align-items:center;flex:none;margin:0 0 10px;padding:3px 1ch;background:#151b23;color:#aea69c;font-size:12px;line-height:18px;white-space:nowrap;overflow:hidden}
.url-form{flex:1;display:flex;min-width:0;margin:0}
.toolbar .url{flex:1;min-width:0;font:inherit;line-height:18px;color:#ece5d4;background:#0a0e12;border:0;border-radius:0;padding:0 1ch;text-overflow:ellipsis}
.toolbar .url:focus{outline:1px solid #e2ad55;outline-offset:0}
.toolbar .url[readonly]{cursor:default}
.toolbar .url[readonly]:focus{outline:0}
.viewport{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.page{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 6px;scrollbar-width:thin;scrollbar-color:#6b6158 transparent}
.page h1{margin:0 0 8px;font:400 clamp(1.6rem,2.6vw,2.2rem)/1.1 "Instrument Serif",Georgia,"Times New Roman",serif;color:#f7f5f0}
.page p{margin:0}
.page .lead{color:#aea69c;margin-bottom:16px;text-wrap:pretty}
.page .cmd{color:#d9d1c1;margin-top:10px}
.page .prompt{color:#7fbf7a;margin-right:.6ch}
.page .out{color:#ece5d4}
.page .credits{margin-top:28px;color:#6f7c8c;font-size:11px;line-height:16px}
.page .credits a{color:#aea69c;text-decoration:none;border-bottom:1px solid currentColor}
.page .credits a:focus-visible{outline:2px solid #e2ad55;outline-offset:2px}
.page .cursor{display:inline-block;color:#e2ad55;animation:caret 1s steps(2) infinite}
@keyframes caret{50%{opacity:0}}
@media (max-width:760px){.screen{font-size:12px;line-height:18px}.desk{padding:8px;gap:8px}.browser{padding:20px 10px 10px}}
@media (prefers-reduced-motion:reduce){.page .cursor{animation:none}}

/* ---------------- the game ---------------- */
/* zoomed in: the glass fills the tab (the transition is the camera moving into the screen) */
.screen{transition:left .5s cubic-bezier(.7,0,.25,1),top .5s cubic-bezier(.7,0,.25,1),width .5s cubic-bezier(.7,0,.25,1),height .5s cubic-bezier(.7,0,.25,1)}
.screen.zoomed{z-index:5}
@media (prefers-reduced-motion:reduce){.screen{transition:none}}
button{font:inherit;color:inherit}
.run{background:none;border:0;padding:0;color:#e2ad55;cursor:pointer;border-bottom:1px solid currentColor}
.run:hover{color:#f3c776}
.run:focus-visible,.tb-btn:focus-visible,.opt:focus-visible,.dt-tabs button:focus-visible{outline:2px solid #e2ad55;outline-offset:2px}
.muted,.mu{color:#6f7c8c}
.topbar .xp{color:#e2ad55}
.topbar .xp.bump{animation:bump .5s}
@keyframes bump{30%{color:#fff3d6;text-shadow:0 0 8px #e2ad55}}
.tb-btn{background:#0a0e12;border:1px solid #3a4553;color:#ece5d4;padding:0 1ch;line-height:16px;cursor:pointer;flex:none}
.tb-btn:hover,.tb-btn.on{border-color:#e2ad55;color:#e2ad55}
.tb-btn.reload{border:0;background:none;padding:0;color:#aea69c}
.tb-btn.reload:hover{color:#e2ad55}
.tb-btn.reload:disabled{color:#3a4553;cursor:default}
.page.flash{animation:flash .4s}
@keyframes flash{15%{filter:brightness(1.9) saturate(.4)}}
.toolbar .url.loading{color:#6f7c8c}
.q-help{margin:0 0 10px;padding-left:3ch;color:#aea69c}
.q-help li{margin-bottom:2px}
.tb-btn.hint{animation:hint 1s steps(2) 4}
@keyframes hint{50%{border-color:#e2ad55;color:#e2ad55}}
/* the quests window, beside the browser */
.quests{flex:0 0 300px;min-height:0;padding:22px 16px 16px;background:#0d1218;overflow:hidden}
.q-inner{height:100%;overflow-y:auto;font-size:12px;line-height:18px;scrollbar-width:thin;scrollbar-color:#6b6158 transparent}
.q-h{margin:0 0 6px;color:#7fbf7a}
.q-spec,.q-list{list-style:none;margin:0 0 14px;padding:0}
.q-spec li{padding-left:2ch;text-indent:-2ch;color:#d9d1c1}
.q-spec li::before{content:"- ";color:#6f7c8c}
.q-list li{padding-left:4ch;text-indent:-4ch;color:#d9d1c1;margin-bottom:4px}
.q-list li.ok{color:#7fbf7a}
.bug-btn{display:inline-block;margin:4px 0 8px}
.bug-btn.on{color:#0b0d12;background:#e2ad55;border:0;padding:0 .6ch}
.toast{min-height:36px;margin:0;color:#e2ad55}
@media (max-width:760px){.zoomed .desk{flex-direction:column}.quests{flex:0 0 auto;max-height:32%}}
/* bug mode: whatever you point at can be reported */
.bugmode .page,.bugmode .dt-body{cursor:crosshair}
.bugmode .lv *:hover,.bugmode .dt-row:hover{outline:1px dashed #e2ad55;outline-offset:1px}
/* the question about a bug */
.modal{position:absolute;inset:0;z-index:4;display:grid;place-items:center;background:rgba(5,8,11,.72)}
.modal[hidden]{display:none}
.modal-box{width:min(460px,calc(100% - 32px));padding:18px 20px;background:#0d1218;border:1px dashed #6f7c8c;font-size:13px;line-height:20px}
.modal-box p{margin:0 0 10px}
.opts{display:flex;flex-direction:column;gap:6px;margin:0 0 10px}
.opt{text-align:left;background:#0a0e12;border:1px solid #3a4553;padding:6px 10px;cursor:pointer}
.opt:hover{border-color:#e2ad55}
.opt:disabled{opacity:.45;cursor:default;text-decoration:line-through}
.ok-t{color:#7fbf7a}
/* hidden checks: found ones shine */
.gem,.q-h.gem{color:#7fc8d6}
.gem-t{color:#d6eef2}
.q-list li.gems{padding-left:0;text-indent:0;margin-top:8px}
/* the browser's DevTools, docked at the bottom like the real ones */
.devtools{flex:0 0 46%;min-height:0;display:flex;flex-direction:column;margin-top:8px;border-top:1px solid #3a4553;background:#0a0e12}
.devtools[hidden]{display:none}
.dt-tabs{display:flex;gap:2px;flex:none;background:#151b23;font-size:12px}
.dt-tabs button{background:none;border:0;padding:3px 1.2ch;color:#aea69c;cursor:pointer}
.dt-tabs button[aria-selected="true"]{color:#ece5d4;box-shadow:inset 0 -2px #e2ad55}
.dt-tablist{display:flex;gap:2px}
.dt-tabs .dt-close{margin-left:auto}
.dt-body:focus-visible,.q-inner:focus-visible{outline:2px solid #e2ad55;outline-offset:-2px}
.dt-body{flex:1 1 auto;min-height:0;overflow:auto;padding:4px 6px;font-size:12px;line-height:17px;scrollbar-width:thin;scrollbar-color:#6b6158 transparent}
.dt-row{white-space:pre-wrap;word-break:break-all;cursor:pointer}
.dt-row:hover{background:#151b23}
.dt-row.sel{background:#1d2a38}
.dt-row .tg{color:#7fbf7a}.dt-row .at,.dt-detail b{color:#aea69c;font-weight:400}.av{color:#e2ad55}.dt-row .tx{color:#ece5d4}
.dt-row.end{cursor:default}
.dt-row.con.error{color:#ff8f86;background:rgba(255,80,70,.07)}
.dt-row.con.warn{color:#f3c776}
.dt-row.net{display:grid;grid-template-columns:7ch 1fr 9ch 7ch;gap:1ch;white-space:nowrap}
.dt-row.net .nm{overflow:hidden;text-overflow:ellipsis}
.dt-row.net.head{color:#6f7c8c;cursor:default;background:none}
.dt-row.net.bad{color:#ff8f86}
.dt-row.kv{display:grid;grid-template-columns:14ch 1fr;gap:1ch}
.dt-detail{margin-top:8px;padding-top:6px;border-top:1px solid #253040;word-break:break-all}
.dt-detail pre{margin:2px 0 0;white-space:pre-wrap;color:#ece5d4}
.dt-h{margin:4px 0;color:#7fbf7a}
.dt-empty{margin:4px 0;color:#6f7c8c}
/* the level's app: a plain light web page inside the dark desktop, as real sites are */
.lv{display:flex;gap:24px;align-items:flex-start;flex-wrap:wrap;padding:18px;min-height:100%;box-sizing:border-box;background:#eef1f5;color:#1d2530;font:14px/20px system-ui,-apple-system,"Segoe UI",sans-serif}
.lv-form{display:flex;flex-direction:column;gap:6px;width:min(300px,100%);padding:20px;background:#fff;border:1px solid #d5dbe3;border-radius:6px}
.lv-form h2{margin:0 0 8px;font-size:20px}
.lv-form label{font-size:13px;color:#4a5566}
.lv-form input{padding:7px 9px;border:1px solid #b9c2ce;border-radius:4px;font:inherit;color:inherit;background:#fff}
.lv-form button{margin-top:6px;padding:8px;border:0;border-radius:4px;background:#2d6cdf;color:#fff;font:inherit;cursor:pointer}
.lv-form button:disabled{opacity:.6}
.lv-err{min-height:20px;margin:0;color:#c0392b;font-size:13px}
.lv-note{padding:12px 14px;background:#fff6a8;color:#3d3a1f;font:13px/18px "IBM Plex Mono",monospace;transform:rotate(-2deg);box-shadow:0 2px 0 rgba(0,0,0,.08)}
.dt-hl{outline:2px solid #e2ad55!important;outline-offset:2px}
/* inside the game the scan lines stay, but softer: over a white web page full ones are too much */
.screen.zoomed::after{opacity:.4}
/* level 2: the shop */
.lv-shop{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:16px;align-items:start;align-content:start}
.lv-top{grid-column:1/-1;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:8px 12px;background:#fff;border:1px solid #d5dbe3;border-radius:6px}
.lv-link{background:none;border:0;padding:0;color:#2d6cdf;text-decoration:underline;cursor:pointer;font:inherit}
.lv-products,.lv-cart{display:flex;flex-direction:column;gap:8px;padding:14px;background:#fff;border:1px solid #d5dbe3;border-radius:6px}
.lv-cart h2{margin:0 0 4px;font-size:18px}
.lv-prod{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center}
.lv-prod button,.lv-cart>button,.lv-code button{padding:5px 10px;border:0;border-radius:4px;background:#2d6cdf;color:#fff;font:inherit;cursor:pointer}
.lv-line{display:grid;grid-template-columns:1fr 64px 72px auto;gap:8px;align-items:center}
.lv-line .qty,.lv-code input{padding:4px 6px;border:1px solid #b9c2ce;border-radius:4px;font:inherit;color:inherit;background:#fff;min-width:0}
.lv-code{display:flex;gap:6px;margin:6px 0}
.lv-code input{flex:1}
.lv-sum{display:flex;justify-content:space-between;color:#4a5566}
.lv-sum.total{color:#1d2530;font-weight:600;border-top:1px solid #d5dbe3;padding-top:6px}
.lv-msg{margin:0;min-height:20px;color:#4a5566;font-size:13px}
@media (max-width:760px){.lv-shop{grid-template-columns:1fr}}
/* level 3: the team's board, and the bug ticket */
.lv-board{flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:12px}
.lv-board .lv-top{align-items:center}
.lv-tools{display:flex;gap:8px;flex-wrap:wrap}
.lv-tools input{padding:4px 8px;border:1px solid #b9c2ce;border-radius:4px;font:inherit;color:inherit;background:#fff;min-width:0;width:180px}
.lv-btn{padding:5px 10px;border:0;border-radius:4px;background:#2d6cdf;color:#fff;font:inherit;cursor:pointer}
.lv-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;align-items:start}
.lv-col{display:flex;flex-direction:column;gap:6px;padding:8px;background:#e1e6ee;border-radius:6px;min-height:80px}
.lv-col h3{margin:0 0 2px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#4a5566}
.lv-col h3 span{color:#8792a2}
.lv-card{display:flex;flex-direction:column;gap:2px;text-align:left;padding:8px 10px;background:#fff;border:1px solid #d5dbe3;border-radius:4px;font:inherit;font-size:13px;line-height:18px;color:inherit;cursor:pointer}
.lv-card:hover{border-color:#2d6cdf}
.lv-card .k{font-size:11px;color:#6b7686}
.lv-card.mine{box-shadow:inset 3px 0 #e2ad55}
.lv-card.new{box-shadow:inset 3px 0 #c0392b}
.lv-detail{padding:14px;background:#fff;border:1px solid #d5dbe3;border-radius:6px}
.lv-detail h2{margin:0 0 6px;font-size:16px}
.lv-detail p{margin:0 0 8px;white-space:pre-line}
.lv-env{font-size:12px;color:#6b7686}
.lv-form.lv-ticket{width:min(640px,100%);box-sizing:border-box;align-self:flex-start}
.lv-ticket input,.lv-ticket textarea,.lv-ticket select{box-sizing:border-box;max-width:100%}
.lv-ticket textarea,.lv-ticket select{padding:7px 9px;border:1px solid #b9c2ce;border-radius:4px;font:inherit;color:inherit;background:#fff;resize:vertical}
.lv-ev{margin:6px 0 0;padding:8px 10px;border:1px solid #d5dbe3;border-radius:4px;display:flex;flex-direction:column;gap:6px}
.lv-ev legend{font-size:13px;color:#4a5566;padding:0 4px}
.lv-shot{display:flex;gap:8px;align-items:center;font-size:13px;color:#1d2530}
.lv-thumb{padding:2px 6px;background:#1d2530;color:#eef1f5;border-radius:3px;font:12px "IBM Plex Mono",monospace}
.lv-actions{display:flex;gap:14px;align-items:center}
.lv-form button.lv-link{margin:0;padding:0;background:none;color:#2d6cdf}
.lv-review{font-size:13px}
.lv-review ul{list-style:none;margin:0 0 6px;padding:0;display:flex;flex-direction:column;gap:4px}
.lv-review li.ok{color:#2c7a3f}
.lv-review li.no{color:#b03a2e}
.lv-rh{margin:6px 0 4px;font-weight:600}
/* level 4: the test cases */
.lv-btn:disabled{opacity:.5;cursor:default}
.lv-story{margin:0;font-size:13px;color:#4a5566}
.lv-chip{padding:1px 6px;border-radius:3px;background:#e1e6ee;color:#4a5566;font-size:11px;font-weight:500;vertical-align:middle}
.lv-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}
.lv-cover{padding:8px 12px;background:#fff;border:1px solid #d5dbe3;border-radius:6px;font-size:13px}
.lv-cover h3{margin:0 0 2px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#4a5566}
.lv-cover ul{list-style:none;margin:0 0 6px;padding:0;display:flex;flex-direction:column;gap:2px}
.lv-cover li.ok{color:#2c7a3f}
.cv-rule{margin:6px 0 2px;font-weight:600}
.cv-near{display:block;margin-left:4ch;color:#9a6a12}
.lv-rows{display:flex;flex-direction:column;gap:6px}
.lv-ev>.lv-link{align-self:flex-start}
.lv-row{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.8fr) minmax(0,1.3fr) auto;gap:6px;align-items:center}
.lv-row input{min-width:0}
.lv-run{padding:12px 14px;background:#1d2530;color:#dfe5ec;border-radius:6px;font:12.5px/19px "IBM Plex Mono",monospace;overflow-wrap:anywhere}
.lv-run p{margin:0}
.lv-run .row{padding-left:2ch}
.lv-run .ok{color:#7fd18b}
.lv-run .no{color:#ff8f86}
.lv-run .rh{margin-bottom:4px;color:#8fa0b3}
.lv-run .sum{margin-top:8px}
.lv-run .note{margin-top:6px;font:13px/19px system-ui,-apple-system,"Segoe UI",sans-serif;color:#dfe5ec}
@media (max-width:760px){.lv-split{grid-template-columns:1fr}.lv-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.lv-row [name=exp]{grid-column:1}.lv-row .lv-link{justify-self:start}.lv-row{padding-bottom:6px;border-bottom:1px solid #e1e6ee}}
