@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Chakra+Petch:wght@600;700&display=swap');

:root {
  --bg: #0c111a;
  --bg-gradient: radial-gradient(860px 420px at 90% -10%, rgba(52, 114, 224, 0.24), transparent 72%),
    radial-gradient(920px 420px at -8% 24%, rgba(16, 160, 148, 0.18), transparent 70%),
    #0c111a;
  --panel: #111826;
  --panel-alt: #182336;
  --panel-soft: #1f2d45;
  --text: #d8e2f2;
  --heading: #f4f7ff;
  --muted: #8fa1bf;
  --border: #283349;
  --border-strong: #3a4963;
  --brand: #67a2ff;
  --brand-strong: #8bb8ff;
  --brand-soft: rgba(103, 162, 255, 0.2);
  --accent: #e8a35c;
  --ok: #52c985;
  --warn: #e7a35b;
  --danger: #e16a58;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 14px 28px rgba(2, 5, 12, 0.45);
  --shadow-soft: 0 6px 16px rgba(2, 5, 12, 0.34);
  --transition-fast: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg-gradient);
  color: var(--text);
  font-family: 'Barlow', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 25, 0.84);
  backdrop-filter: blur(10px) saturate(130%);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--heading);
  white-space: nowrap;
}

.brand span {
  color: var(--brand);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.topnav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.topnav a:hover,
.topnav a.is-active {
  color: var(--brand-strong);
  border-color: var(--border-strong);
  background: var(--panel-soft);
}

.live-counters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-counters span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-soft);
}

