@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=VT323&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #080600;
  --surface: #110d00;
  --border:  #2e2200;
  --text:    #e8a820;
  --hot:     #ffc840;
  --dim:     #6b4f12;
  --red:     #d95f5f;
  --font:    'Courier Prime', 'Courier New', monospace;
  --display: 'VT323', monospace;
  --glow:    0 0 8px rgba(232,168,32,0.5);
  --glow-sm: 0 0 5px rgba(232,168,32,0.3);
}

html { font-size: 17px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}

/* CRT scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.14) 3px,
    rgba(0,0,0,0.14) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 48%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
  z-index: 9998;
}

a { color: var(--hot); text-decoration: underline; }
a:hover { text-shadow: var(--glow); color: var(--hot); }

code {
  font-family: var(--font);
  color: var(--hot);
  background: rgba(232,168,32,0.07);
  padding: 1px 5px;
  border: 1px solid rgba(232,168,32,0.2);
}

strong { color: var(--hot); font-weight: 700; }

/* Layout */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */

nav {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  color: var(--hot);
  text-decoration: none;
  text-shadow: var(--glow);
}

.nav-logo:hover { text-shadow: 0 0 16px rgba(255,200,64,0.7); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.1s;
}

.nav-links a:hover { color: var(--text); text-shadow: none; }

/* Buttons */

.btn-primary {
  display: inline-block;
  background: transparent;
  color: var(--hot);
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  padding: 8px 20px;
  border: 1px solid var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s, text-shadow 0.15s;
  line-height: 1;
}

.btn-primary::before { content: '[ '; }
.btn-primary::after  { content: ' ]'; }

.btn-primary:hover {
  background: rgba(232,168,32,0.08);
  box-shadow: 0 0 20px rgba(232,168,32,0.25), inset 0 0 8px rgba(232,168,32,0.05);
  text-shadow: var(--glow);
  color: var(--hot);
}

/* Hero */

.hero {
  padding: 88px 0 80px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.03em;
  max-width: 800px;
  margin-bottom: 22px;
  color: var(--hot);
  text-shadow: var(--glow);
}

.hero h1::before {
  content: '> ';
  color: var(--dim);
  text-shadow: none;
}

.hero h1::after {
  content: '_';
  color: var(--hot);
  animation: blink 1.1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--dim);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.72;
}

/* Explainer */

.explainer {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.explainer p {
  font-size: 0.9rem;
  margin-bottom: 18px;
  line-height: 1.75;
}

.explainer p:last-child { margin-bottom: 0; }

/* Sections */

.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section h2 {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  color: var(--hot);
}

.section-sub {
  color: var(--dim);
  margin-bottom: 32px;
  font-size: 0.82rem;
}

/* Game cards */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.game-card {
  display: block;
  padding: 20px 22px;
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}

.game-card:hover {
  background: var(--surface);
  color: var(--text);
  text-shadow: none;
}

.game-name {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  color: var(--hot);
  margin-bottom: 3px;
}

.game-type {
  font-size: 0.68rem;
  color: var(--dim);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-issue {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.5;
}

/* Page header */

.page-header {
  padding: 52px 0 36px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--hot);
  margin-bottom: 6px;
  text-shadow: var(--glow-sm);
}

.page-header p {
  color: var(--dim);
  font-size: 0.84rem;
}

/* Optimize page states */

.state { display: none; }
.state.active { display: block; }

/* Detecting */

.detecting-wrap { padding: 80px 0 64px; }

.detecting-label {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: 0.05em;
  color: var(--hot);
  text-shadow: var(--glow);
  margin-bottom: 24px;
}

.detecting-label::before { content: '> '; color: var(--dim); }
.detecting-label::after  { content: '_'; animation: blink 0.9s step-start infinite; }

.progress-track {
  width: 300px;
  height: 1px;
  background: var(--border);
  margin-bottom: 14px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--text);
  box-shadow: 0 0 6px var(--text);
  width: 0%;
  transition: width 2.5s linear;
}

.detecting-sub {
  font-size: 0.78rem;
  color: var(--dim);
}

/* Spec readout */

.results-wrap { padding: 48px 0 80px; }

.spec-readout {
  font-family: var(--font);
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 20px;
  margin-bottom: 28px;
  display: inline-block;
}

.spec-row {
  display: flex;
  gap: 20px;
  padding: 3px 0;
}

