/* Pure-blood Category Play Stage & Geography Rarity Explorer
   Strict 390px zero-overflow guardrails across inputs, <select>, pills, and tables. */

.cat-stage-shell,
.explorer-shell {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.cat-stage {
  margin: 18px 0 28px;
  padding: 20px;
  background: linear-gradient(180deg, #0b1424 0%, #09101d 100%);
  border: 2px solid #593824;
  box-shadow: inset 0 0 0 2px #1a263b, 0 10px 28px #00000073;
  font-family: VT323, monospace;
  color: #e4eaf3;
  max-width: 100%;
  min-width: 0;
}

.cat-stage-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #243550;
}

.cat-stage-badge {
  font-size: 16px;
  letter-spacing: 2px;
  color: #ff8a5c;
  text-transform: uppercase;
}

.cat-stage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 18px;
  color: #c5d4e6;
}

.cat-stage-stats strong {
  font-weight: 400;
  color: #edc65b;
}

.cat-idle-box {
  text-align: center;
  padding: 8px 0 4px;
}

.cat-idle-lead {
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: #c7d5e6;
  margin: 0 auto 16px;
  max-width: 620px;
}

.cat-start-btn {
  display: inline-block;
  width: 100%;
  max-width: 480px;
  font-size: 26px;
  padding: 18px 20px;
}

.cat-idle-meta {
  margin: 12px 0 0;
  font-size: 16px;
  color: #93a8c4;
}

.cat-pips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}

.cat-pips .pip {
  width: 14px;
  height: 14px;
}

.cat-departure {
  text-align: center;
  padding: 26px 12px;
  font-size: 24px;
  letter-spacing: 1.5px;
  color: #9db2ce;
}

.cat-departure span {
  display: inline-block;
  margin-left: 6px;
  font-size: 34px;
  color: #ff7c4d;
}

.cat-prompt-box {
  background: #14120c;
  border: 1px solid #4e3623;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.cat-prompt-leg {
  font-size: 15px;
  letter-spacing: 3px;
  color: #ff7a4f;
  margin: 0 0 8px;
}

.cat-prompt-text {
  margin: 0;
  font-size: 31px;
  line-height: 1.22;
  font-weight: 400;
  color: #f2f5f7;
  overflow-wrap: anywhere;
}

.cat-prompt-hint {
  margin: 10px 0 0;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #9eb4cf;
}

.cat-scope-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: #0d1626;
  border: 1px solid #2d405d;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #c5d4e5;
}

.cat-form {
  margin-top: 12px;
}

.cat-form .input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.cat-form input {
  min-width: 0;
  flex: 1 1 auto;
}

.cat-feedback {
  text-align: center;
  padding: 16px;
  background: #100c09;
  border: 2px solid var(--tier-color, #4e2c20);
}

.cat-feedback h3 {
  margin: 0 0 8px;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--tier-color, #edc65b);
}

.cat-feedback-answer {
  margin: 0 0 6px;
  font-size: 25px;
  color: #f4f7fa;
  overflow-wrap: anywhere;
}

.cat-feedback-pts {
  margin: 0 0 10px;
  font-size: 24px;
  color: var(--tier-color, #edc65b);
}

.cat-feedback-copy {
  margin: 0 auto 12px;
  max-width: 600px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #b7c8dd;
}

.cat-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.cat-summary {
  padding: 6px 0;
}

.cat-summary-score {
  text-align: center;
  margin: 6px 0 12px;
}

.cat-summary-score strong {
  font-size: 72px;
  line-height: 1;
  font-weight: 400;
  color: #fff;
}

.cat-summary-score span {
  font-size: 22px;
  color: #8fa4be;
  margin-left: 6px;
}

.cat-emoji-strip {
  text-align: center;
  font-size: 22px;
  letter-spacing: 4px;
  margin: 8px 0 14px;
}

.cat-summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 18px;
}

.cat-summary-actions .primary {
  grid-column: 1 / -1;
  width: 100%;
  padding: 15px 16px;
  font-size: 22px;
  text-align: center;
  text-decoration: none;
}

.cat-field-notes details {
  border-top: 1px solid #26354b;
  padding: 10px 4px;
}

.cat-field-notes summary {
  cursor: pointer;
  font-size: 19px;
  color: #d9e4f2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cat-field-notes summary span {
  color: #edc65b;
  white-space: nowrap;
}

.cat-answer-preview {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #24354e;
  background: #0a1220;
  padding: 8px 10px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
}

.cat-answer-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid #1b293f;
}

/* Editorial guide & prompt cards on /categories/<slug>/ */
.cat-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}

.cat-guide-card {
  padding: 16px 18px;
  background: #0b1424;
  border: 1px solid #293a54;
}

.cat-guide-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #f0c97e;
}

.cat-guide-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.cat-prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 16px 0 28px;
}

.cat-prompt-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: #0b1424;
  border: 1px solid #2b3c57;
  text-decoration: none;
  color: #d7e2ef;
  min-width: 0;
}

.cat-prompt-card:hover,
.cat-prompt-card:focus-visible {
  border-color: #e6ac39;
  background: #131f33;
}

.cat-prompt-card strong {
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  color: #edf2f7;
  overflow-wrap: anywhere;
}

.cat-prompt-card small {
  font-size: 13px;
  color: #93aac6;
}

.cat-mesh {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 24px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #354967;
  background: #0c1525;
  color: #d1deed;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  cursor: pointer;
  max-width: 100%;
}

