/* BayBuzz — late-2010s quiz site styling */

:root {
  --brand: #ee3322;
  --brand-dark: #c4231a;
  --ink: #222;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --bg: #f7f7f7;
  --card: #fff;
  --accent: #0f65ef;
  --head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --body: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button { font: inherit; }

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

/* ---------- Header ---------- */

.site-header {
  background: #fff;
  border-bottom: 4px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
}

.logo {
  font-family: var(--head);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -1px;
  text-decoration: none;
  color: var(--brand);
  white-space: nowrap;
}
.logo span { color: #1f2a44; }

/* ---------- Ads ---------- */

.ad-wrap { text-align: center; }
.ad-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 4px;
}

.ad-img {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border: 1px solid rgba(0,0,0,.08);
  overflow: hidden;
}
.ad-img img { width: 100%; height: auto; display: block; }

.ad-top { padding: 14px 16px 0; }
.ad-leaderboard { width: 728px; }
.ad-rect { width: 300px; }
.ad-inline { margin: 8px 0 28px; }

/* ---------- Page layout ---------- */

.page {
  max-width: 712px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ---------- Article header ---------- */

.article-header { margin-bottom: 26px; }

.kicker {
  display: inline-block;
  font-family: var(--head);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: #fff;
  background: var(--brand);
  padding: 3px 9px;
  border-radius: 3px;
}

h1 {
  font-family: var(--head);
  font-weight: 900;
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -.5px;
  margin: 12px 0 8px;
}

.subtitle { font-size: 19px; color: #444; margin: 0 0 16px; }

.byline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #ffe3dc;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.byline-name { font-weight: 700; color: var(--ink); }

.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--head);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 4px;
  transition: filter .15s;
}
.share:hover { filter: brightness(1.1); }
.share span { font-weight: 900; font-size: 15px; }
.share-fb { background: #3b5998; }
.share-tw { background: #1da1f2; }
.share-pin { background: #bd081c; }

/* ---------- Question cards ---------- */

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 28px;
  scroll-margin-top: 80px;
  transition: box-shadow .3s, border-color .3s;
}

.q-title {
  font-family: var(--head);
  font-weight: 800;
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.q-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  display: grid; place-items: center;
  margin-top: -2px;
}
.q-card.answered .q-num { background: #1f2a44; }

.q-card.missed { animation: missed 1.6s ease; }
@keyframes missed {
  0%, 60% { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(238,51,34,.25); }
  100% { border-color: var(--line); box-shadow: none; }
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  position: relative;
  min-height: 120px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--tile-bg, #eef);
  color: var(--ink);
  cursor: pointer;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform .12s, opacity .2s, border-color .2s, box-shadow .2s;
}
.tile:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.tile-emoji { font-size: 38px; line-height: 1; }
.tile-text { font-family: var(--head); font-weight: 700; font-size: 17px; }

.tile-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  display: grid; place-items: center;
  transform: scale(0);
  transition: transform .2s cubic-bezier(.3,1.6,.6,1);
}

.q-card.answered .tile:not(.selected) { opacity: .45; }
.q-card.answered .tile:not(.selected):hover:not(:disabled) { opacity: .8; }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(15,101,239,.2); }
.tile.selected .tile-check { transform: scale(1); }

.tile:disabled { cursor: default; }

/* ---------- Submit + results ---------- */

.submit-area { text-align: center; margin: 10px 0 30px; }

.big-btn {
  font-family: var(--head);
  font-weight: 900;
  font-size: 22px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-bottom: 4px solid var(--brand-dark);
  border-radius: 6px;
  padding: 16px 40px;
  cursor: pointer;
  width: 100%;
  max-width: 420px;
  transition: transform .1s, filter .15s;
}
.big-btn:hover:not(:disabled) { filter: brightness(1.07); }
.big-btn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.big-btn:disabled { background: #bbb; border-bottom-color: #999; cursor: default; }

.missed-msg { color: var(--brand); font-weight: 700; margin: 12px 0 0; }
.privacy-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

.results {
  --sys-color: #0099D8;
  background: var(--card);
  border: 3px solid var(--sys-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 30px;
  scroll-margin-top: 80px;
  animation: pop .45s cubic-bezier(.3,1.4,.6,1);
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

.results-banner {
  background: var(--sys-color);
  color: #fff;
  text-align: center;
  padding: 24px 16px 20px;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 14px, transparent 14px 28px);
}
.result-emoji { font-size: 64px; line-height: 1; display: block; }
.result-title {
  font-family: var(--head);
  font-weight: 800;
  font-size: 26px;
  margin: 8px 0 0;
}
.result-title strong { font-weight: 900; font-size: 44px; display: block; letter-spacing: -.5px; line-height: 1.1; }

.results-body { padding: 22px; text-align: center; }
.result-blurb { font-size: 17px; margin: 0 0 20px; text-align: left; }

.station-box {
  border: 2px dashed var(--sys-color);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
  background: #fafafa;
}
.station-label {
  display: block;
  font-family: var(--head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: var(--muted);
}
.station-name {
  display: block;
  font-family: var(--head);
  font-weight: 900;
  font-size: 28px;
  color: var(--sys-color);
  line-height: 1.2;
  margin-top: 4px;
}

.share-row-big { justify-content: center; margin: 0 0 18px; }

.retake-btn {
  font-family: var(--head);
  font-weight: 800;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px 26px;
  cursor: pointer;
}
.retake-btn:hover { background: var(--ink); color: #fff; }

/* ---------- Footer ---------- */

.site-footer { background: #1f2a44; color: #c9d1e3; padding: 28px 16px; text-align: center; }
.footer-inner { max-width: 760px; margin: 0 auto; }
.logo-small { font-size: 22px; color: #fff; }
.logo-small span { color: #ff8a7a; }
.footer-note, .copyright { font-size: 12px; margin: 6px 0 0; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .ad-top { padding-top: 10px; }
  /* Phones: crop the wide banner to its left (blue) panel, as a 320x100 banner */
  .ad-leaderboard { width: 320px; aspect-ratio: 32 / 10; }
  .ad-leaderboard img { height: 100%; object-fit: cover; object-position: left center; }
}

@media (max-width: 600px) {
  .header-inner { gap: 16px; padding: 8px 16px; }
  .logo { font-size: 24px; }
  h1 { font-size: 30px; }
  .subtitle { font-size: 17px; }
  .q-card { padding: 14px; border-radius: 6px; }
  .q-title { font-size: 19px; gap: 10px; }
  .q-num { width: 30px; height: 30px; font-size: 14px; }
  .tiles { gap: 8px; }
  .tile { min-height: 100px; padding: 12px 6px; }
  .tile-emoji { font-size: 32px; }
  .tile-text { font-size: 15px; }
  .big-btn { font-size: 20px; padding: 14px 20px; }
  .result-title strong { font-size: 38px; }
  .station-name { font-size: 24px; }
  .share-row-big .share { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
