/* public/css/app.css */
/* Bernard League — dark editorial aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ─── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:          #0f0e0c;
  --bg2:         #1a1916;
  --bg3:         #242220;
  --border:      #2e2c29;
  --border2:     #3d3b37;
  --gold:        #c9a84c;
  --gold2:       #e8c878;
  --text:        #e8e4dc;
  --text2:       #9e9a92;
  --text3:       #6b6760;
  --green:       #4caf7d;
  --red:         #d95f5f;
  --blue:        #5b8dd9;
  --radius:      6px;
  --radius-lg:   12px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', system-ui, sans-serif;
  --shadow:       0 2px 12px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.6);
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ─── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 2rem;
  height: 58px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text) !important;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.nav-brand span { color: var(--gold); }
.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
  flex: 1;
}
.nav-links a {
  display: block;
  padding: .25rem .85rem;
  color: var(--text2);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg3); }
.nav-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
  color: var(--text2);
  margin-left: auto;
}

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ─── Page Header ────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--text);
}
.page-header .subtitle {
  margin-top: .4rem;
  color: var(--text2);
  font-size: .95rem;
}

/* ─── Auth ───────────────────────────────────────────────────────── */
.auth-page .main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 5rem;
}
.auth-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.auth-logo span { color: var(--gold); }
.auth-box h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.switch-link { margin-top: 1.25rem; font-size: .875rem; color: var(--text2); text-align: center; }
.error { color: var(--red); margin-bottom: 1rem; }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text2);
  margin-bottom: .4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  padding: .6rem .85rem;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}
.form-group input[readonly] { opacity: .6; cursor: not-allowed; }
.hint { font-weight: 400; color: var(--text3); font-size: .8rem; text-transform: none; letter-spacing: 0; }
.field-note { font-size: .78rem; color: var(--text3); margin-top: .35rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.form-note { font-size: .83rem; color: var(--text3); }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--gold);
  color: #0f0e0c;
  border: none;
  border-radius: var(--radius);
  padding: .6rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .02em;
}
.btn-primary:hover { background: var(--gold2); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-full { width: 100%; text-align: center; }
.btn-primary.btn-large { padding: .75rem 2rem; font-size: 1rem; }
.btn-primary.btn-sm { padding: .3rem .75rem; font-size: .82rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-size: .875rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  display: inline-block;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost.btn-sm { padding: .28rem .65rem; font-size: .8rem; }
.btn-warn {
  background: #7a2020;
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: .3rem .75rem;
  font-size: .82rem;
  cursor: pointer;
}
.btn-warn:hover { background: #a02828; }

/* ─── Cards / Lists ──────────────────────────────────────────────── */
.dash-section { margin-bottom: 2.5rem; }
.dash-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.card-list { display: flex; flex-direction: column; gap: .5rem; }
.card-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  transition: border-color .15s, background .15s;
  color: var(--text);
  text-decoration: none;
}
.card-item:hover { border-color: var(--gold); background: var(--bg3); color: var(--text); }
.card-item-main { flex: 1; display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; min-width: 0; }
.card-item-title { font-weight: 600; }
.card-item-sub { color: var(--text2); font-size: .875rem; }
.card-item-status { font-size: .8rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; text-align: right; }
.card-item-status.done { color: var(--green); }
.card-item-status.pending { color: var(--gold); }

/* ─── Tags / Badges ──────────────────────────────────────────────── */
.tag {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: .1rem .45rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.status-badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-setup    { background: rgba(91,141,217,.15); color: var(--blue); }
.status-active   { background: rgba(76,175,125,.15); color: var(--green); }
.status-pending  { background: rgba(201,168,76,.12); color: var(--gold); }
.status-open     { background: rgba(76,175,125,.15); color: var(--green); }
.status-grading  { background: rgba(217,95,95,.15);  color: var(--red); }
.status-complete { background: var(--bg3); color: var(--text2); }
.badge-saved { background: rgba(76,175,125,.15); color: var(--green); font-size:.75rem; padding:.1rem .5rem; border-radius:4px; font-weight:700; }

/* ─── Notices ────────────────────────────────────────────────────── */
.notice {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .9rem;
  border-left: 3px solid;
}
.notice-success { background: rgba(76,175,125,.1); border-color: var(--green); color: var(--green); }
.notice-info    { background: rgba(91,141,217,.1); border-color: var(--blue); color: #8ab4f5; }
.notice-warn    { background: rgba(201,168,76,.1); border-color: var(--gold); color: var(--gold); }

/* ─── Match Day / Question submission ───────────────────────────── */
.question-submission-form .question-form-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color .15s;
}
.question-submission-form .question-form-block:hover { border-color: var(--border2); }
.slot-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.slot-num, .slot-badge {
  background: var(--gold);
  color: #0f0e0c;
  font-weight: 900;
  font-size: .78rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  letter-spacing: .05em;
}
.slot-cat, .q-cat { color: var(--text2); font-size: .9rem; font-weight: 600; }

/* ─── Match play ─────────────────────────────────────────────────── */
.defensive-explainer {
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  margin-bottom: 1.75rem;
  font-size: .9rem;
  color: var(--text2);
}
.questions-list { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.q-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}
.q-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.opp-stat {
  margin-left: auto;
  font-size: .78rem;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .15rem .55rem;
}
.q-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.q-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .q-inputs { grid-template-columns: 1fr; } }

.def-options { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }
.def-label { cursor: pointer; }
.def-label input[type=radio] { display: none; }
.def-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--border2);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text2);
  transition: border-color .15s, background .15s, color .15s;
}
.def-label input:checked + .def-chip {
  border-color: var(--gold);
  background: rgba(201,168,76,.15);
  color: var(--gold);
}
.def-label:hover .def-chip { border-color: var(--gold); color: var(--gold); }

