/* ==========================================================================
   Geekfest - retro LAN party meets CS2.
   Beige towers, CRT phosphor, CAT5 cables, a basement full of friends.
   ========================================================================== */
@font-face { font-family: 'Press Start 2P'; src: url(/fonts/press-start-2p.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url(/fonts/vt323.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(/fonts/space-grotesk.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #0c0e13;
  --bg2: #12151d;
  --panel: #171b25;
  --line: #262c3a;
  --text: #e9e6dc;
  --muted: #9aa0ad;
  --beige: #d9cfb4;
  --beige-dark: #b5aa8c;
  --beige-shadow: #8f8569;
  --phosphor: #39ff14;
  --phosphor-dim: #1f8f0b;
  --amber: #ffb000;
  --orange: #ff8a00;
  --cyan: #00e5ff;
  --red: #ff3b3b;
  --discord: #5865f2;
  --radius: 10px;
  --pixel: 'Press Start 2P', monospace;
  --term: 'VT323', monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 138, 0, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(57, 255, 20, .06), transparent 60%),
    linear-gradient(var(--bg), var(--bg2));
  background-color: var(--bg);
  background-repeat: no-repeat;
  min-height: 100vh;
}
/* faint "carpet + floor grid" texture */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
a { color: var(--cyan); }
a:hover { color: #fff; }
img { max-width: 100%; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.pixel { font-family: var(--pixel); letter-spacing: .02em; line-height: 1.35; }
.term { font-family: var(--term); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- header */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px); background: rgba(12, 14, 19, .82); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo .mark { width: 34px; height: 34px; border-radius: 6px; background: var(--beige); box-shadow: inset -3px -3px 0 var(--beige-shadow), inset 3px 3px 0 #f1ead7; display: grid; place-items: center; }
.logo .mark i { display: block; width: 20px; height: 14px; background: #0b1a0b; border-radius: 2px; box-shadow: inset 0 0 6px rgba(57,255,20,.6); }
.logo b { font-family: var(--pixel); font-size: 15px; }
.logo small { font-family: var(--pixel); font-size: 9px; color: var(--orange); margin-left: 2px; }
.nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--text); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font-family: var(--pixel); font-size: 10px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 8px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-family: var(--sans); font-size: 16px; transition: transform .08s ease, filter .15s; color: #111; }
.btn:hover { filter: brightness(1.08); color: #111; }
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--orange); box-shadow: 0 4px 0 #a35800; }
.btn-discord { background: var(--discord); color: #fff; box-shadow: 0 4px 0 #3a43a8; }
.btn-discord:hover { color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { color: #fff; border-color: var(--muted); }
.btn-green { background: var(--phosphor); box-shadow: 0 4px 0 var(--phosphor-dim); }
.btn-steam { background: #1b2838; color: #fff; border: 1px solid #66c0f4; }
.btn-steam:hover { color: #fff; }
.btn-x { background: #000; color: #fff; border: 1px solid #444; }
.btn-x:hover { color: #fff; }
.btn-sm { padding: 8px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.nav .btn { padding: 9px 14px; font-size: 14px; }
.nav a.btn-discord, .nav a.btn-discord:hover { color: #fff; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 70px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center; }
.eyebrow { font-family: var(--pixel); font-size: 11px; color: var(--phosphor); text-transform: uppercase; letter-spacing: .12em; }
.hero h1 { font-family: var(--pixel); font-size: clamp(38px, 6.3vw, 76px); margin: 18px 0 8px; line-height: 1.05;
  text-shadow: 4px 4px 0 var(--orange), 8px 8px 0 rgba(255, 138, 0, .25); }
.hero h1 span { color: var(--beige); }
.hero .tag { font-family: var(--term); font-size: 30px; color: var(--amber); margin: 6px 0 16px; }
.hero p.lead { font-size: 19px; color: #cfcbbf; max-width: 560px; }
.hero .ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero .stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.hero .stats div { font-family: var(--term); font-size: 22px; color: var(--muted); }
.hero .stats b { display: block; font-family: var(--pixel); font-size: 22px; color: var(--text); }

/* ---------------------------------------------------------------- CRT monitor (beige box) */
.crt { background: linear-gradient(160deg, #e6dcc2, var(--beige) 40%, var(--beige-dark)); border-radius: 18px 18px 22px 22px; padding: 22px 22px 40px; position: relative;
  box-shadow: inset -6px -6px 0 rgba(0,0,0,.12), inset 5px 5px 0 rgba(255,255,255,.5), 0 30px 60px rgba(0,0,0,.5); }
.crt::after { content: "GEEKFEST  ●"; position: absolute; bottom: 12px; left: 26px; right: 26px; font-family: var(--pixel); font-size: 8px; color: #7c7359; letter-spacing: .2em; display: flex; justify-content: space-between; }
.screen { background: #050a05; border-radius: 14px / 18px; padding: 18px 20px; color: var(--phosphor); font-family: var(--term); font-size: 22px; line-height: 1.25; min-height: 260px; position: relative; overflow: hidden;
  box-shadow: inset 0 0 40px rgba(57,255,20,.18), inset 0 0 4px #000; text-shadow: 0 0 6px rgba(57,255,20,.65); }
.screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.28) 2px 4px); }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.55)); }
.screen .dim { color: var(--phosphor-dim); text-shadow: none; }
.screen .amber { color: var(--amber); text-shadow: 0 0 6px rgba(255,176,0,.6); }
.cursor { display: inline-block; width: 11px; height: 20px; background: var(--phosphor); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.crt-stand { width: 46%; height: 18px; margin: 0 auto; background: linear-gradient(var(--beige-dark), var(--beige-shadow)); border-radius: 0 0 10px 10px; }
.crt-base { width: 70%; height: 14px; margin: 0 auto; background: var(--beige-dark); border-radius: 8px; box-shadow: 0 10px 20px rgba(0,0,0,.4); }

/* ---------------------------------------------------------------- sections */
section { padding: 60px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--pixel); font-size: clamp(20px, 2.6vw, 28px); margin: 8px 0 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 560px; }
.cable { height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--cyan) 0 30px, #0087a3 30px 34px); opacity: .5; margin: 0 0 30px; }

/* ---------------------------------------------------------------- server cards */
.servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 26px; }
.srv { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.srv .bezel { background: linear-gradient(160deg, #e6dcc2, var(--beige) 50%, var(--beige-dark)); padding: 12px 12px 10px; }
.srv .scr { background: #040904; border-radius: 10px / 14px; padding: 14px 16px; font-family: var(--term); color: var(--phosphor); text-shadow: 0 0 5px rgba(57,255,20,.55); position: relative; overflow: hidden; min-height: 132px;
  box-shadow: inset 0 0 30px rgba(57,255,20,.14); }
.srv .scr::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.3) 2px 4px); }
.srv.offline .scr { color: #5e6b5e; text-shadow: none; }
.srv .scr .mode { font-family: var(--pixel); font-size: 10px; letter-spacing: .1em; color: var(--accent, var(--amber)); text-shadow: none; }
.srv .scr .map { font-size: 34px; line-height: 1.1; margin: 8px 0 6px; word-break: break-all; }
.srv .scr .count { font-size: 22px; }
.srv .bar { display: flex; gap: 3px; margin-top: 8px; }
.srv .bar i { flex: 1; height: 9px; background: #0f2a0a; border-radius: 1px; }
.srv .bar i.on { background: var(--phosphor); box-shadow: 0 0 6px rgba(57,255,20,.7); }
.srv .bar i.bot { background: var(--phosphor-dim); }
.srv .bezel .leds { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-family: var(--pixel); font-size: 7px; color: #7c7359; letter-spacing: .15em; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #444; display: inline-block; box-shadow: inset 0 0 2px #000; }
.led.on { background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor); }
.led.idle { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.led.off { background: var(--red); box-shadow: 0 0 6px var(--red); }
.srv .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.srv h3 { margin: 0; font-size: 19px; }
.srv .desc { margin: 0; color: var(--muted); font-size: 15px; }
.srv .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.srv .addr { font-family: var(--term); font-size: 20px; background: #0b0e14; border: 1px dashed var(--line); border-radius: 6px; padding: 6px 10px; color: var(--amber); cursor: pointer; }
.players { width: 100%; border-collapse: collapse; font-size: 14px; }
.players th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); padding: 4px 6px; }
.players td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.04); }
.players td.num { text-align: right; font-variant-numeric: tabular-nums; }
.players tr.bot td { color: var(--muted); }
.players-wrap { max-height: 230px; overflow: auto; }
details.plist summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
details.plist[open] summary { margin-bottom: 6px; }
.updated { font-family: var(--term); font-size: 19px; color: var(--muted); }
.updated .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--phosphor); margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------------------------------------------------------------- perks teaser */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; counter-reset: s; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.step::before { counter-increment: s; content: "0" counter(s); font-family: var(--pixel); font-size: 12px; color: var(--orange); }
.step h3 { margin: 10px 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.perk-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; }
.perk { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: rgba(57,255,20,.06); border: 1px solid rgba(57,255,20,.25); }
.perk b { font-family: var(--pixel); font-size: 11px; color: var(--phosphor); }
.perk span { color: #cfd6cc; font-size: 15px; }
.floppy { width: 34px; height: 34px; flex: none; border-radius: 3px; background: #2b2f3a; position: relative; box-shadow: inset 0 -10px 0 #3a3f4d; }
.floppy::before { content: ""; position: absolute; top: 3px; left: 8px; width: 18px; height: 10px; background: #b8bcc6; border-radius: 1px; }
.floppy::after { content: ""; position: absolute; bottom: 4px; left: 6px; right: 6px; height: 10px; background: #e9e6dc; border-radius: 1px; }

/* ---------------------------------------------------------------- discord + x */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: stretch; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.discord-card { background: linear-gradient(140deg, #2a2f7a, #1b1f4f 60%, #151833); border-color: #3b43a3; position: relative; overflow: hidden; }
.discord-card h2 { font-family: var(--pixel); font-size: 22px; margin: 6px 0 12px; }
.discord-card ul { padding-left: 18px; color: #c9ccf3; }
.discord-card .big { font-size: 18px; padding: 16px 24px; }
.discord-card .ascii { position: absolute; right: -10px; bottom: -14px; font-family: var(--term); font-size: 18px; color: rgba(255,255,255,.08); white-space: pre; line-height: 1; pointer-events: none; }
.x-card h2 { font-family: var(--pixel); font-size: 18px; margin: 6px 0 14px; }
.x-feed { background: #0b0d12; border: 1px solid var(--line); border-radius: 12px; min-height: 380px; max-height: 620px; overflow: auto; padding: 6px; }
.x-fallback { padding: 18px; color: var(--muted); }
.x-post { border-bottom: 1px solid var(--line); padding: 14px; }
.x-post:last-child { border-bottom: 0; }
.x-post .meta { font-size: 13px; color: var(--muted); }
.x-post p { margin: 6px 0; white-space: pre-wrap; }

.polaroid { background: #f3efe4; color: #222; padding: 14px 14px 46px; border-radius: 4px; transform: rotate(-2.5deg); box-shadow: 0 20px 40px rgba(0,0,0,.45); position: relative; max-width: 440px; }
.polaroid .photo { aspect-ratio: 4 / 3; border-radius: 2px; background: #1a1410; position: relative; overflow: hidden; }
.polaroid .photo svg { width: 100%; height: 100%; display: block; }
.polaroid figcaption { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-family: var(--term); font-size: 24px; color: #333; }

/* ---------------------------------------------------------------- perks page */
.perks-page { padding: 50px 0 70px; }
.perks-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 26px; align-items: start; }
.check { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 14px; align-items: flex-start; }
.check .box { width: 34px; height: 34px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-family: var(--pixel); font-size: 12px; color: var(--muted); }
.check.done { border-color: rgba(57,255,20,.4); }
.check.done .box { border-color: var(--phosphor); background: rgba(57,255,20,.12); color: var(--phosphor); }
.check.locked { opacity: .55; }
.check h3 { margin: 2px 0 4px; font-size: 18px; }
.check p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.check .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check .who img { width: 28px; height: 28px; border-radius: 4px; }
.check label.honor { display: flex; gap: 10px; align-items: center; cursor: pointer; margin-top: 8px; font-size: 15px; }
.check label.honor input { width: 20px; height: 20px; accent-color: var(--phosphor); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.banner.ok { background: rgba(57,255,20,.1); border: 1px solid rgba(57,255,20,.4); color: #b9ffab; }
.banner.warn { background: rgba(255,176,0,.1); border: 1px solid rgba(255,176,0,.4); color: #ffd98a; }
.banner.err { background: rgba(255,59,59,.1); border: 1px solid rgba(255,59,59,.4); color: #ffb3b3; }
.status-screen .screen { min-height: 210px; font-size: 21px; }
.small { font-size: 14px; }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--muted); font-size: 14px; margin-top: 30px; }
footer .wrap { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
footer a { color: var(--muted); }
.console { font-family: var(--term); font-size: 24px; background: #050a05; color: var(--phosphor); padding: 12px 16px; border-radius: 8px; }
.connect-page main { padding: 80px 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .hero .wrap, .split, .perks-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .polaroid { margin: 0 auto; }
}
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 20px; align-items: flex-start; }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  section { padding: 44px 0; }
  .servers { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .cursor, .updated .dot { animation: none; } html { scroll-behavior: auto; } }
.srv .loc{margin:.1rem 0 .4rem;font-size:.85rem;opacity:.8;letter-spacing:.05em}

/* Member perks are off unless PERKS_ENABLED=true (common.js adds .perks-on) */
.perks-only{display:none!important}
html.perks-on .perks-only{display:revert!important}

/* ---------------------------------------------------------------- X posts (server-rendered) */
.x-post { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
.x-post:first-child { border-top: 0; }
.x-post .x-body { flex: 1; min-width: 0; }
.x-post p { margin: 4px 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.x-post .meta { font-size: 12px; opacity: .7; }
.x-post .x-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; flex: none; }
.x-follow { margin: 12px 0 0; }
/* header social buttons */
.social-nav { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.btn-social { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .05em; }
.btn-social svg { flex: none; }
.btn-youtube { background: #ff0033; color: #fff; box-shadow: 0 4px 0 #a30021; }
.nav a.btn-youtube, .nav a.btn-x, .btn-youtube:hover { color: #fff; }
