/* Trade Counter Simulator bug site: the game's own colours (orange hex nut, charcoal, warm white) and its font, Rubik (SIL OFL). */
@font-face { font-family: "Rubik"; src: url("/fonts/Rubik-Medium.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("/fonts/Rubik-Bold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }

:root {
  --orange: #f07d1f;
  --orange-dark: #c45c0e;
  --charcoal: #1e2328;
  --charcoal-2: #2c323a;
  --charcoal-3: #3a424c;
  --paper: #f7f5f0;
  --paper-2: #ece8df;
  --ink: #1e2328;
  --muted: #6b7785;
  --yellow: #fac81e;
  --green: #2f9e5b;
  --red: #d64534;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--charcoal); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 500 16px/1.5 "Rubik", system-ui, sans-serif; color: var(--paper);
  background:
    radial-gradient(1200px 500px at 50% -10%, #2c323a 0%, transparent 70%),
    var(--charcoal);
}
a { color: var(--orange); }

/* ---------- header ---------- */
.hero {
  position: relative; text-align: center; padding: 56px 20px 64px;
  background:
    linear-gradient(180deg, rgba(30,35,40,.55) 0%, rgba(30,35,40,.82) 60%, var(--charcoal) 100%),
    url("/img/hero.jpg") center 40% / cover no-repeat;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.wordmark { width: min(520px, 86vw); height: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.hero h1 { margin: 22px 0 8px; font-size: clamp(26px, 4.2vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.lede { margin: 0 auto; max-width: 600px; color: #d5d9de; font-size: 17px; }
.stripe {
  position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: repeating-linear-gradient(-45deg, var(--orange) 0 18px, var(--charcoal) 18px 36px);
}
.stripe.thin { position: static; height: 6px; }

/* ---------- layout ---------- */
.wrap { width: min(920px, 100% - 32px); margin: 32px auto 56px; flex: 1; }

/* ---------- version card ---------- */
.version-card {
  display: flex; gap: 16px; align-items: center; padding: 14px 18px; margin-bottom: 22px;
  border-radius: var(--radius); background: var(--charcoal-2); border: 2px solid var(--charcoal-3);
}
.version-card img { flex: none; }
.version-card strong { display: block; font-size: 18px; font-weight: 700; }
.version-card span { color: #c3c9d0; font-size: 15px; }
.version-card.ok { border-color: var(--green); background: linear-gradient(90deg, rgba(47,158,91,.18), var(--charcoal-2) 60%); }
.version-card.ok strong::before { content: "✓ "; color: #5fd08c; }
.version-card.old { border-color: var(--yellow); background: linear-gradient(90deg, rgba(250,200,30,.16), var(--charcoal-2) 60%); }
.version-card.old strong { color: var(--yellow); }
.version-card.checking strong { color: #c3c9d0; }

/* ---------- the report "slip" ---------- */
.slip, .receipt-paper {
  color: var(--ink); background: var(--paper); border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 2px 0 rgba(255,255,255,.04) inset;
}
.slip { overflow: hidden; }
.slip-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 24px; background: var(--orange); color: #fff;
}
.slip-label { font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .14em; }
.slip-ref { font-size: 14px; opacity: .95; }
.slip-ref b { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .05em; }
.slip-body { padding: 24px; display: grid; gap: 18px; }
.slip-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 24px; background: var(--paper-2); border-top: 2px dashed #cfc8b8;
}

.row { display: grid; gap: 18px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1.6fr 1.1fr; }
@media (max-width: 760px) { .row.two, .row.three { grid-template-columns: 1fr; } }

.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--charcoal-2); }
.field i { color: var(--orange-dark); font-style: normal; }
.field em { text-transform: none; letter-spacing: 0; font-style: normal; font-weight: 500; color: var(--muted); }

input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid #d9d3c6; border-radius: 8px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus, .drop:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(240,125,31,.2); }
input.bad, textarea.bad { border-color: var(--red); }
::placeholder { color: #a29c90; }
.inline { display: flex; gap: 12px; align-items: center; }
.inline input { flex: 1; }

/* chips: radio buttons that look like the game's shelf tags */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block; padding: 7px 11px; border-radius: 6px; font-size: 14px; font-weight: 600;
  background: #fff; border: 2px solid #d9d3c6; color: var(--charcoal-2); transition: all .12s;
}
.chips label:hover span { border-color: #bdb4a2; }
.chips input:focus-visible + span { box-shadow: 0 0 0 4px rgba(240,125,31,.25); }
.chips input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.chips input:checked + span.sev-crash { background: var(--red); border-color: var(--red); }
.chips input:checked + span.sev-block { background: var(--orange); border-color: var(--orange); }
.chips input:checked + span.sev-annoy { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.chips input:checked + span.sev-small { background: #5b7fa3; border-color: #5b7fa3; }

.check { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; white-space: nowrap; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }

/* drop zones */
.drop {
  border: 2px dashed #c9c1b0; border-radius: 8px; background: #fff; padding: 14px;
  min-height: 150px; display: grid; place-items: center; text-align: center; cursor: pointer; transition: all .15s;
}
.drop:hover, .drop.over { border-color: var(--orange); background: #fff8f1; }
.drop-empty { display: grid; gap: 4px; }
.drop-empty b { font-weight: 600; }
.drop small { color: var(--muted); font-size: 13px; }
.drop code {
  display: block; margin: 2px auto; padding: 5px 8px; max-width: 100%; overflow-wrap: anywhere;
  font: 12px/1.4 ui-monospace, Consolas, monospace; background: var(--paper-2); border-radius: 5px; color: var(--charcoal-2); user-select: all; cursor: text;
}
kbd { font: 600 12px ui-monospace, Consolas, monospace; padding: 1px 5px; border: 1px solid #bbb; border-bottom-width: 2px; border-radius: 4px; background: #fafafa; }
.drop-full { display: grid; gap: 8px; justify-items: center; }
.drop-full img { max-width: 100%; max-height: 180px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.file-pill { padding: 8px 12px; background: var(--charcoal); color: #fff; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--orange-dark); text-decoration: underline; cursor: pointer; }

/* system details */
.system { border: 2px solid #e1dbcf; border-radius: 8px; padding: 10px 14px; background: #fff; }
.system summary { cursor: pointer; font-weight: 600; }
.system summary span { color: var(--muted); font-weight: 500; }
.system dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; font-size: 14px; }
.system dt { color: var(--muted); }
.system dd { margin: 0; overflow-wrap: anywhere; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { margin: 0; padding: 10px 14px; border-radius: 8px; background: #fde7e4; color: #8d2417; font-weight: 600; }
.small { margin: 0; font-size: 13px; color: var(--muted); max-width: 520px; }

.btn {
  font: 700 17px "Rubik", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: #fff;
  background: var(--orange); border: 0; border-bottom: 4px solid var(--orange-dark); border-radius: 8px;
  padding: 14px 30px; cursor: pointer; transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn:disabled { filter: grayscale(.6); cursor: wait; }
.btn.ghost { background: var(--charcoal); border-bottom-color: #000; }

/* ---------- receipt ---------- */
.receipt { display: grid; place-items: center; }
.receipt-paper {
  width: min(420px, 100%); padding: 30px 28px 34px; text-align: center; position: relative;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px;
  animation: print .6s ease-out;
  /* torn bottom edge */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
}
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.receipt-paper h2 { font: 800 24px "Rubik", sans-serif; text-transform: uppercase; letter-spacing: .1em; margin: 10px 0 4px; }
.ticket { margin: 0; font-size: 17px; }
.ticket b { font-size: 26px; color: var(--orange-dark); letter-spacing: .06em; }
.dashes { border-top: 2px dashed #bdb4a2; margin: 18px 0; }
.receipt-paper dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; text-align: left; margin: 0; }
.receipt-paper dt { color: var(--muted); }
.receipt-paper dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.receipt-paper p { font-family: "Rubik", sans-serif; }
.receipt-paper .btn { margin-top: 8px; }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: 14px; }
.foot p { margin: 18px; }

/* ---------- admin ---------- */
.admin .wrap { width: min(1200px, 100% - 32px); }
.admin-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-bar h1 { margin: 0; font-size: 26px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: 600 14px "Rubik", sans-serif; padding: 8px 12px; border-radius: 6px; border: 2px solid var(--charcoal-3); background: var(--charcoal-2); color: #d5d9de; cursor: pointer; }
.tabs button.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.panel { background: var(--charcoal-2); border: 2px solid var(--charcoal-3); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.panel .inline input { max-width: 160px; }
.panel label.mini { font-size: 13px; color: #c3c9d0; display: grid; gap: 4px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: #9aa4af; padding: 8px; border-bottom: 2px solid var(--charcoal-3); }
table.list td:first-child { white-space: nowrap; }
table.list td { padding: 9px 8px; border-bottom: 1px solid var(--charcoal-3); vertical-align: top; }
table.list tr { cursor: pointer; }
table.list tbody tr:hover { background: #333a43; }
table.list tr.sel { background: #3d3326; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; background: var(--charcoal-3); color: #fff; white-space: nowrap; }
.tag.new { background: var(--orange); }
.tag.seen { background: #5b7fa3; }
.tag.fixed { background: var(--green); }
.tag.wontfix, .tag.duplicate { background: #59616b; }
.tag.old { background: var(--yellow); color: var(--ink); }
.tag.crash { background: var(--red); }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.detail { color: var(--ink); background: var(--paper); border-radius: var(--radius); padding: 20px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.detail h2 { margin: 0 0 6px; font-size: 20px; }
.detail h3 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: 14px/1.5 "Rubik", sans-serif; }
.detail pre.log { font: 12px/1.4 ui-monospace, Consolas, monospace; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 10px; max-height: 300px; overflow: auto; }
.detail img { max-width: 100%; border-radius: 6px; cursor: zoom-in; }
.detail .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.detail .actions button { font: 600 13px "Rubik", sans-serif; padding: 7px 10px; border-radius: 6px; border: 2px solid #d9d3c6; background: #fff; cursor: pointer; }
.detail .actions button.on { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.detail .actions button.danger { color: var(--red); margin-left: auto; }
.muted { color: var(--muted); }
.login { max-width: 420px; margin: 40px auto; }
