@font-face { font-family: 'Roboto Mono'; font-weight: 500; src: url('../assets/fonts/RobotoMono-Medium.ttf'); }
@font-face { font-family: 'Roboto Mono'; font-weight: 700; src: url('../assets/fonts/RobotoMono-Bold.ttf'); }
@font-face { font-family: 'Garota'; src: url('../assets/fonts/GarotaSansRegular-8Or1D.ttf'); }

/* The same look as the sprites: black lines, flat color, hatching for shade. Words over the game
   world are pale with a black edge. Everything else is black on paper. */
:root {
  --black: #15110e;
  --paper: #eadfc3;
  --paper-light: #f4ebd5;
  --paper-dark: #d3c49f;
  --dim: #5d5240;
  --yellow: #f9c63b;
  --orange: #ee7d1c;
  --red: #c61f1b;
  --green: #6f8f3a;
  --hatch: repeating-linear-gradient(135deg, rgba(21, 17, 14, .2) 0 1px, transparent 1px 5px);
  --edge: -1.5px -1.5px 0 var(--black), 1.5px -1.5px 0 var(--black), -1.5px 1.5px 0 var(--black), 1.5px 1.5px 0 var(--black), 0 2px 0 var(--black), 2px 0 0 var(--black), -2px 0 0 var(--black), 0 -2px 0 var(--black);
  scrollbar-color: var(--black) transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--black); overflow: hidden; }
body { font-family: 'Roboto Mono', ui-monospace, Menlo, monospace; font-weight: 500; color: var(--paper); user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ----- HUD ----- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: var(--edge); }
.vitals { position: absolute; left: 30px; bottom: 26px; display: flex; align-items: flex-end; gap: 12px; }
.readout { display: flex; align-items: baseline; gap: 5px; min-width: 76px; justify-content: flex-end; }
.readout b { font-size: 40px; line-height: .9; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.readout small, .tally small { font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.gauges { display: grid; gap: 4px; width: 250px; padding-bottom: 3px; }
.gauge { position: relative; transform: skewX(-20deg); background: var(--black); border: 3px solid var(--black); overflow: hidden; box-shadow: 3px 3px 0 var(--black); }
.gauge i { position: absolute; inset: 0; display: block; transform-origin: left; }
.gauge::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--black) calc(10% - 2px) 10%); }
.health { height: 21px; }
.health i { background: var(--red); transition: transform .08s linear; }
.health .trail { background: var(--paper); transition: transform .45s ease-out .18s; } /* what you just lost, draining away */
.stamina { height: 11px; width: 76%; }
.stamina i { background: var(--yellow); }
.stamina::after { display: none; }
.vitals.low .readout b { color: var(--orange); animation: hud-pulse .7s ease-in-out infinite alternate; }
.vitals.low .gauge { border-color: var(--red); }
.vitals.winded .stamina { animation: hud-pulse .35s ease-in-out infinite alternate; }
@keyframes hud-pulse { from { opacity: 1; } to { opacity: .55; } }
#hud.behind { visibility: hidden; }
#hud.paused::before { content: ''; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(135deg, rgba(21, 17, 14, .72) 0 2px, rgba(21, 17, 14, .42) 2px 6px); }
#pause { background: none; }
.score { position: absolute; right: 26px; top: 20px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 0 20px; max-width: 320px; }
.tally { display: flex; align-items: baseline; gap: 6px; }
.tally + .tally { padding-left: 20px; border-left: 3px solid var(--black); }
.tally b { display: inline-block; font-size: 24px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally:first-child b { color: var(--yellow); }
.tally svg { width: 17px; height: 17px; align-self: center; color: var(--paper); }
.tally svg path { stroke: var(--black); stroke-width: 2px; paint-order: stroke; }
.objective { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); text-align: center; display: grid; gap: 1px; max-width: 40vw; padding: 3px 16px 4px; color: var(--black); background: var(--paper); border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black); text-shadow: none; }
.objective small { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.objective b { font-size: 16px; font-weight: 700; }
.objective strong { font-size: 34px; color: var(--red); font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.1; }
.objective strong:empty { display: none; }
#radio, #cineLine { position: absolute; left: 50%; transform: translateX(-50%); max-width: min(760px, 86vw); padding: 9px 16px; color: var(--black); background: var(--paper); border: 3px solid var(--black); border-left: 9px solid var(--green); box-shadow: 4px 4px 0 var(--black); font-size: 16px; line-height: 1.4; text-shadow: none; }
#radio { bottom: 130px; }
/* the top-left corner: where you are, and the wave calls below it */
.corner { position: absolute; left: 30px; top: 22px; display: grid; gap: 6px; justify-items: start; pointer-events: none; }
#wavecall { font-size: 22px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--wave, var(--red)); text-shadow: 2px 2px 0 var(--black); opacity: 0; }
#place { color: var(--paper); font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; opacity: 0; }
#radio:empty, #tip:empty { display: none; }
#tip { position: absolute; left: 50%; bottom: 94px; transform: translateX(-50%); padding: 3px 11px; font-size: 14px; font-weight: 700; color: var(--black); background: var(--yellow); border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black); text-shadow: none; white-space: nowrap; }
/* Feedback and Credits, off Character settings. The trap field is for bots and stays out of sight. */
#feedback .panel textarea, #feedback .panel input { font: inherit; font-size: 13px; color: var(--black); background: var(--paper-light); border: 3px solid var(--black); padding: 8px 10px; width: 100%; box-sizing: border-box; resize: vertical; user-select: text; -webkit-user-select: text; }
.feedback-email { display: grid; gap: 4px; font-size: 12px; color: var(--dim); }
.feedback-status { min-height: 1.4em; color: var(--black) !important; font-weight: 700; }
.trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#credits .panel { width: min(640px, 100%); box-sizing: border-box; max-height: calc(100dvh - 48px); grid-template-rows: auto minmax(0, 1fr) auto; }
.credits-list { overflow-y: auto; min-height: 0; padding-right: 8px; display: grid; gap: 6px; align-content: start; }
.credits-list h3 { margin: 10px 0 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--black); }
.credits-list h3:first-child { margin-top: 0; }
.credits-list p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--dim); }
/* The tutorial's panel, under the objective: the step, what to do, any choices, and Skip tutorial at its foot. The HUD parts a
   step is about pulse a yellow outline (tut-mark). */
