/* h1116: one centered frame for the home page, the catch game back as a real arena,
   and a clean "not on mainnet yet" block. Loaded last on the home page. */

/* ---------- 1. Catch the blocks: the arena is visible before you press Start ---------- */
#rain .rn {
  border-radius: 16px !important;
  border: 1px solid var(--line, #ddd) !important;
  max-width: none !important;
  background:
    radial-gradient(80% 60% at 20% 0%, rgba(61,123,255,.16), transparent 70%),
    radial-gradient(70% 60% at 100% 30%, rgba(15,157,138,.10), transparent 70%),
    color-mix(in srgb, var(--text, #111) 3%, var(--bg, #fff)) !important;
}
#rain .rn:not(.on) .rn-cv,
#rain .rn .rn-cv { display: block !important; height: min(52vh, 380px) !important; }
#rain .rn:not(.on) .rn-hud { display: flex !important; }
#rain .rn .rn-start {
  position: absolute !important; left: 0 !important; right: 0 !important;
  top: calc(50% + 40px) !important; bottom: auto !important;
  display: flex !important; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 !important; pointer-events: none; z-index: 2;
}
#rain .rn .rn-start > * { pointer-events: auto; }
#rain .rn .rn-start[hidden] { display: none !important; }
#rain .rn-how { display: none !important; }
#rain .rn .rn-go {
  border-radius: 999px !important; min-height: 48px; padding: 0 34px !important;
  font-size: 17px; box-shadow: 0 8px 24px rgba(35,80,200,.30) !important;
}
#rain .rn .rn-src:empty { display: none; }
#rain .rn .rn-src {
  background: color-mix(in srgb, var(--bg, #fff) 92%, transparent) !important;
  border-radius: 999px !important; padding: 4px 12px !important;
  font: 500 13px/1.4 var(--mono, ui-monospace, monospace);
}
#rain .rn .rn-out:not(:empty) { padding: 10px 16px 0; margin: 0; }
#rain .tw-lede { max-width: 46ch; }
@media (max-width: 640px) {
  #rain .rn .rn-cv, #rain .rn:not(.on) .rn-cv { height: min(58vh, 420px) !important; }
}

/* ---------- 2. One frame: every home section lines up on the same centered edge ---------- */
@media (min-width: 900px) {
  main#main > :is(#rain, #why-it-matters, #crypto-talk, #compare, #live, #why-youd-care,
    #the-short-version, #start, #the-problem, #one-order, #try-to-break-it, #the-race, #today,
    #who-got-the-coins, #price-and-risk, #coins-with-rules, #check-it-yourself, #finish, #deeper, #books) {
    box-sizing: border-box;
    padding-left: max(24px, calc((100% - 1152px) / 2)) !important;
    padding-right: max(24px, calc((100% - 1152px) / 2)) !important;
  }
  main#main > #guess-confirm {
    box-sizing: border-box; max-width: 1152px !important; width: auto !important;
    margin: 8px auto 24px !important; padding: 0 !important;
  }
  /* Narrow reading sections sit as a centered column, the same way "Kaspa vs others" does. */
  #why-it-matters > *, #kaspa-vs-now { max-width: 760px !important; margin-left: auto !important; margin-right: auto !important; }
  #why-it-matters .fx5-usps { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ---------- 3. "What is not on mainnet yet": readable lede, left-aligned captions, fitted sketches ---------- */
#whats-next .fx16-lede {
  color: var(--mute, #5b6170) !important; opacity: 1 !important; filter: none !important;
  -webkit-text-fill-color: currentColor !important; background: none !important;
  font-size: 15px; line-height: 1.5; margin: 4px 0 14px; max-width: 60ch;
}
#whats-next .fx16-next-lanes { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { #whats-next .fx16-next-lanes { grid-template-columns: 1fr 1fr; } }
#whats-next .fx16-next-lane {
  display: block !important; padding: 16px !important;
  border: 1px solid var(--line, #ddd) !important; border-radius: 14px !important;
  background: color-mix(in srgb, var(--text, #111) 2%, var(--bg, #fff)) !important;
}
#whats-next .fx16-next-lane h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px !important; }
#whats-next .fx24-chip {
  font: 600 12px/1 var(--mono, ui-monospace, monospace); letter-spacing: .02em;
  padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, #e0a100 18%, transparent); color: #8a5a00;
}
html[data-theme="dark"] #whats-next .fx24-chip { color: #f3c55a; }
#whats-next .fx24-chip.dev { background: color-mix(in srgb, #1f5be0 14%, transparent); color: #1f44d1; }
html[data-theme="dark"] #whats-next .fx24-chip.dev { color: #9cb6ff; }
#whats-next .fx16-sketch {
  height: auto !important; border: 0 !important; padding: 0 !important; background: none !important; margin: 0 0 8px;
}
#whats-next .fx16-sketch svg { width: 100% !important; height: auto !important; max-height: 90px; }
#whats-next .fx16-cap, #whats-next .fx16-next-lane .fx16-cap {
  text-align: left !important; margin: 6px 0 0 !important; font-size: 15px !important; line-height: 1.5 !important;
  color: var(--text, #1a1a1a) !important; display: block !important; grid-column: auto !important; grid-row: auto !important;
}
#whats-next .fx16-src { margin: 8px 0 0 !important; font-size: 13px; text-align: left !important; }
#whats-next .fx16-next-links { margin-top: 10px !important; }
#whats-next .fx24-live {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.5;
  background: color-mix(in srgb, #0f9d8a 10%, transparent); border: 1px solid color-mix(in srgb, #0f9d8a 30%, transparent);
}
#whats-next .fx24-live b { color: #0b7a6b; }
html[data-theme="dark"] #whats-next .fx24-live b { color: #5fd3c1; }
#whats-next .fx16-src a + a { margin-left: 14px; }
