/* The pages for developers (developers.html, docs.html), on top of site.css.
   2026-10-11. Technical and calm: code in a monospace face, the console drawn
   as it looks, and the same night colours as the games page. */

/* --- the top ---------------------------------------------------------------------- */

.d-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 56px;
}

.d-hero::before {
  content: "";
  position: absolute;
  inset: -50% -10% auto -10%;
  height: 140%;
  background:
    radial-gradient(38% 45% at 15% 35%, rgba(91, 134, 255, 0.3), transparent 70%),
    radial-gradient(32% 40% at 85% 25%, rgba(255, 95, 168, 0.2), transparent 70%);
  pointer-events: none;
}

.d-hero-in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.d-title {
  font-size: clamp(42px, 5.6vw, 72px);
}

.hl {
  background: linear-gradient(92deg, #7c9fff 0%, #b78bff 50%, #ff7fb8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.d-lead {
  margin-top: 22px;
  max-width: 580px;
}

.d-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.d-buttons-center {
  justify-content: center;
}

.d-works {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* --- the console, drawn ----------------------------------------------------------- */

.mock {
  margin: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line-strong);
  overflow: hidden;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.mock-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.mock-bar b {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.mock-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.mock-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid rgba(91, 134, 255, 0.55);
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue-hover);
}

.mock-drop span,
.mock-live > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mock-drop b,
.mock-live b {
  color: var(--text);
  font-size: 16px;
}

.mock-drop small,
.mock-live small {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mock-steps {
  list-style: none;
  margin: 0;
  padding: 0 4px;
  display: grid;
  gap: 12px;
}

.mock-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 15px;
  animation: mock-in 0.5s ease both;
  animation-delay: var(--d);
}

.tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  position: relative;
}

.tick::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--green);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.mock-live {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(47, 220, 147, 0.35);
  animation: mock-in 0.5s ease both;
  animation-delay: var(--d);
}

.mock-copy {
  margin-left: auto;
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

@keyframes mock-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- sections --------------------------------------------------------------------- */

.d-section {
  padding-top: 72px;
  padding-bottom: 8px;
}

.d-head {
  max-width: 720px;
  margin-bottom: 32px;
}

.d-head .lead {
  margin-top: 14px;
}

.d-head-row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.d-head-row .h-section {
  margin: 0;
}

.pains,
.caps {
  display: grid;
  gap: 16px;
}

.pains {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pain,
.cap {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pain h3,
.cap h3,
.flow-step h3,
.ex-steps h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
}

.pain p,
.cap p,
.flow-step p,
.ex-steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}

.pain-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: rgba(255, 95, 168, 0.14);
  color: #ff8cc0;
}

.caps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cap {
  position: relative;
  padding-top: 24px;
}

.cap::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
}

/* --- build, upload, play ---------------------------------------------------------- */

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: flow;
}

.flow-step {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.flow-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(91, 134, 255, 0.35);
}

.flow-step:nth-child(2) .flow-n {
  background: var(--violet);
  box-shadow: 0 8px 24px rgba(155, 107, 255, 0.35);
}

.flow-step:nth-child(3) .flow-n {
  background: var(--pink);
  box-shadow: 0 8px 24px rgba(255, 95, 168, 0.35);
}

.flow-step b {
  color: var(--text);
  overflow-wrap: anywhere;
}

/* --- the live game ------------------------------------------------------------------ */

.demo {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: center;
  padding: 36px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.demo .lead {
  margin-top: 14px;
  font-size: 17px;
}

.checks {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.checks li {
  position: relative;
  padding-left: 30px;
  color: var(--text-2);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-soft);
}

.checks li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 5px;
  height: 10px;
  border: solid var(--green);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.demo-links {
  margin: 20px 0 0;
  font-weight: 700;
}

.demo-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow), 0 0 0 1px var(--line-strong);
}

.demo-start {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #1b2142;
  cursor: pointer;
  color: #fff;
  font: inherit;
}

.demo-start img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.demo-start:hover img {
  transform: scale(1.03);
}

.demo-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(7, 9, 18, 0.25), rgba(7, 9, 18, 0.7));
}

.demo-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 999px;
  background: #fff;
  color: #0b0e1a;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.demo-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- the worked example ------------------------------------------------------------- */

.example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.ex-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
  counter-reset: ex;
}

.ex-steps > li {
  position: relative;
  padding-left: 58px;
  counter-increment: ex;
}

.ex-steps > li::before {
  content: counter(ex);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
}

.ex-steps p + p,
.ex-steps p + .prompt,
.ex-steps .prompt + p,
.ex-steps p + pre {
  margin-top: 12px;
}

.ex-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-weight: 700;
}

.prompt {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-deep);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.prompt p {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
}

.small {
  color: var(--muted);
  font-size: 14px;
}

.ex-steps .small {
  color: var(--muted);
  font-size: 14px;
}

