/* ========= THEME ========= */
:root {
  --bg: #0d0f14;
  --bg-2: #11161d;
  --panel: #15181d;
  --panel-2: #1b1f26;
  --text: #e7e7ea;
  --muted: #9aa3ad;
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(255, 255, 255, .06);
  --accent: #7c4dff;
  --accent-2: #9a7dff;
  --mx: 0;
  --my: 0;
  --footer-gap: clamp(48px, 6vw, 96px);
}

/* Base sizing */
html {
  font-size: 14px;
  min-height: 100%;
  height: 100%;
}

@media (min-width:768px) {
  html {
    font-size: 16px;
  }
}

/* ========= BACKGROUND & EFFECTS ========= */
body {
  height: 100%;
  color: var(--text);
  margin-bottom: 60px;
  background: url('/images/bg.png') center/cover fixed no-repeat;
  position: relative;
  animation: bg-pan 60s linear infinite alternate;
}

/* Aurora (after) */
body::after {
  content: "";
  position: fixed;
  inset: -8%;
  pointer-events: none;
  z-index: 0;
  filter: blur(28px) saturate(120%);
  opacity: .52;
  background:
    radial-gradient(60% 100% at 10% 20%, rgba(124, 77, 255, .30), transparent 65%),
    radial-gradient(75% 85% at 90% 30%, rgba(0, 180, 255, .22), transparent 60%),
    radial-gradient(80% 70% at 50% 85%, rgba(255, 160, 80, .18), transparent 60%);
  animation: aurora-drift 38s ease-in-out infinite alternate;
}

/* Vignette (before) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(1200px 680px at 50% 30%,
      rgba(10, 12, 18, .85) 0%, rgba(10, 12, 18, .75) 40%, rgba(10, 12, 18, .45) 60%,
      rgba(10, 12, 18, .20) 75%, rgba(10, 12, 18, 0) 100%);
}

/* Parallax glow + auras (kept) */
.bg-3d {
  position: fixed;
  inset: -10%;
  z-index: 1;
  pointer-events: none;
  perspective: 1000px;
}

.bg-3d .p-layer {
  position: absolute;
  inset: -10%;
  will-change: transform, opacity;
  filter: blur(26px) saturate(115%);
}

.bg-3d .d1 {
  opacity: .28;
  background: radial-gradient(55% 55% at 20% 30%, rgba(124, 77, 255, .35), transparent 60%);
  transform: translate3d(calc(var(--mx)*-24px), calc(var(--my)*-16px), 0) scale(1.06);
  animation: drift1 30s ease-in-out infinite alternate;
}

.bg-3d .d2 {
  opacity: .22;
  background: radial-gradient(60% 60% at 80% 35%, rgba(0, 185, 255, .28), transparent 60%);
  transform: translate3d(calc(var(--mx)*18px), calc(var(--my)*10px), 0) scale(1.04);
  animation: drift2 36s ease-in-out infinite alternate;
}

.bg-3d .d3 {
  opacity: .18;
  background: radial-gradient(70% 70% at 50% 85%, rgba(255, 160, 80, .22), transparent 65%);
  transform: translate3d(calc(var(--mx)*-12px), calc(var(--my)*8px), 0) scale(1.03);
  animation: drift3 42s ease-in-out infinite alternate;
}

.bg-auras {
  position: fixed;
  inset: -10%;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .9;
}

header,
main,
footer {
  position: relative;
  z-index: 4;
}

/* Animations */
@keyframes bg-pan {
  0% {
    background-position: 49% 44%
  }

  100% {
    background-position: 52% 56%
  }
}

@keyframes aurora-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1)
  }

  100% {
    transform: translate3d(2%, 1%, 0) scale(1.05)
  }
}

@keyframes drift1 {
  0% {
    transform: translate3d(calc(var(--mx)*-24px), calc(var(--my)*-16px), 0) scale(1.02)
  }

  100% {
    transform: translate3d(calc(var(--mx)*-30px), calc(var(--my)*-20px), 0) scale(1.07)
  }
}

