:root {
  --bg: #0b0f14;
  --panel: #0f1620;
  --panel-soft: #111827;
  --border: #1f2937;

  --text: #e5e7eb;
  --muted: #9ca3af;

  --brand: #4aa3ff;
  --brand2: #7c5cff;

  --success: #34d399;
  --danger: #fb7185;
  --warning: #facc15;

  --radius: 16px;
  --radius-sm: 12px;

  --shadow: 0 14px 40px rgba(0,0,0,.35);

  /* themed background holder */
  --themed-bg:
    radial-gradient(1200px 600px at 20% -10%, rgba(74,163,255,.12), transparent 60%),
    radial-gradient(900px 520px at 90% -5%, rgba(124,92,255,.10), transparent 55%),
    var(--bg);
}

/* Global Reset + smooth transitions */
* {
  box-sizing: border-box;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

@keyframes steamFloat {
  0% {
    background-position: 0% 0%, 100% 0%;
  }
  100% {
    background-position: 20% 10%, 80% 20%;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--themed-bg);
  background-size: 130% 130%;
  animation: steamFloat 30s ease-in-out infinite alternate;
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 8px 0; }
p { margin: 6px 0; color: var(--muted); }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,15,20,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 0 4px rgba(74,163,255,.10);
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-right { display:flex; align-items:center; gap:10px; }

/* Avatar in header */
.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.15);
}

/* Pills */
.pill {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(15,22,32,0.65);
  color:var(--text);
  font-weight:700;
}

.pill:hover { border-color:rgba(74,163,255,.45); text-decoration:none; }
.pill.admin { border-color:rgba(74,163,255,.6); background:rgba(74,163,255,.10); }
.pill.danger { border-color:rgba(251,113,133,.55); background:rgba(251,113,133,.10); }

/* Notifications */
.notif { position: relative; }

