/* ============================================
   Perfect World Forum — Victory PW Theme
   Тёмная игровая тема | Креативный дизайн
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Primary Palette */
  --pw-red: #dc2626;
  --pw-red-dark: #991b1b;
  --pw-red-glow: rgba(220, 38, 38, 0.4);
  --pw-gold: #f59e0b;
  --pw-gold-dark: #b45309;
  --pw-gold-glow: rgba(245, 158, 11, 0.3);

  /* Neutrals */
  --pw-bg: #0a0c10;
  --pw-bg-light: #11141a;
  --pw-bg-lighter: #1a1f28;
  --pw-surface: #151920;
  --pw-border: #1e2430;
  --pw-text: #e2e8f0;
  --pw-text-muted: #94a3b8;
  --pw-text-dim: #64748b;

  /* Accents */
  --pw-blue: #3b82f6;
  --pw-green: #10b981;
  --pw-purple: #8b5cf6;
  --pw-cyan: #06b6d4;

  /* Typography */
  --font-main: 'Segoe UI', 'Roboto', sans-serif;
  --font-heading: 'Georgia', serif;

  /* Spacing */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-main);
  background: var(--pw-bg);
  color: var(--pw-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--pw-gold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #fbbf24;
  text-shadow: 0 0 12px var(--pw-gold-glow);
}

/* --- Background Grid Pattern --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(220, 38, 38, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 38, 38, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--pw-bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pw-red), var(--pw-red-dark));
  border-radius: 4px;
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(10,12,16,0.98) 0%, rgba(10,12,16,0.92) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--pw-border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--pw-red), var(--pw-red-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 20px var(--pw-red-glow);
  text-shadow: 0 0 8px rgba(255,255,255,0.3);
  transition: var(--transition);
}

.logo:hover .logo-icon {
  transform: rotate(-5deg) scale(1.05);
  box-shadow: 0 0 30px var(--pw-red-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-server {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--pw-red);
  font-weight: 700;
}

.logo-name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.logo-name span {
  color: var(--pw-gold);
}

/* Desktop Navigation */
.nav-main {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-main a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--pw-text-muted);
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  position: relative;
}

.nav-main a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--pw-red);
  transition: var(--transition);
  border-radius: 1px;
}

.nav-main a:hover,
.nav-main a.active {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.nav-main a:hover::after,
.nav-main a.active::after {
  width: 60%;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pw-red), var(--pw-red-dark));
  color: #fff;
  box-shadow: 0 2px 12px var(--pw-red-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--pw-red-glow);
  text-shadow: none;
  color: #fff;
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--pw-text);
  border: 1px solid var(--pw-border);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--pw-text-dim);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--pw-gold), var(--pw-gold-dark));
  color: #000;
  font-weight: 800;
  box-shadow: 0 2px 12px var(--pw-gold-glow);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--pw-gold-glow);
  color: #000;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--pw-border);
  color: var(--pw-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.btn-icon .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--pw-red);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   TABS NAVIGATION
   ============================================ */

.tabs-bar {
  background: var(--pw-bg-light);
  border-bottom: 1px solid var(--pw-border);
  position: sticky;
  top: 64px;
  z-index: 999;
}

.tabs-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-inner::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pw-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.03);
}

.tab-btn.active {
  color: var(--pw-red);
  border-bottom-color: var(--pw-red);
}

.tab-btn .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
}

.tab-btn.active .count {
  background: rgba(220, 38, 38, 0.2);
  color: var(--pw-red);
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* ============================================
   FORUM CATEGORIES
   ============================================ */

.forum-category {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  transition: var(--transition);
}

.forum-category:hover {
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.06);
}

.cat-header {
  background: linear-gradient(135deg, rgba(220,38,38,0.12) 0%, rgba(220,38,38,0.03) 100%);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--pw-border);
}

.cat-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220,38,38,0.15);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cat-title {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  flex: 1;
}

.cat-stats {
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--pw-text-dim);
  font-weight: 600;
}

.cat-stats span strong {
  color: var(--pw-text-muted);
}

/* Forum Row */
.forum-row {
  display: grid;
  grid-template-columns: 44px 1fr 80px 80px 200px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(30,36,48,0.5);
  transition: var(--transition);
}