.spec-label {
  color: var(--dim);
  width: 90px;
  flex-shrink: 0;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.spec-value { color: var(--hot); }

/* Tier */

.tier-block { margin-bottom: 36px; }

.tier-badge {
  display: inline-block;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  padding: 2px 10px;
  margin-bottom: 8px;
  border: 1px solid;
}

.tier-badge::before { content: '[ '; }
.tier-badge::after  { content: ' ]'; }

.tier-badge--struggling {
  color: var(--red);
  border-color: var(--red);
  background: rgba(217,95,95,0.07);
  text-shadow: 0 0 8px rgba(217,95,95,0.45);
}
.tier-badge--decent {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}
.tier-badge--capable {
  color: var(--hot);
  border-color: var(--text);
  background: rgba(232,168,32,0.07);
  text-shadow: var(--glow-sm);
}

.tier-desc {
  font-size: 0.86rem;
  color: var(--dim);
  max-width: 560px;
  margin-top: 8px;
}

/* Mode toggle */

.mode-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.checklist-h {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.mode-toggle {
  display: flex;
  border: 1px solid var(--border);
}

.mode-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.1s, color 0.1s;
  line-height: 1;
}

.mode-btn + .mode-btn { border-left: 1px solid var(--border); }

.mode-btn.active {
  background: var(--text);
  color: var(--bg);
}

/* Checklist */

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.checklist-item {
  border: 1px solid var(--border);
  background: var(--surface);
}

.checklist-item.done .checklist-item-title {
  text-decoration: line-through;
  opacity: 0.35;
}

.checklist-item-header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.checklist-item-header:hover { background: rgba(232,168,32,0.04); }

.checklist-cb {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  accent-color: var(--text);
  cursor: pointer;
}

.checklist-item-meta { flex: 1; min-width: 0; }

.checklist-item-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.checklist-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.impact-badge {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 0 6px;
  border: 1px solid;
  flex-shrink: 0;
}

.impact-badge--high   { color: var(--red);  border-color: var(--red); }
.impact-badge--medium { color: var(--text); border-color: var(--border); }
.impact-badge--low    { color: var(--dim);  border-color: var(--border); }

.checklist-simple-line {
  font-size: 0.82rem;
  color: var(--dim);
  line-height: 1.5;
  margin-top: 3px;
}

.checklist-item-why {
  font-size: 0.8rem;
  color: var(--dim);
  line-height: 1.62;
  display: none;
  margin-top: 4px;
}

.checklist-toggle-hint {
  font-size: 0.66rem;
  color: var(--dim);
  flex-shrink: 0;
  margin-top: 4px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.checklist-item-body {
  padding: 0 14px 12px 39px;
  border-top: 1px solid var(--border);
  display: none;
}

.checklist-item.expanded .checklist-item-body { display: block; }

.checklist-item-steps {
  margin-top: 10px;
  padding-left: 18px;
}

.checklist-item-steps li {
  font-size: 0.84rem;
  margin-bottom: 6px;
  line-height: 1.58;
}

/* Mode switching */
body.mode-technical .checklist-simple-line { display: none; }
body.mode-technical .checklist-item-why    { display: block; }
body.mode-simple    .checklist-item-why    { display: none; }
body.mode-simple    .checklist-simple-line { display: block; }
.checklist-item-why { display: none; }

/* Fallback form */

.fallback-wrap { padding: 48px 0 80px; }

.fallback-wrap h2 {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--hot);
  margin-bottom: 8px;
}

.fallback-sub {
  color: var(--dim);
  margin-bottom: 32px;
  font-size: 0.86rem;
}

.form-group { margin-bottom: 26px; }

.form-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.87rem;
  cursor: pointer;
}

.radio-option input {
  accent-color: var(--text);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Article / game pages */

.article-nav-back {
  display: inline-block;
  font-size: 0.76rem;
  color: var(--dim);
  text-decoration: none;
  padding: 20px 0 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-nav-back:hover { color: var(--text); text-shadow: none; }

.article-header {
  padding: 36px 0 44px;
  border-bottom: 1px solid var(--border);
}

.article-tag {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}

.article-header h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.12;
  margin-bottom: 18px;
  max-width: 720px;
  color: var(--hot);
  text-shadow: var(--glow-sm);
}

.article-lead {
  font-size: 0.9rem;
  color: var(--dim);
  max-width: 600px;
  line-height: 1.72;
}

.article-body {
  padding: 44px 0 88px;
  max-width: 680px;
}

.article-body h2 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 40px 0 14px;
  color: var(--text);
}

.article-body h2:first-child { margin-top: 0; }

.article-body h2::before {
  content: '## ';
  color: var(--dim);
  font-size: 1.1rem;
}

.article-body p {
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.75;
}

.article-body ol,
.article-body ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

.article-body li {
  font-size: 0.88rem;
  margin-bottom: 7px;
  line-height: 1.6;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 0.86rem;
  line-height: 1.67;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
}

.setting-row:last-child { border-bottom: none; }
.setting-name { color: var(--text); }
.setting-val  { color: var(--hot); font-size: 0.84rem; }

.settings-block {
  border: 1px solid var(--border);
  padding: 0 16px;
  margin: 16px 0 24px;
  background: var(--surface);
}

/* Footer */

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-note {
  font-size: 0.74rem;
  color: var(--dim);
}

.footer-links { display: flex; gap: 20px; }

.footer-links a {
  font-size: 0.74rem;
  color: var(--dim);
  text-decoration: none;
}

.footer-links a:hover { color: var(--text); text-shadow: none; }

/* Responsive */

@media (max-width: 640px) {
  html { font-size: 16px; }
  .hero { padding: 52px 0; }
  .nav-links { display: none; }
  .games-grid { grid-template-columns: 1fr 1fr; }
  .spec-readout { width: 100%; }
  .spec-row { flex-direction: column; gap: 1px; }
  .spec-label { width: auto; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .mode-toggle-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .games-grid { grid-template-columns: 1fr; }
}
