/**
 * Slot card (js/slotcard.js) + complaint form (js/report.js).
 *
 * Both screens live inside the shared modal, so this file only adds what those
 * two need: the 3x preview, the contract history, the tabs and the ticket.
 * Buttons, fields, pills and the modal shell itself come from css/base.css, and
 * the banner internals come from css/wall.css - nothing is restyled here.
 */

/* --- card skeleton of the layout ------------------------------------------ */
.card { display: grid; gap: var(--s-4); }
.card .acts { margin-top: 0; }

.card-top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding-bottom: var(--s-2); border-bottom: 1px solid var(--line);
}
.card-addr { font-size: var(--fs-sm); color: var(--ink-3); letter-spacing: var(--track); }

.card-grid { display: grid; gap: var(--s-4); align-items: start; }
@media (min-width: 560px) { .card-grid { grid-template-columns: auto 1fr; } }

/* --- 3x preview ------------------------------------------------------------ */
.card-prev { text-align: center; }
.cap { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.cap.dim { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 2px; }

.b3 {
  --zoom: 3;
  /* wall.js retunes --cw on <html> for the live grid; the preview is always 1:1. */
  --cw: 88px;
  position: relative;
  width: calc(88px * var(--zoom));
  height: calc(31px * var(--zoom));
  margin: 0 auto;
  border: 1px solid var(--line-2);
  overflow: hidden;
  /* Checkerboard: a transparent banner must look transparent, not white. */
  background-color: #fff;
  background-image:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
/*
 * The banner itself is rendered at its true 88x31 and then scaled, so every
 * internal style comes from css/wall.css (.g / .row / .tx / .px / .bars) and the
 * preview stays pixel-identical to the wall - nothing is redeclared here.
 * The flex centring is for the "$1" label of a free slot, which the wall centres
 * on the cell (.b.free), not on the label.
 */
.b3 .bx {
  position: absolute;
  top: 0;
  left: 0;
  width: 88px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: scale(var(--zoom));
  transform-origin: 0 0;
}
/* On the wall an image is letterboxed on black; here the checkerboard has to
   show through, otherwise a transparent PNG reads as a solid one. */
.b3 .g { background: none; }
@media (max-width: 340px) { .b3 { --zoom: 2; } }

/* --- facts ----------------------------------------------------------------- */
.card-facts dd { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.card-facts .lnk { overflow-wrap: anywhere; color: var(--ink-2); }
.card-facts .open { padding: 2px 6px; flex: 0 0 auto; }

/* --- notices --------------------------------------------------------------- */
.note {
  margin: 0; padding: var(--s-3);
  border-left: 2px solid var(--ink); background: var(--surface-2);
  font-size: var(--fs-sm); line-height: 1.5;
}
.note.bad { border-left-color: var(--danger); color: var(--danger); }

/* --- money explainer ------------------------------------------------------- */
.money { border: 1px solid var(--line); padding: var(--s-3); background: var(--surface-2); }
.money p { margin: 0 0 var(--s-2); font-size: var(--fs-md); line-height: 1.5; }
.money p:last-child { margin-bottom: 0; }
.money .hint { margin-top: var(--s-2); }

/* --- contract history ------------------------------------------------------ */
.hist { border-top: 1px solid var(--line); padding-top: var(--s-3); }
.hist .label { margin-bottom: var(--s-2); }
.hist-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.ev {
  display: grid; grid-template-columns: 82px 1fr auto; gap: var(--s-2);
  align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.ev:last-child { border-bottom: 0; }
.ev-t { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.ev-x { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-who { color: var(--ink-3); }
.ev-tx { white-space: nowrap; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.ev-tx.dim { color: var(--ink-4); border: 0; }
@media (max-width: 420px) {
  .ev { grid-template-columns: 1fr auto; }
  .ev-t { grid-column: 1 / -1; }
  .card .acts { flex-direction: column; }
}

/* --- loading --------------------------------------------------------------- */
.sk { background: var(--surface-3); }
.sk-prev { width: calc(88px * 3); max-width: 100%; height: calc(31px * 3); margin: 0 auto; }
.sk-line { height: 12px; margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: sk-pulse 1.2s ease-in-out infinite; }
}
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* --- report: tabs ---------------------------------------------------------- */
.tabs { display: flex; border-bottom: 1px solid var(--line-2); margin-bottom: var(--s-3); }
.tab {
  appearance: none; margin: 0 0 -1px; padding: 8px 12px;
  border: 1px solid transparent; border-bottom: 0; background: none;
  font: 600 var(--fs-sm)/1.2 var(--font); text-transform: uppercase;
  letter-spacing: var(--track); color: var(--ink-3); cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--line-2); background: var(--surface); }
.tab:hover { color: var(--ink); }

/* --- report: forms --------------------------------------------------------- */
.rep-form .cap { margin: 0 0 var(--s-2); text-align: left; }
.rep-form [aria-invalid="true"] { border-color: var(--danger); }
/* A prefilled slot number is not editable: the complaint is about that banner. */
.rep-form input[readonly] { background: var(--surface-3); color: var(--ink-2); }
.sworn { margin-top: var(--s-4); display: grid; gap: var(--s-2); }
.check {
  display: flex; align-items: flex-start; gap: var(--s-2);
  font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); cursor: pointer;
}
.check input { width: auto; flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--accent); }

/* --- report: reason checkboxes + captcha ---------------------------------- */
.reasons { display: grid; gap: 5px; margin-top: var(--s-1); }
.reason span { color: var(--ink); }
.reason.red span { color: var(--danger); font-weight: 700; }   /* CSAM group stands out */
.captcha { margin-top: var(--s-3); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.captcha-note { font-size: var(--fs-xs); color: var(--ink-3); }

/* --- report: receipt ------------------------------------------------------- */
.ticket-box { text-align: center; padding: var(--s-3) 0 0; }
.ticket {
  margin: var(--s-2) 0 var(--s-3); padding: var(--s-3);
  border: 1px solid var(--ink); background: var(--surface-2);
  font-size: 24px; font-weight: 700; letter-spacing: .1em;
}
.ticket-note {
  margin: 0;
  padding: var(--s-3);
  border-left: 2px solid var(--ok);
  background: var(--surface-2);
  font-size: var(--fs-md);
  line-height: 1.5;
  text-align: left;
}
.ticket-box .hint { margin-top: var(--s-2); }

/* --- keyboard focus (base.css leaves buttons unstyled here) ---------------- */
.card .btn:focus-visible,
.rep-form .btn:focus-visible,
.ticket-box .btn:focus-visible,
.tab:focus-visible,
.card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
