body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  transition: background 0.3s, color 0.3s;
  position: relative;
}

.background-extend {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background: #fff;
  transition: background 0.3s;
}

body.dark-mode .background-extend {
  background: #0c020f;
}

body.dark-mode {
  color: #f5f5f5;
}

.rounded-header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 20px auto;
  width: 90%;
  max-width: 1100px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 40px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  padding: 12px 32px;
  gap: 18px;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.18);
}

body.dark-mode .rounded-header {
  background: rgba(35, 39, 42, 0.35);
  border: 1px solid rgba(184, 134, 11, 0.18);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.home-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

/* Discord logo in an oval */
.discord-logo-oval-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-left: 4px;
}

.discord-logo-oval {
  background: #b8860b;
  border-radius: 20px / 50%;
  width: 60px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

body.dark-mode .discord-logo-oval {
  background: #a67c1a;
}

.discord-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

/* Gold color for buttons and accents */
.oval-btn {
  background: #b8860b;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 22px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.oval-btn:hover {
  background: #cfa526;
}

body.dark-mode .oval-btn {
  background: #a67c1a;
  color: #fff;
}

body.dark-mode .oval-btn:hover {
  background: #b8860b;
  color: #fff;
}

.search-bar {
  flex: 1 1 320px;
  min-width: 180px;
  max-width: 340px;
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  background: #f5f5f5;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin: 0 16px;
}

body.dark-mode .search-bar {
  background: #2c2f33;
  color: #f5f5f5;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  position: relative;
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  padding: 8px 0;
  flex-direction: column;
  transition: opacity 0.2s;
}

body.dark-mode .dropdown-menu {
  background: #23272a;
  color: #fff;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  padding: 10px 22px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: none;
  text-align: left;
  font-size: 1rem;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

body.dark-mode .dropdown-item:hover {
  background: #2c2f33;
}

/* Profile dropdown */
.profile-dropdown {
  position: relative;
}

.profile-menu {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 260px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 16px 0 8px 0;
  flex-direction: column;
  transition: opacity 0.2s;
}

body.dark-mode .profile-menu {
  background: #23272a;
  color: #fff;
}

.profile-menu.show {
  display: flex;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px 12px 22px;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

body.dark-mode .profile-header {
  border-bottom: 1px solid #333;
}

.profile-pic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}

.profile-username {
  font-weight: bold;
  font-size: 1.1rem;
}

.profile-handle {
  color: #888;
  font-size: 0.95rem;
}

body.dark-mode .profile-handle {
  color: #bbb;
}

.profile-menu-btn {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  padding: 10px 22px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 8px;
}

.profile-menu-btn:hover {
  background: #f5f5f5;
}

body.dark-mode .profile-menu-btn:hover {
  background: #2c2f33;
}

.arrow {
  font-size: 0.9em;
  margin-left: 4px;
  display: inline-block;
  transition: transform 0.3s;
  /* Remove any transform here */
}

/* Only flip the arrow when the profile menu is open */
.profile-dropdown .profile-menu.show ~ .dropdown-toggle .arrow,
.profile-dropdown .dropdown-toggle .arrow {
  transform: none;
}

.profile-dropdown .profile-menu.show + .dropdown-toggle .arrow,
.profile-dropdown .dropdown-toggle.active .arrow {
  transform: rotate(180deg);
}

/* The correct selector for your structure: */
.profile-dropdown .dropdown-toggle .arrow {
  transform: none;
}
.profile-dropdown .profile-menu.show ~ .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

/* But for your HTML structure, use this: */
.profile-dropdown .dropdown-toggle .arrow {
  transform: none;
}
.profile-dropdown .profile-menu.show {
  /* nothing here, just for reference */
}
.profile-dropdown .profile-menu.show ~ .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

/* The most robust way for your structure: */
.profile-dropdown .dropdown-toggle .arrow {
  transform: none;
}
.profile-dropdown .profile-menu.show {
  /* nothing here */
}
.profile-dropdown.open .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

.dark-mode-switch {
  margin-right: 25px;
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0c020f; /* Opposite of light mode */
  border-radius: 24px;
  transition: background 0.4s;
  overflow: hidden;
}

/* In dark mode, the background is white */
body.dark-mode .slider {
  background: #fff;
}

/* The knob (circle) always matches the current mode's background */
.slider:before {
  position: absolute;
  content: "☀️";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff; /* Light mode knob */
  border-radius: 50%;
  transition: left 0.4s, background 0.4s, content 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  z-index: 1;
}

/* In dark mode, knob is dark */
body.dark-mode .slider:before {
  background-color: #0c020f;
}

/* Move knob and swap icon when checked */
.dark-mode-switch input:checked + .slider:before {
  left: 23px;
  content: "🌙";
}

.fade-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  min-height: 100vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: auto;
}

.section-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.section-content {
  margin-top: 120px;
  text-align: center;
}

.scroll-btn {
  margin-top: 40px;
  padding: 12px 32px;
  font-size: 1.2rem;
  border: none;
  border-radius: 24px;
  background: #b8860b;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.scroll-btn:hover {
  background: #cfa526;
}

body.dark-mode .scroll-btn {
  background: #a67c1a;
  color: #fff;
}

body.dark-mode .scroll-btn:hover {
  background: #b8860b;
  color: #fff;
}

.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-8px); }
  90% { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

/* Dropdown hover for games */
.games-dropdown {
  position: relative;
}

.games-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  padding: 8px 0;
  flex-direction: column;
  transition: opacity 0.2s;
}

body.dark-mode .games-dropdown .dropdown-menu {
  background: #23272a;
  color: #fff;
}

.games-dropdown .dropdown-menu.show {
  display: flex;
}

/* Profile dropdown menu */
.profile-dropdown .profile-menu {
  display: none;
}
.profile-dropdown .profile-menu.show {
  display: flex;
}
