/* ============================================================
   SPACEBAR CLICKER — Global Stylesheet
   Dark theme · Acid yellow accent · Bebas Neue + DM Sans
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #E8F060;
  --accent-dark: #c8d040;
  --bg: #0e0e0e;
  --surface: #161616;
  --surface2: #1f1f1f;
  --border: #2a2a2a;
  --text: #ffffff;
  --body: #c9c9c9;
  --muted: #8f8f8f;
  --dim: #4a4a4a;
  --radius: 18px;
  --maxw: 1120px;
  --article-w: 760px;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body { line-height: 1.7; font-size: 16px; }

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

/* ── HEADER / NAV ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,14,14,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 2px; color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .keycap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 26px; padding: 0 8px;
  background: var(--accent); color: #111;
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--accent-dark);
  font-size: 15px; letter-spacing: 1px;
}
.nav-links { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.6rem); list-style: none; }
.nav-links a {
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-links a.nav-cta {
  background: var(--accent); color: #111;
  padding: 8px 18px; border-radius: 999px; font-weight: 700;
}
.nav-links a.nav-cta:hover { background: var(--accent-dark); color: #111; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 10px; width: 42px; height: 42px; cursor: pointer;
  color: var(--text); font-size: 20px; line-height: 1;
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    background: #121212; border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem 1rem 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid #1c1c1c; }
  .nav-links li:last-child { border-bottom: none; padding-top: .75rem; }
  .nav-links a { display: block; padding: 14px 4px; font-size: 16px; }
  .nav-links a.nav-cta { text-align: center; }
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero { text-align: center; padding: clamp(2rem, 6vw, 3.5rem) 0 1rem; }
.eyebrow {
  display: inline-block;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 1rem;
}
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 8vw, 68px);
  letter-spacing: 2px; line-height: 1.02;
  margin-bottom: .5rem;
}
.hero .sub { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: clamp(15px, 3.5vw, 17px); }

/* ── GAME ─────────────────────────────────────────────────── */
.game-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  max-width: 720px; margin: 2rem auto 0;
}
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 1.5rem; }
.tab {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .2s; touch-action: manipulation;
}
.tab.active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }
.tab:hover:not(.active) { border-color: var(--dim); color: #ddd; }
.custom-wrap { display: none; justify-content: center; align-items: center; gap: 8px; margin: -0.5rem 0 1.25rem; }
.custom-wrap.visible { display: flex; }
.custom-wrap label { font-size: 13px; color: var(--muted); }
.custom-wrap input {
  width: 90px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 15px;
}
.stats { display: flex; justify-content: center; align-items: flex-end; gap: clamp(1.5rem, 7vw, 4rem); margin-bottom: 1.25rem; }
.stat { text-align: center; }
.stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(30px, 8vw, 52px); line-height: 1; letter-spacing: 1px;
  transition: color .15s;
}
.stat-val.main { font-size: clamp(58px, 15vw, 96px); }
.stat-val.lit { color: var(--accent); }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 5px; letter-spacing: 2px; text-transform: uppercase; }
.progress-wrap { width: 100%; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; margin-bottom: 1.5rem; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width .1s linear; }
.start-hint { text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: .95rem 2.4rem;
  background: var(--accent); color: #111; border: none; border-radius: 999px;
  font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 2px;
  cursor: pointer; transition: transform .15s, background .15s;
  touch-action: manipulation;
}
.btn:hover { background: var(--accent-dark); transform: scale(1.03); text-decoration: none; color:#111; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover { color: var(--text); border-color: var(--dim); transform: none; }
.start-hint .kbd-note { display: block; margin-top: .8rem; font-size: 13px; color: var(--muted); }
kbd {
  font-family: 'DM Sans', sans-serif; font-size: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-bottom-width: 3px; border-radius: 6px; padding: 2px 8px; color: #ddd;
}
#tap-zone { display: none; flex-direction: column; align-items: center; }
#tap-zone.visible { display: flex; }
#tap-btn {
  width: 100%; min-height: clamp(180px, 38vw, 260px);
  background: var(--bg); border: 2px dashed var(--border); border-radius: 20px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; touch-action: manipulation; position: relative; overflow: hidden;
  transition: background .1s, border-color .1s, transform .08s;
  -webkit-user-select: none; user-select: none; color: inherit;
}
#tap-btn.active-state { background: #1c1c08; border-color: var(--accent); transform: scale(.98); }
.tap-key { font-family: 'Bebas Neue', sans-serif; font-size: clamp(26px, 7vw, 42px); letter-spacing: 3px; color: #ccc; }
.tap-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.tap-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(232,240,96,.15); width: 20px; height: 20px;
  transform: scale(0); animation: ripple .4s ease-out forwards; pointer-events: none;
}
@keyframes ripple { to { transform: scale(25); opacity: 0; } }
.plus-flash {
  position: absolute; top: 12px; right: 18px;
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(22px, 5vw, 30px);
  color: var(--accent); opacity: 0; pointer-events: none; transition: opacity .06s;
}
.plus-flash.show { opacity: 1; }

