/* BrainU rebuilt UI — no external frameworks, no shared code with the old
   site. Class prefix: bu-. */

:root {
  --ink: #16202e;
  --paper: #f4f2ec;
  --card: #ffffff;
  --line: #d8d3c6;
  --accent: #0e7c66;
  --accent-dark: #0a5c4c;
  --amber: #d97a1f;
  --bad: #b3402f;
  --good: #1d7a4f;
  --muted: #6d7686;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }

/* Author display rules (e.g. .bu-btn) must never override the hidden attribute. */
[hidden] { display: none !important; }

a { color: var(--accent); }

/* Top bar */
.bu-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
}
.bu-brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}
.bu-brand em { font-style: normal; color: var(--amber); }
.bu-tagline {
  font-size: 0.8rem;
  color: #b9c2d0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* Layout */
.bu-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px;
}
.bu-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.bu-center { text-align: center; }

.bu-title {
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0 0 6px;
}
.bu-facts {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.bu-desc { margin: 16px 0; }

.bu-cover {
  margin: 0 0 18px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bu-cover img { width: 100%; object-fit: cover; max-height: 420px; }

/* Buttons */
.bu-btn {
  display: inline-block;
  padding: 10px 26px;
  border: 2px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.bu-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.bu-btn-big { padding: 14px 42px; font-size: 1.25rem; }
.bu-btn-alt { background: #fff; color: var(--accent-dark); }
.bu-btn-alt:hover { background: #eef5f2; }
.bu-start-actions { text-align: center; margin: 22px 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Ads — the reserved heights and sticky behavior are part of the retained
   monetization contract. */
.bu-ad-box {
  position: relative;
  margin: 18px 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #faf9f5;
  padding: 20px 8px 10px;
  text-align: center;
  min-height: 110px;
}
.bu-ad-label {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.bu-ad-label-under { padding: 10px 8px 20px; }
.bu-ad-label-under .bu-ad-label { top: auto; bottom: 4px; }
.bu-ad-dark { background: #232a35; border-color: #3a4455; }
.bu-ad-tall .bu-ad-slot {
  position: sticky;
  top: 96px;
}
.bu-ad-box > div[id^="ezoic-pub-ad-placeholder"],
.bu-ad-slot > div[id^="ezoic-pub-ad-placeholder"] { margin: 0 auto; }

/* Score bar */
.bu-scorebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 2px solid var(--line);
  font-size: 0.95rem;
}
.bu-scorebar-stats { color: var(--muted); }
.bu-scorebar-stats span { color: var(--ink); font-weight: 700; }

/* Question page */
.bu-game { padding-top: 8px; }
.bu-qimage {
  margin: 12px 0;
  min-height: 200px;
  border-radius: 10px;
  overflow: hidden;
}
.bu-qimage img { margin: 0 auto; max-height: 340px; object-fit: contain; }
.bu-question {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 14px 4px;
  text-align: center;
}

.bu-options {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.bu-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.bu-option:hover { border-color: var(--accent); }
.bu-option-key {
  flex: 0 0 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.bu-option[disabled] { cursor: default; opacity: 0.9; }
.bu-option.bu-right { border-color: var(--good); background: #e8f4ee; }
.bu-option.bu-right .bu-option-key { background: var(--good); }
.bu-option.bu-wrong { border-color: var(--bad); background: #f9e9e6; }
.bu-option.bu-wrong .bu-option-key { background: var(--bad); }

.bu-extra {
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  background: #fdf6ec;
  border-radius: 0 8px 8px 0;
}

.bu-continue-top { text-align: center; margin: 14px 0; }

/* Verdict block (answer status + continue) */
.bu-verdict {
  margin: 18px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #232a35;
}
.bu-verdict-banner {
  padding: 14px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
}
.bu-verdict-banner.bu-right { background: var(--good); }
.bu-verdict-banner.bu-wrong { background: var(--bad); }
.bu-verdict-body { padding: 20px; text-align: center; }
.bu-verdict-hint { color: #b9c2d0; font-size: 0.9rem; margin: 10px 0 0; }
.bu-verdict .bu-ad-box { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.bu-verdict .bu-ad-label { color: #8f99a8; }

/* "How others answered" stats (shown after answering) */
.bu-stats {
  margin: 0 16px 18px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
}
.bu-stats-title { margin: 0 0 12px; font-size: 1rem; }
.bu-stat-row { margin-bottom: 10px; }
.bu-stat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
}
.bu-stat-row.bu-mine .bu-stat-head { font-weight: 700; color: #fff; }
.bu-stat-track {
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bu-stat-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  transition: width 300ms ease;
}
.bu-stat-row.bu-mine.bu-right .bu-stat-fill { background: var(--good); }
.bu-stat-row.bu-mine.bu-wrong .bu-stat-fill { background: var(--bad); }

/* Results page */
.bu-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.bu-result {
  background: #faf9f5;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.bu-result-num { display: block; font-size: 1.6rem; font-weight: 800; }
.bu-result-cap { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }

.bu-rank {
  text-align: center;
  margin: 20px 0;
  padding: 18px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}
.bu-rank-band { font-size: 1.4rem; font-weight: 800; margin: 0; color: var(--amber); }
.bu-rank-note { margin: 6px 0 0; color: #b9c2d0; }

/* Slideshow */
.bu-slide-highlight {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 8px 0 14px;
}
.bu-slide-body { margin: 16px 0; font-size: 1.05rem; }
.bu-slide-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

/* Homepage */
.bu-hero { text-align: center; padding: 30px 0 10px; }
.bu-hero h1 { font-size: 2.2rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.bu-hero p { color: var(--muted); margin: 0; font-size: 1.05rem; }

.bu-home-section { margin: 30px 0; }
.bu-home-heading {
  font-size: 1.3rem;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--amber);
  display: inline-block;
}
.bu-tilegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.bu-tile {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(22, 32, 46, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.bu-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(22, 32, 46, 0.12);
}
.bu-tile-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: #e8e4da;
  overflow: hidden;
}
.bu-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease;
}
.bu-tile:hover .bu-tile-media img { transform: scale(1.04); }
.bu-tile-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px 16px;
}
.bu-tile-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.bu-tile-kicker-quiz { color: var(--accent); }
.bu-tile-kicker-show { color: #7a4fb3; }
.bu-tile-title { font-weight: 700; font-size: 1.05rem; line-height: 1.35; }
.bu-tile-meta { color: var(--muted); font-size: 0.85rem; }

/* Footer */
.bu-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 26px 16px 40px;
}
.bu-footer a { color: var(--muted); }

@media (max-width: 640px) {
  .bu-panel { padding: 16px; }
  .bu-title { font-size: 1.35rem; }
  .bu-question { font-size: 1.2rem; }
  .bu-btn-big { width: 100%; }
  .bu-slide-nav .bu-btn { flex: 1; text-align: center; }
}
