/* Paperwork City: pixel-crisp game UI in the Hire the Robots palette (charcoal, teal, amber, cream). */
@font-face { font-family: "Pixelify"; font-weight: 500; font-display: block; src: url(fonts/pixelify-500.woff2) format("woff2"); }
@font-face { font-family: "Pixelify"; font-weight: 700; font-display: block; src: url(fonts/pixelify-700.woff2) format("woff2"); }
@font-face { font-family: "Silkscreen"; font-weight: 400; font-display: block; src: url(fonts/silkscreen-400.woff2) format("woff2"); }
@font-face { font-family: "Silkscreen"; font-weight: 700; font-display: block; src: url(fonts/silkscreen-700.woff2) format("woff2"); }
@font-face { font-family: "Satoshi"; font-weight: 500; font-display: swap; src: url(fonts/satoshi-500.woff2) format("woff2"); }
@font-face { font-family: "Satoshi"; font-weight: 700; font-display: swap; src: url(fonts/satoshi-700.woff2) format("woff2"); }
@font-face { font-family: "Cabinet Grotesk"; font-weight: 800; font-display: swap; src: url(fonts/cabinet-grotesk-800.woff2) format("woff2"); }

:root {
  --ink: #0c0f13; --panel: #131922; --panel2: #1b2330; --cream: #f6f1e3; --soft: #cbd5e1; --muted: #8fa0b3;
  --teal: #2ee6d6; --amber: #ffb454; --pink: #ff8fb8; --red: #e25b4a; --green: #5fd38d;
  --px: "Pixelify", "Silkscreen", ui-monospace, monospace; --body: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--cream); font-family: var(--px); font-variant-ligatures: none; }
