/* ==========================================================================
   126 Games — site styles
   Design language: dark terminal / neon grid. Deliberately nothing like a
   mail client: no blue, no envelope, no @.
   ========================================================================== */

:root {
  --bg: #08090d;
  --bg-soft: #0d0f15;
  --panel: #12141c;
  --panel-2: #171a24;
  --line: #232735;
  --line-soft: #1a1d28;

  --ink: #e9ecf3;
  --ink-2: #a7aec1;
  --ink-3: #6e7689;

  --lime: #c6ff3d;
  --magenta: #ff5da2;
  --cyan: #4fe3d8;
  --amber: #ffc857;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle grid texture behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.9), transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.9), transparent 75%);
}

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img, canvas, iframe { display: block; max-width: 100%; }

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.022em; margin: 0; font-weight: 680; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 9, 13, 0.82);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--lime) 0%, var(--lime) 47%, transparent 47%),
    linear-gradient(315deg, var(--magenta) 0%, var(--magenta) 47%, transparent 47%),
    #1b1f2a;
  box-shadow: 0 0 0 1px rgba(198,255,61,0.28), 0 0 18px -6px var(--lime);
}

.brand-name { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.brand-name span { color: var(--ink-3); }

.site-nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; }
.site-nav a { color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); text-decoration: none; }

/* ---------- hero ---------- */

.hero { padding: 74px 0 46px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  padding: 6px 12px;
  border: 1px solid rgba(198,255,61,0.26);
  border-radius: 999px;
  background: rgba(198,255,61,0.05);
}

.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.78); }
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(34px, 5.6vw, 58px);
  max-width: 17ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--lime);
}

.lede {
  margin-top: 20px;
  max-width: 58ch;
  font-size: 17px;
  color: var(--ink-2);
}

