/* Draw the Lines: redistricting game (house style, Oct 2026) */
.rd { max-width: 1040px; margin: 0 auto; padding: 16px 16px 64px; color: #15202c; font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif; display: grid; gap: 28px; }
.rd *, .rd *::before, .rd *::after { box-sizing: border-box; }
.rd h1, .rd h2 { text-wrap: balance; margin: 0; line-height: 1.2; }
.rd-muted { color: #566271; margin: 0; }
.rd-r { color: #b3261e; }
.rd-b { color: #2f5e9e; }

.rd-crumbs > div { padding: 0 !important; max-width: none !important; }
.rd-crumbs, .rd-crumbs span, .rd-crumbs .text-yellow-500 { color: #566271 !important; font-size: 13px; }
.rd-crumbs a { color: #1e3a5f !important; text-decoration: none; }

.rd-head { background: #fff; border: 1px solid #d2d8df; border-radius: 10px; padding: 22px 26px; display: grid; gap: 8px; }
.rd-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #566271; }
.rd-title { font-size: clamp(28px, 4vw, 36px); font-weight: 800; color: #1e3a5f; }
.rd-lede { color: #566271; margin: 0; max-width: 44rem; line-height: 1.55; font-size: 17px; }
.rd-jump { display: flex; flex-wrap: wrap; gap: 8px 18px; border-top: 1px solid #d2d8df; padding-top: 12px; margin-top: 6px; font-size: 14px; font-weight: 600; }
.rd-jump a { color: #1e3a5f; text-decoration: none; }
.rd-jump a:hover { text-decoration: underline; }

.rd-level { display: grid; gap: 16px; border-top: 1px solid #d2d8df; padding-top: 24px; scroll-margin-top: 80px; }
.rd-level-head h2 { font-size: 24px; color: #1e3a5f; }
.rd-level-head p { margin: 6px 0 0; color: #566271; max-width: 46rem; line-height: 1.55; }

.rd-challenges { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.rd-challenges button { text-align: left; font: inherit; border: 1px solid #d2d8df; background: #fff; border-radius: 8px; padding: 10px 12px; cursor: pointer; color: #15202c; display: grid; gap: 2px; }
.rd-challenges button b { font-size: 15px; }
.rd-challenges button span { font-size: 13px; color: #566271; }
.rd-challenges button:hover { border-color: #1e3a5f; }
.rd-challenges button[aria-pressed="true"] { border-color: #1e3a5f; background: #e5ebf2; box-shadow: inset 0 0 0 1px #1e3a5f; }

.rd-play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 20px; align-items: start; }
.rd-board-wrap { background: #fff; border: 1px solid #d2d8df; border-radius: 10px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.rd-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-tool { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border: 1px solid #d2d8df; border-radius: 8px; background: #fff; color: #15202c; cursor: pointer; }
.rd-tool i, .rd-districts i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; flex: none; }
.rd-tool[aria-pressed="true"] { border-color: #15202c; box-shadow: inset 0 0 0 1px #15202c; }
.d0 { background: #fff; border: 1px dashed #8a96a3; }
.d1 { background: #e8c66a; } .d2 { background: #7fbfb4; } .d3 { background: #b8a1cf; } .d4 { background: #b7c2cf; }

.rd-board { display: grid; grid-template-columns: repeat(6, 1fr); width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; border: 3px solid #15202c; border-radius: 4px; background: #f3f5f7; }
.rd-cell { position: relative; display: grid; place-items: center; cursor: pointer; border: 1px solid #d2d8df; border-width: 1px; }
.rd-cell.c1 { background: #f3e2b3; } .rd-cell.c2 { background: #c6e3de; } .rd-cell.c3 { background: #ddd1ea; } .rd-cell.c4 { background: #dde3ea; }
.rd-cell .v { width: 46%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: clamp(10px, 2.6vw, 14px); }
.rd-cell .v.R { background: #b3261e; } .rd-cell .v.D { background: #2f5e9e; }
.rd-cell.bt { border-top: 3px solid #15202c; } .rd-cell.bb { border-bottom: 3px solid #15202c; }
.rd-cell.bl { border-left: 3px solid #15202c; } .rd-cell.br { border-right: 3px solid #15202c; }
.rd-cell:focus-visible { outline: 3px solid #d8a62a; outline-offset: -3px; z-index: 1; }
.rd-hint { font-size: 13px; color: #566271; margin: 0; text-align: center; }
.rd-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.rd-btn { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border: 1px solid #d2d8df; border-radius: 8px; background: #fff; color: #15202c; cursor: pointer; }
.rd-btn:hover { border-color: #1e3a5f; }
.rd-btn.quiet { border-color: transparent; color: #1e3a5f; text-decoration: underline; text-underline-offset: 3px; }
.rd button:focus-visible, .rd a:focus-visible { outline: 3px solid #d8a62a; outline-offset: 2px; }

.rd-panel { background: #fff; border: 1px solid #d2d8df; border-radius: 10px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.rd-goal { font-size: 15px; line-height: 1.5; }
.rd-goal b { display: block; color: #1e3a5f; font-size: 16px; }
.rd-districts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rd-districts li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 14px; padding: 7px 8px; border: 1px solid #d2d8df; border-radius: 8px; font-variant-numeric: tabular-nums; }
.rd-districts .w { font-weight: 700; font-size: 13px; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.rd-districts .w.R { background: #fbe6e3; color: #b3261e; } .rd-districts .w.D { background: #e5ebf2; color: #2f5e9e; }
.rd-districts .w.x { background: #eef0f3; color: #566271; font-weight: 600; }
.rd-score { display: grid; gap: 4px; border-top: 1px solid #d2d8df; padding-top: 12px; font-size: 14px; color: #566271; }
.rd-score .seats { font-size: 22px; font-weight: 800; color: #15202c; }
.rd-status { font-size: 14px; line-height: 1.5; border-radius: 8px; padding: 10px 12px; background: #eef0f3; }
.rd-status.ok { background: #e2f1e8; color: #1d7447; font-weight: 600; }
.rd-status.warn { background: #f6ecd2; color: #6b4f0e; }

.rd-learn { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.rd-learn > div { border: 1px solid #d2d8df; border-radius: 8px; padding: 12px 14px; background: #fff; }
.rd-learn p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.rd-term { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 1px 8px; border-radius: 99px; }
.rd-term.pack { background: #e5ebf2; color: #2f5e9e; } .rd-term.crack { background: #fbe6e3; color: #b3261e; }

.rd-seg { display: inline-flex; width: fit-content; border: 1px solid #d2d8df; border-radius: 8px; overflow: hidden; background: #fff; }
.rd-seg button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; color: #15202c; cursor: pointer; }
.rd-seg button + button { border-left: 1px solid #d2d8df; }
.rd-seg button[aria-pressed="true"] { background: #1e3a5f; color: #fff; }

.rd-utah { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 20px; align-items: start; }
.rd-mapbox { background: #fff; border: 1px solid #d2d8df; border-radius: 10px; padding: 12px; min-width: 0; }
.rd-mapbox svg { width: 100%; height: auto; max-height: 560px; display: block; }
.rd-mapbox path.dist { stroke: #fff; stroke-width: 2; stroke-linejoin: round; cursor: pointer; }
.rd-mapbox path.dist.on { stroke: #15202c; stroke-width: 3; }
.rd-mapbox path.slco { fill: none; stroke: #d8a62a; stroke-width: 2.5; stroke-dasharray: 6 4; pointer-events: none; }
.rd-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #566271; margin-top: 8px; }
.rd-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: 4px; }
.rd-legend i.slco { border: 2px dashed #d8a62a; background: none; }
.rd-side { display: grid; gap: 14px; min-width: 0; }
.rd-summary { background: #fff; border: 1px solid #d2d8df; border-radius: 10px; padding: 16px; display: grid; gap: 8px; }
.rd-summary h3 { margin: 0; font-size: 17px; color: #1e3a5f; }
.rd-summary p { margin: 0; font-size: 14px; line-height: 1.5; color: #566271; }
.rd-summary .seats { font-size: 26px; font-weight: 800; color: #15202c; font-variant-numeric: tabular-nums; }
.rd-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #d2d8df; border-radius: 10px; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rd-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #566271; font-weight: 700; padding: 10px; border-bottom: 1px solid #d2d8df; }
.rd-table td { padding: 9px 10px; border-bottom: 1px solid #d2d8df; }
.rd-table tr:last-child td { border-bottom: 0; }
.rd-table tr.on td { background: #f3f5f7; }
.rd-table .chip { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; }
.rd-note { font-size: 13px; color: #566271; line-height: 1.5; margin: 0; }

@media (max-width: 800px) {
  .rd-play, .rd-utah { grid-template-columns: 1fr; }
  .rd-head { padding: 18px; }
}
