: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-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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, 0.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: 0.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,
.card-label,
.result-label {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.hero h1 {
  margin: 0;
  color: var(--yellow);
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.live-reference {
  display: grid;
  grid-template-columns: repeat(2, 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);
}

.calculator-section {
  padding-block: 20px 70px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-heading h2,
.content-card h2 {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.section-heading p {
  color: var(--muted);
}

.calculator-card {
  padding: clamp(20px, 4vw, 38px);
}

.calculator-card > h3 {
  margin-top: 0;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
}

.number-button {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.number-button:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
}

.number-button.selected {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.result-panel {
  margin-top: 38px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.selected-ball,
.group-ball,
.associated-ball {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.selected-ball {
  width: 76px;
  height: 76px;
  margin: 4px auto 14px;
  background: var(--yellow);
  color: #111;
  font-size: 1.8rem;
}

.group-results {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin: 20px auto 32px;
}

.group-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.group-ball {
  width: 54px;
  height: 54px;
  border: 2px solid var(--purple);
}

.group-ball-selected {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.associated-section {
  padding-top: 18px;
}

.associated-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.associated-ball {
  width: 58px;
  height: 58px;
  background: var(--purple);
  color: #0b0910;
}

.information-section {
  padding-bottom: 32px;
}

.content-card {
  padding: clamp(24px, 5vw, 44px);
}

.content-card > p {
  max-width: 760px;
}

.example-box {
  max-width: 650px;
  margin-top: 28px;
  padding: 22px;
  border-left: 4px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
}

.example-groups {
  color: var(--yellow);
  font-weight: 800;
  line-height: 2;
}

.disclaimer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer {
  padding-block: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 16px;
  }

  .live-reference {
    grid-template-columns: 1fr;
  }

  .number-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 430px) {
  .number-grid {
    gap: 7px;
  }

  .number-button {
    font-size: 0.85rem;
  }
}

/* Compact Play Whe number selector */
.number-grid {
  grid-template-columns: repeat(12, 38px);
  justify-content: center;
  gap: 9px;
}

.number-button {
  width: 38px;
  height: 38px;
  aspect-ratio: auto;
  padding: 0;
  border: 2px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  font-size: 0.85rem;
}

.number-button:hover {
  background: var(--yellow);
  color: #111;
}

.number-button.selected {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

/* All Play Whe result balls remain yellow */
.group-ball,
.group-ball-selected,
.associated-ball {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

@media (max-width: 620px) {
  .number-grid {
    grid-template-columns: repeat(9, 36px);
    gap: 7px;
  }

  .number-button {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 430px) {
  .number-grid {
    grid-template-columns: repeat(6, 36px);
  }
}

/* Play Whe live context */

.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);
  font-size: 0.82rem;
  line-height: 1.35;
}

.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: 48px;
  height: 48px;
  font-size: 1rem;
}

.strategy-draw-ball.pending {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.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: 8px 6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.strategy-under-table th {
  color: var(--muted);
  font-size: 0.72rem;
}

.strategy-under-table td:first-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.under-number {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
}

.under-na,
.context-empty {
  color: var(--muted);
}

@media (max-width: 520px) {
  .strategy-draws {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Stack Play Whe context cards like the analyzer */
.live-reference {
  grid-template-columns: 1fr;
  gap: 18px;
}

.strategy-draw-mark {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Improve Today's Draws readability */
.strategy-draw-time {
  font-size: 0.95rem;
  font-weight: 700;
}

.strategy-draw-ball {
  width: 64px;
  height: 64px;
  font-size: 1.35rem;
}

.strategy-draw-mark {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 520px) {
  .strategy-draw-ball {
    width: 58px;
    height: 58px;
    font-size: 1.2rem;
  }

  .strategy-draw-mark {
    font-size: 0.9rem;
  }
}

/* Improve Under Today readability without overpowering Today's Draws */
.under-number {
  width: 38px;
  height: 38px;
  font-size: 0.88rem;
  font-weight: 900;
}

.strategy-under-table th {
  font-size: 0.82rem;
}

.strategy-under-table td:first-child {
  font-size: 0.86rem;
}

.strategy-under-table th,
.strategy-under-table td {
  padding: 10px 7px;
}

@media (max-width: 520px) {
  .under-number {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
  }
}

/* Lucky Diamonds interactive charts */

.diamond-mark-selector {
  max-width: 620px;
  margin: 0 auto 22px;
  padding: 16px 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.diamond-mark-selector .result-label { margin-bottom: 12px; }

.diamond-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 8px;
}

.diamond-number-button {
  min-width: 0;
  min-height: 40px;
  padding: 7px 4px;
  border: 2px solid var(--yellow);
  border-radius: 9px;
  background: transparent;
  color: var(--yellow);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.diamond-number-button:hover,
.diamond-number-button:focus-visible,
.diamond-number-button.selected {
  background: var(--yellow);
  color: #111;
}

.diamond-number-button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.diamond-number-button.selected {
  box-shadow: 0 0 0 3px rgba(255,216,77,0.22);
}

.diamond-tool {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.diamond-chart-card,
.diamond-result-card,
.diamond-match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.diamond-chart-card {
  padding: 22px;
}

.diamond-chart-heading {
  margin-bottom: 18px;
}

.diamond-chart-heading span {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.green-chart-card .diamond-chart-heading span,
.green-label {
  color: var(--green);
}

.red-chart-card .diamond-chart-heading span,
.red-label {
  color: #ff6868;
}

.diamond-chart-heading h3 {
  margin: 3px 0 0;
}

.diamond-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.diamond-mark {
  min-width: 0;
  min-height: 68px;
  padding: 7px 3px;
  border: 1px solid rgba(255,255,255,0.14);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  border-radius: 9px;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.diamond-chart-green .diamond-mark {
  border-color: rgba(121,230,165,0.28);
}

.diamond-chart-red .diamond-mark {
  border-color: rgba(255,104,104,0.28);
}

.diamond-mark:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
}

.diamond-mark-number {
  display: block;
  color: var(--yellow);
  font-size: 1.15rem;
  font-weight: 900;
}

.diamond-mark-name {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.15;
}

.diamond-chart-green .diamond-mark.is-surrounding {
  background: rgba(121,230,165,0.16);
  border-color: var(--green);
}

.diamond-chart-red .diamond-mark.is-surrounding {
  background: rgba(255,104,104,0.16);
  border-color: #ff6868;
}

.diamond-mark.is-selected {
  background: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: #111;
}

.diamond-mark.is-selected .diamond-mark-number,
.diamond-mark.is-selected .diamond-mark-name {
  color: #111;
}

.diamond-result {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.diamond-selected {
  text-align: center;
}

.diamond-selected-name {
  display: flex;
  max-width: min(100%, 240px);
  min-height: 1.3em;
  margin: 0 auto 26px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.diamond-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.diamond-result-card,
.diamond-match-card {
  padding: 20px;
  text-align: center;
}

.diamond-match-card {
  margin-top: 18px;
}

.diamond-result-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 12px;
}

.diamond-result-ball {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
}

.match-result-ball {
  box-shadow: 0 0 0 3px var(--purple);
}

.diamond-no-match {
  color: var(--muted);
}

@media (max-width: 800px) {
  .diamond-tool,
  .diamond-results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .diamond-chart {
    gap: 3px;
  }

  .diamond-mark {
    min-height: 54px;
    padding: 5px 2px;
  }

  .diamond-mark-number {
    font-size: 1rem;
  }

  .diamond-mark-name {
    display: none;
  }
}

/* Shared Play Whe 3D ball finish */

.number-button,
.selected-ball,
.group-ball,
.associated-ball,
.strategy-draw-ball,
.under-number,
.diamond-result-ball {
  background:
    radial-gradient(
      circle at 35% 30%,
      #fff4a3 0%,
      #ffd21f 38%,
      #e5ad00 100%
    );
  color: #171717;
  border: 2px solid #e2ad00;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,0.65),
    0 4px 11px rgba(133,93,0,0.30);
}

.number-button:hover,
.group-ball:hover,
.associated-ball:hover,
.under-number:hover {
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,0.72),
    0 6px 14px rgba(133,93,0,0.38);
}

.number-button.selected,
.group-ball-selected {
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,0.80),
    0 0 0 3px rgba(255,216,77,0.20),
    0 6px 14px rgba(133,93,0,0.42);
}

.strategy-draw-ball.pending {
  background: var(--surface);
  color: var(--muted);
  border: 2px dashed var(--border);
  box-shadow: none;
}


/* Lucky Diamonds production finish */
.skip-link {
  position: absolute;
  top: 0;
  left: 16px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 0 0 8px 8px;
  background: var(--yellow);
  color: #111;
  font-weight: 800;
  transform: translateY(-120%);
  transition: transform 120ms ease;
}

.skip-link:focus { transform: translateY(0); }

nav a:focus-visible,
.brand:focus-visible,
.back-to-strategies:focus-visible,
.diamond-node:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.diamond-node { cursor: pointer; }

.diamond-lattice-host {
  max-width: 900px;
  margin-inline: auto;
  overflow-x: auto;
}

.diamond-lattice {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 900px;
  margin-inline: auto;
}

.diamond-edge { opacity: 0.5; stroke-width: 2.5; }
.diamond-lattice-green .diamond-edge { stroke: var(--green); }
.diamond-lattice-red .diamond-edge { stroke: #ff6868; }

.diamond-node-circle {
  fill: var(--surface-2);
  stroke-width: 2;
}

.diamond-lattice-green .diamond-node-circle { stroke: var(--green); }
.diamond-lattice-red .diamond-node-circle { stroke: #ff6868; }

.diamond-node-number {
  fill: var(--yellow);
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
}

.diamond-node:hover .diamond-node-circle {
  stroke: var(--yellow);
  stroke-width: 4;
}

.diamond-node.is-surrounding .diamond-node-circle {
  fill: #333019;
  stroke: var(--yellow);
  stroke-width: 3;
}

.diamond-node.is-selected .diamond-node-circle {
  fill: var(--yellow);
  stroke: var(--yellow);
}

.diamond-node.is-selected .diamond-node-number { fill: #111; }

.diamond-chart-card { padding: 20px; }
.diamond-chart-heading { max-width: 900px; margin-inline: auto; }
.diamond-chart-heading h3 { font-size: 1.15rem; line-height: 1.25; }

.diamond-result-ball {
  font-size: 1rem;
  line-height: 1;
}


.diamond-mark-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.diamond-pool-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.diamond-pool-summary,
.diamond-overlap-summary {
  margin: 0;
  color: var(--muted);
}

.diamond-result-balls + .diamond-overlap-summary { margin-top: 14px; }

.diamond-pool-card .pool-overlap {
  box-shadow: 0 0 0 3px var(--purple);
}

.diamond-node[tabindex]:focus-visible .diamond-node-circle {
  stroke: var(--yellow);
  stroke-width: 4;
}

@media (max-width: 520px) {
  .diamond-lattice-host { overflow-x: auto; }
  .diamond-pool-card { padding: 16px 12px; }
}
