:root {
  --bg: #08090d;
  --surface: #11131a;
  --surface-2: #171a23;
  --border: #292d3a;
  --text: #f5f5f7;
  --muted: #a9adba;
  --yellow: #ffd84d;
  --purple: #a98cff;
  --green: #79e6a5;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 Arial, Helvetica, sans-serif; }
a { color: inherit; }
.page-width { width: min(960px, calc(100% - 32px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--border); background: rgba(8, 9, 13, .96); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--yellow); font-weight: 800; text-decoration: none; letter-spacing: .03em; }
nav { display: flex; flex-wrap: wrap; gap: 20px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--yellow); }
.hero { padding-block: 72px 44px; text-align: center; }
.eyebrow, .result-label, .card-label { margin: 0 0 8px; color: var(--purple); font-size: .78rem; font-weight: 800; letter-spacing: .13em; }
.hero h1 { margin: 0; color: var(--yellow); font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1; }
.hero-copy { max-width: 720px; margin: 24px auto 0; color: var(--muted); font-size: 1.08rem; }

/* Established Play Whe strategy-page live context pattern. */
.live-reference { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 60px; }
.reference-card, .calculator-card, .content-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.reference-card { padding: 22px; }
.draw-placeholder, .under-placeholder { color: var(--muted); }

/* These are the established Number Lines live-context classes. */
.strategy-draws { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.strategy-draw { text-align: center; }
.strategy-draw-time { display: block; margin-bottom: 10px; color: var(--muted); line-height: 1.35; font-size: .95rem; font-weight: 700; }
.strategy-draw-ball, .under-number { display: inline-grid; place-items: center; border-radius: 50%; background: var(--yellow); color: #111; font-weight: 900; }
.strategy-draw-ball { width: 64px; height: 64px; font-size: 1.35rem; }
.strategy-draw-ball.pending { border: 2px dashed var(--border); background: var(--surface-2); color: var(--muted); box-shadow: none; }
.strategy-draw-mark { display: block; margin-top: 10px; color: var(--muted); font-size: .95rem; font-weight: 700; line-height: 1.3; }
.strategy-under-scroll { overflow-x: auto; margin-top: 10px; }
.strategy-under-table { width: 100%; border-collapse: collapse; text-align: center; }
.strategy-under-table th, .strategy-under-table td { padding: 10px 7px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.strategy-under-table th { color: var(--muted); font-size: .72rem; }
.strategy-under-table td:first-child { color: var(--muted); font-size: .86rem; }
.under-number { width: 38px; height: 38px; border: 2px solid #e2ad00; background: radial-gradient(circle at 35% 30%, #fff4a3 0%, #ffd21f 38%, #e5ad00 100%); color: #171717; font-size: .88rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 3px 8px rgba(133,93,0,.24); }
.under-na, .context-empty { color: var(--muted); }

.information-section { margin-bottom: 28px; }
.content-card, .calculator-card { padding: clamp(20px, 4vw, 38px); }
.content-card h2, .section-heading h2 { margin: 0 0 10px; color: var(--yellow); font-size: clamp(1.8rem, 5vw, 2.6rem); }
.content-card p { color: var(--muted); }
.disclaimer { border-left: 3px solid var(--purple); padding-left: 16px; }
.calculator-section { padding-block: 20px 50px; }
.section-heading { max-width: 720px; margin-bottom: 24px; }
.section-heading > p:last-child { color: var(--muted); }

/* Cross-Stitch-specific lattice geometry and states. */
.chart-scroll { overflow-x: auto; padding: 28px 22px 32px; }
.cross-stitch-board { display: grid; grid-template-columns: repeat(6, 78px); gap: 28px 24px; width: max-content; margin: auto; padding: 28px; }
.cross-stitch-cell { position: relative; width: 78px; height: 78px; transform: rotate(45deg); border: 2px solid #41485a; border-radius: 5px; background: linear-gradient(135deg, #202636, #121722); color: var(--text); cursor: pointer; font-size: 0; font-weight: 800; transition: background .15s, border-color .15s, transform .15s; box-shadow: 0 0 0 1px rgba(255,255,255,.02); }
.cross-stitch-cell::after { content: ""; position: absolute; inset: -15px; border: 1px solid rgba(169,140,255,.15); pointer-events: none; }
.cross-stitch-cell::before { content: attr(data-mark); display: grid; place-items: center; position: absolute; inset: 0; transform: rotate(-45deg); font-size: 1.15rem; }
.cross-stitch-cell:hover, .cross-stitch-cell:focus-visible { border-color: var(--yellow); transform: rotate(45deg) translateY(-2px); outline: none; }
.cross-stitch-cell.related { border-color: var(--green); background: rgba(121,230,165,.2); color: var(--green); }
.cross-stitch-cell.starter { border-color: var(--yellow); background: var(--yellow); color: #111; box-shadow: 0 0 0 2px #08090d, 0 0 0 4px var(--yellow); }

.result-panel { border-top: 1px solid var(--border); padding-top: 24px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr); gap: 28px; align-items: center; }
.result-details { min-width: 0; }
.result-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 22px; }
.result-summary div { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
dt { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
dd { margin: 3px 0 0; color: var(--text); font-weight: 800; }
.related-marks { display: flex; flex-wrap: wrap; gap: 7px; min-height: 48px; }
.related-mark { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 2px solid #e2ad00; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4a3 0%, #ffd21f 38%, #e5ad00 100%); color: #171717; font-size: 1.3rem; font-weight: 900; box-shadow: inset 0 2px 1px rgba(255,255,255,.65), 0 4px 11px rgba(133,93,0,.30); }
.result-layout .explorer-link { width: 100%; margin-top: 0; text-align: center; }
.explorer-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin-top: 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); padding: 9px 14px; font-size: .9rem; font-weight: 700; text-decoration: none; }
.explorer-link:hover, .explorer-link:focus-visible { border-color: var(--yellow); color: var(--yellow); outline: none; }
.coverage { margin: 18px 0; color: var(--muted); font-weight: 700; }
.secondary-button { width: 100%; margin-top: 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-weight: 700; padding: 9px 12px; }
.secondary-button:hover, .secondary-button:focus-visible { border-color: var(--yellow); outline: none; }
.back-navigation { padding-bottom: 24px; }
.back-to-strategies { color: var(--muted); text-decoration: none; }
.back-to-strategies:hover { color: var(--yellow); }

@media (max-width: 760px) {
  .result-layout { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 560px) {
  .page-width { width: min(100% - 20px, 960px); }
  .hero { padding-block: 52px 34px; }
  .live-reference { margin-bottom: 36px; }
  .strategy-draws { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  .strategy-draw-ball { width: 58px; height: 58px; font-size: 1.2rem; }
  .strategy-draw-mark { font-size: .9rem; }
  .strategy-under-table th, .strategy-under-table td { padding: 8px 6px; }
  .under-number { width: 34px; height: 34px; }
  .chart-scroll { padding-inline: 8px; }
  .cross-stitch-board { grid-template-columns: repeat(6, 64px); gap: 24px 18px; padding: 24px; }
  .cross-stitch-cell { width: 64px; height: 64px; }
  .cross-stitch-cell::before { font-size: .95rem; }
  .related-mark { width: 44px; height: 44px; font-size: 1.1rem; }
  .explorer-link { width: 100%; text-align: center; }
}
