/* Daily District — static district reference pages.
   Self-contained; intentionally independent of the game's style.css so these
   crawlable content pages stay lightweight and stable. On-brand with the game
   (CMU red #C41230, Barlow). */

:root {
  --dd-red: #C41230;
  --dd-red-dark: #9d0e26;
  --dd-ink: #1a1a1a;
  --dd-muted: #5a5f6b;
  --dd-line: #e3e5ea;
  --dd-bg: #ffffff;
  --dd-panel: #f7f8fa;
  --dd-dem: #2166ac;
  --dd-rep: #b2182b;
  --dd-oth: #9aa0ab;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--dd-ink);
  background: var(--dd-bg);
  line-height: 1.55;
}

a { color: var(--dd-red-dark); }
a:hover { color: var(--dd-red); }

.dd-header {
  border-bottom: 3px solid var(--dd-red);
  background: #fff;
}
.dd-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dd-header-inner img { width: 34px; height: 34px; }
/* "Daily District" wordmark, rendered from wordmark.svg via a CSS mask so its
   colour is controlled by the page (currentColor in the SVG can't be reached
   through an <img>). */
.dd-wordmark {
  display: block;
  height: 22px;
  aspect-ratio: 260 / 56;
  background-color: var(--dd-red);
  -webkit-mask: url(/wordmark.svg) no-repeat left center;
  mask: url(/wordmark.svg) no-repeat left center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.dd-header-inner .dd-play {
  margin-left: auto;
  background: var(--dd-red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
}
.dd-header-inner .dd-play:hover { background: var(--dd-red-dark); color:#fff; }

@media (max-width: 560px) {
  .dd-header-inner { padding: 10px 14px; gap: 8px; }
  .dd-header-inner img { width: 26px; height: 26px; }
  .dd-wordmark { height: 18px; }
  .dd-header-inner .dd-play { padding: 7px 12px; font-size: 13px; }
}

main.dd-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 20px 64px;
}

.dd-crumbs {
  font-size: 13.5px;
  color: var(--dd-muted);
  margin: 4px 0 18px;
}
.dd-crumbs a { color: var(--dd-muted); text-decoration: none; }
.dd-crumbs a:hover { color: var(--dd-red); text-decoration: underline; }
.dd-crumbs span { margin: 0 6px; opacity: .5; }

h1.dd-title {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 900;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.05;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.dd-sub {
  font-size: 17px;
  color: var(--dd-muted);
  margin: 0 0 22px;
}

.dd-lede {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 26px;
  padding-left: 16px;
  border-left: 4px solid var(--dd-red);
}

section.dd-card {
  border: 1px solid var(--dd-line);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 18px;
  background: #fff;
}
section.dd-card h2 {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 15px;
  color: var(--dd-red);
  margin: 0 0 14px;
}

.dd-rep {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.dd-rep .dd-rep-name { font-size: 22px; font-weight: 700; }
.dd-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  color: #fff;
}
.dd-pill.D { background: var(--dd-dem); }
.dd-pill.R { background: var(--dd-rep); }
.dd-pill.I, .dd-pill.V { background: var(--dd-oth); }

.dd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px;
}
.dd-stat .dd-stat-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dd-stat .dd-stat-lbl {
  font-size: 12.5px;
  color: var(--dd-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.dd-bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0 10px;
  background: var(--dd-panel);
}
.dd-bar > span { display: block; height: 100%; }
.seg-white { background: #7db3d8; }
.seg-black { background: #d98b5f; }
.seg-hisp  { background: #86c98a; }
.seg-asian { background: #c99ad8; }
.seg-other { background: #c2c7d0; }
.seg-dem   { background: var(--dd-dem); }
.seg-rep   { background: var(--dd-rep); }
.seg-oth   { background: var(--dd-oth); }
.dd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13.5px;
  color: var(--dd-muted);
}
.dd-legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: baseline;
}

.dd-locator { text-align: center; }
.dd-locator img {
  max-width: 200px;
  width: 100%;
  height: auto;
  opacity: .85;
}

.dd-neighbors { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dd-neighbors a {
  display: inline-block;
  border: 1px solid var(--dd-line);
  border-radius: 8px;
  padding: 6px 12px;
  text-decoration: none;
  font-weight: 600;
  background: var(--dd-panel);
}

.dd-source {
  font-size: 12.5px;
  color: var(--dd-muted);
  margin-top: 4px;
}

.dd-cta {
  text-align: center;
  margin: 30px 0 8px;
}
.dd-cta a {
  display: inline-block;
  background: var(--dd-red);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  padding: 13px 30px;
  border-radius: 999px;
}
.dd-cta a:hover { background: var(--dd-red-dark); color: #fff; }

footer.dd-footer {
  border-top: 1px solid var(--dd-line);
  margin-top: 40px;
  padding: 22px 20px 60px;
  text-align: center;
  font-size: 13.5px;
  color: var(--dd-muted);
}
footer.dd-footer a { color: var(--dd-muted); margin: 0 8px; }

/* Interactive map (browse index) */
.dd-map-wrap {
  position: relative;
  margin: 0 0 10px;
  border: 1px solid var(--dd-line);
  border-radius: 12px;
  background: var(--dd-panel);
  overflow: hidden;
}
.dd-map-wrap.dd-map-failed { display: none; }
.dd-map-svg { display: block; width: 100%; height: auto; }
#dd-map { min-height: 60px; }
.dd-map-hint {
  font-size: 13.5px;
  color: var(--dd-muted);
  margin: 0 0 22px;
  text-align: center;
}
.dd-map-back {
  position: absolute;
  top: 10px;
  left: 10px;
  display: none;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--dd-ink);
  border: 1px solid var(--dd-line);
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.dd-map-back.show { display: inline-flex; }
.dd-map-back:hover { border-color: var(--dd-red); color: var(--dd-red); }
.dd-map-title {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 20px;
  color: var(--dd-ink);
  opacity: .7;
  pointer-events: none;
}
.dd-map-tip {
  position: absolute;
  pointer-events: none;
  background: var(--dd-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  transform: translate(-50%, -140%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .1s;
  z-index: 5;
}
.dd-map-tip.show { opacity: 1; }

/* district + state paths */
path.dd-d {
  fill: #dfe3ea;
  stroke: #b6bcc7;
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  transition: fill .1s;
}
path.dd-d.hot {
  fill: rgba(196, 18, 48, .18);
  stroke: var(--dd-red);
  stroke-width: 1.8;
}
/* Districts are only clickable once a state is selected. */
path.dd-d.live { cursor: pointer; }
/* The district a profile page is about — always shown, not a link. */
path.dd-d.current {
  fill: rgba(196, 18, 48, .5);
  stroke: var(--dd-red);
  stroke-width: 2.2;
  pointer-events: none;
}
path.dd-d.dim {
  fill: #eceef2;
  stroke: #d6dae1;
  pointer-events: none;
  opacity: .55;
}
path.dd-s {
  fill: none;
  stroke: #7f8797;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
/* Transparent per-state hit layer — the click/hover target in the national view. */
path.dd-statehit { fill: transparent; stroke: none; cursor: pointer; }

/* Zoom controls — reused from the game (.map-zoom-btns / .mzb). */
.dd-map-wrap .map-zoom-btns {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 5;
}
.dd-map-wrap .mzb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .12);
  background: rgba(255, 255, 255, .92);
  color: var(--dd-ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  transition: background .15s, border-color .15s, color .15s;
}
.dd-map-wrap .mzb:hover { background: #fff; border-color: var(--dd-red); color: var(--dd-red); }
.dd-map-wrap .mzb-icon { width: 15px; height: 15px; }

@media (max-width: 560px) {
  .dd-map-title { font-size: 14px; }
  .dd-map-wrap .mzb { width: 34px; height: 34px; }
}

/* Browse index */
.dd-browse-all { margin: 6px 0 10px; }
.dd-browse-all > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--dd-red);
  padding: 8px 0;
  list-style: revert;
}
.dd-browse-all[open] > summary { margin-bottom: 16px; }
.dd-browse-state { margin: 0 0 26px; }
.dd-browse-state h2 {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 20px;
  margin: 0 0 10px;
  border-bottom: 2px solid var(--dd-line);
  padding-bottom: 4px;
}
.dd-browse-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dd-browse-links a {
  display: inline-block;
  border: 1px solid var(--dd-line);
  border-radius: 8px;
  padding: 5px 11px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  background: var(--dd-panel);
}
.dd-browse-links a:hover { border-color: var(--dd-red); }

/* Inline sign-up / sign-in modal (so auth happens on the page, not the homepage) */
.dd-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .5);
}
.dd-auth-modal.hidden { display: none; }
.dd-auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 26px 20px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .28);
}
.dd-auth-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--dd-muted);
  cursor: pointer;
}
.dd-auth-card h2 {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 27px;
  margin: 0 0 6px;
}
.dd-auth-sub { color: var(--dd-muted); font-size: 14px; margin: 0 0 18px; }
.dd-auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--dd-line);
  border-radius: 10px;
  background: #fff;
  color: var(--dd-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dd-auth-google:hover { border-color: var(--dd-red); }
.dd-auth-google:disabled { opacity: .6; cursor: default; }
.dd-auth-google svg { width: 18px; height: 18px; }
.dd-auth-or {
  position: relative;
  text-align: center;
  color: var(--dd-muted);
  font-size: 13px;
  margin: 14px 0;
}
.dd-auth-or::before, .dd-auth-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--dd-line);
}
.dd-auth-or::before { left: 0; }
.dd-auth-or::after { right: 0; }
#dd-auth-form { display: flex; flex-direction: column; gap: 10px; }
#dd-auth-form input[type=email], #dd-auth-form input[type=password] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--dd-line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--dd-ink);
}
.dd-auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dd-muted);
}
.dd-auth-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--dd-red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 2px;
}
.dd-auth-submit:hover { background: var(--dd-red-dark); }
.dd-auth-submit:disabled { opacity: .6; cursor: default; }
.dd-auth-error { font-size: 13px; color: var(--dd-red); text-align: center; margin: 10px 0 0; min-height: 1em; }
.dd-auth-error.ok { color: #158a3a; }
.dd-auth-toggle {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--dd-red);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin: 12px 0 0;
}
.dd-auth-legal { font-size: 11.5px; color: var(--dd-muted); text-align: center; margin: 14px 0 0; }
.dd-auth-legal a { color: var(--dd-muted); text-decoration: underline; }