.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--lime);
  color: #0a0d05;
  box-shadow: 0 10px 30px -14px rgba(198,255,61,0.9);
}
.btn-primary:hover { box-shadow: 0 14px 34px -12px rgba(198,255,61,0.95); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: #38405a; background: rgba(255,255,255,0.03); }

/* stats strip */

.stats {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat { background: var(--bg-soft); padding: 18px 20px; }
.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat span { font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }

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

.section { padding: 54px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 24px; }
.section-head p { margin-top: 7px; color: var(--ink-3); font-size: 13.5px; max-width: 46ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}
.chip:hover { color: var(--ink); border-color: #38405a; }
.chip.is-active { background: rgba(198,255,61,0.1); border-color: rgba(198,255,61,0.45); color: var(--lime); }

/* ---------- game cards ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(198,255,61,0.3);
  box-shadow: 0 20px 45px -30px rgba(198,255,61,0.75);
}
.card a.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card a.card-link:hover { text-decoration: none; }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0d13;
  border-bottom: 1px solid var(--line-soft);
}
.thumb canvas { width: 100% !important; height: 100% !important; }

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }

.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card-desc { font-size: 13.5px; color: var(--ink-2); }

.card-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(198,255,61,0.09);
  border: 1px solid rgba(198,255,61,0.22);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11.5px;
}
.score-pill.empty { background: rgba(255,255,255,0.03); border-color: var(--line); color: var(--ink-3); }

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(198,255,61,0.92);
  color: #0a0d05;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.18s ease;
}
.card:hover .play-badge { opacity: 1; transform: translateY(0); }

/* ---------- lab list ---------- */

.lab-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.lab-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.lab-item span.name { color: var(--ink-2); }
.lab-item span.cat {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.step .n {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--magenta);
}
.step h3 { margin-top: 10px; font-size: 16.5px; }
.step p { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line-soft);
  padding: 38px 0 44px;
  color: var(--ink-3);
  font-size: 12.5px;
  position: relative;
  z-index: 1;
}
.site-footer .cols {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.site-footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }

.disclaimer {
  max-width: 74ch;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  line-height: 1.7;
}

/* ==========================================================================
   Game page
   ========================================================================== */

.crumbs {
  padding: 22px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 8px;
  align-items: center;
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); text-decoration: none; }

.game-hero { padding: 18px 0 0; }
.game-hero h1 { font-size: clamp(28px, 4.4vw, 42px); }
.game-tagline { margin-top: 10px; color: var(--ink-2); font-size: 16px; max-width: 60ch; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  margin-top: 26px;
  align-items: start;
}

.player {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05060a;
  aspect-ratio: 16 / 10;
  box-shadow: 0 30px 60px -40px rgba(0,0,0,1);
}
.player iframe { width: 100%; height: 100%; border: 0; }

.poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(198,255,61,0.15), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 34px),
    #07080d;
  z-index: 3;
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.poster.hidden { opacity: 0; pointer-events: none; }
.poster .glyph {
  font-family: var(--mono);
  font-size: 40px;
  color: var(--lime);
  text-shadow: 0 0 30px rgba(198,255,61,0.6);
}
.poster .label {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.poster .hint { font-size: 12px; color: var(--ink-3); }

.side-box {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.side-box + .side-box { margin-top: 14px; }
.side-box h2 { font-size: 13px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }

.kv { margin-top: 14px; display: grid; gap: 10px; font-size: 13.5px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt, .kv .k { color: var(--ink-3); }
.kv .v { color: var(--ink); font-family: var(--mono); font-size: 12.5px; }

.controls { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.controls li { display: flex; gap: 10px; align-items: baseline; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--panel-2);
  color: var(--ink);
  white-space: nowrap;
}

.prose { margin-top: 30px; max-width: 68ch; }
.prose h2 { font-size: 19px; margin-top: 30px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.prose ul { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.prose li { margin-top: 7px; }
.prose strong { color: var(--ink); font-weight: 620; }

.made-box {
  margin-top: 34px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,93,162,0.22);
  background: linear-gradient(180deg, rgba(255,93,162,0.055), rgba(255,93,162,0.015));
}
.made-box h2 {
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--magenta);
  font-weight: 500;
}
.made-box p { margin-top: 10px; font-size: 14px; color: var(--ink-2); }

/* ---------- ratings ---------- */

.rate-box {
  margin-top: 34px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.rate-box h2 { font-size: 18px; }
.rate-box .sub { margin-top: 6px; font-size: 13px; color: var(--ink-3); }

.rate-summary { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.rate-avg { font-family: var(--mono); font-size: 34px; line-height: 1; color: var(--ink); }
.rate-avg small { font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.rate-count { font-size: 12.5px; color: var(--ink-3); }

.stars { display: inline-flex; gap: 4px; }
.stars button {
  background: none;
  border: 0;
  padding: 0 2px;
  font-size: 24px;
  line-height: 1;
  color: #2c3242;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}
.stars button:hover { transform: scale(1.12); }
.stars button.on { color: var(--lime); text-shadow: 0 0 14px rgba(198,255,61,0.5); }
.stars.small { font-size: 13px; }
.stars.small span { color: var(--amber); font-size: 13px; }

textarea, input[type="text"] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  resize: vertical;
  outline: none;
  transition: border-color 0.14s ease;
}
textarea:focus, input[type="text"]:focus { border-color: rgba(198,255,61,0.4); }
textarea { min-height: 84px; margin-top: 14px; }

.rate-actions { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rate-note { font-size: 12px; color: var(--ink-3); }

.comments { margin-top: 24px; display: grid; gap: 12px; }
.comment {
  padding: 13px 15px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-head .who { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.comment-body { color: var(--ink-2); }
.comments-empty { font-size: 13px; color: var(--ink-3); padding: 6px 0; }

.toast {
  font-size: 13px;
  color: var(--lime);
  font-family: var(--mono);
}

/* related */

.related { margin-top: 44px; }

@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 32px; }
  .site-nav { gap: 14px; font-size: 12.5px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .section { padding: 38px 0; }
  .hero h1 { font-size: 32px; }
  .game-grid { grid-template-columns: 1fr; }
  .rate-avg { font-size: 28px; }
}
