:root {
  --bg: #070b14;
  --bg-elevated: #0f1628;
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-soft: rgba(30, 41, 59, 0.55);
  --border: rgba(148, 163, 184, 0.16);
  --border-gold: rgba(245, 158, 11, 0.35);
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --gold: #f59e0b;
  --gold-bright: #fde047;
  --cta: #22c55e;
  --cta-hover: #16a34a;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Be Vietnam Pro", "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(ellipse 65% 45% at 85% 0%, rgba(245, 158, 11, 0.14), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(34, 197, 94, 0.08), transparent 55%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 4px
  );
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.font-display {
  font-family: "Russo One", "Chakra Petch", "Be Vietnam Pro", sans-serif;
  letter-spacing: 0.02em;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-logo {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.35));
}

.brand-text strong {
  display: block;
  font-family: "Russo One", "Chakra Petch", sans-serif;
  font-size: 18px;
  line-height: 1.1;
  background: linear-gradient(90deg, #fde047, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(124, 58, 237, 0.18);
  color: #fff;
}

.nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4);
  color: var(--gold-bright);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 10px var(--cta);
}

.dot-pulse.off {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.btn:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }

.btn-cta {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #04130a;
  box-shadow: 0 6px 22px rgba(34, 197, 94, 0.35);
}
.btn-cta:hover { box-shadow: 0 10px 26px rgba(34, 197, 94, 0.5); }

.btn-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1c0f02;
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.3);
}
.btn-gold:hover { box-shadow: 0 10px 26px rgba(245, 158, 11, 0.45); }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(124, 58, 237, 0.5); }

.btn-outline {
  background: rgba(15, 23, 42, 0.75);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); background: rgba(30, 41, 59, 0.9); }

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* Cards & Grids */
.main-content {
  flex: 1;
  padding: 26px 0 48px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card-gold {
  border-color: var(--border-gold);
  box-shadow: 0 14px 40px rgba(245, 158, 11, 0.08), var(--shadow);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-portal { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-portal > *, .hero-box > * { min-width: 0; }

/* Hero */
.hero-box {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border-gold);
  background:
    radial-gradient(circle at 75% 35%, rgba(245, 158, 11, 0.18), transparent 50%),
    radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.28), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(9, 13, 26, 0.98));
  padding: 34px 30px;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.hero-title .accent {
  background: linear-gradient(90deg, #4ade80, #fde047, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 15.5px;
  max-width: 580px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-visual img {
  max-width: 360px;
  width: 100%;
  filter: drop-shadow(0 12px 32px rgba(245, 158, 11, 0.3));
}

.stat-strip {
  margin-top: 18px;
}

.stat-tile {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.16);
  color: var(--primary-light);
  flex-shrink: 0;
}

.stat-ico.gold { background: rgba(245, 158, 11, 0.16); color: var(--gold-bright); }
.stat-ico.green { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.stat-ico.blue { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }

.stat-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-val { font-family: "Russo One", sans-serif; font-size: 20px; color: #fff; }

/* Login Announcement Box (synced from Admin Panel) */
.notify-banner {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.11), rgba(124, 58, 237, 0.11));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 18px 22px;
}

.notify-banner-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.notify-banner-body {
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 12px;
  padding: 13px 16px;
  white-space: pre-line;
  color: #fef3c7;
  font-size: 14px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-pin { background: rgba(245, 158, 11, 0.2); color: var(--gold-bright); border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-admin { background: rgba(239, 68, 68, 0.22); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); }
.badge-vip { background: rgba(168, 85, 247, 0.22); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.45); }
.badge-active { background: rgba(34, 197, 94, 0.2); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.badge-muted { background: rgba(148, 163, 184, 0.15); color: var(--muted); border: 1px solid rgba(148, 163, 184, 0.25); }
.badge-earth { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.badge-namec { background: rgba(34, 197, 94, 0.18); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.badge-saiyan { background: rgba(249, 115, 22, 0.2); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.4); }

.cat-notice { background: rgba(245, 158, 11, 0.18); color: #fde047; }
.cat-discuss { background: rgba(124, 58, 237, 0.22); color: #c4b5fd; }
.cat-guide { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.cat-trade { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.cat-bug { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.85);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 180ms ease;
}
.form-control:focus { border-color: var(--gold); outline: none; }

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.45); color: #fecaca; }
.alert-ok { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.45); color: #bbf7d0; }

/* Character Dashboard & Items */
.char-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.char-id-box {
  display: flex;
  align-items: center;
  gap: 18px;
}

.char-avatar-frame {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 25%, rgba(245, 158, 11, 0.32), rgba(15, 23, 42, 0.95));
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}
.char-avatar-frame img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
}

.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 180ms ease;
}

.tab-btn:hover { border-color: var(--primary-light); color: #fff; }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(245, 158, 11, 0.25));
  border-color: var(--gold);
  color: #fff;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.item-card {
  background: rgba(7, 11, 20, 0.78);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 180ms ease, transform 180ms ease;
}

.item-card:hover { border-color: var(--gold); transform: translateY(-2px); }

.item-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.item-icon-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}

.item-qty {
  position: absolute;
  bottom: 2px;
  right: 4px;
  background: rgba(7, 11, 20, 0.92);
  color: var(--gold-bright);
  font-size: 10.5px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 4px;
}

.item-opts {
  margin-top: 4px;
  font-size: 12px;
  color: #4ade80;
  line-height: 1.45;
}

/* Forum & Tables */
.post-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid var(--border);
  transition: border-color 180ms ease, background 180ms ease;
}

.post-row:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(30, 41, 59, 0.72);
}