@keyframes drift2 {
  0% {
    transform: translate3d(calc(var(--mx)*18px), calc(var(--my)*10px), 0) scale(1.02)
  }

  100% {
    transform: translate3d(calc(var(--mx)*24px), calc(var(--my)*14px), 0) scale(1.06)
  }
}

@keyframes drift3 {
  0% {
    transform: translate3d(calc(var(--mx)*-12px), calc(var(--my)*8px), 0) scale(1.01)
  }

  100% {
    transform: translate3d(calc(var(--mx)*-16px), calc(var(--my)*12px), 0) scale(1.05)
  }
}

/* ========= NAVBAR ========= */
.navbar {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-2);
  overflow: visible;
}

.navbar .nav-link {
  color: #eaeaf1;
}

.navbar .nav-link:hover {
  color: #fff;
}

.subnav {
  background: rgba(0, 0, 0, .45);
  border-bottom: 1px solid var(--border-2);
  backdrop-filter: blur(6px);
}

header {
  position: relative;
  z-index: 1000;
}

.navbar {
  position: relative;
  z-index: 1100;
}

.subnav {
  position: relative;
  z-index: 1050;
}

.navbar .dropdown-menu {
  z-index: 5000;
}

.brand-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
}

@media (max-width:991.98px) {
  .brand-logo {
    height: 64px;
  }
}

/* ========= UI BASICS ========= */
a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  outline: none !important;
  box-shadow: 0 0 0 .12rem #fff, 0 0 0 .28rem var(--accent);
  border-color: var(--accent);
}

.card {
  border-color: var(--border-2);
  background: var(--panel);
  color: var(--text);
}

.text-secondary {
  color: var(--muted) !important;
}

.border-soft {
  border: 1px solid var(--border-2);
  border-radius: 12px;
}

.shadow-soft {
  box-shadow: 0 10px 35px rgba(0, 0, 0, .35);
}

.rank-badge {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, .25);
}

a,
.btn,
.list-group-item {
  transition: all .2s ease;
}

.form-control,
.form-select {
  background-color: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}

.form-control::placeholder {
  color: #9099a3;
}

.form-check-input {
  background-color: var(--panel-2);
  border: 1px solid var(--border-2);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ========= FOOTER ========= */
.app-footer {
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .55));
  backdrop-filter: blur(8px);
  color: var(--text);
  position: relative;
  z-index: 4;
  margin-top: var(--footer-gap) !important;
}

.app-footer .footer-divider {
  height: 2px;
  width: 100%;
  background:
    radial-gradient(1200px 2px at 50% 50%, rgba(124, 77, 255, .65), transparent 60%),
    linear-gradient(90deg, rgba(124, 77, 255, .25), rgba(0, 185, 255, .25), rgba(255, 160, 80, .25));
  opacity: .85;
}

.footer-links li+li {
  margin-top: .35rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-card {
  background: linear-gradient(180deg, rgba(21, 24, 29, .85), rgba(21, 24, 29, .6));
  border: 1px solid var(--border-2);
  border-radius: 12px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bbb;
  box-shadow: 0 0 12px rgba(255, 255, 255, .3);
}

.status-dot.online {
  background: #3ddc84;
  box-shadow: 0 0 14px rgba(61, 220, 132, .65);
}

.footer-bar {
  border-top: 1px solid var(--border-2);
  background: rgba(0, 0, 0, .35);
}

.footer-mini-links .nav-link {
  color: var(--muted);
}

.footer-mini-links .nav-link:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-social .btn.btn-icon {
  --size: 38px;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(6px);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.footer-social .btn.btn-icon:hover {
  transform: translateY(-2px);
  background: rgba(124, 77, 255, .18);
  border-color: rgba(124, 77, 255, .35);
}

/* ========= CONTENT WIDTH ========= */
.page-main .container-xxl {
  max-width: 1180px;
}

@media (min-width:1600px) {
  .page-main .container-xxl {
    max-width: 1240px;
  }
}

.app-footer .container-xxl {
  max-width: 1180px;
}

@media (min-width:1600px) {
  .app-footer .container-xxl {
    max-width: 1240px;
  }
}

.page-main {
  padding-bottom: var(--footer-gap) !important;
}

/* ========= HERO BANNER ========= */
.hero-banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  background: rgba(0, 0, 0, .35);
}

@media (min-width:992px) {
  .hero-banner {
    min-height: 340px;
  }
}

.hero-banner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(110%) contrast(102%);
  z-index: 0;
}