/* Result overlay */
#result-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 200;
  align-items: center; justify-content: center; padding: 1.25rem;
}
#result-overlay.visible { display: flex; }
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: clamp(1.5rem, 5vw, 2.5rem);
  max-width: 460px; width: 100%; text-align: center;
  animation: popIn .3s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.res-emoji { font-size: clamp(52px, 14vw, 72px); line-height: 1; margin-bottom: .4rem; }
.res-rank-label { font-size: 11px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.res-rank-name {
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(38px, 10vw, 56px);
  color: var(--accent); letter-spacing: 2px; margin-bottom: 1.25rem; line-height: 1;
}
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.25rem; }
.res-cell { background: var(--bg); border-radius: 14px; padding: .9rem .5rem; }
.res-val { font-family: 'Bebas Neue', sans-serif; font-size: clamp(26px, 7vw, 36px); letter-spacing: 1px; }
.res-lbl { font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: 1px; text-transform: uppercase; }
.res-note { font-size: 12px; color: var(--muted); margin-bottom: 1.1rem; }
.res-btns { display: flex; gap: 10px; }
.rbtn {
  flex: 1; padding: .85rem; border-radius: 999px;
  font-family: 'DM Sans', sans-serif; font-size: 14.5px; font-weight: 700;
  cursor: pointer; border: none; transition: opacity .2s, transform .15s;
  touch-action: manipulation;
}
.rbtn:active { transform: scale(.96); }
.rbtn.primary { background: var(--accent); color: #111; }
.rbtn.secondary { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* Auto clicker */
.auto-shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: clamp(1.25rem, 4vw, 2rem);
  max-width: 720px; margin: 1.25rem auto 0;
}
.auto-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.auto-title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1.5px; }
.auto-badge { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(232,240,96,.35); border-radius: 999px; padding: 4px 12px; }
.auto-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; }
.auto-controls label { font-size: 13.5px; color: var(--muted); }
.auto-controls input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.auto-cps { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--accent); min-width: 74px; text-align: center; }
.auto-note { font-size: 12.5px; color: var(--muted); margin-top: .9rem; }

/* ── ARTICLE / CONTENT ────────────────────────────────────── */
.article { max-width: var(--article-w); margin: 0 auto; padding: clamp(2rem, 6vw, 3.5rem) 0; }
.article > * + * { margin-top: 1.1rem; }
.article p, .article li { color: var(--body); font-size: 16px; }
.article h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 6vw, 38px); letter-spacing: 1.5px; line-height: 1.1;
  margin-top: 2.75rem; padding-top: 1rem; position: relative;
}
.article h2::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 44px; height: 4px; background: var(--accent); border-radius: 2px;
}
.article h3 { font-size: clamp(18px, 4vw, 21px); font-weight: 700; margin-top: 1.9rem; color: var(--text); }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-top: .5rem; }
.article strong { color: var(--text); }
.article blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--muted); font-style: italic; }
.article .lead { font-size: 18px; color: #ddd; }

/* Images */
.img-wrap { margin: 1.75rem 0; }
.img-wrap img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.img-wrap figcaption { font-size: 12.5px; color: var(--muted); margin-top: .5rem; text-align: center; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 14px; }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; background: var(--surface); }
table.data th, table.data td { padding: 12px 16px; font-size: 14.5px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; background: var(--surface2); white-space: nowrap; }
table.data td { color: var(--body); }
table.data tr:last-child td { border-bottom: none; }
table.data td:first-child { color: var(--text); font-weight: 500; }

