/* Champion Cards card scanner. Brand tokens are taken from championcards.nl:
   red gradient from the logo, navy body text (#222e50), Fira Sans with italic headings. */
:root {
  --brand: #ff2c4a;
  --brand-deep: #d6102f;
  --brand-dark: #ac1010;      /* cart/wishlist badges on the shop */
  --ink: #222e50;             /* body text on the shop */
  --ink-soft: #4b5471;        /* breadcrumbs, muted text */
  --paper: #ffffff;
  --mist: #eeedf5;           /* light panels on the shop */
  --line: #e1e1e1;
  --ok: #17803d;
  --warn: #8a5a00;
  --radius: 10px;
  --gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
}
:root { color-scheme: light; } /* the shop is light only; the tool follows */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .2px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2 { font-weight: 500; font-style: italic; line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand-deep); }
.muted { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: .9rem; }

.topbar {
  background: var(--paper);
  border-bottom: 3px solid var(--brand);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 5;
}
.brand img { display: block; height: 44px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav form { margin: 0; }
.nav-link {
  font: inherit; font-style: italic; text-transform: uppercase; letter-spacing: 1px; font-size: .8rem;
  color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 6px; background: none; border: 0; cursor: pointer;
}
.nav-link.is-active { color: var(--brand-deep); font-weight: 600; }
.nav-link.is-soon { color: #9aa0b4; cursor: default; }
.nav-button:hover, a.nav-link:hover { background: var(--mist); }

.page { width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
.footer { text-align: center; color: var(--ink-soft); font-size: .8rem; padding: 16px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 0 0 16px; box-shadow: 0 1px 2px rgba(34, 46, 80, .05);
}
.card-narrow { max-width: 420px; margin: 24px auto; }

[hidden] { display: none !important; }
.form { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: .85rem; color: var(--ink-soft); }
.grow { flex: 1; }
input, select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid #c9ccd8; border-radius: 8px; padding: 12px; min-height: 48px; width: 100%;
}
input:focus, select:focus, .btn:focus-visible { outline: 3px solid rgba(255, 44, 74, .35); outline-offset: 1px; border-color: var(--brand); }

.btn {
  font: inherit; font-weight: 500; font-style: italic; letter-spacing: .5px;
  border: 0; border-radius: 8px; padding: 12px 18px; min-height: 48px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { filter: brightness(.95); }
.btn-primary[disabled] { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid #c9ccd8; }
.btn-ghost[disabled] { color: #9aa0b4; cursor: not-allowed; }
.btn-wide { width: 100%; }

.search { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.search .field { min-width: 0; flex: 1 1 220px; }

.notice { border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: .95rem; }
.notice-info { background: #e8ecfa; color: var(--ink); }
.notice-warn { background: #fff3d6; color: var(--warn); }
.notice-error { background: #fde4e8; color: var(--brand-dark); }
.notice-ok { background: #def3e5; color: var(--ok); }

.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }
.check input { width: 18px; min-height: 18px; accent-color: var(--brand-deep); }
a.result { text-decoration: none; }
.result.is-in-shop { background: #f6f6fb; }
.result.is-in-shop small { color: var(--ok); font-weight: 500; }

/* browse tiles */
.search-all { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; }
.tools .field { min-width: 160px; flex: 1 1 160px; }
.tools .check { flex: 1 1 100%; margin-top: 0; }
.tile { display: grid; gap: 4px; align-content: start; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.tile.is-in-shop { background: #f6f6fb; }
.tile-link { display: grid; gap: 6px; color: inherit; text-decoration: none; }
.tile-link img { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; background: var(--mist); border-radius: 4px; }
.tile-link b { font-weight: 500; font-size: .95rem; }
.tile small { color: var(--ink-soft); }
.tile-price { font-weight: 600; min-height: 1.4em; }
.tile-shop { color: var(--ok); font-weight: 500; font-size: .85rem; min-height: 1.2em; }
.btn-small { min-height: 40px; padding: 8px 10px; font-size: .9rem; width: 100%; }
.tile:hover, .tile:focus-within { border-color: var(--brand); }
.review { list-style: none; margin: 0 0 12px; padding: 10px 12px 10px 28px; }
.review li { list-style: disc; }
.results { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.result { display: grid; gap: 6px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.result:hover, .result:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(255, 44, 74, .2); }
.result img { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; background: var(--mist); border-radius: 4px; }
.result b { font-weight: 500; font-size: .95rem; }
.result small { color: var(--ink-soft); }

.detail { display: grid; gap: 18px; grid-template-columns: 1fr; }
.detail-img { width: min(100%, 320px); height: auto; aspect-ratio: 5 / 7; object-fit: contain; justify-self: center; background: var(--mist); border-radius: 8px; }
.ref { background: var(--mist); border-radius: 8px; padding: 10px 12px; font-size: .95rem; }
@media (min-width: 720px) {
  .detail { grid-template-columns: 300px 1fr; }
  .detail-img { justify-self: start; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .result { transition: filter .15s, box-shadow .15s, border-color .15s; }
}

/* password screens */
.meter { height: 8px; background: var(--mist); border-radius: 4px; overflow: hidden; margin-top: -6px; }
.meter span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.meter span[data-level="ok"] { background: #d99a00; }
.meter span[data-level="strong"] { background: var(--ok); }

/* usage dashboard */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 16px 0; }
.tilebox { background: var(--mist); border-radius: 8px; padding: 14px; display: grid; gap: 2px; }
.tilebox b { font-size: 1.6rem; font-weight: 600; font-style: italic; color: var(--ink); line-height: 1.2; }
.tilebox span { color: var(--ink-soft); font-size: .9rem; }
table.data { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data.wide td:not(:first-child), table.data.wide th:not(:first-child) { text-align: right; }
pre.report { background: var(--mist); border-radius: 8px; padding: 14px; overflow-x: auto; font-size: .85rem; line-height: 1.5; white-space: pre; }