.cat-pill:hover,
.cat-pill:focus-visible {
  border-color: #edc65b;
  color: #fff2cc;
  background: #172338;
}

.cat-pill.is-active,
.cat-pill[aria-pressed="true"] {
  border-color: #ff7c4d;
  background: #27150e;
  color: #ffd8b5;
}

.cat-pill-count {
  font-size: 12px;
  color: #96adc8;
}

/* Geography Rarity Explorer (/answers/) */
.explorer-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 16px 0 14px;
  min-width: 0;
}

.explorer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.explorer-field label {
  font-size: 14px;
  color: #d6e2ef;
}

.explorer-input,
.explorer-select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 46px;
  padding: 8px 12px;
  border: 2px solid #3c506d;
  background: #0b1424;
  color: #eef3f8;
  font-family: system-ui, sans-serif;
  font-size: 15px;
}

.explorer-select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-input:focus-visible,
.explorer-select:focus-visible {
  outline: 2px solid #efba57;
  outline-offset: 2px;
  border-color: #efba57;
}

.explorer-pill-group {
  margin: 10px 0 14px;
}

.explorer-pill-label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #93a9c5;
  margin-bottom: 6px;
}

.explorer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.explorer-status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 14px 0 16px;
  background: #0c1627;
  border: 1px solid #2b3e5b;
  font-size: 14px;
  color: #c8d6e7;
}

.explorer-inspector {
  margin: 16px 0 22px;
  padding: 18px;
  background: #0d172a;
  border: 2px solid #8a5b32;
  max-width: 100%;
  min-width: 0;
}

.explorer-inspector h2 {
  margin: 6px 0 8px;
  font-size: 22px;
  color: #fff3da;
  overflow-wrap: anywhere;
}

.explorer-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.explorer-card {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: #0a1220;
  border: 1px solid #253650;
  max-width: 100%;
  min-width: 0;
}

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

.explorer-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #edf2f8;
  overflow-wrap: anywhere;
}

.explorer-meta {
  font-size: 13px;
  color: #94aac6;
  margin: 0 0 8px;
}

.explorer-tier-badge {
  display: inline-block;
  padding: 2px 7px;
  font-family: VT323, monospace;
  font-size: 16px;
  letter-spacing: 0.8px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.tier-100 { color: #edc65b; }
.tier-85 { color: #b694f6; }
.tier-60 { color: #f47789; }
.tier-30 { color: #55c6da; }
.tier-15 { color: #e4a17e; }
.tier-10 { color: #95b1d6; }

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.explorer-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.explorer-table th,
.explorer-table td {
  border-bottom: 1px solid #23334c;
  padding: 9px 6px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.explorer-table th:nth-child(2),
.explorer-table td:nth-child(2) {
  width: 135px;
}

.explorer-table th:last-child,
.explorer-table td:last-child {
  width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.explorer-hit-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.explorer-hit {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #101b2f;
  border: 1px solid #2b3e5c;
  min-width: 0;
}

.explorer-hit strong {
  color: #f3f7fb;
  overflow-wrap: anywhere;
}

.explorer-hit small {
  display: block;
  color: #97adc8;
  overflow-wrap: anywhere;
}

.cat-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}

.cat-hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  background: #0c1525;
  border: 2px solid #2d405c;
  text-decoration: none;
  color: #d6e2ef;
}

.cat-hub-card:hover,
.cat-hub-card:focus-visible {
  border-color: #e6ac39;
  background: #142138;
}

.cat-hub-card h2 {
  margin: 0;
  font-family: VT323, monospace;
  font-size: 28px;
  font-weight: 400;
  color: #f1cb7d;
}

.cat-hub-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #b4c6dc;
}

.cat-hub-card small {
  font-size: 13px;
  color: #ff8f61;
}

.geo-fact-note {
  margin: 10px auto 0;
  max-width: 560px;
  padding: 9px 12px;
  border: 1px solid #365660;
  border-left: 3px solid #55c6da;
  background: #0a1924;
  color: #d6e9f2;
  font-family: system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}

.explorer-geo-fact {
  margin-top: 5px;
  padding: 5px 8px;
  border-left: 2px solid #edc65b;
  background: #0c1726;
  color: #cddbeb;
  font-size: 12.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .cat-stage {
    padding: 14px;
  }
  .cat-prompt-text {
    font-size: 25px;
  }
  .cat-guide-grid,
  .explorer-controls,
  .cat-summary-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .cat-prompt-grid,
  .cat-hub-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cat-start-btn {
    font-size: 22px;
    padding: 15px 12px;
  }
  .cat-form .clock {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 21px;
  }
  .cat-form input,
  .cat-form .trek {
    height: 48px;
    font-size: 20px;
  }
  .explorer-table {
    font-size: 13px;
  }
  .explorer-table th:nth-child(2),
  .explorer-table td:nth-child(2) {
    width: 108px;
  }
  .explorer-tier-badge {
    font-size: 14px;
    padding: 1px 5px;
  }
}

.cat-pill:focus-visible,
.explorer-input:focus-visible,
.explorer-select:focus-visible,
.cat-prompt-card:focus-visible,
.cat-hub-card:focus-visible {
  outline: 2px solid #f7cf6c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cat-pill,
  .cat-prompt-card,
  .cat-hub-card,
  .cat-stage .timebar {
    transition: none !important;
    animation: none !important;
  }
}