.post-row.pinned {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.8));
}

.post-row-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.post-row-body {
  min-width: 0;
  flex: 1;
}

.post-row-title {
  font-weight: 700;
  color: #fff;
  font-size: 15.5px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row-excerpt {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.post-row-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.post-row-stats {
  text-align: right;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row-stats .stat-like {
  color: var(--gold-bright);
  font-weight: 700;
}

.cat-pills-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dl-quick-jumps {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.char-task-box {
  text-align: right;
}

.show-mobile-sub {
  display: none;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.mobile-nav-status,
.mobile-nav-actions {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.author-avatar img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 14px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.85);
  color: var(--gold-bright);
  font-weight: 700;
  white-space: nowrap;
}
table.data-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tr:hover td { background: rgba(124, 58, 237, 0.08); }

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-msg {
  padding: 11px 16px;
  border-radius: 11px;
  background: #0f172a;
  border: 1px solid var(--gold);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.94);
  padding: 28px 0;
  color: var(--muted);
  font-size: 13.5px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

@media (max-width: 1024px) {
  .hero-box, .grid-portal { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
  .container {
    padding: 0 12px;
  }
  .main-content {
    padding: 16px 0 32px;
  }
  .nav-bar {
    min-height: 60px;
    gap: 8px;
  }
  .brand-logo {
    height: 38px;
  }
  .brand-text strong {
    font-size: 16px;
  }
  .brand-text span {
    font-size: 10.5px;
  }
  .nav-actions {
    gap: 6px;
  }
  .nav-hide-xs {
    display: none !important;
  }
  .nav-user-btn {
    max-width: 132px;
    padding: 6px 10px;
  }
  .nav-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(7, 11, 20, 0.98);
    border-bottom: 1px solid var(--border-gold);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 14px 16px;
    gap: 6px;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-link {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 15px;
  }
  .mobile-nav-status {
    display: block;
    margin-bottom: 6px;
  }
  .mobile-nav-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .mobile-nav-actions .btn {
    min-height: 42px;
    width: 100%;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
  }
  .status-pill { display: none; }

  /* Sticky Bottom App Navigation Bar on Mobile */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(7, 11, 20, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .mb-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 4px 2px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    transition: color 150ms ease, background 150ms ease;
  }
  .mb-nav-item svg {
    flex-shrink: 0;
  }
  .mb-nav-item.active {
    color: var(--gold-bright);
    background: rgba(124, 58, 237, 0.16);
  }
  .mb-nav-cta {
    color: #fff;
  }
  .mb-nav-cta-pill {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #04130a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
  }
  .mb-nav-cta.active .mb-nav-cta-pill {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
  }

  /* Buttons & Form Inputs (Prevent iOS Auto-Zoom & Text Overflow) */
  .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    min-height: 44px;
  }
  .btn-sm {
    min-height: 38px;
  }
  .btn-lg {
    padding: 12px 18px;
    font-size: 14.5px;
    min-height: 48px;
  }
  .form-control,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Grids & Cards */
  .card {
    padding: 16px 14px;
    border-radius: 14px;
  }
  .grid-2, .grid-3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .grid-4,
  .stat-strip,
  .stat-grid-mobile-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-tile {
    padding: 12px 11px;
    gap: 10px;
    border-radius: 12px;
  }
  .stat-ico {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
  }
  .stat-ico svg {
    width: 18px;
    height: 18px;
  }
  .stat-lbl {
    font-size: 11px;
    line-height: 1.25;
  }
  .stat-val {
    font-size: 15px !important;
    line-height: 1.25;
    word-break: break-word;
  }

  /* Hero Section Mobile Optimization */
  .hero-box {
    padding: 18px 15px;
    border-radius: 16px;
    gap: 16px;
  }
  .hero-badge {
    display: flex;
    flex-wrap: wrap;
    border-radius: 12px;
    padding: 7px 10px;
    font-size: 11.5px;
    line-height: 1.35;
    gap: 6px;
  }
  .hero-title {
    font-size: clamp(23px, 6.5vw, 31px);
    margin-bottom: 10px;
  }
  .hero-desc {
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.55;
  }
  .hero-cta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hero-cta-row .btn:first-child {
    grid-column: 1 / -1;
  }
  .hero-visual img {
    max-width: 175px;
  }

  /* Notice Banner */
  .notify-banner {
    padding: 14px;
    border-radius: 14px;
  }
  .notify-banner-hd {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .notify-banner-body {
    padding: 11px 12px;
    font-size: 13.5px;
  }

  /* Swipeable Tabs & Category Filters */
  .tabs-nav,
  .cat-pills-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
    margin-left: -2px;
    margin-right: -2px;
  }
  .tabs-nav::-webkit-scrollbar,
  .cat-pills-scroll::-webkit-scrollbar {
    display: none;
  }
  .tabs-nav .tab-btn,
  .tabs-nav .btn,
  .cat-pills-scroll .btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Forum Post Rows on Mobile */
  .post-row {
    flex-direction: column;
    gap: 10px;
    padding: 13px 12px;
  }
  .post-row-main {
    width: 100%;
    gap: 10px;
  }
  .post-row-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14.5px;
    line-height: 1.38;
  }
  .post-row-excerpt {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12.5px;
    line-height: 1.45;
  }
  .post-row-stats {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px dashed rgba(148, 163, 184, 0.16);
    font-size: 12px;
  }

  /* Profile & Character Header */
  .char-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .char-id-box {
    gap: 12px;
    width: 100%;
  }
  .char-avatar-frame {
    width: 66px;
    height: 66px;
    border-radius: 14px;
  }
  .char-avatar-frame img {
    width: 48px;
    height: 48px;
  }
  .char-name-heading {
    font-size: 22px !important;
  }
  .char-task-box {
    text-align: left;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .search-input-responsive {
    max-width: 100% !important;
    width: 100%;
  }
  .item-grid {
    grid-template-columns: 1fr;
  }

  /* Tables & Leaderboard */
  .hide-mobile {
    display: none !important;
  }
  .show-mobile-sub {
    display: flex;
  }
  table.data-table {
    font-size: 13px;
  }
  table.data-table th,
  table.data-table td {
    padding: 9px 10px;
  }

  /* Download Page Mobile Quick Jumps */
  .dl-quick-jumps {
    display: flex;
  }
  .download-hero-logo {
    display: none;
  }

  /* Modals on Mobile */
  .portal-modal {
    max-height: 86dvh !important;
  }
  .portal-modal-hd,
  .portal-modal-body,
  .portal-modal-ft {
    padding: 12px 14px !important;
  }

  /* Footer & Toast */
  .site-footer {
    padding: 20px 0 24px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .footer-links .btn {
    width: 100%;
  }
  .toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
  }
}

@media (max-width: 390px) {
  .brand-text span {
    display: none;
  }
  .hero-cta-row {
    grid-template-columns: 1fr;
  }
}
