:root {
  color-scheme: dark;
  --bg: #0d0d0e;
  --panel: #17171a;
  --panel-2: #1e1e21;
  --line: #2b2b2f;
  --text: #eaeaec;
  --muted: #97979c;
  --accent: #cfcfd3;
  --accent-2: #8f8f94;
  --good: #a8a8ac;
  --warn: #e2e2e6;
  --bad: #f7f7f8;
  --chip-1: #3c3c41;
  --chip-2: #212124;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background-image: radial-gradient(1200px 600px at 15% -10%, rgba(255, 255, 255, .04), transparent 60%);
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; }
a { color: var(--accent); }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.multiline { white-space: pre-wrap; word-break: break-word; }
.noscript { padding: 24px; }
i.fa-solid, i.fa-brands, i.fa-regular { line-height: 1; }
::selection { background: rgba(255, 255, 255, .22); }

/* ------------------------------------------------------------------ layout */
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.center { flex: 1; display: grid; place-items: center; padding: 28px 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .12); }
.pad { padding: 28px; }
.form { width: 380px; max-width: 100%; display: grid; gap: 18px; }
.account-panel { width: 460px; }
.row-between { justify-content: space-between; }
.section-label { text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: var(--muted); font-weight: 600; margin: 6px 0 0; display: flex; align-items: center; gap: 12px; }
/* same icon slot as .profile-row so a heading's icon and text line up with the rows under it */
.section-label i { font-size: 11px; width: 16px; text-align: center; }

/* ------------------------------------------------------------------ hero (landing page) */
.hero-icon {
  width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto;
  background: linear-gradient(135deg, var(--chip-1), var(--chip-2)); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.hero-icon i { font-size: 30px; color: #fff; }

/* ------------------------------------------------------------------ screenshots (landing page) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.showcase { width: 100%; max-width: 1040px; margin: 0 auto; padding: 40px 20px 72px; display: grid; gap: 10px; justify-items: center; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tab {
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 18px; color: var(--muted); cursor: pointer;
  transition: color .1s ease, background .1s ease, border-color .1s ease;
}
.tab:hover { color: var(--text); border-color: #3a3a3f; }
.tab[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.frames { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 30px; align-items: center; }
.frame { background: none; border: 0; border-radius: 6px; padding: 4px 10px; color: var(--muted); cursor: pointer; font-size: 13px; }
.frame:hover { color: var(--text); }
.frame[aria-current="true"] { background: var(--panel-2); color: var(--text); }
.tab:focus-visible, .frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage { width: 100%; display: grid; place-items: center; }
.stage img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)) drop-shadow(0 3px 10px rgba(0, 0, 0, .4)); }

/* ------------------------------------------------------------------ profile card */
.profile-card { display: flex; align-items: center; gap: 20px; }
.profile-info { display: grid; gap: 4px; }
.profile-info .name { font-size: 19px; font-weight: 700; }
.profile-rows { display: grid; gap: 16px; margin-top: 6px; }
/* under a heading, leave the same space as between two rows */
.section-label + .profile-rows { margin-top: 16px; }
.profile-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.profile-row i { width: 16px; text-align: center; color: var(--muted); }
.profile-row .val { color: var(--text); font-weight: 500; }
.profile-row .lbl { color: var(--muted); }

/* ------------------------------------------------------------------ controls */
input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; outline: none;
}
textarea { resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 255, 255, .14); }
label.field { display: grid; gap: 5px; }
label.field > span { color: var(--muted); font-size: 12px; }
.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; cursor: pointer;
  white-space: nowrap; text-decoration: none; color: var(--text); display: inline-block; text-align: center;
  transition: transform .08s ease, background .1s ease, border-color .1s ease;
}
.btn:hover { border-color: #3a3a3f; background: #202023; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent-2); border-color: var(--accent); color: var(--bg); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.btn.primary:hover { background: var(--accent); }
.btn.danger { border-color: #4a4a50; color: var(--bad); font-weight: 600; }
.btn.danger:hover { background: #232326; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center-x { justify-content: center; }
.error { color: var(--bad); font-weight: 600; min-height: 1.2em; }
.notice { color: var(--good); min-height: 1.2em; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ------------------------------------------------------------------ forum */
.wrap { max-width: 900px; margin: 0 auto; padding: 32px 20px 56px; display: grid; gap: 22px; width: 100%; }
.page-title { display: flex; align-items: center; gap: 14px; }
.page-title i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); color: var(--accent); font-size: 17px; flex: 0 0 auto; }
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

.list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { background: var(--panel); padding: 18px 20px; display: flex; align-items: center; gap: 16px; transition: background .1s ease; }
.list-row:hover { background: var(--panel-2); }
.list-row-icon { width: 40px; height: 40px; border-radius: 9px; background: var(--panel-2); color: var(--accent); display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }
.list-row:hover .list-row-icon { background: var(--bg); }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main a { color: var(--text); text-decoration: none; font-weight: 600; }
.list-row-main a:hover { color: var(--accent); }
.list-row-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.list-row-stats { color: var(--muted); font-size: 12px; text-align: right; min-width: 90px; }
.list-row-stats strong { color: var(--text); font-size: 14px; display: block; margin-bottom: 2px; }
.list-empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.list-empty i { display: block; font-size: 24px; margin-bottom: 12px; opacity: .5; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 3px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle; }
.badge.sticky { background: #232326; color: var(--good); }
.badge.locked { background: #232326; color: var(--warn); }
.badge.staff { background: #232326; color: var(--accent); }

.post-list { display: grid; gap: 14px; }
.post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; }
.post-main { flex: 1; min-width: 0; display: grid; gap: 12px; }
.post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.post-author-group { display: flex; align-items: center; gap: 8px; }
.post-author { font-weight: 600; color: var(--text); text-decoration: none; }
.post-author:hover { color: var(--accent); text-decoration: underline; }
.post-meta { color: var(--muted); }
.post-body { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.post-body.deleted { color: var(--muted); font-style: italic; }
.post-actions { display: flex; gap: 8px; justify-content: flex-end; }
.post-actions .btn { padding: 5px 12px; font-size: 12px; }
.post-actions .like-btn { margin-right: auto; }
.post-actions .like-btn.active { color: var(--accent); border-color: var(--accent-2); }
.post-actions .like-btn.active:hover { color: var(--accent); }

.bb-mention { font-weight: 600; text-decoration: none; }
.bb-mention:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ members directory */
.member-row { text-decoration: none; color: inherit; cursor: pointer; }
.member-name { font-weight: 600; color: var(--text); }

/* ------------------------------------------------------------------ BBCode */
.bb-u { text-decoration: underline; }
.bb-code {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 4px 0;
  overflow-x: auto; font-size: 12.5px; white-space: pre; font-family: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}
.bb-quote { background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 8px 12px; margin: 4px 0; }
.bb-quote-who { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.bb-list { margin: 4px 0; padding-left: 22px; display: grid; gap: 4px; }

.bb-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
/* a field label already puts 5px between its children */
label.field > .bb-toolbar { margin-bottom: 1px; }
.bb-toolbar-btn { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; color: var(--muted); cursor: pointer; font-size: 12px; }
.bb-toolbar-btn:hover { color: var(--text); background: var(--panel-2); }

@media (max-width: 480px) {
  .form { width: 100%; }
  .pad { padding: 20px; }
  .wrap { padding: 20px 14px 40px; gap: 16px; }
  .list-row-icon { display: none; }
  .list-row { flex-wrap: wrap; padding: 14px 16px; }
  .list-row-stats { text-align: left; }
  .post { padding: 16px; }
}
