/* HoopCorner — basketball community theme */

:root {
  --bg: #15110e;
  --bg-raised: #201a15;
  --bg-card: #262019;
  --line: #3a3027;
  --text: #f2ebe2;
  --text-dim: #b3a593;
  --accent: #ff7a1a;        /* basketball orange */
  --accent-strong: #ff9548;
  --accent-ink: #1c1309;
  --good: #7ecb7e;
  --bad: #e07070;
  --radius: 12px;
  --maxw: 960px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(255, 122, 26, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: .9em;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  background: rgba(21, 17, 14, .92);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .3px;
}
.brand:hover { text-decoration: none; }
.brand-name em { color: var(--accent); font-style: normal; }
.brand-ball { font-size: 1.3rem; }

.topnav { display: flex; gap: 16px; flex: 1; }
.topnav a { color: var(--text-dim); font-weight: 600; }
.topnav a:hover { color: var(--text); text-decoration: none; }

.auth-area { display: flex; align-items: center; gap: 10px; }
.auth-area .username { color: var(--accent-strong); font-weight: 700; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 48px;
  flex: 1;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  text-align: center;
  font-size: .85rem;
  padding: 16px;
}

.loading { color: var(--text-dim); padding: 40px 0; text-align: center; }

.config-banner {
  background: #4b2a0a;
  color: #ffd9b0;
  padding: 10px 16px;
  text-align: center;
  font-size: .9rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, rgba(255,122,26,.16), rgba(255,122,26,.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 28px;
}
.hero h1 { margin: 0 0 6px; font-size: 1.7rem; }
.hero p { margin: 0; color: var(--text-dim); }

/* ---------- Cards / lists ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 12px;
}
.section-title h2 { margin: 0; font-size: 1.15rem; }
.section-title .hint { color: var(--text-dim); font-size: .85rem; }

.card-list { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }

.cat-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cat-card .cat-name { font-weight: 700; font-size: 1.02rem; }
.cat-card .cat-desc { color: var(--text-dim); font-size: .88rem; margin-top: 2px; }
.cat-card .cat-count { color: var(--text-dim); font-size: .85rem; white-space: nowrap; }

.thread-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.thread-main { min-width: 0; }
.thread-title { font-weight: 700; font-size: 1rem; }
.thread-title a { color: var(--text); }
.thread-title a:hover { color: var(--accent-strong); }
.thread-meta { color: var(--text-dim); font-size: .82rem; margin-top: 3px; }
.thread-meta .cat-tag {
  background: rgba(255,122,26,.15);
  color: var(--accent-strong);
  border-radius: 20px;
  padding: 1px 9px;
  font-size: .78rem;
  margin-right: 6px;
}
.thread-replies {
  text-align: center;
  color: var(--text-dim);
  font-size: .8rem;
  min-width: 56px;
}
.thread-replies b { display: block; color: var(--text); font-size: 1.05rem; }

/* ---------- Thread view ---------- */
.thread-head { margin-bottom: 18px; }
.thread-head h1 { margin: 0 0 4px; font-size: 1.45rem; }
.breadcrumb { color: var(--text-dim); font-size: .85rem; margin-bottom: 14px; }

.post {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.post-head {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: .83rem;
  margin-bottom: 8px;
}
.post-author { color: var(--accent-strong); font-weight: 700; }
.post-body { white-space: pre-wrap; word-wrap: break-word; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}
.form-card h3 { margin: 0 0 12px; }

label { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--text-dim); }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  display: block;
  width: 100%;
  margin-top: 5px;
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.form-msg { font-size: .88rem; min-height: 1.2em; margin: 8px 0 0; }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: var(--bad); }

.empty { color: var(--text-dim); padding: 24px 0; text-align: center; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
  max-width: 380px;
  position: relative;
}
.modal-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.5rem; cursor: pointer;
}
.modal-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  color: var(--text-dim);
  font: inherit; font-weight: 700;
  padding: 8px;
  cursor: pointer;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; justify-content: center; padding-top: 6px; }
  .thread-card { flex-direction: column; align-items: flex-start; }
  .thread-replies { display: flex; gap: 6px; align-items: baseline; }
}