#tutorial { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); width: min(560px, 90vw); display: grid; gap: 8px; justify-items: center; padding: 10px 18px 8px; color: var(--black); background: var(--paper); border: 3px solid var(--black); border-left: 9px solid var(--yellow); box-shadow: 4px 4px 0 var(--black); text-shadow: none; text-align: center; pointer-events: auto; }
#tutorial small { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
#tutorial p { margin: 0; font-size: 15px; line-height: 1.45; }
#tutButtons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#tutButtons:empty { display: none; }
#tutorial button { font-size: 13px; padding: 6px 14px; }
#tutorial .tut-skip { background: none; border: none; box-shadow: none; padding: 2px 6px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); text-decoration: underline; }
#tutorial .tut-skip:hover { color: var(--black); }
.tut-mark { outline: 3px solid var(--yellow); outline-offset: 8px; animation: tut-pulse .8s ease-in-out infinite alternate; }
@keyframes tut-pulse { from { outline-color: var(--yellow); } to { outline-color: transparent; } }
.loadout { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.ammo { position: absolute; right: 30px; bottom: 26px; display: grid; gap: 5px; justify-items: end; }
.ammo > small { font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.ammo-row { display: flex; align-items: flex-end; gap: 12px; }
.ammo .readout { min-width: 76px; }
.ammo .readout small { font-variant-numeric: tabular-nums; letter-spacing: 0; font-size: 14px; }
#magazine { display: flex; gap: 2px; width: 220px; height: 21px; margin-bottom: 3px; padding: 2px; transform: skewX(-20deg); background: var(--black); border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black); }
#magazine:empty { display: none; }
#magazine i { flex: 1 1 0; min-width: 0; background: var(--yellow); }
#magazine i.spent { background: #40372a; }
.ammo.low .readout b { color: var(--yellow); }
.ammo.low #magazine i:not(.spent) { background: var(--orange); }
.ammo.empty .readout b { color: var(--orange); animation: hud-pulse .4s ease-in-out infinite alternate; }
.ammo.empty > small { color: var(--orange); }
.ammo.reloading > small { color: var(--yellow); }
.ammo.reloading #magazine { animation: hud-pulse .3s ease-in-out infinite alternate; }
#slots { display: flex; gap: 7px; }
.slot { position: relative; width: 82px; height: 56px; color: var(--black); background: var(--paper); border: 3px solid var(--black); box-shadow: 3px 3px 0 var(--black); display: grid; place-items: center; text-shadow: none; }
.slot.active { background: var(--yellow); }
.slot kbd { position: absolute; left: -3px; top: -3px; font-size: 11px; margin: 0; padding: 0 5px; }
.slot span { position: absolute; right: 4px; bottom: 1px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot canvas { width: 66px; height: 33px; }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; }
#fade.on { opacity: 1; }

#cine { position: fixed; inset: 0; pointer-events: none; }
#cineLine { bottom: 14vh; }
#cineLine:empty { display: none; }
#cineTitle { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: clamp(48px, 8vw, 96px); color: var(--yellow); text-shadow: var(--edge), 5px 5px 0 var(--black); opacity: 0; transition: opacity .8s; }
#cineTitle.on { opacity: 1; }
#cine small { position: absolute; right: 16px; bottom: 3vh; font-size: 12px; text-shadow: var(--edge); }

/* ----- screens ----- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(135deg, rgba(21, 17, 14, .72) 0 2px, rgba(21, 17, 14, .42) 2px 6px); padding: 16px; overflow-y: auto; }
/* A slanted black panel down the left, with the picture clear beside it. Its edge is placed by fitMenuShade (ui.js) to clear everything
   on the page, so it follows the buttons as the window narrows. The page hangs from the top, so a longer tip or a mode's page grows
   downward instead of moving everything above it. */
#menu { background: transparent; will-change: transform; /* its own layer, so the masked title isn't painted again with every frame of the backdrop */ justify-items: start; align-content: start; padding-top: clamp(16px, 7vh, 72px); padding-left: clamp(16px, 8vw, 120px); }
.menu-shade { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; background: rgba(21, 17, 14, .94); clip-path: polygon(0 0, 46% 0, 40% 100%, 0 100%); pointer-events: none; }
.title-block { position: relative; z-index: 1; display: grid; gap: 18px; max-width: 560px; }
/* The title, lettered like a comic's cover: slanted, inked thick, and pushed out of the page with a solid block of shadow. */
h1 { --block: 1px 1px 0 var(--black), 2px 2px 0 var(--black), 3px 3px 0 var(--black), 4px 4px 0 var(--black), 5px 5px 0 var(--black), 6px 6px 0 var(--black), 7px 7px 0 var(--black), 8px 8px 0 var(--black);
  display: grid; justify-items: start; margin: 0 0 6px; font-family: 'Bangers', 'Garota', 'Roboto Mono', sans-serif; font-weight: 400; font-size: clamp(76px, 13vw, 158px); line-height: .84; letter-spacing: 6px; text-transform: uppercase; transform: rotate(-4deg); transform-origin: left bottom; }
/* Padded out so the mask that cuts the bites and bullet holes (scuffTitle in ui.js) also covers the shadow and outline. */
h1 span { position: relative; padding: .12em .2em .24em .12em; margin: -.12em -.2em -.24em -.12em; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; color: var(--yellow); -webkit-text-stroke: 7px var(--black); paint-order: stroke fill; text-shadow: var(--block), 11px 11px 0 var(--red); }
h1 .scuffs { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
h1 span + span { margin-left: calc(.9em - .12em); color: var(--paper-light); text-shadow: var(--block), 11px 11px 0 var(--red); }
.touch-note { display: none; margin: 0; color: var(--orange); font-size: 14px; }
@media (hover: none) and (pointer: coarse) { .touch-note { display: block; } }
.difficulty { display: grid; justify-items: start; gap: 8px; text-shadow: var(--edge); }
.difficulty small { letter-spacing: 3px; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.difficulty span { display: block; font-size: 12px; width: min(420px, 100%); } /* as wide as the tip box below, so it stays on the black panel */
/* The title screen's two pages: the modes, and one mode's difficulty and save. */
.menu-view { display: grid; gap: 16px; justify-items: start; }
.mode-buttons { display: grid; gap: 12px; width: min(340px, 100%); }
.mode-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; font-size: clamp(15px, 4.4vw, 19px); text-align: left; text-transform: uppercase; letter-spacing: 2px; }
.mode-btn:first-child, .mode-btn:nth-child(2) { background: var(--yellow); }
.mode-btn:first-child:hover, .mode-btn:nth-child(2):hover { background: #ffd968; }
.beta { flex: none; padding: 2px 7px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--paper-light); background: var(--red); border: 2px solid var(--black); transform: rotate(3deg); text-shadow: none; }
.mode-head { display: flex; align-items: center; gap: 14px; }
.mode-head h2 { color: var(--yellow); text-shadow: var(--edge), 4px 4px 0 var(--black); font-size: 36px; }
.mode-head .beta { align-self: flex-start; }
button.back { padding: 5px 11px; font-size: 12px; box-shadow: 2px 2px 0 var(--black); }
.segments button.saved::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; vertical-align: 1px; background: var(--green); border: 1.5px solid var(--black); border-radius: 50%; }
.save-card { display: grid; gap: 4px; justify-items: start; width: min(420px, 100%); padding: 10px 14px 12px; color: var(--black); background: var(--hatch) right top / 90px 100% no-repeat, var(--paper); border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black); }
.save-card small { font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--red); }
.save-card b { font-weight: 700; font-size: 30px; line-height: 1.05; letter-spacing: -0.5px; } /* the lettering font has no numbers */
.save-card > span { font-size: 13px; color: var(--dim); }
.save-char { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; padding-top: 8px; border-top: 2px solid var(--black); font-size: 11px; color: var(--dim); width: 100%; }
.prestige-badge { padding: 1px 8px; font-weight: 700; font-size: 12px; color: var(--black); background: var(--yellow); border: 2px solid var(--black); }
.prestige-badge.none { background: var(--paper-dark); color: var(--dim); }
.copyright { margin: 4px 0 0; color: var(--paper-dark); opacity: .7; font-size: 11px; letter-spacing: .3px; }
.copyright a { color: inherit; }
.menu-stack { display: grid; gap: 12px; width: min(340px, 100%); margin-top: -6px; } /* character settings and the tip, as wide as the mode buttons above */
.settings-btn { padding: 9px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--black); }
/* tips and did-you-knows shuffling on the title screen; a click skips to the next */
.menu-tip { display: grid; gap: 3px; justify-items: start; align-content: start; text-align: left; min-height: 44px; padding: 7px 12px 8px; color: var(--black); background: var(--paper); border: 3px solid var(--black); box-shadow: 3px 3px 0 var(--black); font: inherit; font-size: 13px; line-height: 1.35; cursor: pointer; transition: opacity .35s; }
.menu-tip small { font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--red); }
.menu-tip.out { opacity: 0; }
.segments { display: flex; box-shadow: 3px 3px 0 var(--black); text-shadow: none; }
.segments button { padding: 8px 16px; font-size: 13px; box-shadow: none; }
.segments button:hover:not(:disabled), .segments button:active:not(:disabled) { transform: none; box-shadow: none; }
.segments button + button { border-left: 0; }
.segments button.on, .segments button.on:hover:not(:disabled) { color: var(--paper-light); background: var(--red); box-shadow: inset 0 -4px 0 var(--black); }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; color: var(--dim); font-size: 12px; padding-top: 14px; border-top: 3px solid var(--black); }
kbd { font: inherit; font-weight: 700; color: var(--paper); background: var(--black); padding: 1px 6px; margin-right: 3px; }
.buttons { display: flex; gap: 12px; flex-wrap: wrap; }
button { font: inherit; font-weight: 700; color: var(--black); background: var(--paper); border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black); padding: 10px 20px; cursor: pointer; transition: background .08s, transform .08s, box-shadow .08s; }
button:hover:not(:disabled) { background: var(--paper-light); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--black); }
button:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--black); }
button:disabled { cursor: default; color: var(--dim); background: var(--paper-dark); box-shadow: none; }
button.primary { background: var(--yellow); }
button.danger { color: var(--paper-light); background: var(--red); }
button.danger:hover:not(:disabled) { background: #d8463a; }
button.primary:hover:not(:disabled) { background: #ffd968; }
button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.panel, .color-pick-box { color: var(--black); background: var(--hatch) right top / 110px 100% no-repeat, var(--paper); border: 3px solid var(--black); box-shadow: 8px 8px 0 var(--black); }
.panel { padding: 26px 28px; width: min(560px, 100%); display: grid; gap: 14px; }
.panel small, .color-pick-box small, .camp-head small { justify-self: start; display: inline-block; padding: 2px 9px; color: var(--black); background: var(--yellow); border: 2px solid var(--black); letter-spacing: 3px; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.panel small:empty { display: none; }
h2 { margin: 0; font-family: 'Garota', 'Roboto Mono', sans-serif; font-weight: 400; font-size: 42px; letter-spacing: 1px; line-height: 1; }
.setting { display: grid; grid-template-columns: 1fr auto 13.5em; align-items: center; gap: 16px; } /* the buttons' column fits the longest thing they say ("Really? It can't be undone"), so asking doesn't shift the row */
.setting > button { justify-self: stretch; } /* the whole column, so a button doesn't grow or shrink with what it says */
.setting b { font-variant-numeric: tabular-nums; color: var(--red); }
.setting button.small { padding: 4px 9px; font-size: 11px; box-shadow: 2px 2px 0 var(--black); }
/* The keys screen holds still while you change keys: the list is a fixed size with even columns, every key button is the same width
   whatever it says (cut short with ... and the whole of it on hover), and the "already used" question floats over the list. */
.keys-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; height: min(52vh, 460px); align-content: start; overflow-y: auto; padding-right: 6px; }
.keys-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.keys-row span { flex: 1; min-width: 0; }
.keys-row button { flex: none; width: 11.5em; padding: 5px 10px; font-size: 12px; box-shadow: 2px 2px 0 var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keys-row button.unbound { color: var(--red); }
.controls-change { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.keys-ask { position: absolute; left: 28px; right: 28px; top: 50%; transform: translateY(-50%); z-index: 2; padding: 12px; border: 3px solid var(--black); background: var(--paper-light); box-shadow: 6px 6px 0 var(--black); display: grid; gap: 10px; }
.panel:has(.keys-list) { width: min(760px, 100%); position: relative; }
/* Both settings screens fit the window without the page scrolling: character settings is wider and tighter, with its notes in smaller
   type, and on Controls the list of keys takes whatever height is left over (it scrolls inside itself). */
#settings .panel { width: min(560px, 100%); padding: 18px 24px; gap: 14px; }
/* Character settings is just buttons, two to a row, every one the same size; the two resets, in red, sit at the bottom and ask first */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.settings-grid button { padding: 8px 12px; font-size: 13px; box-shadow: 3px 3px 0 var(--black); }
.settings-grid .danger { margin-top: 8px; }
#settings .buttons button { padding: 8px 18px; }
#keys .panel { box-sizing: border-box; max-height: calc(100dvh - max(16px, 9vh) - 32px); /* under the screen's 9vh top, see #keys below */ grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; padding: 18px 24px; gap: 10px; }
#keys .panel p { font-size: 11.5px; line-height: 1.4; }
#keys .keys-list { height: auto; max-height: 460px; min-height: 120px; }
#keys .setting > button { padding: 6px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--black); }
/* the Your look screen */
.looks-panel { width: min(900px, 100%); gap: 16px; }
.looks-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.looks { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.looks-side { display: grid; gap: 10px; justify-items: start; }
#looksPreview { width: 300px; height: 300px; background: radial-gradient(circle, rgba(21, 17, 14, .08) 0 46%, transparent 47%), var(--paper-light); border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black); }
.panel p.looks-summary { color: var(--black); font-size: 12px; line-height: 1.45; min-height: 3em; }
#looksRandom, #looksUndo { padding: 7px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--black); }
.looks-actions, .looks-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.looks-list { display: grid; gap: 14px; align-content: start; height: max(330px, min(60vh, 520px)); overflow-y: auto; padding: 3px 8px 6px 3px; }
.looks-section { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 2px dashed rgba(21, 17, 14, .25); }
.looks-section:last-child { border-bottom: 0; }
.looks-label { display: flex; align-items: baseline; gap: 10px; font-size: 11px; }
.looks-label span { font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.looks-label b { color: var(--red); font-size: 13px; }
.looks-label em { margin-left: auto; font-style: normal; color: var(--dim); }
.hidden-by-hat .looks-picks { opacity: .55; }
.looks-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.looks-picks .chip { padding: 6px 12px; font-size: 12px; box-shadow: 2px 2px 0 var(--black); }
.looks-picks .chip.on, .looks-picks .chip.on:hover:not(:disabled) { background: var(--yellow); box-shadow: inset 0 -3px 0 var(--black); transform: none; }
.looks-picks .swatch { position: relative; width: 34px; height: 34px; padding: 0; box-shadow: 2px 2px 0 var(--black); }
.looks-picks .swatch.none { background: linear-gradient(135deg, transparent 0 45%, var(--red) 45% 55%, transparent 55%), var(--paper-light); }
.looks-picks .swatch.on { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--black); transform: none; }
.looks-picks .swatch.on::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -6px 0 0 -6px; background: var(--paper-light); border: 2px solid var(--black); border-radius: 50%; }
.looks-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 3px solid var(--black); }
.panel p { margin: 0; color: var(--dim); line-height: 1.5; white-space: pre-line; }
#dialogText { color: var(--black); font-size: 17px; }
#dialogOptions { display: grid; gap: 10px; }
#dialogOptions button { text-align: left; }
/* ----- the shop at a bed or sleeping bag ----- */
.camp { position: relative; color: var(--black); width: min(1120px, 100%); height: min(720px, calc(100vh - 32px)); display: grid; grid-template: auto minmax(0, 1fr) auto / 214px minmax(0, 1fr); background: var(--paper); border: 3px solid var(--black); box-shadow: 9px 9px 0 var(--black); }
.camp-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 18px 26px 14px; background: var(--hatch) right top / 340px 100% no-repeat; border-bottom: 3px solid var(--black); }
.camp-head small { font-size: 11px; margin-bottom: 7px; }
.camp-purse { text-align: right; flex: none; }
.camp-purse small { display: block; padding: 0; margin-bottom: 3px; color: var(--dim); background: none; border: 0; }
.camp-purse b { display: inline-block; padding: 2px 11px; color: var(--black); background: var(--yellow); border: 3px solid var(--black); box-shadow: 3px 3px 0 var(--black); font-size: 32px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.camp-aisles { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; background: var(--black); overflow-y: auto; scrollbar-color: var(--paper) transparent; }
.aisle { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 16px 11px 13px; text-align: left; font-size: 13px; color: var(--paper); background: transparent; border: 0; box-shadow: none; }
.aisle span:not(.ico) { flex: 1; }
.aisle .ico { width: 20px; height: 20px; }
.aisle i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--black); background: var(--yellow); min-width: 19px; padding: 2px 5px; text-align: center; font-variant-numeric: tabular-nums; }
.aisle:hover:not(:disabled), .aisle:active:not(:disabled) { color: var(--yellow); background: #322a20; transform: none; box-shadow: none; }
.aisle.on, .aisle.on:hover:not(:disabled), .aisle.on:active:not(:disabled) { color: var(--black); background: var(--paper); }
.ico { display: block; flex: none; width: 34px; height: 34px; }
.ico svg { display: block; width: 100%; height: 100%; }
.camp-goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-content: start; gap: 12px; padding: 16px 20px 18px 18px; overflow-y: auto; min-height: 0; }
.camp-aisle-note { grid-column: 1 / -1; margin: 0 0 2px; color: var(--dim); font-size: 12px; }
.aisle.reveal { animation: veteran-flash .45s ease-in-out 6 alternate; } /* three flashes, the first time the Old hand aisle is there */
@keyframes veteran-flash { to { color: var(--black); background: var(--yellow); } }
.good { position: relative; display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 10px 11px 10px 10px; text-align: left; font-weight: 500; background: var(--paper-light); border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black); }
.good:hover:not(:disabled) { background: #fcecb6; box-shadow: 4px 4px 0 var(--black); }
.good:disabled { color: var(--black); background: var(--paper-light); box-shadow: 3px 3px 0 var(--black); }
.good-art { display: grid; place-items: center; width: 68px; height: 68px; color: var(--black); background: var(--hatch), var(--paper-dark); border: 2px solid var(--black); overflow: hidden; }
.good-art canvas { width: 60px; height: 30px; }
.good-text { display: grid; gap: 4px; min-width: 0; }
.good-text b { font-weight: 700; font-size: 14px; line-height: 1.25; }
.good-text span { color: var(--dim); font-size: 12px; line-height: 1.35; }
.good em { font-style: normal; font-weight: 700; font-size: 13px; color: var(--black); background: var(--yellow); border: 2px solid var(--black); padding: 2px 7px; white-space: nowrap; font-variant-numeric: tabular-nums; transform: rotate(-2deg); }
.good.owned, .good.owned:disabled { background: #dde2b8; }
.good.owned em { background: var(--green); color: var(--paper-light); }
.good.owned .good-art { color: #39501a; }
.good.broke, .good.broke:disabled { background: var(--paper-dark); }
.good.broke .good-text b { color: var(--dim); }
.good.broke em { background: var(--paper-light); color: var(--red); border-color: var(--red); }
.good.broke .good-art, .good.locked .good-art { opacity: .6; }
.good.locked, .good.locked:disabled { background: transparent; border-style: dashed; box-shadow: none; }
.good.locked .good-text b { color: var(--dim); font-weight: 500; }
.good.locked em { background: transparent; border-color: transparent; color: var(--dim); font-weight: 500; font-size: 12px; white-space: normal; max-width: 92px; text-align: right; transform: none; }
.good.bought { animation: bought .45s ease-out; }
/* locked lines, kept small below what you can buy now */
.up-next { grid-column: 1 / -1; display: grid; gap: 7px; margin-top: 6px; padding-top: 12px; border-top: 2px dashed var(--dim); }
.up-next small { font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); }
.up-next p { margin: 0; color: var(--dim); font-size: 12px; }
.up-next-row { display: flex; flex-wrap: wrap; gap: 8px; }
.up-chip { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 5px 10px 5px 5px; border: 2px dashed var(--dim); }
.up-art { display: grid; place-items: center; flex: none; width: 34px; height: 34px; color: var(--dim); background: var(--paper-dark); opacity: .7; overflow: hidden; }
.up-art canvas { width: 32px; height: 16px; }
.up-art .ico { width: 22px; height: 22px; }
.up-chip b { display: block; font-size: 12px; line-height: 1.2; color: var(--dim); }
.up-chip span { display: block; font-size: 11px; color: var(--dim); }
@keyframes bought { from { background: var(--yellow); } }
.pips { display: flex; gap: 3px; margin-top: 3px; }
.pips i { flex: 1; height: 7px; background: transparent; border: 1.5px solid var(--black); }
.pips i.on { background: var(--black); }
.camp-prestige { grid-column: 1 / -1; display: grid; justify-items: start; gap: 14px; max-width: 620px; padding: 6px 4px; }
.camp-prestige p { margin: 0; color: var(--dim); line-height: 1.55; white-space: pre-line; }
.camp-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 22px 14px 26px; border-top: 3px solid var(--black); color: var(--dim); font-size: 12px; }

.gear { width: min(860px, 100%); }
.gear-note { grid-column: 1 / -1; margin: 0; color: var(--red); font-weight: 700; }
.menu-tabs { display: flex; gap: 8px; margin-top: 10px; }
.menu-tabs button { padding: 6px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--black); }
.menu-tabs button.on, .menu-tabs button.on:hover:not(:disabled) { background: var(--yellow); }
.panel .menu-tabs { margin-top: 0; }
.gear-slots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 9px; } /* six, and the Body slot once there's armor */
.gear-slot { position: relative; display: grid; justify-items: center; gap: 4px; padding: 20px 4px 8px; font-size: 11px; box-shadow: 3px 3px 0 var(--black); }
.gear-slot kbd { position: absolute; left: -3px; top: -3px; font-size: 11px; margin: 0; }
.gear-slot canvas, .gear-slot i { display: block; width: 66px; height: 33px; }
.gear-slot .ico { display: grid; place-items: center; width: 66px; height: 33px; } .gear-slot .ico svg { width: 30px; height: 30px; }
.gear-slot.on, .gear-slot.on:hover:not(:disabled) { background: var(--yellow); }
.restock { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 3px solid var(--black); }
.restock small { font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.restock-row { display: flex; flex-wrap: wrap; gap: 8px; }
.restock-row button { padding: 7px 14px; font-size: 13px; }
.restock-row button.on, .restock-row button.on:hover:not(:disabled) { background: var(--yellow); }
.gear-slot[data-gun] { touch-action: none; }
.gear-slot.dragging { z-index: 2; pointer-events: none; opacity: .85; transition: none; }
.gear-slot.drop { outline: 3px dashed var(--black); outline-offset: 3px; background: var(--yellow); }
.gear-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-content: start; height: max(220px, 42vh); overflow-y: auto; padding: 0 5px 5px 0; } /* one height whichever slot is picked, so the panel doesn't move */
.gear-items .good { font-size: 13px; }

