:root {
  --ink: #141a24;
  --panel: #1c2430;
  --panel2: #232d3b;
  --line: #303c4f;
  --paper: #ece4d2;
  --muted: #9ba7b7;
  --lamp: #f2b45a;
  --lamp-deep: #9c6a22;
  --felt: #5fae8f;
  --flag: #e5705a;
  --mat: #1f3d33;
  /* Pixelify's 5 and 8 read like S; every number uses this instead. */
  --num: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.55 "Atkinson Hyperlegible", system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Pixelify Sans", ui-monospace, monospace; font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 5vw, 58px); line-height: .95; }
h2 { font-size: 24px; line-height: 1.15; }
h3 { font-size: 17px; }
p { margin: 0; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
[hidden] { display: none !important; }

.eyebrow { font: 500 12px/1 "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); }
.lede { color: var(--muted); max-width: 60ch; }
.note, .hint { font: 12.5px/1.5 "IBM Plex Mono", monospace; color: var(--muted); }

.pill { font: 600 13px/1 var(--num); padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.amber { color: var(--lamp); border-color: #6a5024; }

.btn { font: 600 15px/1 "Pixelify Sans", monospace; background: var(--lamp); color: #1a1206; border: 0; padding: 11px 16px; border-radius: 3px; cursor: pointer; box-shadow: 0 3px 0 var(--lamp-deep); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lamp-deep); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--panel2); color: var(--paper); border: 1px solid var(--line); box-shadow: 0 3px 0 #0b0f16; }
.btn.ghost[aria-pressed="true"] { border-color: var(--lamp); color: var(--lamp); }
.btn.small { font-size: 13.5px; padding: 8px 12px; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: 20px; background: #10151d; border-bottom: 1px solid var(--line); }
.brand { background: none; border: 0; color: var(--paper); font: 600 20px "Pixelify Sans", monospace; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 560px) { #whoPill { display: none; } .brand { font-size: 17px; } }

.screen { max-width: 1360px; margin: 0 auto; padding-inline: 20px; padding-block: 24px 48px; }

/* mentor */
.mentor { display: flex; gap: 12px; align-items: flex-start; background: #10151d; border: 2px solid var(--line); border-radius: 4px; padding: 12px; }
.mentor canvas { width: 64px; height: 64px; flex: none; image-rendering: pixelated; border: 2px solid var(--line); background: var(--panel); }
.mentor-name { display: block; font: 600 14px "Pixelify Sans", monospace; color: var(--lamp); margin-bottom: 2px; }
.mentor-text { font-size: 15.5px; }
.mentor-text b { color: #fff4dc; }

/* title */
.title-screen { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: center; min-height: calc(100vh - 140px); }
@media (max-width: 900px) { .title-screen { grid-template-columns: 1fr; min-height: 0; } }
.title-scene { position: relative; border: 4px solid #0b0f16; box-shadow: 0 0 0 1px var(--line), 0 40px 60px -40px #000; }
.title-scene canvas { display: block; width: 100%; height: auto; aspect-ratio: 240 / 135; image-rendering: pixelated; }
.scene-card { position: absolute; left: 57.9%; top: 49.6%; width: 5%; filter: drop-shadow(0 0 5px rgba(255, 220, 150, .6)); }
.scene-card svg { display: block; width: 100%; height: auto; }
.title-copy { display: grid; gap: 16px; }
.name-form { display: grid; gap: 8px; }
.name-form label { font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.name-row { display: flex; gap: 8px; flex-wrap: wrap; }
input[type=text], input:not([type]), textarea { flex: 1; min-width: 0; background: #10151d; color: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; }
input:not([type]):focus, textarea:focus { border-color: var(--lamp); outline: none; }

/* hub */
.hub { max-width: 1100px; margin: 0 auto; display: grid; gap: 28px; }
.hub-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 860px) { .hub-top { grid-template-columns: 1fr; } }
.hub-figure { margin: 0; display: grid; gap: 8px; }
.hub-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .hub-grid { grid-template-columns: 1fr; } }
.list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.row .ln { font: 600 18px var(--num); color: var(--muted); text-align: center; }
.row b { display: block; }
.row .bl { color: var(--muted); font-size: 13.5px; }
.row.done .ln { color: var(--felt); }
.row.next { border-color: var(--lamp); }
.row.locked { opacity: .55; }
.reset { margin-top: 16px; }

/* play layout */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .play { grid-template-columns: 1fr; } }
.panel { display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.crumb { display: grid; gap: 6px; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots i { width: 18px; height: 6px; background: var(--line); }
.dots i.done { background: #7a6130; }
.dots i.on { background: var(--lamp); }
.panel-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.task { display: grid; gap: 12px; }
.task:empty { display: none; }
.task-prompt { font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { font-family: var(--num); font-weight: 700; }
.choice.correct { border-color: var(--felt); color: var(--felt); }
.choice.wrong { border-color: #6a3328; color: var(--flag); }
.meter { height: 10px; background: #10151d; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; width: 0; background: var(--felt); transition: width .1s linear; }

/* desk */
.mat { --lx: 40%; display: grid; justify-items: center; gap: 16px; padding: 24px 20px; border-radius: 6px;
  background: radial-gradient(circle at var(--lx) 10%, rgba(242, 180, 90, .26), transparent 58%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .015) 0 2px, transparent 2px 5px), var(--mat);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .45); }
.stage { position: relative; width: min(340px, 100%, calc((100vh - 250px) * 5 / 7)); min-width: 220px; touch-action: none; }
.layers { position: relative; border-radius: 4.8% / 3.43%; overflow: hidden; box-shadow: 0 24px 30px -20px #000; cursor: crosshair; }
.layers > svg { display: block; width: 100%; height: auto; }
.layers > svg:not(:first-child) { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 42%, rgba(255, 236, 200, .24) 50%, transparent 58%); background-size: 300% 300%; background-position: var(--sheen-pos, 60%) var(--sheen-pos, 60%); }
.foil-shine { mix-blend-mode: color-dodge; }
.layers.wiping::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); animation: wipe .5s ease forwards; }
.layers.flipping { animation: flip .28s ease; }
@keyframes flip { 50% { transform: scaleX(.03); } }
@keyframes wipe { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.loupe { position: absolute; width: 150px; height: 150px; border-radius: 50%; overflow: hidden; border: 5px solid #c9a24a; background: var(--mat); box-shadow: 0 12px 30px rgba(0, 0, 0, .6); pointer-events: none; z-index: 5; }
.loupe::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 22px rgba(0, 0, 0, .55); }
.loupe-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.loupe-inner .layers { box-shadow: none; }
.layers.uv .card-base { filter: grayscale(1) brightness(.3) sepia(1) hue-rotate(220deg) saturate(3); }
.layers.uv .sheen { background: radial-gradient(circle at 50% 35%, rgba(140, 80, 255, .22), rgba(30, 0, 70, .32)); }
.mat.uv { background: radial-gradient(circle at 50% 10%, rgba(140, 80, 255, .3), transparent 60%), #1a1430; }
.dirty { font: 13px/1.45 var(--num); color: var(--flag); }
.bad-note { color: var(--flag); }
.measure-readout { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; background: #10151d; color: #bfe3cf; border: 1px solid #2f5a4a; border-radius: 4px; padding: 4px 10px; font: 700 14px/1.2 var(--num); white-space: nowrap; pointer-events: none; }
.disclose { display: flex; gap: 10px; align-items: center; font-size: 15px; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.disclose input { width: 18px; height: 18px; accent-color: var(--lamp); margin: 0; }

/* toast, shipping, vest */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: #10151d; color: var(--paper); border: 1px solid var(--lamp); border-radius: 6px; padding: 12px 16px; box-shadow: 0 16px 30px -12px #000; max-width: calc(100% - 32px); }
.ship-step { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.ship-options { display: grid; gap: 8px; }
.ship-report { display: grid; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.ship-report ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ship-report li.bad { color: var(--flag); }
.vest-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; width: 100%; }
@media (max-width: 760px) { .vest-wrap { grid-template-columns: 1fr; } }
.vest-art svg { display: block; width: 100%; height: auto; }
.pin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pin-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.pin-list li b { display: block; }
.pin-list li:not(.earned) { opacity: .75; }
.pin { display: block; width: 52px; height: 52px; }

/* card shop and pack opening */
.set-tabs, .sealed-row { display: flex; flex-wrap: wrap; gap: 8px; }
.set-tabs .btn[aria-pressed="true"] { border-color: var(--lamp); color: var(--lamp); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.product-art svg { display: block; width: 100%; height: auto; }
.product-info { display: grid; gap: 8px; justify-items: start; }
.product-info h2 { font-size: 19px; }
.odds { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; width: 100%; }
.odds summary { cursor: pointer; font: 600 15px "Pixelify Sans", monospace; }
.odds-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.odds-table th, .odds-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.odds-notes { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.opening { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: center; max-width: 1000px; margin: 0 auto; }
@media (max-width: 760px) { .opening { grid-template-columns: 1fr; } }
.wrapper-stage svg { display: block; width: min(300px, 100%); height: auto; margin: 0 auto; filter: drop-shadow(0 20px 20px rgba(0, 0, 0, .5)); }
.opening-panel { align-content: start; }
.mat.hit { box-shadow: inset 0 0 70px rgba(242, 180, 90, .55); }
.hit-pill { display: inline-block; font: 700 13px/1.4 var(--num); color: #1a1206; background: var(--lamp); border-radius: 3px; padding: 1px 7px; margin-right: 4px; }
.rar { display: inline-block; font: 700 11px/1.4 var(--num); letter-spacing: .05em; padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px; }
.rar-common { color: #b8c2cf; }
.rar-uncommon { color: #9fd0b8; border-color: #2f5a4a; }
.rar-rare { color: #8fb3d9; border-color: #34506e; }
.rar-mythic { color: #f2b45a; border-color: #6a5024; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag { font: 600 11px/1.4 var(--num); padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.tag-foil { color: #ff8ad8; border-color: #7a2a64; }
.tag-promo { color: #1a1206; background: var(--lamp); border-color: var(--lamp); }
.tag-hit { color: var(--felt); border-color: #2f5a4a; }
.pull-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; width: 100%; }
.pull { margin: 0; display: grid; gap: 6px; }
.pull.hit .own-thumb { box-shadow: 0 0 0 3px var(--lamp), 0 0 24px rgba(242, 180, 90, .6); }
.pull figcaption { display: flex; flex-wrap: wrap; gap: 4px; }

/* slab sealing */
.slab-game { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.seal-bar { position: relative; height: 28px; background: #4a1d22; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seal-bar i { position: absolute; top: 0; bottom: 0; }
.seal-yellow { background: #7a5a24; }
.seal-green { background: #2f6a4f; }
.seal-gold { background: #f2b45a; }
.seal-marker { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 0 2px #0b0f16; }
.seal-result { font-size: 15px; }
.seal-result.good { color: var(--felt); }
.seal-result.bad { color: var(--flag); }
.layers .ruler-hit { pointer-events: all; cursor: grab; }
.stage-row { display: flex; gap: 18px; align-items: flex-start; justify-content: center; flex-wrap: wrap; width: 100%; }
.reference { margin: 0; width: 120px; display: grid; gap: 6px; text-align: center; }
.reference svg { display: block; width: 100%; height: auto; border-radius: 4.8% / 3.43%; box-shadow: 0 14px 20px -14px #000; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.warn { background: transparent; color: var(--flag); border: 1px solid #6a3328; box-shadow: none; }
.tells { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.stage.dragging, .stage.dragging * { cursor: grabbing !important; }

/* binder */
.binder { max-width: 1180px; margin: 0 auto; display: grid; gap: 32px; justify-items: start; }
.binder-head { display: grid; gap: 10px; }
.binder-set { display: grid; gap: 14px; width: 100%; }
.binder-set h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.binder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.binder-card { margin: 0; display: grid; gap: 6px; }
.binder-card svg { display: block; width: 100%; height: auto; border-radius: 4.8% / 3.43%; box-shadow: 0 16px 24px -16px #000; }
.binder-card { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.binder-card .cap { display: flex; justify-content: space-between; gap: 6px; font-size: 13.5px; }
.binder-card:hover svg { transform: translateY(-3px); transition: transform .15s; }

/* card viewer */
.viewer { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; background: var(--panel); color: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow: auto; }
.viewer::backdrop { background: rgba(5, 8, 12, .75); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 600 18px "Pixelify Sans", monospace; }
.mat.big .stage { width: min(460px, 100%, calc((100vh - 220px) * 5 / 7)); }

/* money */
.pill.money { color: var(--felt); border-color: #2f5a4a; }
.pay { font: 700 18px var(--num); color: var(--felt); }
.pay.bad { color: var(--flag); }
.diff { justify-self: start; display: inline-block; font: 700 11px/1.4 var(--num); letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px; }
.diff-easy { color: #9fd0b8; border-color: #2f5a4a; }
.diff-normal { color: var(--paper); }
.diff-hard { color: var(--lamp); border-color: #6a5024; }
.diff-expert { color: #ff8ad8; border-color: #7a2a64; }

/* handbook */
.manual { max-width: 880px; margin: 0 auto; display: grid; gap: 22px; justify-items: start; }
.manual-head { display: grid; gap: 12px; }
.manual-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.manual-page { width: 100%; background: #f4efe4; color: #1d2533; border-radius: 6px; padding-block: 36px; padding-inline: clamp(18px, 5vw, 56px); display: grid; gap: 38px; box-shadow: 0 30px 60px -40px #000; }
.manual-page section { display: grid; gap: 12px; scroll-margin-top: 72px; }
.manual-page h2 { font-size: 26px; color: #16263a; border-bottom: 2px solid #d9cdb4; padding-bottom: 6px; }
.manual-page h3 { font-size: 17px; color: #16263a; margin-top: 8px; }
.manual-page p, .manual-page li, .manual-page dd { font-size: 16px; line-height: 1.65; max-width: 68ch; }
.manual-page .small { font-size: 14px; color: #5e5647; }
.manual-page ul, .manual-page ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.manual-page b { color: #16263a; }
.manual-page .story p:first-of-type::first-letter { float: left; font: 700 3.4em/0.8 "Cinzel", Georgia, serif; margin: 6px 10px 0 0; color: #7a1f2e; }
.manual-page table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.manual-page th, .manual-page td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #d9cdb4; vertical-align: top; }
.manual-page thead th { font: 600 11.5px/1.3 var(--num); letter-spacing: .08em; text-transform: uppercase; color: #6b6255; }
.manual-page tbody th { font-weight: 700; color: #16263a; }
.manual-page td.n { font-family: var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; width: 100%; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 24px; }
.rules-grid > div { display: grid; gap: 6px; align-content: start; }
.you-are { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; background: #16263a; color: #ece4d2; border-radius: 6px; padding: 14px 16px; }
.you-are b { color: #f2b45a; font-family: "Pixelify Sans", monospace; font-size: 18px; font-weight: 600; }
.glossary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.glossary dt { font-weight: 700; color: #16263a; }
.glossary dd { margin: 0; }
@media (max-width: 560px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: 6px; } #moneyPill { display: none; } }

/* tool shop and collection */
.shop { max-width: 1180px; margin: 0 auto; display: grid; gap: 24px; }
.shop-head { display: grid; gap: 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tool-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.tool-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tool-top h2 { font-size: 19px; }
.pips { display: flex; gap: 4px; }
.pips i { width: 16px; height: 6px; background: var(--line); }
.pips i.on { background: var(--lamp); }
.tool-next { display: grid; gap: 8px; justify-items: start; border-top: 1px solid var(--line); padding-top: 10px; }
.tool-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.tool-icon-box { width: 76px; height: 76px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px;
  background: radial-gradient(circle at 50% 38%, #2b3546, #161c26 75%); }
.tool-icon-box.small { width: 48px; height: 48px; }
.tool-icon-box.empty { border-style: dashed; background: #10151d; }
.tool-icon-box svg { width: 84%; height: 84%; }
.tool-icon.ghost { filter: grayscale(1) brightness(1.6); opacity: .4; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.own-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; align-items: start; }
.own-thumb { position: relative; border-radius: 4.8% / 3.43%; overflow: hidden; }
.own-thumb svg { display: block; width: 100%; height: auto; }
.own-thumb svg + svg { position: absolute; inset: 0; height: 100%; }
.own-thumb.big { width: min(220px, 100%); }
.own-info { display: grid; gap: 4px; align-content: start; }
.own-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.chip-status { justify-self: start; font: 600 12px/1.4 var(--num); padding: 3px 8px; border: 1px solid var(--line); border-radius: 3px; }
.chip-status.good { color: var(--felt); border-color: #2f5a4a; }
.chip-status.bad { color: var(--flag); border-color: #6a3328; }
.sale-note { background: #10151d; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; max-width: 72ch; }
.sell-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 560px) { .sell-row { grid-template-columns: 1fr; } }
.sell-info { display: grid; gap: 10px; }
.venue { display: grid; gap: 2px; text-align: left; background: var(--panel2); color: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 12px; cursor: pointer; font: inherit; }
.venue:hover { border-color: var(--lamp); }
.tools { width: min(340px, 100%); display: grid; gap: 10px; }
.lamp-tool { display: grid; gap: 4px; }
.lamp-row { display: flex; gap: 8px; align-items: center; }
.lamp-row input[type="range"] { flex: 1; min-width: 0; }
.sweep-btn[aria-pressed="true"] { border-color: var(--lamp); color: var(--lamp); }
.lamp-tool label { display: flex; justify-content: space-between; font: 12px "IBM Plex Mono", monospace; color: #cfe0d6; }
input[type=range] { width: 100%; accent-color: var(--lamp); }
.tool-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tool-buttons:has(> :not([hidden])) { min-height: 36px; }
.desk-hint { text-align: center; color: #9fc2b3; }

/* grading form */
.grade-form { display: grid; gap: 10px; }
.area { margin: 0; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px 12px; display: grid; gap: 6px; }
.area legend { padding: 0 4px; font: 600 15px "Pixelify Sans", monospace; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; min-width: 42px; text-align: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel2); font: 700 17px/1 var(--num); font-variant-numeric: tabular-nums; }
.chip:hover span { border-color: #6a5024; }
.chip input:checked + span { background: var(--lamp); color: #1a1206; border-color: var(--lamp); }
.chip input:focus-visible + span { outline: 2px solid var(--lamp); outline-offset: 2px; }
.overall-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px; border-top: 1px solid var(--line); }
.overall-row output { font: 700 28px/1 var(--num); color: var(--lamp); }

/* review */
.review { display: grid; gap: 10px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.verdict { font: 600 20px "Pixelify Sans", monospace; }
.verdict.good { color: var(--felt); }
.verdict.bad { color: var(--flag); }
.review table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.review th, .review td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.review thead th { font: 500 11.5px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.review td { font: 700 18px var(--num); text-align: center; width: 64px; }
.review .why { display: block; font: 12.5px/1.4 "IBM Plex Mono", monospace; color: var(--muted); font-weight: 400; }
.review tr.ok td:nth-of-type(1) { color: var(--felt); }
.review tr.miss td:nth-of-type(1) { color: var(--flag); }
.review tr.total th { font-family: "Pixelify Sans", monospace; font-size: 16px; }

/* narrow screens: challenge, exam results */
.narrow { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.score { font: 700 88px/1 var(--num); color: var(--lamp); }
.score small { font-size: 28px; color: var(--muted); margin-left: 6px; }
.share { display: grid; gap: 10px; }
.share label { font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
textarea { resize: none; width: 100%; }
.best { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.best li { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--panel); border-radius: 3px; font-family: "IBM Plex Mono", monospace; }
.best b { color: var(--lamp); }

/* certificate */
.cert-wrap { max-width: 720px; margin: 0 auto; display: grid; gap: 20px; justify-items: stretch; }
.cert { background: #f4efe4; color: #16263a; border: 10px double #c9a24a; padding: 40px 32px; text-align: center; display: grid; gap: 12px; }
.cert-eyebrow { font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: #7a5a1e; }
.cert h1 { color: #16263a; }
.cert-name { font: 700 clamp(26px, 5vw, 38px) "Cinzel", Georgia, serif; }
.cert-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font: 13px "IBM Plex Mono", monospace; }

/* rulebook */
.rulebook { width: min(640px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; background: var(--panel); color: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.rulebook::backdrop { background: rgba(5, 8, 12, .7); }
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #10151d; }
.rb-body { padding: 16px 18px 20px; display: grid; gap: 16px; overflow: auto; max-height: calc(100vh - 130px); }
.rb-area { display: grid; gap: 6px; }
.rb-area table { width: 100%; border-collapse: collapse; }
.rb-area td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rb-area td.g { text-align: right; font: 700 17px var(--num); color: var(--lamp); width: 60px; }

@media (prefers-reduced-motion: reduce) {
  .layers.wiping::after { animation: none; }
  .meter i { transition: none; }
}