.forum-row:last-child { border-bottom: none; }

.forum-row:hover {
  background: rgba(255,255,255,0.02);
}

.forum-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.forum-row:hover .forum-icon {
  background: rgba(220,38,38,0.15);
}

.forum-icon .online {
  color: var(--pw-green);
  text-shadow: 0 0 8px rgba(16,185,129,0.5);
}

.forum-info { min-width: 0; }

.forum-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  display: block;
}

.forum-name:hover {
  color: var(--pw-gold);
}

.forum-desc {
  font-size: 12px;
  color: var(--pw-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-subforums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.subforum-tag {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  color: var(--pw-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: var(--transition);
}

.subforum-tag:hover {
  background: rgba(245,158,11,0.15);
  color: var(--pw-gold);
}

.forum-latest {
  font-size: 11px;
  color: var(--pw-text-dim);
}

.forum-latest-title {
  display: block;
  color: var(--pw-text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.forum-latest-title:hover {
  color: var(--pw-gold);
}

.forum-latest-meta {
  font-size: 10px;
  color: var(--pw-text-dim);
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-block {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.block-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--pw-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.block-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.block-title span {
  color: var(--pw-gold);
}

/* Online Users */
.online-users {
  padding: 14px 16px;
  font-size: 12px;
  color: var(--pw-text-muted);
  line-height: 1.8;
}

.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--pw-green);
  border-radius: 50%;
  margin-right: 4px;
  box-shadow: 0 0 6px rgba(16,185,129,0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.user-tag {
  color: var(--pw-gold);
  font-weight: 600;
}

.user-admin {
  color: var(--pw-red) !important;
  font-weight: 700;
}

.user-mod {
  color: var(--pw-blue) !important;
  font-weight: 700;
}

/* Statistics */
.stats-list {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.stat-label {
  color: var(--pw-text-dim);
  font-weight: 500;
}

.stat-value {
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

/* Top Posters */
.top-poster {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(30,36,48,0.5);
  transition: var(--transition);
}

.top-poster:hover {
  background: rgba(255,255,255,0.02);
}

.poster-rank {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--pw-text-dim);
  flex-shrink: 0;
}

.top-poster:nth-child(1) .poster-rank {
  background: rgba(245,158,11,0.2);
  color: var(--pw-gold);
}

.top-poster:nth-child(2) .poster-rank {
  background: rgba(148,163,184,0.2);
  color: #94a3b8;
}

.top-poster:nth-child(3) .poster-rank {
  background: rgba(180,83,9,0.2);
  color: #d97706;
}

.poster-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pw-red), var(--pw-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.poster-info {
  flex: 1;
  min-width: 0;
}

.poster-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--pw-text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-posts {
  font-size: 10px;
  color: var(--pw-text-dim);
}

/* ============================================
   TOPIC LIST
   ============================================ */

.topic-header {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px 160px;
  gap: 12px;
  padding: 10px 20px;
  background: var(--pw-bg-lighter);
  border-bottom: 1px solid var(--pw-border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pw-text-dim);
}

.topic-list {
  list-style: none;
}

.topic-item {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px 160px;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(30,36,48,0.3);
  transition: var(--transition);
  align-items: center;
}

.topic-item:hover {
  background: rgba(255,255,255,0.02);
}

.topic-poll, .topic-voted {
  font-size: 10px;
  font-weight: 700;
  color: var(--pw-blue);
  text-align: center;
}

.topic-info {
  min-width: 0;
}

.topic-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pw-text);
  display: block;
  margin-bottom: 3px;
}

.topic-title:hover { color: var(--pw-gold); }

.topic-title .pin {
  color: var(--pw-gold);
  margin-right: 4px;
}

.topic-title .hot {
  color: var(--pw-red);
  margin-right: 4px;
}

.topic-title .page-links {
  display: inline-flex;
  gap: 3px;
}

.topic-title .page-links span {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}

.topic-starter {
  font-size: 11px;
  color: var(--pw-text-dim);
}

.topic-stats {
  font-size: 12px;
  font-weight: 700;
  color: var(--pw-text-muted);
  text-align: center;
}

.topic-last-post {
  font-size: 11px;
  color: var(--pw-text-dim);
}

.topic-last-post .last-title {
  display: block;
  color: var(--pw-text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumbs {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--pw-text-dim);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--pw-text-muted);
  font-weight: 600;
}

.breadcrumbs a:hover {
  color: var(--pw-gold);
}

.breadcrumb-sep {
  color: var(--pw-text-dim);
  opacity: 0.5;
}

/* ============================================
   PAGES & PANELS
   ============================================ */

.page-header {
  margin-bottom: 20px;
}

.page-title {
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 4px;
}

.page-title span {
  color: var(--pw-red);
}

.page-subtitle {
  font-size: 13px;
  color: var(--pw-text-dim);
}

/* Panel / Card */
.panel {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-header {
  padding: 14px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--pw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
}

.panel-body {
  padding: 20px;
}

/* Post / Message */
.post {
  border-bottom: 1px solid var(--pw-border);
}

.post:last-child { border-bottom: none; }

.post-header {
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.15);
  font-size: 11px;
  color: var(--pw-text-dim);
}

.post-date { font-weight: 600; }

.post-actions {
  display: flex;
  gap: 12px;
}

.post-actions a {
  color: var(--pw-text-dim);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}

.post-actions a:hover {
  color: var(--pw-gold);
}

.post-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 160px;
}

.post-author {
  padding: 20px;
  text-align: center;
  border-right: 1px solid var(--pw-border);
}

.author-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pw-red), var(--pw-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 20px var(--pw-red-glow);
}

.author-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.author-rank {
  font-size: 10px;
  color: var(--pw-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.author-stats {
  margin-top: 10px;
  font-size: 10px;
  color: var(--pw-text-dim);
  line-height: 1.8;
}

.post-content {
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--pw-text-muted);
}

.post-signature {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--pw-border);
  font-size: 11px;
  color: var(--pw-text-dim);
}

/* ============================================
   USER CONTROL PANEL (UCP)
   ============================================ */

.ucp-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

.ucp-nav {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ucp-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pw-text-muted);
  border-bottom: 1px solid rgba(30,36,48,0.4);
  transition: var(--transition);
}

.ucp-nav a:hover {
  background: rgba(255,255,255,0.03);
  color: #fff;
}

.ucp-nav a.active {
  background: rgba(220,38,38,0.1);
  color: var(--pw-red);
  border-left: 3px solid var(--pw-red);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pw-text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--pw-bg);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius-sm);
  color: var(--pw-text);
  font-size: 13.5px;
  font-family: var(--font-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--pw-red);
  box-shadow: 0 0 0 3px var(--pw-red-glow);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 11px;
  color: var(--pw-text-dim);
  margin-top: 4px;
}

.form-options {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--pw-text-muted);
}

