/* Colors and type follow the Nurbly app's dark theme (forge blue, steel greys, DM Sans). */
:root {
  --bg: #0b0d12;
  --surface: #0f1117;
  --surface2: #141720;
  --surface3: #1a1e2b;
  --text: #e8ecf4;
  --text-2: #c5cee0;
  --muted: #8b94ad;
  --border: rgba(99, 118, 148, 0.18);
  --border-bright: rgba(99, 118, 148, 0.35);
  --forge-300: #8aaaff;
  --forge-400: #527dff;
  --forge-500: #2952ff;
  --forge-600: #1432f5;
  --forge-700: #1128e1;
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-bd: rgba(245, 158, 11, 0.45);
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--forge-300); }
a:hover { color: #b9ccff; }

img { max-width: 100%; }

h1, h2 { letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 1rem; }

p { margin: 0; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

section { padding: 3rem 0 0; }

.section-lead { color: var(--muted); margin: -0.5rem 0 1rem; }
.note { color: var(--muted); margin-top: 1rem; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--forge-300);
  background: rgba(41, 82, 255, 0.12);
  border: 1px solid rgba(41, 82, 255, 0.25);
  padding: 0.05em 0.4em;
  border-radius: 6px;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
}
.btn-lg { font-size: 1rem; padding: 0.75rem 1.4rem; }
.btn-primary { background: var(--forge-600); color: #fff; }
.btn-primary:hover { background: var(--forge-500); color: #fff; }
.btn-primary:active { background: var(--forge-700); }
.btn-outline { color: var(--text-2); border-color: var(--border-bright); }
.btn-outline:hover { color: var(--text); background: var(--surface2); }

/* Header */
.site-header {
  background: rgba(11, 13, 18, 0.85);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--text); }
.brand img { flex: none; }
.brand .muted { font-weight: 500; }

/* Hero: the app's steel grid with a forge glow from the top */
.hero {
  position: relative;
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(41, 82, 255, 0.22), transparent),
    linear-gradient(rgba(99, 118, 148, 0.07) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(99, 118, 148, 0.07) 1px, transparent 1px) 0 0 / 32px 32px;
}
.hero h1 {
  font-size: 2.4rem;
  line-height: 1.08;
  font-weight: 700;
  margin: 0 0 1.25rem;
}
.grad {
  background: linear-gradient(90deg, var(--forge-400), var(--forge-300));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.lead { color: var(--text-2); font-size: 1.1rem; max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.value { font-size: 1.15rem; font-weight: 700; margin-top: 0.35rem; }
.sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* Stages table */
.table-card { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: 0; }
th {
  background: var(--surface2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
td { color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 700; white-space: nowrap; }
td:nth-child(2) { color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--forge-300);
  background: rgba(41, 82, 255, 0.12);
  border: 1px solid rgba(41, 82, 255, 0.25);
  border-radius: 6px;
  padding: 0 0.4em;
  margin-right: 0.4em;
}

/* Phones: stack table rows so nothing scrolls sideways */
@media (max-width: 599px) {
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); }
  tbody tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 0.1rem 0; white-space: normal; }
  td:first-child { white-space: normal; }
  td:nth-child(2) { font-size: 0.85rem; }
  td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--sans); }
}

/* Judging weights with bars */
.weights { list-style: none; margin: 0; padding: 0; }
.weights li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.weights li:first-child { padding-top: 0.2rem; }
.weights li:last-child { border-bottom: 0; padding-bottom: 0.2rem; }
.weights strong { font-family: var(--mono); color: var(--forge-300); }
.weights i {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, var(--forge-500), var(--forge-300)) 0 0 / var(--w) 100% no-repeat,
    var(--surface3);
}

/* Prizes */
.card-grand {
  border-color: rgba(41, 82, 255, 0.45);
  background:
    radial-gradient(ellipse 90% 80% at 0% 0%, rgba(41, 82, 255, 0.18), transparent),
    var(--surface);
}
.amount { font-size: 1.5rem; font-weight: 700; margin-top: 0.4rem; }
.card-grand .amount { font-size: 2rem; }
.amount-sm { font-size: 1.15rem; color: var(--text-2); }
.tbd {
  font-family: var(--mono);
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px dashed var(--warn-bd);
  padding: 0 0.35em;
  border-radius: 6px;
}

/* Rules checklist */
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem 1.5rem;
}
.checks li { position: relative; padding-left: 1.6rem; color: var(--text-2); }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 4px;
  background: rgba(41, 82, 255, 0.18);
  border: 1px solid rgba(41, 82, 255, 0.45);
}
.checks li::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: 0.48em;
  width: 0.28rem;
  height: 0.5rem;
  border: solid var(--forge-300);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Sponsors */
.sponsors { display: flex; flex-wrap: wrap; gap: 12px; }
.sponsors a {
  flex: 1 1 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.sponsors a:hover { border-color: rgba(41, 82, 255, 0.4); }
.sponsors img { max-height: 100%; }

/* FAQ */
.faq { display: grid; gap: 8px; }
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}
details[open] { border-color: var(--border-bright); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--forge-300); font-family: var(--mono); }
details[open] summary::after { content: "-"; }
details p { color: var(--text-2); margin-top: 0.6rem; }

/* Footer call to action */
.site-footer {
  margin-top: 4rem;
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: radial-gradient(ellipse 70% 80% at 50% 120%, rgba(41, 82, 255, 0.2), transparent);
}
.site-footer h2 { font-size: 1.9rem; margin-bottom: 0.5rem; }
.site-footer .btn { margin-top: 1.5rem; }
.footer-sponsor { margin-top: 2.5rem; color: var(--text-2); }
.footer-meta {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-bright); }
.site-footer-slim { padding-top: 2.5rem; }
.site-footer-slim .btn { margin-top: 0; }

/* Rules page */
.page-head {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 80% 90% at 50% -20%, rgba(41, 82, 255, 0.18), transparent);
}
.page-head h1 { font-size: 2.2rem; line-height: 1.1; font-weight: 700; margin: 0.5rem 0 0.4rem; }
.back { font-size: 0.9rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--text); }
.toc { margin-top: 2rem; }
.toc ol { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.3rem 1.5rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.rules section > p { color: var(--text-2); margin-bottom: 0.9rem; }
.rules section > p b { color: var(--text); }
.rules .num { font-family: var(--mono); font-weight: 500; color: var(--forge-300); margin-right: 0.4em; }
.rules .caps { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; color: var(--text); }
.rules .table-card { margin: 0.25rem 0 1rem; }
.rules section > .note { margin-top: 0; }
.rules section > .section-lead { margin-top: -0.5rem; color: var(--muted); }
section[id] { scroll-margin-top: 1rem; }
/* Rules tables wrap and keep columns in normal weight, unlike the landing page's stages table */
.rules td:first-child { white-space: normal; }
.rules .defs td:first-child { width: 30%; }
.rules .plain td:nth-child(2) { color: var(--text-2); }
.checks.checks-1 { grid-template-columns: 1fr; }

@media (min-width: 600px) {
  .hero { padding: 5.5rem 0 4.5rem; }
  .hero h1 { font-size: 3.5rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .checks { grid-template-columns: 1fr 1fr; }
  .toc ol { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 860px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(4, 1fr); }
  /* Cash prizes share the first row; the four sponsor prizes fill the second */
  .card-cash { grid-column: span 2; }
}
