/* Card Table palette (CtScreen defaults) */
:root {
  --bg: #0f1218; --panel: #161a22; --panel2: #12161d; --cell: #1f2430; --border: #2a303c;
  --btn: #2b3242; --btn-b: #4a5468; --gold: #e3b341; --gold-hi: #f5cf6b; --text: #e8eaf0; --text2: #c3c9d5;
  --muted: #9aa3b5; --felt: #173a2a; --green: #7bd389; --red: #e66b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 17px; color: var(--gold); letter-spacing: .02em; }
h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* buttons + inputs */
.btn {
  background: var(--btn); color: var(--text); border: 1px solid var(--btn-b); border-radius: 6px;
  padding: 8px 14px; font: inherit; cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.btn:focus-visible, input:focus-visible, .link:focus-visible, .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.gold { background: var(--gold); border-color: var(--gold-hi); color: #1a1408; font-weight: 650; }
.btn.gold:hover { background: var(--gold-hi); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--gold-hi); text-decoration: underline; }
input, textarea {
  width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 11px; font: inherit;
}
input:focus, textarea:focus { border-color: var(--gold); outline: none; }
label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 12px; }
label input { margin-top: 4px; }
.error { color: var(--red); min-height: 1.2em; margin: 0 0 10px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }

/* sign in */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 30%, #1d4a36 0%, var(--felt) 45%, #0b1d15 100%); }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-top: 3px solid var(--gold); border-radius: 10px; padding: 26px 26px 18px; box-shadow: 0 20px 60px #0008; }
.auth-logo { width: 56px; display: block; margin: 0 auto 8px; image-rendering: pixelated; border-radius: 4px; }
.auth h1 { text-align: center; font-size: 24px; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.tab { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px; border-radius: 6px; font: inherit; cursor: pointer; }
.tab.on { background: var(--btn); color: var(--text); }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* home */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; }
.brand img { width: 26px; image-rendering: pixelated; border-radius: 3px; }
.me { display: flex; align-items: center; gap: 12px; }
.me .link { font-weight: 600; }
.cols { display: grid; grid-template-columns: 1fr 360px; gap: 18px; padding: 18px 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.felt { margin-top: 12px; min-height: 320px; border-radius: 8px; padding: 28px;
  background: radial-gradient(ellipse at 50% 40%, #1f4d38, var(--felt) 70%); border: 1px solid #ffffff14;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.felt-title { font-size: 18px; font-weight: 650; margin: 0 0 6px; }
.felt .muted { max-width: 440px; margin: 0; }
.felt-go { display: inline-block; margin-top: 18px; text-decoration: none; }
.count { color: var(--muted); font-weight: 400; font-size: 14px; }
.search { margin-top: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; }
.list li:hover { background: var(--cell); }
.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 12px; }
.list .acts { display: flex; gap: 6px; }
#search-results:not(:empty) { margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #4a5263; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 6px #7bd38988; }

/* profile modal */
.modal { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal-card { position: relative; width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-top: 3px solid var(--gold); border-radius: 10px; padding: 22px; max-height: 90vh; overflow: auto; }
.close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.close:hover { color: var(--text); }
.prof-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.prof-head h2 { color: var(--text); font-size: 20px; }
.avatar { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; font-weight: 700;
  font-size: 22px; color: #1a1408; background: var(--gold); flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 15px; }
.stat span { color: var(--muted); font-size: 12px; }
.bio { white-space: pre-wrap; background: var(--panel2); border-radius: 8px; padding: 10px 12px; color: var(--text2); margin: 0 0 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1; }
textarea { min-height: 70px; resize: vertical; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--cell);
  border: 1px solid var(--gold); padding: 9px 16px; border-radius: 8px; z-index: 20; box-shadow: 0 8px 30px #0008; }
/* W7: a game invite while on this page */
.invite-banner { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 50; display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 14px; box-shadow: 0 6px 24px #0008; }
.felt-welcome { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--gold); background: rgba(0,0,0,.22);
  color: var(--gold-hi); font-weight: 600; border-radius: 4px; }