.sticky-submit {
  position: sticky;
  bottom: 1rem;
  background: var(--bg);
  padding: 1rem;
  border-top: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}
.def-msg { font-size: .85rem; flex: 1; }
.def-msg.warn  { color: var(--gold); }
.def-msg.error { color: var(--red); }
.def-msg.ok    { color: var(--green); }

/* ─── Results / Scoreboard ───────────────────────────────────────── */
.scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.score-player { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.score-name { font-size: .9rem; color: var(--text2); font-weight: 600; }
.score-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text3);
  line-height: 1;
}
.score-player.winner .score-num { color: var(--gold); }
.you-tag { font-size: .75rem; color: var(--text3); }
.score-sep {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
}

/* ─── Tables ─────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.results-table, .cat-stats-table, .responses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.results-table th, .results-table td,
.cat-stats-table th, .cat-stats-table td,
.responses-table th, .responses-table td {
  padding: .6rem .85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  background: var(--bg2);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.result-row td { vertical-align: middle; }
.slot-cell { white-space: nowrap; display: flex; gap: .5rem; align-items: center; padding: .6rem .85rem; }
.q-cat-sm { font-size: .75rem; color: var(--text3); }
.q-cell { max-width: 260px; line-height: 1.4; }
.ans-cell { }
.ans-cell.correct .correct-indicator { color: var(--green); margin-left: .35rem; }
.ans-cell.incorrect .correct-indicator { color: var(--red); margin-left: .35rem; }
.def-cell { color: var(--text3); font-size: .85rem; }
.pts-cell { font-weight: 700; }
.total-label { text-align: right; color: var(--text2); font-weight: 600; }
.total { font-size: 1.1rem; }

/* ─── Stats ──────────────────────────────────────────────────────── */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
}
.stat-card.highlight { border-color: var(--gold); }
.stat-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-label { font-size: .78rem; color: var(--text2); margin-top: .4rem; }
.stats-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}
.cat-name { font-weight: 600; }
.cat-bar-cell { width: 200px; }
.cat-bar {
  background: var(--bg3);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width .4s ease;
}
.cat-pct { color: var(--text2); font-size: .85rem; }
.cat-correct { color: var(--text2); font-size: .85rem; }

/* ─── Review ─────────────────────────────────────────────────────── */
.review-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
}
.review-q { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; }
.resp-row.correct td { background: rgba(76,175,125,.06); }
.resp-row.incorrect td { background: rgba(217,95,95,.06); }
.resp-autograde { color: var(--text3); font-size: .83rem; }
.toggle-correct { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .85rem; }
.badge { font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.badge.correct { background: rgba(76,175,125,.2); color: var(--green); }
.badge.incorrect { background: rgba(217,95,95,.2); color: var(--red); }

/* ─── Admin ──────────────────────────────────────────────────────── */
.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.admin-form { max-width: 660px; }
.admin-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1rem; }
.admin-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.admin-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.admin-card-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.admin-card-actions { margin-top: 1rem; }
.admin-md-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.admin-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.admin-detail-grid ul { padding-left: 1.2rem; color: var(--text2); font-size: .9rem; line-height: 1.9; }
.admin-detail-grid ol { padding-left: 1.2rem; color: var(--text2); font-size: .9rem; line-height: 1.9; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: .3rem .75rem;
  cursor: pointer;
  font-size: .875rem;
  transition: border-color .15s;
}
.checkbox-label:hover { border-color: var(--gold); }
.checkbox-label input { accent-color: var(--gold); }