/* FAQ */
.faq { margin-top: 1rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; margin-top: .75rem; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; color: var(--text);
  list-style: none; position: relative; padding-right: 3rem; font-size: 15.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.25rem; top: 50%;
  transform: translateY(-50%);
  font-family: 'Bebas Neue', sans-serif; font-size: 24px; color: var(--accent);
  transition: transform .2s;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 1.25rem 1.1rem; color: var(--body); font-size: 15px; }

/* Section wrapper for homepage below-game content */
.page-section { padding: 0; }

/* ── BLOG CARDS ───────────────────────────────────────────── */
.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem; margin: 2.5rem 0 3.5rem;
}
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--dim); }
.post-card a.thumb { display: block; aspect-ratio: 16/9; background: var(--surface2); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 44px; color: var(--dim); letter-spacing: 3px;
}
.post-body { padding: 1.25rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.post-tag { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.post-title { font-size: 18px; font-weight: 700; line-height: 1.35; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-excerpt { font-size: 14px; color: var(--muted); flex: 1; }
.post-more { font-size: 13.5px; font-weight: 700; }

/* Breadcrumbs */
.crumbs { font-size: 13px; color: var(--muted); padding-top: 1.5rem; max-width: var(--article-w); margin: 0 auto; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--dim); margin: 0 .4rem; }

/* Post meta */
.post-meta { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: 13.5px; margin-top: .75rem; flex-wrap: wrap; }
.post-meta .dot { color: var(--dim); }

/* Author box */
.author-box {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.4rem; margin-top: 3rem;
}
.author-avatar {
  width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--accent);
  border: 2px solid var(--border);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-box .a-label { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.author-box .a-name { font-weight: 700; font-size: 17px; margin: .15rem 0 .35rem; }
.author-box p { font-size: 14px; color: var(--muted); }
@media (max-width: 520px) { .author-box { flex-direction: column; } }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, #191906, #101010);
  border: 1px solid rgba(232,240,96,.25);
  border-radius: 24px; text-align: center;
  padding: clamp(2rem, 6vw, 3rem); margin: 3rem auto; max-width: var(--article-w);
}
.cta-band h2 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(26px, 6vw, 40px); letter-spacing: 1.5px; margin-bottom: .5rem; }
.cta-band p { color: var(--muted); margin-bottom: 1.4rem; }

/* ── CONTACT FORM ─────────────────────────────────────────── */
.contact-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: clamp(1.5rem, 5vw, 2.25rem); margin-top: 2rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: .4rem; letter-spacing: .5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 15px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form-success {
  display: none; background: rgba(232,240,96,.08);
  border: 1px solid rgba(232,240,96,.35); border-radius: 14px;
  padding: 1rem 1.25rem; color: var(--text); margin-bottom: 1.1rem; font-size: 15px;
}
.form-success.visible { display: block; }

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; background: #0b0b0b; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem; padding: clamp(2.5rem, 6vw, 3.5rem) 0 2rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer-grid .f-brand { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 2px; display: inline-flex; align-items: center; gap: 10px; margin-bottom: .6rem; }
.footer-grid .f-brand .keycap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 24px; padding: 0 7px;
  background: var(--accent); color: #111; border-radius: 6px;
  box-shadow: 0 3px 0 var(--accent-dark); font-size: 14px;
}
.footer-grid p { color: var(--muted); font-size: 14px; max-width: 360px; }
.footer-grid h4 { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); margin-bottom: .9rem; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: .55rem; }
.footer-grid ul a { color: var(--muted); font-size: 14.5px; }
.footer-grid ul a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0; text-align: center;
  color: var(--dim); font-size: 13px;
}