.ex-code {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(160deg, #161c3a, #10142a);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.ex-code-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}

.code-card {
  border-radius: 14px;
  background: var(--bg-deep);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.code-file {
  margin: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}

.code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--bg-deep);
  color: #dfe4ff;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: 12px;
}

.code-card .code {
  border-radius: 0;
}

.code code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.c-dim {
  color: #7a83a6;
}

.c-key {
  color: #8fb0ff;
}

.c-str {
  color: #ffb3d4;
}

.ex-code-note {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 15px;
}

/* --- games already here ------------------------------------------------------------ */

.strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
}

.strip a {
  display: block;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.strip a:hover {
  color: var(--text);
}

.strip-art {
  display: block;
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}

.strip-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.strip-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- questions ----------------------------------------------------------------------- */

.faq-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: start;
}

.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.faq details[open] {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--muted);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--text-2);
}

/* --- the last word ----------------------------------------------------------------- */

.d-final {
  padding-top: 80px;
}

.d-final-in {
  padding: 64px 32px;
  border-radius: 30px;
  text-align: center;
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(255, 95, 168, 0.38), transparent 60%),
    radial-gradient(60% 100% at 0% 100%, rgba(91, 134, 255, 0.5), transparent 60%),
    linear-gradient(135deg, #1b2350, #2a1f55);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.d-final-title {
  font-size: clamp(34px, 4.4vw, 54px);
}

.d-final .lead {
  margin: 16px auto 0;
  max-width: 560px;
  color: #e3e6f7;
}

/* --- the guide (docs.html) ---------------------------------------------------------- */

.doc-top {
  padding: 48px 0 8px;
}

.doc-top .lead {
  margin-top: 16px;
  max-width: 680px;
}

.doc-title {
  font-size: clamp(38px, 4.6vw, 56px);
}

.doc {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 32px;
}

.toc {
  position: sticky;
  top: 92px;
}

.toc p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.toc a {
  display: block;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* min-width 0: a long line of code scrolls inside its box instead of
   widening the page on a phone. */
.doc > *,
.example > *,
.demo > *,
.faq-wrap > *,
.d-hero-in > * {
  min-width: 0;
}

.doc-body {
  max-width: 760px;
}

.doc-body section {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.doc-body section:last-child {
  border-bottom: 0;
}

.doc-body h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.doc-body h3 {
  margin: 26px 0 8px;
  font-size: 19px;
  font-weight: 800;
}

.doc-body p,
.doc-body li {
  color: var(--text-2);
  font-size: 17px;
}

.doc-body p {
  margin: 0 0 14px;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body strong,
.doc-body b {
  color: var(--text);
}

.doc-body .code {
  margin: 0 0 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.rules {
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: 10px;
}

.rules li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 !important;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.rules .rule-n {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue-hover);
  font-weight: 800;
}

.rules b {
  display: block;
  margin-bottom: 2px;
}

.note-box {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.35);
  color: #ffe2b3 !important;
}

.trouble {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.trouble div {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.trouble b {
  display: block;
  margin-bottom: 4px;
}

.trouble p {
  margin: 0;
}

/* --- narrower windows --------------------------------------------------------------- */

@media (max-width: 1100px) {
  .caps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .strip li:nth-child(n + 9) {
    display: none;
  }
}

@media (max-width: 960px) {
  .d-hero {
    padding: 40px 0 32px;
  }

  .d-hero-in,
  .demo,
  .example,
  .faq-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .pains,
  .flow {
    grid-template-columns: 1fr;
  }

  .ex-code {
    position: static;
  }

  .demo {
    padding: 24px;
  }

  .doc {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .toc {
    position: static;
    padding: 18px;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
  }

  .toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .d-hero {
    padding: 28px 0 20px;
  }

  .d-title {
    font-size: 40px;
  }

  .d-buttons .btn {
    flex: 1 1 auto;
  }

  .d-section {
    padding-top: 56px;
  }

  .d-head {
    margin-bottom: 24px;
  }

  .caps {
    grid-template-columns: 1fr;
  }

  .pain,
  .cap,
  .flow-step {
    padding: 22px;
  }

  .mock-body {
    padding: 16px;
  }

  .mock-copy {
    display: none;
  }

  .demo {
    padding: 18px;
    border-radius: 22px;
  }

  .demo-stage {
    aspect-ratio: 4 / 3;
  }

  .demo-play {
    padding: 13px 20px;
    font-size: 15px;
  }

  .ex-steps > li {
    padding-left: 50px;
  }

  .ex-code {
    padding: 16px;
  }

  .code {
    font-size: 12.5px;
  }

  .strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .strip li:nth-child(n + 7) {
    display: none;
  }

  .d-final-in {
    padding: 40px 20px;
    border-radius: 22px;
  }

  .doc-top {
    padding-top: 28px;
  }

  .doc-body h2 {
    font-size: 25px;
  }

  .doc-body p,
  .doc-body li {
    font-size: 16px;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }
}