.assignment-chip {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: .1rem .5rem;
  font-size: .78rem;
  color: var(--text2);
  margin: .1rem;
}
.assignment-chip.done { border-color: var(--green); color: var(--green); background: rgba(76,175,125,.08); }

/* ─── Empty state ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text3);
  font-style: italic;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .78rem;
  color: var(--text3);
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  letter-spacing: .08em;
}

/* ─── Light theme ────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:    #f5f3ee;
  --bg2:   #ffffff;
  --bg3:   #ede9e1;
  --border:  #d8d3c8;
  --border2: #c8c2b5;
  --gold:    #8a6a1a;
  --gold2:   #6b4f0e;
  --text:    #1a1816;
  --text2:   #4a4540;
  --text3:   #8a8278;
  --green:   #2d7a52;
  --red:     #a03030;
  --blue:    #2855a0;
}
[data-theme="light"] .navbar { background: #fff; }
[data-theme="light"] .cat-bar { background: #ddd8cc; }
[data-theme="light"] .cat-bar-fill { background: var(--gold); }
[data-theme="light"] .def-chip { border-color: #c8c2b5; color: #4a4540; }
[data-theme="light"] .auth-box { box-shadow: 0 4px 24px rgba(0,0,0,.08); }

/* ─── Back link ──────────────────────────────────────────────────── */
.back-link {
  display: inline-block;
  font-size: .82rem;
  color: var(--text3);
  margin-bottom: .6rem;
  transition: color .15s;
}
.back-link:hover { color: var(--gold); }

/* ─── Score display on dashboard ────────────────────────────────── */
.card-item-status.loss { color: var(--red); }

/* ─── Correct answer cell ────────────────────────────────────────── */
.correct-ans { color: var(--green); font-weight: 600; }

/* ─── Score correct count ────────────────────────────────────────── */
.score-correct { font-size: .8rem; color: var(--text2); }

/* ─── League table ───────────────────────────────────────────────── */
.league-table .my-row td { background: rgba(201,168,76,.08); font-weight: 600; }
.pos-cell { color: var(--text3); font-weight: 700; width: 2rem; }

/* ─── Results grid ───────────────────────────────────────────────── */
.results-grid th, .results-grid td { text-align: center; }
.results-grid .grid-name { text-align: left; font-weight: 600; }
.results-grid .grid-self { color: var(--text3); }
.results-grid .grid-pending { color: var(--border2); }
.results-grid .grid-score a { color: var(--text2); font-size: .85rem; }
.results-grid .grid-score a:hover { color: var(--gold); }

/* ─── Profile history ────────────────────────────────────────────── */
.history-blocks { display: flex; flex-direction: column; gap: 1.5rem; }
.history-cat h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text2);
}
tr.correct td { background: rgba(76,175,125,.05); }
tr.incorrect td { background: rgba(217,95,95,.05); }

/* ─── Theme toggle button ────────────────────────────────────────── */
.btn-icon {
  padding: .3rem .5rem;
  font-size: 1rem;
  line-height: 1;
}

/* ─── Submitted match table ──────────────────────────────────────── */
.results-table .correct td, .results-table tr.correct td { background: rgba(76,175,125,.06); }
.results-table .incorrect td, .results-table tr.incorrect td { background: rgba(217,95,95,.06); }

/* ─── History disclosure ─────────────────────────────────────────── */
.history-cat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .6rem;
}
.history-cat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg2);
  list-style: none;
  gap: 1rem;
}
.history-cat-summary::-webkit-details-marker { display: none; }
.history-cat-summary::before {
  content: '▶';
  font-size: .65rem;
  color: var(--text3);
  transition: transform .2s;
  margin-right: .5rem;
  flex-shrink: 0;
}
details[open] .history-cat-summary::before { transform: rotate(90deg); }
.history-cat-summary:hover { background: var(--bg3); }
.history-cat-name { font-weight: 700; font-size: .95rem; }
.history-cat-score { font-size: .8rem; color: var(--text3); white-space: nowrap; }
.history-table { margin: 0; }
.history-table td, .history-table th { border-top: 1px solid var(--border); border-bottom: none; }

/* ─── Spoiler tag ────────────────────────────────────────────────── */
.spoiler {
  background: var(--text3);
  color: transparent;
  border-radius: 3px;
  padding: .05rem .3rem;
  cursor: pointer;
  transition: background .2s, color .2s;
  user-select: none;
}
.spoiler:hover, .spoiler:focus, .spoiler.revealed {
  background: var(--bg3);
  color: var(--text);
  outline: none;
}
[data-theme="light"] .spoiler { background: #b0a898; }
[data-theme="light"] .spoiler:hover,
[data-theme="light"] .spoiler:focus,
[data-theme="light"] .spoiler.revealed { background: var(--bg3); color: var(--text); }
