:root {
  --bg: #0e1116; --panel: #161b22; --panel-2: #1c232d; --ink: #e8edf2; --muted: #8b97a5;
  --border: #2a323d; --accent: #f5c518; --red: #ff5a5f; --blue: #3aa0ff; --green: #48d597;
  --violet: #8b5cf6; --radius: 16px; --max: 1080px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #182029, var(--bg)) no-repeat, var(--bg);
  color: var(--ink); font: 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
img { max-width: 100%; }
main { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px 40px; flex: 1; }

/* header / footer */
.site-header {
  width: 100%; max-width: var(--max); margin: 0 auto; padding: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; }
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-header nav a:hover { color: var(--ink); }
.site-footer { border-top: 1px solid var(--border); padding: 24px 16px 32px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -.5px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto; }

/* game cards */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 28px 0; }
.game-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s;
}
.game-card:hover { transform: translateY(-3px); border-color: #3a4552; }
.game-art { height: 170px; display: flex; align-items: center; justify-content: center; }
.game-art.ttt { background: radial-gradient(circle at 30% 20%, #1f3b57, #111820); }
.game-art.echo { background: radial-gradient(circle at 70% 20%, #3b2566, #0b0d17); }
.game-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-body h2 { margin: 0; font-size: 22px; }
.game-body p { margin: 0; color: var(--muted); flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; font-weight: 800; font-size: 15px; text-decoration: none;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--ink); cursor: pointer; font-family: inherit;
}
.btn:hover { background: #28323e; }
.btn.primary { background: var(--accent); color: #111; border-color: var(--accent); }
.btn.primary:hover { background: #ffd43b; }

/* "Have a code?" row inside each game card */
.card-join {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border);
}
.card-join label { color: var(--muted); font-size: 14px; font-weight: 600; margin-right: 2px; }
.card-join input {
  width: 92px; height: 38px; padding: 0 8px; text-align: center;
  background: var(--bg); color: var(--ink); border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase;
  transition: border-color .15s, box-shadow .15s;
}
.card-join input::placeholder { color: #3a4552; }
.card-join input:hover { border-color: #3a4552; }
.card-join input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #f5c51833; }
.card-join .btn { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.card-join .btn:disabled { opacity: .6; cursor: default; }
.card-join .card-join-msg { flex: 1 1 100%; margin: 0; font-size: 13px; color: var(--red); }
.card-join .card-join-msg:empty { display: none; }

/* content sections */
.section { margin: 40px 0; }
.section h2 { font-size: 26px; margin: 0 0 12px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step b { display: block; font-size: 17px; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); }
.step .num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #111; font-weight: 800; align-items: center; justify-content: center; margin-bottom: 8px; }

details { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 700; }
details p { color: var(--muted); margin: 10px 0 0; }

/* articles (rules, legal) */
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 24px 0 8px; }
.article .lede { color: var(--muted); font-size: 18px; margin-top: 0; }
.article h2 { font-size: 24px; margin: 36px 0 10px; }
.article h3 { font-size: 18px; margin: 24px 0 6px; }
.article p, .article li { color: #c9d2dc; }
.article li { margin-bottom: 6px; }
.article .play-cta { margin: 20px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.callout { background: var(--panel); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.callout p { margin: 0; }
.rules-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.rules-table th, .rules-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.rules-table th { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }
.updated { color: var(--muted); font-size: 14px; }

@media (max-width: 520px) {
  .hero { padding-top: 20px; }
  .hero p { font-size: 16px; }
}