.notif-btn {
  width:44px;height:44px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(15,22,32,0.65);
  color:var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.notif-btn:hover { border-color:rgba(74,163,255,.45); }

.notif-badge {
  position:absolute;
  top:-6px; right:-6px;
  min-width:18px;height:18px;
  padding:0 6px;
  border-radius:999px;
  background:var(--brand);
  color:#000;
  font-size:12px;
  font-weight:900;
  display:none;
  align-items:center;
  justify-content:center;
  border:2px solid rgba(11,15,20,0.85);
}
.notif-badge.show { display:flex; }

.notif-menu {
  position:absolute;
  right:0;
  top:52px;
  width:340px;
  max-width:calc(100vw - 24px);
  background:linear-gradient(180deg,rgba(17,24,39,0.98),rgba(15,22,32,0.98));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  display:none;
}
.notif-menu.open { display:block; }

.notif-head {
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.notif-title { font-weight:900; }

.notif-list { max-height:340px; overflow:auto; }

.notif-item {
  padding:12px 14px;
  border-bottom:1px solid rgba(31,41,55,.7);
}
.notif-item:last-child { border-bottom:none; }

.notif-empty { padding:14px; color:var(--muted); }

/* Cards */
.card {
  background:linear-gradient(180deg,rgba(17,24,39,0.9),rgba(15,22,32,0.9));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--shadow);
}

/* Topics / Threads */
.topic {
  padding:12px;
  border-radius:var(--radius-sm);
  background:rgba(17,24,39,0.85);
  border:1px solid var(--border);
  transition:border-color .15s ease, transform .15s ease;
}
.topic:hover {
  border-color:rgba(74,163,255,.35);
  transform:translateY(-1px);
}

.topic + .topic { margin-top:10px; }

.topic-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.topic-title { font-weight:900; font-size:15px; color:var(--text); }

.topic-title a { color:var(--text); }
.topic-title a:hover { color:var(--brand); text-decoration:none; }

.topic-meta { font-size:12px; color:var(--muted); margin-top:6px; line-height:1.35; }

.topic-icons { display:flex; align-items:center; gap:6px; }

.ico {
  width:26px;height:26px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(15,22,32,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
}

/* Posts */
.post {
  padding:16px;
  border-radius:var(--radius);
  background:rgba(15,22,32,0.75);
  border:1px solid var(--border);
}
.post + .post { margin-top:14px; }

.post-author { font-weight:900; display:flex; align-items:center; gap:10px; }
.post-body { margin-top:10px; line-height:1.55; white-space:pre-wrap; }

/* Badges (theme-aware) */
.badge {
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}
.badge.admin {
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  color:#000;
}
.badge.moderator {
  background:rgba(52,211,153,.18);
  border:1px solid rgba(52,211,153,.6);
  color:#bbf7d0;
}
.badge.user {
  background:#374151;
  color:var(--text);
}

/* Inputs */
input, textarea, select {
  width:100%;
  background:rgba(15,22,32,0.75);
  border:1px solid var(--border);
  color:var(--text);
  padding:10px 12px;
  border-radius:var(--radius-sm);
}

textarea { min-height:120px; resize:vertical; }

button, .btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:var(--brand);
  border:none;
  color:#000;
  font-weight:900;
  padding:10px 16px;
  border-radius:var(--radius-sm);
  cursor:pointer;
  text-decoration:none;
}
button:hover, .btn:hover { opacity:.92; }

.btn.ghost {
  background:rgba(15,22,32,0.75);
  color:var(--text);
  border:1px solid var(--border);
}
.btn.danger {
  background:rgba(251,113,133,.12);
  color:var(--text);
  border:1px solid rgba(251,113,133,.55);
}

/* Editor */
.editor-wrap { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media(max-width:900px){ .editor-wrap{grid-template-columns:1fr;} }

.editor-toolbar { display:flex; gap:8px; margin-bottom:8px; }

.editor-toolbar button{
  background:rgba(15,22,32,.75);
  border:1px solid var(--border);
  color:var(--text);
  padding:6px 10px;
  border-radius:10px;
  font-weight:900;
}

.editor-preview {
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px;
  background:rgba(17,24,39,.85);
}

.editor-preview blockquote{
  border-left:4px solid var(--brand);
  padding-left:12px;
  color:var(--muted);
}

/* Per-category platform highlights (used in index/category cards) */
.cat-platform-xbox { box-shadow:0 0 0 1px rgba(34,197,94,.28); }
.cat-platform-playstation { box-shadow:0 0 0 1px rgba(59,130,246,.28); }
.cat-platform-pc { box-shadow:0 0 0 1px rgba(148,163,184,.28); }
.cat-platform-nintendo { box-shadow:0 0 0 1px rgba(248,113,113,.32); }
.cat-platform-general {}

/* Platform pills */
.platform-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
}
.platform-pill-xbox{
  background:rgba(34,197,94,.2);
  color:#bbf7d0;
}
.platform-pill-playstation{
  background:rgba(59,130,246,.25);
  color:#dbeafe;
}
.platform-pill-pc{
  background:rgba(148,163,184,.25);
  color:#e5e7eb;
}
.platform-pill-nintendo{
  background:rgba(248,113,113,.22);
  color:#fee2e2;
}

/* Footer */
footer{
  text-align:center;
  padding:32px 0;
  font-size:13px;
  color:var(--muted);
}

/* ================= THEMES ================= */

/* Default */
body[data-theme="default"]{
  --brand:#4aa3ff;
  --brand2:#7c5cff;
  --themed-bg:
    radial-gradient(1200px 600px at 20% -10%, rgba(74,163,255,.12), transparent 60%),
    radial-gradient(900px 520px at 90% -5%, rgba(124,92,255,.10), transparent 55%),
    var(--bg);
}

/* Xbox */
body[data-theme="xbox"]{
  --brand:#22c55e;
  --brand2:#4ade80;
  --themed-bg:
    radial-gradient(1000px 600px at 10% -10%, rgba(34,197,94,.18), transparent 60%),
    radial-gradient(1000px 500px at 90% -10%, rgba(52,211,153,.15), transparent 55%),
    var(--bg);
}

/* PlayStation */
body[data-theme="playstation"]{
  --brand:#3b82f6;
  --brand2:#2563eb;
  --themed-bg:
    radial-gradient(1000px 600px at 15% -10%, rgba(59,130,246,.16), transparent 60%),
    radial-gradient(1000px 500px at 95% -10%, rgba(37,99,235,.14), transparent 55%),
    var(--bg);
}

/* PC */
body[data-theme="pc"]{
  --brand:#9ca3af;
  --brand2:#e5e7eb;
  --themed-bg:
    radial-gradient(1000px 600px at 50% -10%, rgba(148,163,184,.15), transparent 60%),
    var(--bg);
}

/* Midnight Neon */
body[data-theme="midnight"]{
  --brand:#a855f7;
  --brand2:#ec4899;
  --themed-bg:
    radial-gradient(900px 520px at 50% -5%, rgba(236,72,153,.14), transparent 60%),
    radial-gradient(900px 520px at -10% 40%, rgba(168,85,247,.14), transparent 60%),
    var(--bg);
}