#confirm { z-index: 20; } /* over the menu, which stays up behind it */
#confirm .panel { width: min(420px, 100%); }
#confirm .panel p { color: var(--black); }
.confirm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.confirm-buttons button { padding: 10px 12px; white-space: nowrap; }
.confirm-rows { display: grid; gap: 6px; font-size: 13px; }
.confirm-rows:empty { display: none; }
.confirm-rows div { display: flex; justify-content: space-between; gap: 16px; }
.confirm-rows b { color: var(--red); font-variant-numeric: tabular-nums; }
#confirmText { font-size: 12.5px; line-height: 1.45; }
.color-pick { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: repeating-linear-gradient(135deg, rgba(21, 17, 14, .78) 0 2px, rgba(21, 17, 14, .5) 2px 6px); }
.color-pick-box { display: grid; justify-items: center; gap: 12px; padding: 20px 24px; }
#colorWheel { width: 220px; height: 220px; border-radius: 50%; border: 3px solid var(--black); cursor: crosshair; touch-action: none; }
#colorChosen { display: block; width: 96px; height: 20px; border: 3px solid var(--black); }
#colorShade { width: 220px; accent-color: var(--black); }
.looks-picks .swatch.custom, .looks-picks .swatch.accent { width: auto; padding: 0 10px; font-weight: 700; font-size: 12px; letter-spacing: .5px; color: var(--black); background-color: var(--paper-light); } /* as tall as the swatches beside them, wide enough for the word */
.looks-picks .swatch.custom.on::after, .looks-picks .swatch.accent.on::after { display: none; } /* the ring round it says it's picked; a dot would sit on the word */
.looks-picks .swatch.custom.set, .looks-picks .swatch.accent.set { color: var(--paper-light); text-shadow: 0 0 3px var(--black); }
.looks-picks .chip.locked { opacity: .5; }
.looks-picks .chip.locked small { display: block; font-size: 9px; letter-spacing: 1px; background: none; border: 0; padding: 0; }