.icon-btn,
.btn-login,
.btn-secondary,
.filter-btn,
.btn-primary {
  border: 1px solid var(--border-strong);
  background: var(--panel-soft);
  color: var(--text);
  min-height: 38px;
  border-radius: 10px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.btn-login {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-secondary,
.filter-btn {
  background: var(--panel-alt);
}

.icon-btn:hover,
.btn-secondary:hover,
.filter-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

.btn-login:hover,
.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  transform: translateY(-1px);
}

.filter-btn.is-active {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  width: min(1300px, 100% - 40px);
  margin: 18px auto 24px;
  gap: 18px;
  align-items: start;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  position: sticky;
  top: 90px;
}

.sidebar-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.sidebar-title {
  color: var(--heading);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
}

.game-group {
  margin-bottom: 10px;
}

.accordion {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  padding: 10px 12px;
  color: var(--heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.accordion:hover,
.accordion.is-open {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.accordion::after {
  content: '+';
  color: var(--brand);
  font-size: 1.1rem;
  line-height: 1;
}

.accordion.is-open::after {
  content: '-';
}

.accordion-panel {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: none;
}

.accordion-panel.is-open {
  display: block;
}

.panel-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.panel-link span:first-child {
  font-weight: 600;
  color: var(--text);
}

.panel-link span:last-child {
  font-size: 0.8rem;
}

.panel-link:hover,
.panel-link.is-active {
  border-color: var(--border-strong);
  background: var(--panel-soft);
  color: var(--brand);
}

.panel-link.is-live span:last-child {
  color: var(--ok);
}

.content {
  display: grid;
  gap: 14px;
}

.content-narrow {
  width: min(760px, 100% - 40px);
  margin: 22px auto;
}

.section-head {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  animation: riseIn 400ms ease;
}

.section-title {
  margin: 0;
  color: var(--heading);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.section-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.category-card,
.thread-row,
.post-card,
.faq-item,
.support-card,
.support-row,
.stat-box,
.quick-card,
.login-card,
.member-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  animation: riseIn 460ms ease;
}

.category-card:hover,
.thread-row:hover,
.post-card:hover,
.faq-item:hover,
.support-card:hover,
.quick-card:hover,
.member-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.category-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.category-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.category-name {
  color: var(--heading);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.count-stack {
  text-align: right;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.subforum-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.subforum-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.subforum-list li:last-child {
  border-bottom: 0;
}

.subforum-title {
  font-weight: 600;
  color: var(--text);
}

.subforum-count,
.subforum-last {
  color: var(--muted);
  font-size: 0.84rem;
}

.last-post {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.last-post strong {
  color: var(--heading);
}

.thread-list {
  display: grid;
  gap: 10px;
}

.thread-row {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.thread-main {
  display: grid;
  gap: 6px;
}

.thread-title {
  color: var(--heading);
  font-size: 1rem;
  font-weight: 700;
}

.thread-title a {
  color: var(--heading);
}

.thread-title a:hover {
  color: var(--brand-strong);
}

.thread-row.has-new .thread-title a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.thread-row.has-new .thread-title a::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(31, 143, 86, 0.12);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.badge,
.tag {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--panel-soft);
}

.tag {
  font-weight: 600;
  color: var(--muted);
}

.badge--verified {
  border-color: rgba(31, 143, 86, 0.35);
  color: var(--ok);
  background: rgba(31, 143, 86, 0.1);
}

.badge--testing {
  border-color: rgba(182, 103, 27, 0.35);
  color: var(--warn);
  background: rgba(182, 103, 27, 0.11);
}

.badge--outdated {
  border-color: rgba(95, 112, 138, 0.35);
  color: #5d6a80;
  background: rgba(95, 112, 138, 0.12);
}

.badge--unsafe {
  border-color: rgba(177, 70, 54, 0.35);
  color: var(--danger);
  background: rgba(177, 70, 54, 0.1);
}

.tag--cyan {
  color: var(--brand);
  border-color: rgba(31, 78, 179, 0.25);
  background: rgba(31, 78, 179, 0.09);
}

.tag--magenta {
  color: var(--accent);
  border-color: rgba(190, 106, 31, 0.27);
  background: rgba(190, 106, 31, 0.09);
}

.thread-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 16px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-size: 0.84rem;
}

.thread-stats strong {
  display: block;
  color: var(--heading);
  font-size: 0.95rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-layout,
.quick-grid,
.support-grid,
.faq-grid,
.stats-grid,
.member-grid {
  display: grid;
  gap: 12px;
}

.quick-grid,
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.support-grid,
.faq-grid,
.member-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.post-card,
.quick-card,
.stat-box,
.support-card,
.faq-item,
.login-card,
.member-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.quick-card h3,
.support-card h3,
.faq-item h3,
.stat-box h3,
.member-card h3 {
  margin: 0;
  color: var(--heading);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.015em;
}

.quick-card p,
.support-card p,
.faq-item p,
.stat-box p,
.member-card p {
  margin: 0;
  color: var(--muted);
}

.stat-value {
  color: var(--brand-strong);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.post-author {
  color: var(--heading);
  font-weight: 700;
}

.post-role,
.post-date {
  color: var(--muted);
  font-size: 0.88rem;
}

.post-body {
  color: var(--text);
}

.post-body p {
  margin: 0 0 10px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

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

.support-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.support-row {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.support-row:last-child {
  border-bottom: 0;
}

.support-topic {
  color: var(--heading);
  font-weight: 700;
}

.support-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-card {
  max-width: 560px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  color: var(--heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  min-height: 40px;
  padding: 10px 11px;
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 78, 179, 0.16);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-help {
  color: var(--muted);
  font-size: 0.88rem;
}

.member-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.member-rank {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.footer-note {
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.announcement-pill {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 500;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 28px));
  animation: riseIn 420ms ease;
}

.announcement-pill button {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.announcement-pill button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.mobile-only {
  display: none;
}

.thread-list .thread-row:nth-child(2),
.category-grid .category-card:nth-child(2),
.quick-grid article:nth-child(2),
.support-grid article:nth-child(2),
.member-grid article:nth-child(2) {
  animation-delay: 70ms;
}

.thread-list .thread-row:nth-child(3),
.category-grid .category-card:nth-child(3),
.quick-grid article:nth-child(3),
.support-grid article:nth-child(3),
.member-grid article:nth-child(3) {
  animation-delay: 140ms;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 5px rgba(31, 143, 86, 0.12);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(31, 143, 86, 0.18);
  }
  100% {
    box-shadow: 0 0 0 5px rgba(31, 143, 86, 0.12);
  }
}

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

@media (max-width: 1080px) {
  .shell {
    width: min(1300px, 100% - 24px);
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 12px;
  }

  .topbar {
    padding: 10px 14px;
  }

  .thread-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .thread-stats {
    text-align: left;
  }
}

@media (max-width: 920px) {
  .topnav,
  .live-counters {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 72px;
    bottom: 0;
    left: 0;
    width: min(300px, 92vw);
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    transform: translateX(-103%);
    transition: transform 220ms ease;
    z-index: 55;
    overflow-y: auto;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 72px 0 0 0;
    background: rgba(18, 26, 43, 0.4);
    z-index: 50;
  }

  .content {
    width: min(1100px, 100% - 24px);
    margin: 12px auto 20px;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 15px;
  }

  .topbar {
    min-height: 64px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .section-head {
    flex-direction: column;
  }

  .subforum-list li,
  .support-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .thread-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .announcement-pill {
    border-radius: 12px;
    align-items: flex-start;
  }
}
