@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

:root {
  --accent: #d21beb;
  --accent-glow: rgba(210, 27, 235, 0.45);
  --bg-dark: #050505;
  --glass: rgba(20, 20, 20, 0.85);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: url("../images/dmgback3.png") center/cover no-repeat fixed;

  color: white;
  transition: background 0.05s;
}

.layout {
  display: grid;
  grid-template-columns: 230px 1fr 230px;
  gap: 20px;
  min-height: 100vh;
  padding: 16px;
  align-items: start;
}

.sidebar,
.topbar,
.hero,
.card,
.box {
  background: var(--glass);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  border-radius: 6px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 26px;
}

.logo img {
  width: 36px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 6px;
  margin-bottom: 6px;
  color: #d1d1d1;
  text-decoration: none;
  transition: all 0.25s ease;
}

.sidebar nav a:nth-child(1) {
  --glow: #f1b76a;
}
.sidebar nav a:nth-child(2) {
  --glow: #b63535;
}
.sidebar nav a:nth-child(3) {
  --glow: #55d0d8;
}
.sidebar nav a:nth-child(4) {
  --glow: #63d855;
}
.sidebar nav a:nth-child(5) {
  --glow: #d1d1d1;
}

.sidebar nav a:nth-child(6) {
  --glow: #d55ee8;
}
.sidebar nav a:nth-child(7) {
  --glow: #a8c6c0;
}
.sidebar nav a:nth-child(8) {
  --glow: #dfdd31;
}
.sidebar nav a:nth-child(9) {
  --glow: #c68f16;
}
.sidebar nav a:nth-child(10) {
  --glow: #a5d656;
}
.sidebar nav a:nth-child(11) {
  --glow: #d82a2a;
}
.sidebar nav a:nth-child(12) {
  --glow: #51d692;
}

.sidebar nav a:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--glow) 12%, transparent),
    transparent
  );
  box-shadow:
    inset 0 0 0 1px var(--glow),
    0 0 12px color-mix(in srgb, var(--glow) 40%, transparent);
}

.sidebar nav a.is-active {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--glow) 12%, transparent),
    transparent
  );
  box-shadow:
    inset 0 0 0 1px var(--glow),
    0 0 12px color-mix(in srgb, var(--glow) 40%, transparent);
}

.sidebar nav a:hover i {
  filter: drop-shadow(0 0 6px var(--glow));
}

.sidebar nav a.is-active i {
  filter: drop-shadow(0 0 6px var(--glow));
}

.sidebar nav a:nth-child(1) i {
  color: #f1b76a;
}
.sidebar nav a:nth-child(2) i {
  color: #b63535;
}
.sidebar nav a:nth-child(3) i {
  color: #55d0d8;
}
.sidebar nav a:nth-child(4) i {
  color: #63d855;
}
.sidebar nav a:nth-child(5) i {
  color: #d1d1d1;
}

.sidebar nav a:nth-child(6) i {
  color: #d55ee8;
}
.sidebar nav a:nth-child(7) i {
  color: #a8c6c0;
}
.sidebar nav a:nth-child(8) i {
  color: #dfdd31;
}
.sidebar nav a:nth-child(9) i {
  color: #c68f16;
}
.sidebar nav a:nth-child(10) i {
  color: #a5d656;
}
.sidebar nav a:nth-child(11) i {
  color: #d82a2a;
}
.sidebar nav a:nth-child(12) i {
  color: #51d692;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 6px;
}

.sidebar-bottom {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 4px;
}

.sidebar-bottom a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  padding: 4px;
}

.sidebar-bottom a i {
  font-size: 26px;
  transform: none;
}

.topbar {
  position: fixed;
  top: 16px;
  left: 260px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--glass);
  border-radius: 6px;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 1000;
  gap: 16px;
}

.topbar-left {
  flex: 1;
}

.topbar-left .search-bar {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 16px;
  outline: none;
  transition: 0.25s;
}