.hero-banner__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(46% 60% at 26% 42%, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .32) 65%, rgba(0, 0, 0, 0) 100%);
}

.hero-banner__content {
  position: relative;
  z-index: 2;
  padding: 28px;
  max-width: 560px;
}

@media (min-width:992px) {
  .hero-banner__content {
    padding: 36px 40px;
  }
}

/* ========= RANK PANEL ========= */
.rank-panel {
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.rank-panel__banner {
  position: relative;
  box-sizing: border-box;
  height: clamp(170px, 14vw, 230px);
  padding: 6px;
  background: none !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  overflow: hidden;
}

.rank-panel__banner::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  background-image: var(--rank-src);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  background-color: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
  z-index: 1;
}

.rank-panel__banner .view-all {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  padding: .34rem .62rem;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  color: #fff !important;
  text-decoration: none !important;
  background: rgba(0, 0, 0, .78);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(4px);
  z-index: 3;
}

.rank-panel__banner .view-all:hover {
  background: rgba(0, 0, 0, .9);
  border-color: rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}

.rank-panel__banner .view-all:focus {
  outline: none;
  box-shadow: 0 0 0 .12rem #fff, 0 0 0 .28rem rgba(0, 0, 0, .55);
  border-color: transparent;
}

.banner-pvp {
  --rank-src: url('/images/Ranking/PvP_Banner.png');
}

.banner-town {
  --rank-src: url('/images/Ranking/TownshipBattle_Banner.png');
}

.banner-pve {
  --rank-src: url('/images/Ranking/PvE_Banner.png');
}

.rank-panel__body {
  padding: .85rem .95rem 1rem;
  background: transparent;
}

.rank-panel ul li+li {
  border-top: 1px solid rgba(255, 255, 255, .07);
}

@media (max-width:991.98px) {
  .rank-panel__banner {
    height: 150px;
  }
}

@media (max-width:575.98px) {
  .rank-panel__banner {
    height: 140px;
  }
}

/* ========= MEGA MENU ========= */
.navbar {
  overflow: visible;
}

.mega-account-wrap,
.mega-account-wrap.dropdown {
  position: static !important;
}

.mega-account {
  position: absolute !important;
  top: calc(100% + .5rem) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-top: 0 !important;
  right: auto !important;
  width: clamp(640px, 58vw, 980px);
  z-index: 1100;
  background: linear-gradient(180deg, rgba(21, 24, 29, .92), rgba(21, 24, 29, .82));
  border: 1px solid var(--border-2);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}

.mega-account[data-bs-popper] {
  top: calc(100% + .5rem) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-top: 0 !important;
  right: auto !important;
}

.mega-account.show {
  display: block !important;
}

.acc-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.acc-item+.acc-item {
  margin-top: .35rem;
}

.acc-item:hover {
  background: rgba(255, 255, 255, .05);
  text-decoration: none;
}

.acc-ico {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  font-size: 1.15rem;
  color: #fff;
}

.acc-text small {
  display: block;
  line-height: 1.2;
  color: var(--muted);
}

@media (max-width:991.98px) {
  .mega-account {
    width: min(94vw, 720px);
  }
}

/* ========= FX OFF ========= */
html[data-fx="off"] * {
  animation: none !important;
  transition-duration: .1s !important;
}

html[data-fx="off"] body {
  animation: none !important;
  background-attachment: scroll;
}

@media (max-width:991.98px) {
  html[data-fx="off"] body {
    background-attachment: scroll;
  }
}