#stats { background: var(--black); }
.stat-sheet { width: min(620px, 100%); display: grid; gap: 14px; }
.stat-sheet small { justify-self: start; padding: 2px 9px; color: var(--black); background: var(--yellow); letter-spacing: 3px; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.stat-sheet h2 { color: var(--yellow); }
.stat { display: flex; justify-content: space-between; gap: 18px; padding: 5px 0; border-bottom: 2px solid #4b4234; opacity: 0; animation: stat-in .35s forwards; animation-delay: calc(var(--i) * .26s + .7s); }
.stat b { color: var(--yellow); font-variant-numeric: tabular-nums; }
#statVerdict { margin: 0; color: var(--yellow); font-size: 17px; opacity: 0; animation: stat-in .6s forwards; animation-delay: calc(var(--i) * .26s + .7s); }
@keyframes stat-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) { .vitals { bottom: auto; top: 18px; left: 18px; } .ammo { right: 18px; bottom: 88px; } .corner { left: 18px; top: 84px; } }
@media (max-width: 720px) {
  .gauges { width: 120px; }
  #magazine { width: 120px; }
  .objective { top: 64px; max-width: 86vw; }
  .slot { width: 54px; height: 44px; }
  .slot canvas { width: 44px; height: 22px; }
  .gear-slots { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls { grid-template-columns: 1fr; }
  .keys-list { grid-template-columns: minmax(0, 1fr); }
  .looks { grid-template-columns: 1fr; justify-items: center; }
  .looks-head, .looks-foot { flex-wrap: wrap; }
  .camp { grid-template: auto auto minmax(0, 1fr) auto / minmax(0, 1fr); }
  .camp-aisles { flex-direction: row; overflow-x: auto; padding: 6px; }
  .aisle { width: auto; flex: none; }
  .camp-goods { grid-template-columns: minmax(0, 1fr); }
  #tip { white-space: normal; text-align: center; width: 86vw; }
}

/* the F3 performance readout */
#devNote { position: fixed; right: 6px; top: 190px; z-index: 50; width: min(300px, 40vw); max-height: calc(100vh - 380px); overflow-y: auto; padding: 4px 7px; font: 11px/1.4 ui-monospace, Menlo, monospace; color: #e8e2d0; background: rgba(0,0,0,.72); white-space: pre-line; cursor: pointer; }
#perf { position: fixed; bottom: 6px; left: 6px; z-index: 50; padding: 4px 7px; font: 11px/1.4 ui-monospace, Menlo, monospace; color: #e8e2d0; background: rgba(0,0,0,.72); white-space: pre; pointer-events: none; }
.text-id-look *:not(#textIdTip) { pointer-events: auto !important; }

/* Screens whose content grows and shrinks as you use them hang from the top, so a longer line or an extra row only moves what's below it. */
#keys, #dialog { align-content: start; padding-top: max(16px, 9vh); }
#dialog { padding-top: max(16px, 22vh); }

/* Dev mode's "Show text ids": the id of the line under the mouse, by the pointer. */
#textIdTip { position: fixed; z-index: 99; padding: 3px 6px; font: 12px/1.35 ui-monospace, Menlo, monospace; color: #8ff0ff; background: rgba(0,0,0,.85); border: 1px solid #2f6f7a; white-space: pre; pointer-events: none; }