@media (prefers-color-scheme: dark) {
  :root {
    --dd-ink: #eceef2;
    --dd-muted: #a2a8b4;
    --dd-line: #2c313a;
    --dd-bg: #14161a;
    --dd-panel: #1d2027;
  }
  body { background: var(--dd-bg); }
  .dd-header, section.dd-card { background: #191c22; }
  a { color: #ff6b81; }
  a:hover { color: #ff9aa8; }
  .dd-crumbs a:hover, .dd-browse-links a:hover { color: #ff6b81; }
  path.dd-d { fill: #2b3038; stroke: #444b57; }
  path.dd-d.hot { fill: rgba(196, 18, 48, .32); stroke: #ff5069; }
  path.dd-d.dim { fill: #23272e; stroke: #333944; }
  path.dd-d.current { fill: rgba(196, 18, 48, .55); stroke: #ff5069; }
  path.dd-s { stroke: #6b7382; }
  .dd-map-back { background: #23272e; color: var(--dd-ink); }
  .dd-map-back:hover { border-color: #ff5069; color: #ff5069; }
  .dd-map-wrap .mzb { background: rgba(35, 39, 46, .92); border-color: rgba(255, 255, 255, .14); color: var(--dd-ink); }
  .dd-map-wrap .mzb:hover { background: #23272e; border-color: #ff5069; color: #ff5069; }
  .dd-auth-card { background: #1d2027; }
  .dd-auth-google { background: #23272e; }
  #dd-auth-form input[type=email], #dd-auth-form input[type=password] { background: #23272e; }
}

/* ── Ad units ─────────────────────────────────────────────────────────────
   A labeled placeholder box shows while AdSense isn't serving yet; the real ad
   fills it once approved, and :has() drops the placeholder chrome when filled. */
.dd-ad { margin: 26px auto; max-width: 728px; }
.dd-ad-label {
  display: block; text-align: center; margin: 0 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--dd-oth);
}
.dd-ad-box {
  min-height: 100px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--dd-line); border-radius: 12px; background: var(--dd-panel);
  overflow: hidden;
}
.dd-ad-box ins.adsbygoogle { display: block; width: 100%; }
.dd-ad-box:has(ins.adsbygoogle[data-ad-status="filled"]) {
  border: 0; background: transparent; min-height: 0;
}

/* ── Editorial pages (about / how-to-play / methodology) ────────────────── */
.dd-card ul, .dd-card ol { margin: 10px 0 0; padding-left: 1.3em; }
.dd-card li { margin: 6px 0; }
.dd-card li::marker { color: var(--dd-red); }
.dd-card h3 { font-size: 16px; margin: 18px 0 4px; }
.dd-card h3:first-of-type { margin-top: 12px; }