html[data-fx="off"] .bg-3d,
html[data-fx="off"] .bg-auras,
html[data-fx="off"] .bg-smoke,
html[data-fx="off"] body::before,
html[data-fx="off"] body::after {
  display: none !important;
}

html[data-fx="off"] .navbar,
.subnav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(0, 0, 0, .70) !important;
  border-bottom-color: rgba(255, 255, 255, .06) !important;
}

/* ========= Reduce Motion ========= */
@media (prefers-reduced-motion:reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .bg-3d,
  .bg-auras,
  .bg-smoke,
  body::before,
  body::after {
    display: none !important;
  }

  .navbar,
  .subnav {
    backdrop-filter: none !important;
  }

  .rank-panel__banner .view-all {
    transition: none !important;
  }
}

/* ===== News/Status helpers ===== */
.news-card {
  background: var(--panel, #15181d);
  border: 1px solid var(--border, rgba(255, 255, 255, .08));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.status-card {
  background: var(--panel, #15181d);
  border: 1px solid var(--border, rgba(255, 255, 255, .08));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.status-online {
  background: #2ecc71 !important;
  color: #0b2e16 !important;
  border: 0;
}

/* === Patch Notes: mode STRIP (final – tidak kepotong) === */
:root {
  --news-banner-strip-h: clamp(108px, 8.2vw, 118px);
}

.news-banner-strip {
  display: block;
  width: 100%;
  height: var(--news-banner-strip-h);
  object-fit: cover;
  object-position: center 54%;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

@media (min-width:1400px) {
  :root {
    --news-banner-strip-h: clamp(122px, 10vw, 200px);
  }

  .news-banner-strip {
    object-position: center 72%;
  }
}

@media (max-width:575.98px) {
  :root {
    --news-banner-strip-h: clamp(72px, 20vw, 96px);
  }

  .news-banner-strip {
    object-position: center 46%;
  }
}

/* === SERVER STATUS WIDGET (tanpa gambar latar dobel) === */
.server-widget {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(21, 24, 29, .92), rgba(21, 24, 29, .82));
  border: 1px solid var(--border-2);
}

.server-widget::before,
.server-widget:before {
  content: none !important;
  display: none !important;
}

.server-widget .sw-head {
  position: relative;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 650;
  min-height: 24px;
  padding: .9rem 1rem;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .45)),
    url('/images/News/Serverstatus.png') right center / contain no-repeat;
  border-top-left-radius: .8rem;
  border-top-right-radius: .8rem;
  z-index: 1;
}

.server-widget .sw-body {
  position: relative;
  z-index: 1;
}

.server-widget .sw-pill {
  display: inline-block;
  background: #0bdb62;
  color: #0b2e16;
  font-weight: 800;
  padding: .55rem 1rem;
  border-radius: .6rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  box-shadow: 0 6px 16px rgba(46, 204, 113, .35);
}

.server-widget .sw-number {
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 800;
  line-height: 1.1;
}

/* === TOP SPENDER WIDGET (sidebar) === */
.topsp-card {
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: .85rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.topsp-card .ts-head {
  display: flex;
  align-items: center;
  /* center vertikal */
  justify-content: center;
  /* center horizontal */
  text-align: center;
  gap: .5rem;
  min-height: 44px;
  padding: .75rem .95rem;
  background: linear-gradient(180deg, #6f1d1d, #502c2c);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-weight: 750;
  letter-spacing: .02em;
}

.topsp-card .ts-head i {
  opacity: .9;
}

.ts-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts-item {
  display: grid;
  grid-template-columns: 40px 1fr 28px 28px;
  align-items: center;
  gap: .5rem;
  padding: .6rem .8rem;
}

.ts-item+.ts-item {
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.ts-rank {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15);
}

.ts-rank.r1 {
  background: #c0392b;
}

.ts-rank.r2 {
  background: #d35400;
}

.ts-rank.r3 {
  background: #27ae60;
}

.ts-rank.r4 {
  background: #34495e;
}

.ts-rank.r5 {
  background: #2c3e50;
}

.ts-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

.ts-empty {
  padding: .9rem;
  color: var(--muted);
  font-style: italic;
}