html { touch-action: manipulation; }
body { touch-action: none; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button, a, .lbl, #dialog, #choices, #hud, #cardview { touch-action: manipulation; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- HUD */
#hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(10px + var(--safe-t)) 12px 0; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 20; }
.hud-r { display: flex; gap: 8px; }
.hbtn { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 4px; background: rgba(19, 25, 34, 0.88); color: var(--cream); text-decoration: none; font: 700 15px/1 var(--px); letter-spacing: 0.02em;
  border: 2px solid #f3e7cd; box-shadow: 0 0 0 2px #0c0f13, inset 0 0 0 2px rgba(46, 230, 214, 0.35); cursor: pointer; }
.hbtn:hover, .hbtn:focus-visible { border-color: var(--teal); outline: none; }
.hbtn svg { width: 18px; height: 18px; }
.hbtn.icon { width: 40px; justify-content: center; padding: 0; }
.hbtn.back span { font-size: 22px; margin-top: -3px; }
.hbtn.dex b { color: var(--amber); font-size: 16px; }
.hbtn.dex span { color: var(--muted); margin-left: -4px; }
#mutebtn .off { display: none; } #mutebtn.muted .on { display: none; } #mutebtn.muted .off { display: block; }
@media (max-width: 560px) { .hbtn.back em { display: none; } }

/* ---- the opening title banner */
#title { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); text-align: center; pointer-events: none; z-index: 15; transition: opacity 0.6s, transform 0.6s; }
#title.gone { opacity: 0; transform: translate(-50%, -16px); }
#title h1 { margin: 2px 0 0; font: 700 clamp(30px, 6vw, 58px)/1 var(--px); letter-spacing: 0.04em; color: var(--cream);
  text-shadow: 3px 3px 0 #0c0f13, -2px -2px 0 #0c0f13, 2px -2px 0 #0c0f13, -2px 2px 0 #0c0f13, 0 6px 0 rgba(12, 15, 19, 0.35); }
#title .t-kicker { display: inline-block; padding: 4px 10px; background: var(--teal); color: #0c0f13; font: 700 13px/1 var(--px); letter-spacing: 0.08em; text-transform: uppercase; box-shadow: 0 0 0 2px #0c0f13; }

/* ---- world-anchored labels and bubbles */
#labels, #bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.lbl { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; text-align: center; transition: opacity 0.4s; white-space: nowrap; border: 0; background: none; padding: 0; }
.lbl .plate { display: inline-block; padding: 5px 9px 6px; background: #f6f1e3; color: #1d232c; font: 700 14px/1.05 var(--px); box-shadow: 0 0 0 2px #1d232c, 3px 3px 0 2px rgba(12, 15, 19, 0.45); }
.lbl .plate small { display: block; font: 500 11px/1.2 var(--px); color: #5a6372; margin-top: 2px; }
.lbl .stem { display: block; width: 3px; height: 14px; margin: 0 auto; background: #1d232c; }
.lbl.done .plate { background: #c8f5df; } .lbl.done .plate::after { content: " ✓"; color: #1f8f59; }
.lbl.minor .plate { background: rgba(246, 241, 227, 0.8); font-size: 12px; }
.lbl.minor { pointer-events: none; }
.lbl:hover .plate, .lbl:focus-visible .plate { background: var(--amber); outline: none; }
.lbl.hide { opacity: 0; pointer-events: none; }
@media (max-width: 560px) { .lbl .plate { font-size: 12px; padding: 4px 7px 5px; } .lbl .plate small { display: none; } }

.clickme { position: absolute; transform: translate(-50%, -100%); text-align: center; animation: bob 0.9s ease-in-out infinite; }
.clickme b { display: inline-block; padding: 6px 10px; background: var(--amber); color: #0c0f13; font: 700 16px/1 var(--px); box-shadow: 0 0 0 2px #0c0f13, 3px 3px 0 2px rgba(12, 15, 19, 0.4); }
.clickme i { display: block; width: 0; height: 0; margin: 2px auto 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 16px solid var(--amber); filter: drop-shadow(0 2px 0 #0c0f13); }
@keyframes bob { 50% { transform: translate(-50%, calc(-100% - 8px)); } }
.bang { position: absolute; transform: translate(-50%, -100%); width: 30px; height: 34px; background: #fff; color: #e25b4a; font: 700 24px/30px var(--px); text-align: center; box-shadow: 0 0 0 2px #1d232c; animation: pop 0.3s steps(3) both; }
.bang::after { content: ""; position: absolute; left: 10px; bottom: -8px; border: 5px solid transparent; border-top: 6px solid #fff; }
.bang.talk { color: #1d232c; font-size: 16px; width: 34px; }
@keyframes pop { from { transform: translate(-50%, -100%) scale(0.2); } to { transform: translate(-50%, -100%) scale(1); } }

#hint { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); padding: 7px 12px; background: rgba(19, 25, 34, 0.86); color: var(--cream); font: 500 14px/1.2 var(--px); box-shadow: 0 0 0 2px #f3e7cd; z-index: 12; opacity: 0; transition: opacity 0.4s; pointer-events: none; text-align: center; max-width: 92vw; }
#hint.on { opacity: 1; }

/* ---- the RPG dialogue box */
#dialog { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(760px, calc(100vw - 20px)); min-height: 118px; padding: 20px 22px 18px; z-index: 30;
  background: rgba(15, 20, 28, 0.94); border: 3px solid #f3e7cd; box-shadow: 0 0 0 3px #0c0f13, inset 0 0 0 3px #1d2735, inset 0 0 0 5px rgba(46, 230, 214, 0.55), 0 10px 0 rgba(12, 15, 19, 0.35); cursor: pointer; }
#dialog .d-name { position: absolute; left: 16px; top: -16px; padding: 5px 10px; background: var(--amber); color: #0c0f13; font: 700 15px/1 var(--px); box-shadow: 0 0 0 2px #0c0f13; letter-spacing: 0.03em; }
#dialog .d-name.jarvis { background: var(--teal); }
#dialog .d-name small { font-weight: 500; opacity: 0.75; margin-left: 6px; }
#dialog .d-text { font: 500 clamp(17px, 2.1vw, 22px)/1.42 var(--px); color: var(--cream); min-height: 2.8em; }
#dialog .d-next { position: absolute; right: 16px; bottom: 8px; color: var(--teal); font-size: 14px; animation: blink 0.8s steps(2) infinite; }
#dialog.typing .d-next, #dialog.choosing .d-next { visibility: hidden; }
@keyframes blink { 50% { opacity: 0; } }
#dialog .d-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#dialog .d-choices:empty { display: none; }
.choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; background: #1b2330; color: var(--cream); border: 2px solid #3a4658; font: 500 clamp(15px, 1.9vw, 19px)/1.3 var(--px); cursor: pointer; }
.choice::before { content: "▶"; color: transparent; font-size: 12px; }
.choice:hover, .choice:focus-visible, .choice.sel { border-color: var(--teal); background: #222c3b; outline: none; }
.choice:hover::before, .choice:focus-visible::before, .choice.sel::before { color: var(--teal); }
.choice.htr { background: linear-gradient(180deg, #ffc06a, #f0a03a); color: #0c0f13; border-color: #0c0f13; font-weight: 700; letter-spacing: 0.06em; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.choice.htr::before { content: ""; width: 22px; height: 22px; flex: 0 0 22px; background: url(img/robot-head.svg) center/contain no-repeat; }
.choice.htr:hover, .choice.htr.sel { border-color: #fff; background: linear-gradient(180deg, #ffd08a, #ffb454); }
.choice .k { margin-left: auto; font-size: 12px; opacity: 0.55; }
@media (max-width: 560px) { #dialog { padding: 18px 14px 14px; min-height: 104px; } }

/* ---- the collectible card */
#cardview { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, rgba(46, 230, 214, 0.18), rgba(12, 15, 19, 0.88) 60%); perspective: 1200px; padding: 16px; }
.cv-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cv-kicker { font: 700 15px/1 var(--px); color: var(--amber); letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 2px 2px 0 #0c0f13; }
.card3d { position: relative; width: min(320px, 78vw); aspect-ratio: 63 / 88; transform-style: preserve-3d; animation: cardIn 1.25s cubic-bezier(.2, .9, .2, 1) both; }
.card3d.noanim { animation: none; transform: rotateY(180deg); }
@keyframes cardIn { 0% { transform: translateY(40vh) scale(0.3) rotateY(0deg) rotateZ(-12deg); } 45% { transform: translateY(-4vh) scale(1.04) rotateY(0deg) rotateZ(3deg); } 75% { transform: translateY(0) scale(1) rotateY(200deg); } 100% { transform: rotateY(180deg); } }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; overflow: hidden; }
.card-back { background: repeating-linear-gradient(45deg, #1b2330 0 10px, #222c3b 10px 20px); border: 8px solid #f3e7cd; display: grid; place-items: center; box-shadow: 0 0 0 3px #0c0f13; }
.card-back img { width: 46%; image-rendering: pixelated; filter: drop-shadow(0 0 14px rgba(46, 230, 214, 0.6)); }
.card-front { transform: rotateY(180deg); background: var(--cc, #2ee6d6); padding: 9px; box-shadow: 0 0 0 3px #0c0f13, 0 18px 40px rgba(0, 0, 0, 0.5); }
.cf-in { height: 100%; display: flex; flex-direction: column; background: linear-gradient(180deg, #fbf7ec, #efe6d0); border-radius: 7px; padding: 8px 10px 9px; color: #1d232c; position: relative; overflow: hidden; }
.cf-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.cf-top h3 { margin: 0; font: 700 clamp(17px, 4.6vw, 21px)/1.05 var(--px); }
.cf-top .no { font: 700 11px/1 var(--px); color: #6b7280; }
.cf-art { margin-top: 6px; border: 3px solid #1d232c; border-radius: 3px; aspect-ratio: 4 / 3; background: #1d232c center/cover no-repeat; image-rendering: pixelated; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
.cf-type { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font: 700 11px/1 var(--px); text-transform: uppercase; letter-spacing: 0.06em; }
.cf-type .t { padding: 3px 6px; background: var(--cc); color: #0c0f13; box-shadow: 0 0 0 1.5px #1d232c; }
.cf-type .st { color: #1f6f4a; }
.cf-type .st.live::before { content: "● "; color: #1f9f59; }
.cf-type .st.custom { color: #6d4aa8; }
.cf-what { margin: 6px 0 0; font: 500 clamp(11.5px, 3.2vw, 12.5px)/1.28 var(--px); }
.cf-moves { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 2px solid rgba(29, 35, 44, 0.2); }
.cf-move { display: flex; align-items: center; gap: 7px; font: 700 clamp(11.5px, 3.1vw, 12.5px)/1.15 var(--px); }
.cf-move .ic { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 0 1.5px #1d232c; display: grid; place-items: center; font-size: 10px; color: #0c0f13; }
.cf-solves { margin-top: 5px; font: 500 10px/1.25 var(--px); color: #4b5563; }
.cf-solves b { color: #1d232c; }
.cf-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font: 500 9.5px/1.2 var(--px); color: #6b7280; }
.cf-foot img { height: 13px; }
.card-front .holo { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 45%, rgba(46, 230, 214, 0.35) 52%, rgba(255, 180, 84, 0.3) 58%, transparent 70%); background-size: 250% 100%; mix-blend-mode: soft-light; animation: shine 3.2s ease-in-out 1.1s infinite; }
@keyframes shine { 0% { background-position: 120% 0; } 60%, 100% { background-position: -40% 0; } }
.cv-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; opacity: 0; animation: fadeUp 0.4s ease 1.2s both; }
.cv-btns.now { animation-delay: 0s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pbtn { min-height: 46px; padding: 0 18px; font: 700 16px/1 var(--px); letter-spacing: 0.04em; cursor: pointer; border: 3px solid #0c0f13; box-shadow: 0 4px 0 #0c0f13; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.pbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0c0f13; }
.pbtn.amber { background: var(--amber); color: #0c0f13; }
.pbtn.teal { background: var(--teal); color: #0c0f13; }
.pbtn.ghost { background: #f6f1e3; color: #0c0f13; }
.pbtn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---- Learn More: a real product page, connected to the game */
#learn { position: fixed; inset: 0; z-index: 50; background: #0c0f13; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; -webkit-user-select: text; user-select: text; font-family: var(--body); color: var(--soft); }
.lm-top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: rgba(12, 15, 19, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(148, 163, 184, 0.15); }
.lm-top .pbtn { min-height: 40px; font-size: 14px; }
.lm-top .crumb { font: 700 13px/1.2 var(--px); color: var(--muted); letter-spacing: 0.04em; }
.lm { max-width: 760px; margin: 0 auto; padding: 26px 20px calc(60px + var(--safe-b)); }
.lm-hero { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; }
.lm-hero .mini { width: 150px; aspect-ratio: 4 / 3; border: 4px solid var(--cc); border-radius: 6px; background: #1d232c center/cover; image-rendering: pixelated; box-shadow: 0 0 0 3px #0c0f13; }
.lm-tag { display: inline-flex; gap: 8px; align-items: center; font: 700 13px/1 var(--px); color: var(--cc); letter-spacing: 0.06em; text-transform: uppercase; }
.lm-tag .st { color: var(--green); }
.lm h2 { margin: 8px 0 6px; font: 800 clamp(30px, 5vw, 44px)/1 "Cabinet Grotesk", var(--body); color: #f1f5f9; letter-spacing: -0.02em; }
.lm .lead { font: 500 clamp(18px, 2.3vw, 21px)/1.45 var(--body); color: var(--soft); margin: 0; }
.lm h3 { margin: 34px 0 10px; font: 700 14px/1 var(--px); color: var(--teal); letter-spacing: 0.08em; text-transform: uppercase; }
.lm p { font: 500 17px/1.6 var(--body); margin: 0 0 10px; }
.lm ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.lm ol li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 16px; background: #131922; border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 10px; font: 500 16px/1.5 var(--body); }
.lm ol li::before { content: counter(s); width: 30px; height: 30px; display: grid; place-items: center; background: var(--cc); color: #0c0f13; font: 700 15px/1 var(--px); border-radius: 6px; }
.lm ul.ex { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.lm ul.ex li { padding: 12px 14px 12px 40px; position: relative; background: #131922; border-left: 4px solid var(--amber); border-radius: 0 8px 8px 0; font: 500 16px/1.5 var(--body); }
.lm ul.ex li::before { content: "✓"; position: absolute; left: 14px; top: 12px; color: var(--amber); font-weight: 700; }
.lm .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.lm .links a { color: var(--teal); font: 700 16px/1.4 var(--body); }
.lm .cta { margin-top: 38px; padding: 22px; background: linear-gradient(135deg, #17202b, #141a23); border: 2px solid rgba(255, 180, 84, 0.45); border-radius: 14px; display: grid; gap: 14px; }
.lm .cta p { margin: 0; font: 700 20px/1.35 var(--body); color: #f1f5f9; }
.lm .cta .row { display: flex; gap: 10px; flex-wrap: wrap; }
.lm .note { margin-top: 18px; font: 500 13px/1.5 var(--body); color: var(--muted); }
@media (max-width: 560px) { .lm-hero { grid-template-columns: 1fr; } .lm-hero .mini { width: 100%; max-width: 280px; } }

/* ---- Robotdex */
#dex { position: fixed; inset: 0; z-index: 45; background: rgba(12, 15, 19, 0.9); overflow-y: auto; touch-action: pan-y; padding: calc(16px + var(--safe-t)) 16px calc(24px + var(--safe-b)); }
.dx { max-width: 820px; margin: 0 auto; }
.dx-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.dx-head h2 { margin: 0; font: 700 26px/1 var(--px); color: var(--cream); }
.dx-head h2 small { font-size: 15px; color: var(--amber); margin-left: 8px; }
.dx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dx-slot { aspect-ratio: 63 / 88; border-radius: 10px; border: 0; padding: 7px; background: var(--cc, #2b3442); cursor: pointer; text-align: left; color: #1d232c; box-shadow: 0 0 0 3px #0c0f13; display: flex; flex-direction: column; }
.dx-slot .in { flex: 1; background: #f6f1e3; border-radius: 5px; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.dx-slot .art { aspect-ratio: 4 / 3; background: #1d232c center/cover; border: 2px solid #1d232c; image-rendering: pixelated; }
.dx-slot b { font: 700 14px/1.1 var(--px); }
.dx-slot small { font: 500 11px/1.2 var(--px); color: #5a6372; }
.dx-slot.locked { background: #2b3442; cursor: default; }
.dx-slot.locked .in { background: #1b2330; color: #5a6372; align-items: center; justify-content: center; text-align: center; }
.dx-slot.locked .in b { font-size: 32px; color: #3a4658; }
.dx-extra { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: #131922; border: 2px solid #3a4658; font: 700 14px/1 var(--px); color: var(--muted); }
.badge.got { border-color: var(--amber); color: var(--cream); }

/* ---- You're hired! */
#hired { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(0.4); z-index: 35; pointer-events: none; opacity: 0; }
#hired span { display: inline-block; padding: 14px 22px; background: #fff; color: #0c0f13; font: 700 clamp(30px, 7vw, 60px)/1 var(--px); box-shadow: 0 0 0 4px #0c0f13, 8px 8px 0 4px rgba(12, 15, 19, 0.35); transform: rotate(-4deg); white-space: nowrap; }
#hired span::first-letter { color: var(--red); }
#hired.on { animation: hiredPop 2.4s cubic-bezier(.2, 1.4, .3, 1) both; }
@keyframes hiredPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(2deg); } 22% { transform: translate(-50%, -50%) scale(1); } 82% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -62%) scale(0.95); } }

#toast { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translate(-50%, -20px); z-index: 60; padding: 10px 14px; background: #f6f1e3; color: #0c0f13; font: 700 15px/1.2 var(--px); box-shadow: 0 0 0 3px #0c0f13, 4px 4px 0 3px rgba(12, 15, 19, 0.4); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; text-align: center; max-width: 92vw; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast b { color: #b26b00; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 34; image-rendering: pixelated; }
#fade { position: fixed; inset: 0; background: #0c0f13; opacity: 0; pointer-events: none; z-index: 70; transition: opacity 0.35s steps(5); }
#fade.on { opacity: 1; }
#loading { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: #0c0f13; transition: opacity 0.5s; }
#loading.done { opacity: 0; pointer-events: none; }
.l-box { text-align: center; font: 500 16px/1.4 var(--px); color: var(--soft); }
.l-bot { width: 64px; height: 64px; margin: 0 auto 12px; background: url(img/robot-head.svg) center/contain no-repeat; animation: bob2 0.8s steps(2) infinite; }
@keyframes bob2 { 50% { transform: translateY(-6px); } }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; font: 500 18px/1.4 var(--body); color: var(--cream); background: #0c0f13; }
.nojs a { color: var(--teal); }

@media (prefers-reduced-motion: reduce) {
  .clickme, .l-bot, #dialog .d-next { animation: none; }
  .card3d { animation: none; transform: rotateY(180deg); }
  .card-front .holo { animation: none; opacity: 0; }
  #hired.on { animation: hiredFade 2.2s both; }
  @keyframes hiredFade { 0%, 100% { opacity: 0; transform: translate(-50%, -50%); } 10%, 85% { opacity: 1; transform: translate(-50%, -50%); } }
}
#dialog .d-choices.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#dialog .d-choices.grid .choice { padding: 8px 10px; font-size: clamp(14px, 1.7vw, 17px); }
@media (max-width: 420px) { #dialog .d-choices.grid .choice { font-size: 13px; padding: 7px 8px; } }

/* ---- location banner, Pokemon-style, when you walk into a district */
#where { position: fixed; left: 12px; top: calc(60px + var(--safe-t)); z-index: 14; pointer-events: none; transform: translateX(-120%); transition: transform 0.45s cubic-bezier(.2, .9, .2, 1); }
#where.on { transform: none; }
#where span { display: inline-block; padding: 8px 14px 9px; background: #f6f1e3; color: #1d232c; font: 700 17px/1 var(--px); box-shadow: 0 0 0 3px #1d232c, inset 0 -3px 0 rgba(0, 0, 0, 0.12), 4px 4px 0 3px rgba(12, 15, 19, 0.35); }

/* ---- the choice panel sits above the text box and arms after a beat (no accidental picks while tapping through) */
#choices { position: fixed; left: 50%; transform: translateX(-50%); width: min(760px, calc(100vw - 20px)); z-index: 31; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: rgba(12, 15, 19, 0.82); border: 3px solid #f3e7cd; box-shadow: 0 0 0 3px #0c0f13, 0 8px 0 rgba(12, 15, 19, 0.3); }
#choices.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#choices .choice { transition: opacity 0.25s; opacity: 0.55; }
#choices.armed .choice { opacity: 1; }
#choices:not(.armed) .choice { pointer-events: none; }
#choices.grid .choice { padding: 8px 10px; font-size: clamp(14px, 1.7vw, 17px); }
@media (max-width: 420px) { #choices.grid .choice { font-size: 13px; padding: 7px 8px; } }

.choice small { display: block; margin-top: 2px; font: 500 12px/1.2 var(--px); opacity: 0.7; }
.choice.htr small { opacity: 0.8; }
#where span small { display: block; margin-top: 4px; font: 500 12px/1 var(--px); color: #5a6372; }
.roletag { position: absolute; transform: translate(-50%, -100%); padding: 4px 8px 5px; background: #1d232c; color: #ffb454; font: 700 12px/1 var(--px); letter-spacing: 0.04em; text-transform: uppercase; box-shadow: 0 0 0 2px #f3e7cd; white-space: nowrap; }
.roletag::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -5px; border: 5px solid transparent; border-top-color: #f3e7cd; border-bottom: 0; }
.roletag.done { color: #5fd38d; }

/* portrait map: places listed down the right on leader lines */
.lbl.side { transform: none; }
.lbl.side::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; background: #1d232c; box-shadow: 0 0 0 2px #f6f1e3; }
.lbl.side .plate { position: absolute; transform: translateY(-50%); text-align: left; }
.lbl.side .plate small { display: block; }
.lbl.side .stem { position: absolute; left: 0; top: -1.5px; height: 3px; margin: 0; transform-origin: 0 50%; }

/* a phone on its side: smaller plates and title so the strip and its places fit the short screen */
@media (max-height: 500px) {
  .lbl .plate { font-size: 11px; padding: 3px 6px 4px; }
  .lbl .plate small { display: none; }
  #title h1 { font-size: 30px; }
  #title .t-kicker { font-size: 10px; padding: 3px 8px; }
}
/* helped: a green tick badge on the plate's corner, so the plate keeps its size and nothing re-flows */
.lbl.done .plate { position: relative; }
.lbl.side.done .plate { position: absolute; }
.lbl.done .plate::after { content: "✓"; position: absolute; right: -9px; top: -9px; width: 18px; height: 18px; background: #1f8f59; color: #fff; font: 700 12px/18px var(--px); text-align: center; box-shadow: 0 0 0 2px #1d232c; }

/* the name tab grows upward from the box's top edge, so it never covers the words; on a phone the business
   drops to its own line under the name instead of wrapping mid-word */
#dialog .d-name { top: auto; bottom: calc(100% - 10px); max-width: calc(100% - 28px); display: flex; align-items: baseline; gap: 8px; }
#dialog .d-name span, #dialog .d-name small { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dialog .d-name small { margin-left: 0; }
@media (max-width: 560px) { #dialog .d-name { flex-direction: column; align-items: flex-start; gap: 3px; } #dialog .d-name small { max-width: 100%; } }
