:root {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: #f4f4f4;
  background: #000;
  color-scheme: dark;
  --accent: #f2c94c;
  --text: #f4f4f4;
  --muted: #a9a9a9;
  --border: #353535;
  --border-strong: #686868;
}

* {
  box-sizing: border-box;
}

html,
body {
  background: #000;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 42px 28px 70px;
  color: var(--text);
}

.page {
  width: min(900px, 100%);
  margin: 0 auto;
}

.site-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.site-header h1::after {
  content: '';
  display: block;
  width: 54px;
  height: 3px;
  margin-top: 12px;
  background: var(--accent);
}

.comparison-section,
.bee-section {
  position: relative;
}

.question-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
}

input,
button {
  font: inherit;
}

input {
  width: min(380px, 100%);
  padding: 10px 12px;
  color: #fff;
  background: #000;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover {
  border-color: #8a8a8a;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(242, 201, 76, 0.16);
}

button {
  min-height: 38px;
  padding: 8px 13px;
  color: #fff;
  background: #111;
  border: 1px solid #4a4a4a;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

button:hover:not(:disabled) {
  background: #1b1b1b;
  border-color: #777;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

#answer-button {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
}

#answer-button:hover:not(:disabled) {
  background: #ffe06f;
  border-color: #ffe06f;
}

.status {
  min-height: 1.25em;
  margin: 13px 0 0;
  color: var(--muted);
}

.result-area {
  margin-top: 18px;
  padding: 18px 0 2px;
  border-top: 1px solid var(--border);
}

.result-sentence {
  margin: 0 0 7px;
  font-size: 1.15rem;
  line-height: 1.45;
  font-weight: 800;
}

.bee-count-line {
  margin: 0 0 14px;
  color: #dedede;
  line-height: 1.5;
}

#why-button,
#learn-more-button {
  background: #000;
}

.bee-section {
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

#bee-loading {
  color: var(--muted);
}

.bee-image {
  display: block;
  width: min(460px, 100%);
  height: auto;
  max-height: 460px;
  object-fit: contain;
  margin: 0 0 14px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.bee-identification {
  margin-bottom: 13px;
  line-height: 1.35;
}

#bee-name {
  font-size: 1.15rem;
  font-weight: 800;
}

.scientific-name {
  margin-top: 3px;
  color: #bdbdbd;
  font-style: italic;
}

.details-panel {
  margin-top: 18px;
  padding: 18px 0 4px;
  max-width: 800px;
  border-top: 1px solid var(--border);
}

.details-panel h2 {
  margin: 0 0 13px;
  font-size: 1.08rem;
}

.details-panel h3 {
  margin-top: 22px;
  font-size: 1rem;
}

.details-panel p,
.details-panel li,
.details-panel dd {
  line-height: 1.55;
}

.comparison-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.comparison-table th,
.comparison-table td {
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.comparison-table tr:last-child th,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: 0;
}

.comparison-table thead th {
  color: #000;
  background: var(--accent);
  border-color: #cfae3e;
  font-weight: 800;
}

.comparison-table tbody th {
  width: 28%;
  color: #e5e5e5;
  font-weight: 700;
}

.cheeky {
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
}

.estimate-note,
.image-credit {
  color: var(--muted);
  font-size: 0.9rem;
}

.bee-details-list {
  display: grid;
  grid-template-columns: minmax(130px, max-content) minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0;
}

.bee-details-list dt {
  color: #d9d9d9;
  font-weight: 700;
}

.bee-details-list dd {
  margin: 0;
  color: #f1f1f1;
}

#bee-facts {
  padding-left: 22px;
}

.image-credit a {
  color: var(--accent);
}

::selection {
  color: #000;
  background: var(--accent);
}

@media (max-width: 620px) {
  body {
    padding: 28px 18px 52px;
  }

  .site-header {
    margin-bottom: 22px;
  }

  .question-row {
    align-items: flex-start;
  }

  input {
    flex-basis: 100%;
  }

  .comparison-table {
    display: block;
    overflow-x: auto;
  }

  .comparison-table th,
  .comparison-table td {
    min-width: 140px;
  }

  .bee-details-list {
    display: block;
  }

  .bee-details-list dt {
    margin-top: 12px;
  }

  .bee-details-list dd {
    margin-top: 3px;
  }
}

