/* The free tools built by tools/build_tools.mjs: trade checker, deck price checker, release dates, fake card
   checker, card grader and the /tools/ page. Site colours and fonts from /css/site.css. */
.tool-page { padding-bottom: 40px; }
.tool-head { margin: 8px 0 18px; }
.tool-head h1 { font: 700 clamp(28px, 5vw, 44px) var(--pixel); line-height: 1.1; margin: 6px 0 10px; }
.tool-head .lead { color: var(--muted); font-size: 17px; max-width: 760px; margin: 0; }
.tool-app { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 0 0 34px; }
.tool-text { max-width: 820px; }
.tr-hint, .tr-fine { color: var(--muted); font-size: 14px; margin: 8px 0; }
.tr-fine { font-size: 12.5px; }
.tr-link { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.tt-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.tt-pick { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.tool-app select, .tool-app input[type="search"], .tool-app input[type="text"], .tool-app input[type="number"], .tool-app textarea {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 15px; }
.tool-app select:focus, .tool-app input:focus, .tool-app textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.tt-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.tt-seg button { background: transparent; color: var(--muted); border: 0; padding: 8px 14px; font: 600 14px var(--body); cursor: pointer; }
.tt-seg button[aria-pressed="true"] { background: var(--gold); color: #111; }

/* ---------- Trade checker ---------- */
.tr-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tr-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.tr-side > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tr-side h2 { font: 700 20px var(--pixel); margin: 0; }
.tr-side[data-side="t"] h2 { color: #7be3a1; }
.tr-side[data-side="g"] h2 { color: #ffb08a; }
.tr-total { font: 700 22px var(--pixel); color: var(--gold); white-space: nowrap; }
.tr-search { display: flex; gap: 8px; }
.tr-search input { flex: 1; min-width: 0; }
.tr-adds { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.tr-chip { background: transparent; border: 1px dashed var(--line); color: var(--text); border-radius: 999px; padding: 7px 12px; font: 600 13.5px var(--body); cursor: pointer; }
.tr-chip:hover { border-color: var(--gold); color: var(--gold); }
.tr-results { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 10px 0; max-height: 520px; overflow: auto; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tr-hit { background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; }
.tr-hit:hover, .tr-hit:focus-visible { border-color: var(--gold); }
.tr-hit img { width: 100%; height: auto; aspect-ratio: 245 / 342; border-radius: 6px; background: var(--bg); }
.tr-hit span { font-weight: 600; font-size: 13px; line-height: 1.25; }
.tr-hit small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.tr-hit em { font-style: normal; color: var(--gold); font-weight: 700; font-size: 13px; min-height: 1em; }
.tr-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tr-row { display: grid; grid-template-columns: 62px 1fr auto auto; gap: 10px; align-items: center; background: var(--bg-2); border-radius: 10px; padding: 8px; }
.tr-row img { width: 62px; height: auto; aspect-ratio: 245 / 342; border-radius: 5px; background: var(--bg); }
.tr-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-info b { font-size: 14.5px; line-height: 1.25; }
.tr-info small { color: var(--muted); font-size: 12px; }
.tr-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tool-app .tr-opts select { padding: 5px 6px; font-size: 13px; }
.tr-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tr-qty button { background: var(--card); color: var(--text); border: 0; width: 28px; height: 30px; font-size: 16px; cursor: pointer; }
.tr-qty b { min-width: 24px; text-align: center; font-size: 14px; }
.tr-price { text-align: right; display: flex; flex-direction: column; }
.tr-price b { color: var(--gold); font-size: 15px; white-space: nowrap; }
.tr-price small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tr-x { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; align-self: start; }
.tr-x:hover { color: var(--coral); }
.tr-missing { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.tr-verdict { margin: 16px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tr-verdict h3 { font: 700 24px var(--pixel); margin: 10px 0 4px; }
.tr-verdict p { margin: 6px 0; }
.tr-verdict.ok h3 { color: #7be3a1; }
.tr-verdict.meh h3 { color: var(--gold); }
.tr-verdict.bad h3 { color: #ff8a7a; }
.tr-meter { height: 14px; border-radius: 999px; background: #3bbf75; overflow: hidden; }
.tr-meter i { display: block; height: 100%; background: #ff9466; border-right: 3px solid var(--bg); transition: width 0.4s; }
.tr-meter-legend { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.tr-meter-legend b { color: var(--text); }
.tr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tr-mine { position: fixed; inset: 0; z-index: 60; background: rgba(5, 6, 15, 0.75); display: flex; align-items: flex-end; justify-content: center; }
.tr-mine-in { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 16px; width: min(900px, 100%); max-height: 80vh; overflow: auto; }
.tr-mine-in header { display: flex; justify-content: space-between; align-items: center; }
.tr-mine-in h3 { font: 700 20px var(--pixel); margin: 0 0 10px; }
.tr-scanner { position: relative; z-index: 80; }
@media (max-width: 760px) {
  .tool-app { padding: 12px; border-radius: 12px; }
  .tr-sides { grid-template-columns: 1fr; }
  .tr-row { grid-template-columns: 52px 1fr auto; }
  .tr-row img { width: 52px; }
  .tr-price { grid-column: 2; grid-row: 2; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
  .tr-x { grid-column: 3; grid-row: 1; }
  .tr-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

/* ---------- Deck price checker ---------- */
.dk-form label { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; }
.dk-form label small { color: var(--muted); font-size: 13px; }
.dk-form textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; line-height: 1.45; resize: vertical; }
.dk-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 12px 0 8px; }
.dk-tops { display: flex; flex-wrap: wrap; gap: 8px; }
.dk-out { margin-top: 18px; scroll-margin-top: 140px; }
.dk-progress { max-width: 420px; }
.dk-label { font-weight: 700; color: var(--gold); margin: 0 0 10px; }
.dk-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.dk-sum div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.dk-sum small { color: var(--muted); font-size: 12.5px; }
.dk-sum b { font: 700 22px var(--pixel); color: var(--gold); }
.dk-rules { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 14.5px; }
.dk-rules p { margin: 4px 0; }
.dk-rules.ok { background: rgba(59, 191, 117, 0.12); border: 1px solid rgba(59, 191, 117, 0.45); }
.dk-rules.bad { background: rgba(255, 107, 87, 0.1); border: 1px solid rgba(255, 107, 87, 0.45); }
.dk-rules code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.dk-table td, .dk-table th { vertical-align: middle; }
/* The card column reads left to right and wraps (the shared .data table right-aligns and never wraps, which pushed the
   names off a phone screen, 2026-11-29); the count column needs no 9em. */
.dk-table td:first-child, .dk-table th:first-child { min-width: 0; }
.dk-table td:nth-child(2), .dk-table thead th:nth-child(2) { text-align: left; white-space: normal; }
.dk-group th { background: var(--card); text-align: left; font-family: var(--pixel); }
.dk-n { font-weight: 700; width: 28px; }
.dk-card { display: flex; gap: 10px; align-items: center; }
.dk-card img { width: 36px; height: auto; aspect-ratio: 245 / 342; border-radius: 3px; background: var(--bg); flex: none; }
.dk-card span { display: flex; flex-direction: column; }
.dk-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.dk-m { text-align: right; white-space: nowrap; }
.dk-own { text-align: center; color: #7be3a1; font-weight: 700; }
@media (max-width: 760px) {
  .dk-sum { grid-template-columns: 1fr 1fr; }
  .dk-sum b { font-size: 19px; }
  .dk-table .dk-card img { display: none; }
}

/* ---------- Set release dates ---------- */
.rd-next { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: center; background: radial-gradient(ellipse at 80% 0%, rgba(245, 197, 66, 0.18), transparent 60%), var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 30px; }
.rd-next h2 { font: 700 clamp(24px, 4vw, 34px) var(--pixel); margin: 6px 0; }
.rd-date { font: 700 20px var(--pixel); color: var(--gold); margin: 0 0 10px; }
.rd-count { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rd-count div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 6px; text-align: center; display: flex; flex-direction: column; }
.rd-count b { font: 700 clamp(30px, 6vw, 46px) var(--pixel); color: var(--gold); line-height: 1; }
.rd-count small { color: var(--muted); font-size: 13px; margin-top: 6px; }
.rd-year { font: 700 22px var(--pixel); margin: 26px 0 8px; }
.rd-table small { color: var(--muted); }
.rd-table td:nth-child(2), .rd-table td:nth-child(3) { white-space: nowrap; }
@media (max-width: 760px) { .rd-next { grid-template-columns: 1fr; padding: 16px; } .rd-table td:nth-child(4), .rd-table th:nth-child(4) { display: none; } }

/* ---------- Fake card checker ---------- */
.fk-step { margin-bottom: 22px; scroll-margin-top: 140px; }
.fk-step h2 { font: 700 21px var(--pixel); margin: 0 0 12px; display: flex; gap: 10px; align-items: center; }
.fk-step h2 span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #111; font-size: 16px; flex: none; }
.fk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; }
.fk-pair figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fk-pair img { width: 100%; height: auto; aspect-ratio: 245 / 342; object-fit: cover; border-radius: 12px; background: var(--card); }
.fk-pair figcaption { color: var(--muted); font-size: 13px; text-align: center; }
.fk-drop { aspect-ratio: 245 / 342; border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 12px; cursor: pointer; }
.fk-drop:hover { border-color: var(--gold); }
.fk-drop b { font-size: 34px; }
.fk-drop small { color: var(--muted); font-size: 12px; }
.fk-slider { max-width: 340px; margin-top: 16px; }
.fk-stack { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 245 / 342; background: var(--card); }
.fk-stack > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fk-top { position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; border-right: 3px solid var(--gold); }
.fk-top img { height: 100%; object-fit: cover; display: block; max-width: none; }
.fk-slider input[type="range"] { width: 100%; margin-top: 10px; accent-color: var(--gold); }
.fk-checks { list-style: none; counter-reset: fk; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fk-check { counter-increment: fk; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fk-check h3 { font-size: 16.5px; margin: 0 0 6px; }
.fk-check h3::before { content: counter(fk) ". "; color: var(--gold); }
.fk-check p { color: var(--muted); font-size: 14.5px; margin: 0 0 10px; }
.fk-check p b { color: var(--text); }
.fk-check[data-answer="yes"] { border-color: rgba(59, 191, 117, 0.6); }
.fk-check[data-answer="no"] { border-color: rgba(255, 107, 87, 0.7); }
.fk-ans { display: flex; gap: 8px; flex-wrap: wrap; }
.fk-ans button { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 16px; font: 600 14px var(--body); cursor: pointer; }
.fk-ans button[aria-pressed="true"][data-ans="yes"] { background: #3bbf75; border-color: #3bbf75; color: #0b1a10; }
.fk-ans button[aria-pressed="true"][data-ans="no"] { background: #ff6b57; border-color: #ff6b57; color: #1a0b08; }
.fk-ans button[aria-pressed="true"][data-ans="unsure"] { background: var(--line); }
.fk-verdict { margin-top: 16px; background: var(--bg-2); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.fk-verdict h3 { font: 700 22px var(--pixel); margin: 0 0 4px; }
.fk-verdict p { margin: 4px 0; }
.fk-verdict.ok { border-color: #3bbf75; }
.fk-verdict.ok h3 { color: #7be3a1; }
.fk-verdict.meh { border-color: var(--gold); }
.fk-verdict.meh h3 { color: var(--gold); }
.fk-verdict.bad { border-color: #ff6b57; }
.fk-verdict.bad h3 { color: #ff8a7a; }

/* ---------- Card grader ---------- */
.gr-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gr-h { font: 700 21px var(--pixel); margin: 0 0 12px; display: flex; gap: 10px; align-items: center; }
.gr-h span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #111; font-size: 16px; flex: none; }
.gr-h small { color: var(--muted); font: 400 14px var(--body); }
.gr-drop { border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 26px 14px; cursor: pointer; min-height: 220px; }
.gr-drop:hover { border-color: var(--gold); }
.gr-drop b { font-size: 34px; }
.gr-drop small { color: var(--muted); font-size: 12.5px; max-width: 300px; }
.gr-stage { background: #05060f; border-radius: 10px; overflow: hidden; }
.gr-stage canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.gr-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.gr-sel { color: var(--muted); font-size: 13.5px; }
.gr-nudge { display: inline-flex; gap: 6px; }
.gr-nudge button { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 40px; height: 34px; cursor: pointer; }
.gr-read { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 15px; }
.gr-read b { color: var(--gold); font-family: var(--pixel); font-size: 18px; }
.gr-links { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }
.gr-cond { margin-top: 22px; }
.gr-cond fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 10px; }
.gr-cond legend { font-weight: 700; padding: 0 6px; }
.gr-cond label { display: inline-flex; align-items: center; gap: 7px; margin: 6px 16px 0 0; font-size: 14.5px; cursor: pointer; }
.gr-cond input { accent-color: var(--gold); width: 17px; height: 17px; }
.gr-result { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.gr-result h2 { font: 700 21px var(--pixel); margin: 0 0 12px; }
.gr-nums, .gr-verdicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gr-nums div, .gr-co { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.gr-nums small, .gr-co small { color: var(--muted); font-size: 12.5px; }
.gr-nums b { font: 700 24px var(--pixel); }
.gr-co b { font: 700 19px var(--pixel); color: var(--gold); }
.gr-est { border-color: var(--gold); }
.gr-limits { margin: 10px 0; }
.gr-limits summary { cursor: pointer; color: var(--gold); font-weight: 600; }
@media (max-width: 760px) { .gr-sides { grid-template-columns: 1fr; } }

/* ---------- Tool tiles: /tools/ and "More free tools" ---------- */
.tool-more { margin-top: 40px; }
.tool-more h2, .tool-page .series-title { font: 700 22px var(--pixel); margin: 26px 0 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool-tile { display: flex; flex-direction: column; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.tool-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.tool-ico { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.tool-tile b { font: 700 17px var(--pixel); }
.tool-tile span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.tool-more > p { margin: 12px 0 0; }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .tool-tile { padding: 12px; } .tool-tile span:last-child { font-size: 12.5px; } }

/* ---------- /tools/: every tool shown working (2026-11-29). A phone with the tool's own screen recording, what it is
   good for, and how to use it in three steps; sides alternate on wide screens. ---------- */
.ts-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.ts-index a { display: inline-flex; gap: 6px; align-items: center; padding: 7px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); font: 600 14px var(--body); text-decoration: none; }
.ts-index a:hover { border-color: var(--gold); color: var(--gold); }
.ts { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); grid-template-areas: 'phone head' 'phone how'; gap: 10px 48px; align-items: start; padding: 38px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.ts:first-of-type { border-top: 0; }
.ts:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(200px, 270px); grid-template-areas: 'head phone' 'how phone'; }
.ts-phone { grid-area: phone; position: relative; aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden; border: 7px solid #23284a; background: #0b0e1f; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.ts-phone video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ts-head { grid-area: head; align-self: end; }
.ts-head h2 { font: 700 clamp(24px, 3.2vw, 34px) var(--pixel); line-height: 1.15; margin: 6px 0 8px; }
.ts-what { font-size: 18px; margin: 0 0 10px; }
.ts-good { color: var(--muted); margin: 0; }
.ts-good b { color: var(--text); }
.ts-how { grid-area: how; }
.ts-how h3 { font: 700 15px var(--body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); margin: 14px 0 10px; }
.ts-steps { list-style: none; counter-reset: ts; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.ts-steps li { counter-increment: ts; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font-size: 16px; line-height: 1.45; }
.ts-steps li::before { content: counter(ts); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #1d1d2b; font: 700 15px var(--pixel); }
@media (max-width: 760px) {
  .ts, .ts:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'phone' 'how'; padding: 28px 0; }
  .ts-phone { width: min(250px, 70vw); justify-self: center; margin: 8px 0 4px; }
  .ts-what { font-size: 16.5px; }
}