.form-options input[type="checkbox"],
.form-options input[type="radio"] {
  accent-color: var(--pw-red);
}

/* ============================================
   LOGIN / REGISTER MODAL
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--pw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 50%;
  color: var(--pw-text-dim);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}

.modal-close:hover {
  background: rgba(220,38,38,0.2);
  color: var(--pw-red);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--pw-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================
   BANNER / HERO
   ============================================ */

.forum-banner {
  background: linear-gradient(135deg, rgba(220,38,38,0.15) 0%, rgba(139,92,246,0.1) 50%, rgba(245,158,11,0.1) 100%);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.forum-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(220,38,38,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.banner-text h2 {
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 6px;
}

.banner-text p {
  font-size: 13px;
  color: var(--pw-text-muted);
}

.banner-stats {
  display: flex;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.banner-stat {
  text-align: center;
}

.banner-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 0 20px var(--pw-red-glow);
}

.banner-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pw-text-dim);
  font-weight: 700;
}

/* ============================================
   ADMIN PANEL STYLES (phpBB-like)
   ============================================ */

.admin-wrap {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(220,38,38,0.05));
  border-bottom: 1px solid var(--pw-border);
}

.admin-title {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.admin-nav {
  display: flex;
  background: var(--pw-bg-lighter);
  border-bottom: 1px solid var(--pw-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav-tab {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pw-text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.admin-nav-tab:hover {
  color: var(--pw-text);
  background: rgba(255,255,255,0.02);
}

.admin-nav-tab.active {
  color: var(--pw-purple);
  border-bottom-color: var(--pw-purple);
}

.admin-body {
  padding: 20px;
}

.admin-panel {
  margin-bottom: 20px;
}

.admin-panel-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pw-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pw-border);
}

.admin-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(30,36,48,0.3);
  gap: 12px;
}

.admin-row:last-child { border-bottom: none; }

.admin-row-label {
  flex: 0 0 200px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pw-text-muted);
}