.topbar-left .search-bar::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.topbar-left .search-bar:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.topbar-center {
  flex: 0 0 180px;
}

.ip-bar {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  transition: 0.25s;
  user-select: none;
}

.ip-bar:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.topbar-right .login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s;
}

.topbar-right .login-btn i {
  font-size: 16px;
}

.topbar-right .login-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.topbar-right .account-menu {
  position: relative;
}

.topbar-right .account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hidden {
  display: none !important;
}

.topbar-right .account-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.topbar-right .account-avatar-wrap {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-right .account-avatar-fallback {
  font-size: 15px;
  opacity: 0.95;
}

.topbar-right .account-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topbar-right .account-name {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right .account-caret {
  font-size: 12px;
  opacity: 0.75;
}

.topbar-right .account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 12px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--glass);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1200;
}

.topbar-right .account-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: var(--glass);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  transform: rotate(45deg);
  backdrop-filter: blur(14px);
  z-index: -1;
}

.topbar-right .account-menu.open .account-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar-right .account-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin: 0 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f0;
  font-size: 14px;
  letter-spacing: 0.01em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-right .account-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.topbar-right .account-dropdown-item.danger:hover {
  background: rgba(220, 50, 60, 0.22);
  border-color: rgba(220, 50, 60, 0.28);
}


.topbar-right .account-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: rgba(20, 20, 20, 0.96);
  transform: rotate(45deg);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  z-index: -1;
}

.topbar-right .account-menu.open .account-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar-right .account-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #f9f9f9;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar-right .account-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topbar-right .account-dropdown-item.danger:hover {
  background: rgba(216, 42, 42, 0.2);
}


.topbar-right .account-menu.open .account-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar-right .account-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: white;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.topbar-right .account-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topbar-right .account-dropdown-item.danger:hover {
  background: rgba(216, 42, 42, 0.18);
}

.topbar-right .logout-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.topbar-right .logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topbar-right .logout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  min-width: 200px;
  max-width: 300px;
  padding: 10px 16px;
  border-radius: 6px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 14px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.news-main {
  padding: 110px 20px 20px;
}

.news-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-auto-rows: 28vh; /* scales with screen height */
  gap: 16px;
}

.news-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: white;

  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.news-card.big {
  grid-row: span 2;
}

.news-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65);
}

.news-card:hover img {
  filter: brightness(0.65);
  transform: none;
}

.news-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7),
    rgba(0, 0, 0, 0.25),
    transparent
  );
  pointer-events: none;
}

.news-text {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  z-index: 2;
}

.news-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 10px 12px;

  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-box h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.news-box h3 {
  font-size: 18px;
  font-weight: 600;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--accent), #ff6bff);
}

.news-tag.update {
  background: linear-gradient(135deg, #3bd6ff, #3b82f6);
}

.news-tag.event {
  background: linear-gradient(135deg, #22c55e, #a3e635);
}

.news-info {
  font-size: 12px;
  opacity: 0.7;
}

@media (max-width: 950px) {
  .layout {
    grid-template-columns: 230px 1fr;
  }

  .news-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 35vh;
  }

  .news-card.big {
    grid-row: span 1;
  }
}

:root {
  --rightbar-offset: 80px;
}

.rightbar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;

  margin-top: var(--rightbar-offset);
}

.rightbox {
  background: var(--glass);
  border-radius: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.rightbox h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  opacity: 0.85;
}

.socials-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 6px;

  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.post-title {
  font-size: 14px;
  font-weight: 500;
}

.post-meta {
  font-size: 11px;
  opacity: 0.6;
}

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  width: fit-content;
}

.tag.bedrock {
  background: #f59e0b;
}

.tag.green {
  background: #22c55e;
}

.tag.purple {
  background: #a855f7;
}

.accent {
  color: var(--accent);
}

.placeholder {
  opacity: 0.85;
}

.post-placeholder {
  height: 58px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04)
  );
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.post-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
