:root {
  color-scheme: dark;
  --brand-lime: #a6e600;
  --brand-white: #f5f5f2;
  --brand-black: #050505;
  --brand-divider: #2b2b2b;
  --ink: var(--brand-white);
  --muted: #c9c9c2;
  --panel: rgba(5, 5, 5, 0.78);
  --panel-strong: rgba(5, 5, 5, 0.92);
  --border: rgba(245, 245, 242, 0.14);
  --lime-border: rgba(166, 230, 0, 0.32);
  --surface: #101313;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(140deg, #050505 0%, #2b2b2b 58%, #050505 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.instructions-shell {
  width: min(72rem, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.instructions-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.2rem;
}

.brand-mark {
  display: block;
  width: min(15rem, 64vw);
  height: auto;
  margin: 0 0 1.1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brand-lime);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.7rem, 10vw, 5.8rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
  line-height: 1.18;
}

p,
li {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
}

.status-panel {
  min-width: min(20rem, 100%);
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--lime-border);
  border-radius: 8px;
  text-align: right;
}

.status-panel span,
.status-panel strong {
  display: block;
}

.status-panel span {
  color: var(--muted);
  font-weight: 800;
}

.status-panel strong {
  margin-top: 0.2rem;
  color: var(--brand-lime);
  font-size: 1.15rem;
}

.summary-band,
.instruction-section,
.template-section {
  margin: 0 0 0.8rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--lime-border);
  border-radius: 8px;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: end;
}

.summary-band p:last-child,
.instruction-section p:last-child,
.template-section p:last-child {
  margin-bottom: 0;
}

.section-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  background: rgba(5, 5, 5, 0.9);
}

.section-tabs a {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0.55rem 0.75rem;
  background: #171a1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.section-tabs a:hover,
.section-tabs a:focus-visible {
  border-color: var(--brand-lime);
  outline: none;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.rule-grid article,
.example-strip,
.template-grid span {
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.rule-grid article p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.turn-list,
.plain-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.4rem;
}

.example-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.example-strip span {
  color: var(--muted);
  font-weight: 900;
}

.example-strip strong {
  color: var(--brand-lime);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.template-grid span {
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

@media (max-width: 760px) {
  .instructions-header,
  .summary-band {
    display: block;
  }

  .status-panel {
    margin-top: 1rem;
    text-align: left;
  }

  .rule-grid,
  .example-strip,
  .template-grid {
    grid-template-columns: 1fr;
  }
}