.admin-row-content {
  flex: 1;
}

.admin-row-explain {
  font-size: 11px;
  color: var(--pw-text-dim);
  margin-top: 4px;
  font-style: italic;
}

/* Permission Matrix */
.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.perm-table th {
  padding: 10px 12px;
  background: var(--pw-bg-lighter);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pw-text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--pw-border);
}

.perm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,36,48,0.3);
  vertical-align: middle;
}

.perm-table tr:hover td {
  background: rgba(255,255,255,0.01);
}

.perm-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--pw-bg);
  border: 1px solid var(--pw-border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  color: var(--pw-text-dim);
}

.perm-check:hover {
  border-color: var(--pw-red);
}

.perm-check.on {
  background: rgba(220,38,38,0.15);
  border-color: var(--pw-red);
  color: var(--pw-red);
}

/* User Group Badges */
.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-admin {
  background: rgba(220,38,38,0.2);
  color: var(--pw-red);
}

.group-mod {
  background: rgba(59,130,246,0.2);
  color: var(--pw-blue);
}

.group-gold {
  background: rgba(245,158,11,0.2);
  color: var(--pw-gold);
}

.group-member {
  background: rgba(255,255,255,0.06);
  color: var(--pw-text-muted);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  transition: var(--transition);
}

.pagination a {
  color: var(--pw-text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--pw-border);
}

.pagination a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: var(--pw-text-dim);
}

.pagination .current {
  color: #fff;
  background: var(--pw-red);
  border: 1px solid var(--pw-red);
}

.pagination .ellipsis {
  color: var(--pw-text-dim);
  border: none;
  background: none;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 30px 24px;
  background: var(--pw-bg-light);
  border-top: 1px solid var(--pw-border);
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--pw-text-dim);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--pw-text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links a:hover {
  color: var(--pw-gold);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  font-size: 13px;
  font-weight: 600;
}

.toast.success { border-left: 3px solid var(--pw-green); }
.toast.error { border-left: 3px solid var(--pw-red); }
.toast.info { border-left: 3px solid var(--pw-blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .header-inner {
    padding: 0 16px;
  }
  .nav-main { display: none; }
  .main-wrapper { padding: 16px; }
  
  .forum-row {
    grid-template-columns: 36px 1fr auto;
  }
  .forum-row > :nth-child(3),
  .forum-row > :nth-child(4) { display: none; }
  
  .topic-header,
  .topic-item {
    grid-template-columns: 36px 1fr auto;
  }
  .topic-header > :nth-child(3),
  .topic-header > :nth-child(4),
  .topic-item > :nth-child(3),
  .topic-item > :nth-child(4) { display: none; }

  .post-body {
    grid-template-columns: 1fr;
  }
  .post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--pw-border);
    padding: 14px 20px;
    text-align: left;
  }
  .author-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
    margin: 0;
  }

  .banner-stats { display: none; }
  .ucp-grid { grid-template-columns: 1fr; }
  .admin-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .admin-row-label { flex: unset; }
}

@media (max-width: 600px) {
  html { font-size: 14px; }
  .header-actions .btn { display: none; }
  .tabs-inner { padding: 0 12px; }
  .tab-btn { padding: 12px 14px; font-size: 12px; }
  .forum-category { border-radius: var(--radius-sm); }
  .forum-row { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .sidebar { grid-template-columns: 1fr; }
  .forum-banner { padding: 20px; }
  .banner-text h2 { font-size: 18px; }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-gold { color: var(--pw-gold); }
.text-red { color: var(--pw-red); }
.text-green { color: var(--pw-green); }
.text-blue { color: var(--pw-blue); }
.text-muted { color: var(--pw-text-dim); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }