:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e9eaee;
  --muted: #9aa0ad;
  --play: #2ecc71;
  --play-ink: #06140b;
  --accent: #f0c24b;
  --danger: #ff6b5b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 32px 0 12px; }

/* Header */
header.site { border-bottom: 1px solid var(--line); margin-bottom: 24px; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
header nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
header nav a { color: var(--text); text-decoration: none; }
header nav a:hover { color: var(--accent); }
header nav form { margin: 0; }
.me { display: inline-flex; align-items: center; gap: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  color: var(--text); background: var(--panel-2);
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.primary { background: var(--play); color: var(--play-ink); }
.btn.big { padding: 12px 28px; font-size: 18px; }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn.ghost { background: none; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); filter: none; }
.btn.danger { background: none; border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
button.link:hover { color: var(--text); }

/* Avatars */
.av { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--panel-2); color: var(--muted); font-weight: 700; flex: none; vertical-align: middle; }
.av.sm { width: 24px; height: 24px; font-size: 12px; }
.av.md { width: 40px; height: 40px; font-size: 16px; }
.av.lg { width: 88px; height: 88px; font-size: 34px; }
.hue-0 { background: #3b2f6b; color: #d9ceff; }
.hue-1 { background: #1f4d3a; color: #b8f0d4; }
.hue-2 { background: #5a2e2e; color: #ffd0c8; }
.hue-3 { background: #23415e; color: #c4e2ff; }
.hue-4 { background: #5b4a1c; color: #ffe9a8; }
.hue-5 { background: #4a2550; color: #f6c9ff; }
.hue-6 { background: #1d4a4f; color: #bff3f7; }
.hue-7 { background: #3d3d46; color: #e2e2ea; }
.xlink { color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.xlink:hover { color: var(--text); }

/* Home */
.hero { padding: 24px 0 8px; max-width: 720px; }
.hero h1 { font-size: 36px; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 0 12px; }
.hero.slim h1 { font-size: 26px; margin-bottom: 4px; }
.hero.slim p { font-size: 16px; }
.cta { margin-top: 20px !important; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 24px 0 16px; }
.bar h1 { margin: 0; }
.bar .btn { margin-left: auto; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 4px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.tabs a.on { background: var(--panel-2); color: var(--text); }
.bar .muted { font-size: 14px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.card h3 { margin: 4px 0 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; }
.by { color: var(--muted); font-size: 14px; }
.by a { color: var(--accent); text-decoration: none; }
.pitch { overflow-wrap: anywhere; }
.stats { color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.card .actions .btn { flex: 1; }
.shot, .shot-lg, .thumb { display: block; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg); }
.shot { width: calc(100% + 32px); margin: -16px -16px 6px; border-bottom: 1px solid var(--line); }
.shot-lg { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.thumb { width: 128px; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.blank { display: grid; place-items: center; background: linear-gradient(135deg, #1c2030, #141821); color: var(--muted); font-weight: 700; text-align: center; padding: 8px; overflow: hidden; }
.thumb.blank { font-size: 12px; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }

/* Game page */
.game-head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.game-info h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.game-info .by { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.game-info .by a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.game-info .pitch { font-size: 18px; margin: 12px 0; }
.game-info .stats { margin: 12px 0 4px; }
.ask { background: rgba(240, 194, 75, .08); border: 1px solid rgba(240, 194, 75, .35); border-radius: var(--radius); padding: 4px 16px; margin-top: 28px; }
.ask h2 { color: var(--accent); font-size: 15px; margin: 12px 0 4px; }
.description { margin-top: 20px; max-width: 720px; overflow-wrap: anywhere; }
.avatars { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.avatars .av.sm { width: 32px; height: 32px; }

/* Comments */
.comments { max-width: 720px; }
.comments ol { list-style: none; padding: 0; margin: 0 0 20px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-main { flex: 1; min-width: 0; }
.comment .meta { margin: 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.comment .name { color: var(--text); font-weight: 600; text-decoration: none; }
.comment .body { overflow-wrap: anywhere; }
.comment .body p { margin: 6px 0; }
.comment-actions { display: flex; gap: 14px; align-items: flex-start; font-size: 13px; }
.comment-actions form { margin: 0; }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 8px; border-radius: 999px; }
.badge.dev { background: var(--accent); color: #1b1503; }
.badge.played { border: 1px solid var(--play); color: var(--play); }
.badge.guest { border: 1px solid var(--line); color: var(--muted); }
.guest-row { margin-top: 12px; max-width: 320px; }
.guest-row label { font-weight: 400; font-size: 14px; margin-bottom: 4px; }
/* A field only bots fill in. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.comment-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.comment-form label { font-weight: 600; display: block; margin-bottom: 8px; }
.sign-in-to { margin: 16px 0; }

/* Report */
.report { font-size: 13px; color: var(--muted); }
.report summary { cursor: pointer; text-decoration: underline; list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.report input { flex: 1; min-width: 180px; padding: 6px 10px; font-size: 14px; }

/* Forms */
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type="file"] { width: auto; flex: 1; min-width: 0; }
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--danger); }
.game-form { max-width: 640px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.err { color: var(--danger); font-size: 14px; margin: 6px 0 0; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.image-tools { max-width: 640px; }
.image-tools .shot-lg { max-width: 480px; margin-bottom: 12px; }
.picture { margin-top: 28px; }
.picture h2 { margin-top: 0; }
.picture .row { margin-top: 8px; }
.danger-zone { max-width: 640px; border-top: 1px solid var(--line); margin-top: 32px; }
.notice { border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.notice.ok { background: rgba(46, 204, 113, .1); border: 1px solid rgba(46, 204, 113, .4); }
.notice.error { background: rgba(255, 107, 91, .08); border: 1px solid rgba(255, 107, 91, .45); }

/* Your games, profile, staff */
.my-games { list-style: none; padding: 0; margin: 0; }
.my-games li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.my-games li > div { flex: 1; min-width: 0; }
.my-games .name { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.my-games p { margin: 2px 0 0; font-size: 14px; }
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile h1 { margin: 0 0 4px; }
.profile p { margin: 0; }
.message { max-width: 560px; padding: 40px 0; }
.narrow { max-width: 480px; padding: 24px 0; }
.stack { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.stack label { font-weight: 600; }
.stack .btn { align-self: flex-start; margin-top: 4px; }
.prefixed { display: flex; align-items: stretch; }
.prefixed span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; color: var(--muted); background: var(--panel); }
.prefixed input { border-radius: 0 8px 8px 0; }
.reports { list-style: none; padding: 0; }
.reports li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.reports p { margin: 6px 0 0; font-size: 14px; }
blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.log { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.log th, .log td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

.terms { max-width: 720px; padding-top: 24px; padding-bottom: 24px; }
.terms li { margin: 4px 0; }

footer.wrap { margin-top: 56px; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); }

@media (max-width: 720px) {
  .game-head { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .thumb { width: 88px; }
}
