/* Times Tables Trainer — supporter edition styles.
 *
 * Loaded only by the supporter build (the website copy and the $5 supporter
 * pack). The free edition never downloads this file: tools/build-itch.mjs
 * strips the link, the panels and js/supporter/extras.js from the free zip.
 */

/* ---------- Themes ---------- */
body.theme-space .board,
body.theme-ocean .board,
body.theme-forest .board,
body.theme-sunset .board,
body.theme-candy .board {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
}

body.theme-space .mode-btn.locked,
body.theme-ocean .mode-btn.locked,
body.theme-forest .mode-btn.locked,
body.theme-sunset .mode-btn.locked,
body.theme-candy .mode-btn.locked {
  opacity: 0.6;
}

body.theme-space .answer-btn,
body.theme-ocean .answer-btn,
body.theme-forest .answer-btn,
body.theme-sunset .answer-btn,
body.theme-candy .answer-btn {
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
}

body.theme-space .hint,
body.theme-ocean .hint,
body.theme-forest .hint,
body.theme-sunset .hint,
body.theme-candy .hint {
  color: #fff;
}

/* ---------- Badges ---------- */
.badges-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.badge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #f1f5f9;
  opacity: 0.55;
  text-align: left;
}

.badge-card.earned {
  opacity: 1;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #6ee7b7;
}

.badge-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.badge-body strong {
  display: block;
  font-size: 0.86rem;
  color: #0f172a;
}

.badge-body em {
  font-style: normal;
  font-size: 0.72rem;
  color: #64748b;
}

@media (max-width: 420px) {
  .badges-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Worksheets ---------- */
.ws-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.ws-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 10px;
}

.ws-preview {
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  max-height: 46vh;
  overflow: auto;
}

.ws-preview h1 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.ws-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.74rem;
  color: #475569;
  margin-bottom: 14px;
}

.ws-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 26px;
  padding: 0;
  margin: 0 0 16px;
}

.ws-grid li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  counter-increment: ws;
}

.ws-grid li::before {
  content: counter(ws) ".";
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  min-width: 20px;
}

.ws-grid {
  counter-reset: ws;
}

.ws-q {
  font-weight: 800;
  white-space: nowrap;
}

.ws-line {
  flex: 1;
  height: 1em;
  border-bottom: 1px solid #94a3b8;
}

.ws-key {
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

.ws-key h2 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.ws-key-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 16px;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
}

@media (max-width: 520px) {
  .ws-grid {
    grid-template-columns: 1fr;
  }

  .ws-key-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Printing a worksheet ----------
 * Only the sheet reaches the printer: everything else on the page is hidden. */
@media print {
  body.printing-worksheet {
    background: #fff !important;
  }

  body.printing-worksheet > * {
    display: none !important;
  }

  body.printing-worksheet #worksheet-panel {
    display: block !important;
    position: static;
    inset: auto;
    padding: 0;
    background: #fff;
    animation: none;
  }

  body.printing-worksheet #worksheet-panel .modal {
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    animation: none;
  }

  body.printing-worksheet .ws-controls,
  body.printing-worksheet .modal-actions,
  body.printing-worksheet .ws-hint,
  body.printing-worksheet #ws-title,
  body.printing-worksheet .modal-subtitle {
    display: none !important;
  }

  body.printing-worksheet .ws-preview {
    max-height: none;
    overflow: visible;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
}

/* ---------- Progress report ---------- */
.report-body {
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  max-height: 56vh;
  overflow: auto;
}

.report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-head h3 {
  font-size: 1.15rem;
}

.report-date {
  font-size: 0.72rem;
  color: #64748b;
}

.report-line {
  font-size: 0.8rem;
  color: #475569;
  margin: 6px 0 14px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.report-table th {
  text-align: left;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 6px;
}

.report-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.report-table td.rep-stars {
  color: #b45309;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.report-table td.rep-num {
  text-align: right;
}

.report-table tr.rep-weak td {
  color: #b91c1c;
}

.report-facts h4 {
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.report-fact {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  margin: 0 6px 6px 0;
}

.report-none {
  font-size: 0.78rem;
  color: #64748b;
}

.report-foot {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 12px;
}

@media print {
  body.printing-report #report-panel .modal {
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    animation: none;
    text-align: left;
  }

  body.printing-report #report-panel .modal-actions,
  body.printing-report #report-panel #report-title,
  body.printing-report #report-panel .modal-subtitle {
    display: none !important;
  }

  body.printing-report .report-body {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }
}