/* ============================================================
   ASCII HEADLINER
   The text itself lives in index.html between the obvious
   ASCII HEADLINER START / END comments.
   ============================================================ */
.ascii-headliner {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  color: var(--text);
  background: transparent;
  border: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.72rem, 2vw, 1rem);
  line-height: 1.05;
  font-weight: 700;
  white-space: pre;
}

.ascii-headliner::after {
  content: '';
  display: block;
  width: 54px;
  height: 3px;
  margin-top: 12px;
  background: var(--accent);
}

.site-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 18px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  color: #fff;
  background: #111;
  border: 1px solid #4a4a4a;
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
}

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-links .is-placeholder,
.site-footer .is-placeholder {
  opacity: 0.52;
  cursor: default;
}

@media (max-width: 620px) {
  .site-links {
    align-items: flex-start;
    flex-direction: column;
  }
}


.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #222;
}

.secondary-link {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.72;
}


.bee-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}


.bee-search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
  min-width: 220px;
}

#bee-search-input {
  width: 100%;
}

.bee-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #050505;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.bee-search-option {
  display: grid;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #242424;
  border-radius: 0;
  background: #050505;
}

.bee-search-option:last-child {
  border-bottom: 0;
}

.bee-search-option:hover,
.bee-search-option.is-active {
  background: #171717;
}

.bee-search-common {
  font-weight: 800;
}

.bee-search-scientific {
  margin-top: 2px;
  color: #c8c8c8;
  font-style: italic;
}

.bee-search-context {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.bee-search-empty {
  padding: 11px 12px;
  color: var(--muted);
}

@media (max-width: 620px) {
  .bee-search-wrap {
    flex-basis: 100%;
    max-width: none;
  }
}


.random-bee-fact {
  margin: 0 0 24px;
  padding: 12px 14px;
  color: #e8e8e8;
  background: #080808;
  border-left: 3px solid var(--accent);
  border-top: 1px solid #242424;
  border-right: 1px solid #242424;
  border-bottom: 1px solid #242424;
  border-radius: 4px;
  line-height: 1.5;
}

.fact-label {
  color: var(--accent);
  font-weight: 800;
  margin-right: 5px;
}

.fact-source {
  margin-left: 8px;
  color: var(--muted);
  font-size: .86rem;
}

.bottom-fact-area { margin-top: 28px; }
.random-bee-fact { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.fact-source { color:#aaa; font-size:.82rem; text-decoration:underline; white-space:nowrap; }
.site-link-row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.bee-conservation-alert { margin:0 0 18px; padding:16px 18px; border:2px solid #555; border-radius:6px; background:#171717; color:#fff; display:grid; gap:6px; }
.bee-conservation-alert[hidden] { display:none !important; }
.bee-conservation-alert strong { font-size:1.18rem; letter-spacing:.035em; }
.bee-conservation-alert a { width:max-content; }
.bee-conservation-alert.status-safe { background:#06270f; border-color:#25a244; }
.bee-conservation-alert.status-safe strong { color:#70e38b; }
.bee-conservation-alert.status-unknown { background:#171717; border-color:#666; }
.bee-conservation-alert.status-unknown strong { color:#c7c7c7; }
.bee-conservation-alert.status-near-threatened { background:#2a2500; border-color:#d2b82c; }
.bee-conservation-alert.status-near-threatened strong { color:#f1d94d; }
.bee-conservation-alert.status-vulnerable { background:#2c1700; border-color:#dc861e; }
.bee-conservation-alert.status-vulnerable strong { color:#ffad42; }
.bee-conservation-alert.status-endangered { background:#310707; border-color:#d93030; }
.bee-conservation-alert.status-endangered strong { color:#ff6262; }
.bee-conservation-alert.status-critical { background:#240000; border-color:#ff2424; box-shadow:inset 0 0 0 1px #6d0000; }
.bee-conservation-alert.status-critical strong { color:#ff4545; font-size:1.35rem; }
.bee-conservation-alert.is-extinct {
  background:
    repeating-linear-gradient(135deg, #050505 0, #050505 12px, #181818 12px, #181818 24px);
  border-color:#777;
}
.bee-conservation-alert.is-extinct strong { color:#d0d0d0; font-size:1.3rem; }
@media (max-width:700px) { .random-bee-fact { align-items:flex-start; flex-direction:column; } }
