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

:root {
  --background: #121212;
  --card: hsl(220, 10%, 12%); 
  --secondary: hsl(220, 10%, 18%);
  --foreground: hsl(0, 0%, 100%);
  --muted-foreground: hsl(0, 0%, 70%); 
  --primary: hsl(24, 95%, 53%);
  --primary-foreground: hsl(0, 0%, 100%);
  --border: hsl(220, 10%, 25%);
  --input: hsl(220, 10%, 14%);
  --radius: 0.5rem;
}

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

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
  background-color: #ff6b00;
  border-radius: 4px;
}

html {
  background-color: var(--background);
  color: white;
  scroll-behavior: smooth;
}

.topbar {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 5vw;
  flex-wrap: wrap;
  gap: 15px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-container a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-container a:hover {
  opacity: 0.9;
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.logo {
  width: 40px;
  height: 40px;
}

.brand-name {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  font-weight: bold;
}

.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(39, 36, 36, 0.3);
  border: 1px solid #4b4b4b;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 998;
}

.user-profile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  border-color: #ff6b00;
}

.avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ff6200;
  margin-right: 10px
}

.details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  color: white;
}
.username {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: bold;
}
.user-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
}
.stat-icon {
  font-size: 0.85rem;
}
.membership {
  background: linear-gradient(135deg, #9c27b0, #673ab7);
  color: #fff;
}
.balance {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
}
.karma {
  background: rgba(54, 244, 54, 0.15);
  color: #36f436;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(40, 40, 40, 0.95);
  border-radius: 8px;
  width: 100%;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid #4b4b4b;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.user-profile:hover .dropdown-menu,
.user-profile .dropdown-menu:hover {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.dropdown-menu a {
  display: block;
  padding: 1rem 1rem;
  color: #ddd;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 1px solid #3a3a3a;
}
.dropdown-menu a:hover {
  background: rgba(255, 107, 0, 0.1);
  color: #ff6b00;
}
.dropdown-menu a:last-child {
  border-bottom: none;
  color: #ff5252;
}
.dropdown-menu a:last-child:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #ff6b6b;
}

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

.logout-button {
  padding: 20px 30px;
  text-decoration: none;
  margin-left: 10px;
  background-color: #dc2626;
  color: white;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.logout-button:hover {
  background-color: #ef4444;
}

.nav {
  margin-top: 20px;
  padding: 15px 5vw;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid #3a3a3a;
}

.nav-links {
  display: inline-flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 15px;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: clamp(1rem, 3vw, 1.3rem);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: #ff6b00;
}

footer {
  padding: 30px 5vw;
  color: white;
  margin-top: 600px;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  border-top: 1px solid #3a3a3a;
  padding-top: 20px;
}
.footer-section {
  flex: 1;
  min-width: 150px;
}
.footer-section h3 {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 12px;
}
.footer-section ul {
  list-style: none;
  padding: 0;
}
.footer-section ul li {
  margin-bottom: 8px;
  list-style: none;
}
.footer-section ul li a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.social-icons {
  display: flex;
  gap: 10px;
}
.social-icons a {
  color: white;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  transition: color 0.3s ease;
}

.footer-bottom {
  margin-top: 30px;
  text-align: center;
  font-size: clamp(1rem, 2vw, 0.8rem);
  padding-top: 20px;
  border-top: 1px solid #3a3a3a;
}

#background-wrap {
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: -1;
  overflow: hidden;
}

.gaming-icon {
  position: absolute;
  font-size: clamp(30px, 8vw, 70px);
  color: rgba(255, 255, 255, 0.1);
  animation: animateIcon 50s linear infinite, sideWays 2s ease-in-out infinite alternate;
}

.save-feedback {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4CAF50;
  color: white;
  padding: 1rem 2rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 10000;
  display: none;
}

.save-feedback.show {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .logo {
    height: 50px;
    width: 50px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .topbar {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .user-profile {
    width: 100%;
    justify-content: space-between;
    margin-top: 20px;
    z-index: 1;
    position: static;
  }

  .nav-links {
    gap: 10px;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
  }
  .footer-section {
    min-width: 100%;
    text-align: center;
  }
  .social-icons {
    justify-content: center;
  }
  .logout-button {
    width: 100%;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 10px;
  }
  .user-profile {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
  .details {
    align-items: center;
  }
  .user-stats {
    justify-content: center;
  }
  .logout-button {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }
}

@keyframes animateIcon {
  0% { margin-top: 1000px; }
  100% { margin-top: -100%; }
}

@keyframes sideWays {
  0% { margin-left: 0px; }
  100% { margin-left: 50px; }
}

.x1 {
  left: -5%;
  top: 5%;
  transform: scale(0.6);
  animation-duration: 35s;
}

.x2 {
  left: 5%;
  top: 80%;
  transform: scale(0.4);
  animation-duration: 40s;
}

.x3 {
  left: 10%;
  top: 40%;
  transform: scale(0.7);
  animation-duration: 40s;
}

.x4 {
  left: 20%;
  top: 0;
  transform: scale(0.3);
  animation-duration: 42s;
}

.x5 {
  left: 30%;
  top: 50%;
  transform: scale(0.5);
  animation-duration: 50s;
}

.x6 {
  left: 50%;
  top: 0;
  transform: scale(0.8);
  animation-duration: 42s;
}

.x7 {
  left: 65%;
  top: 70%;
  transform: scale(0.4);
  animation-duration: 40s;
}

.x8 {
  left: 80%;
  top: 10%;
  transform: scale(0.3);
  animation-duration: 22s;
}

.x9 {
  left: 90%;
  top: 50%;
  transform: scale(0.6);
  animation-duration: 40s;
}

.x10 {
  left: 80%;
  top: 80%;
  transform: scale(0.3);
  animation-duration: 35s;
}

.sidebar {
  overflow-y: auto;
  position: fixed;
  inset: 0 auto 0 0;
  width: 300px;
  background: var(--background);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  z-index: 1100;
  transform: translateX(0);
  transition: transform 0.25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
}

.sidebar-header .brand-name { 
  font-weight: 700; 
  font-size: 1.8rem; 
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.sidebar-nav { list-style: none; margin: 8px 0 0; padding: 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  margin: 4px 0;
  color: var(--muted-foreground);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.sidebar-nav a:hover { background: var(--card); color: var(--foreground); }
.sidebar-nav a.active {
  color: var(--foreground);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), hsl(14, 90%, 55%));
  outline: 1px solid var(--border);
}

.content {
  flex: 1;
  margin-left: 260px;
  background: var(--background);
  min-width: 0;
}

.sidebar-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 1300;
}

.scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  z-index: 1050;
}
body.sidebar-open .scrim { opacity: 1; pointer-events: auto; }

.nav { display: none !important; }

.filters-section, .matches-container, footer {
  padding-left: max(5vw, 0);
}

.sidebar a:focus-visible, .sidebar-toggle:focus-visible,
:where(button, [role="button"], a, select, input, .matches-tab, .selection-btn, .fee-btn, .create-btn):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: calc(var(--radius) + 2px);
}

.edge-toggle {
  position: fixed;
  left: 12px; top: 12px;
  width: 40px; height: 40px;
  display: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  border-radius: var(--radius);
  z-index: 1300;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%) !important; border-right: 0 !important; }
  body.sidebar-open .sidebar { transform: translateX(0) !important; border-right: 1px solid var(--border) !important; }
  .content { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
  .edge-toggle { display: inline-flex; }
  body.sidebar-open .edge-toggle { display: none; }
}

@media (min-width: 1025px) {
  body.sidebar-collapsed .sidebar { transform: translateX(-100%) !important; border-right: 0 !important; }
  body.sidebar-collapsed .content { margin-left: 0 !important; }
  body.sidebar-collapsed .edge-toggle { display: inline-flex; }
  body:not(.sidebar-collapsed) .edge-toggle { display: none; }
}

.sidebar-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li { margin: 4px 0; }
.sidebar-list a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: var(--radius);
  color: var(--foreground);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.sidebar-list a:hover { background: var(--sidebar-hover-bg); color: var(--primary); }

.sidebar-list2 { list-style: none; margin: 0; padding: 0; }
.sidebar-list2 li { margin: 4px 0; }
.sidebar-list2 a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: var(--radius);
  color: var(--foreground);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.sidebar-list2 a:hover { background: var(--sidebar-hover-bg); color: var(--primary); }

.upgrade-box {
  margin-top: 1rem;
}

.upgrade-card {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.upgrade-title {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Buttons */
.upgrade-btn {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  margin: 5px 0;
  font-weight: bold;
  cursor: pointer;
  transition: 0.25s ease;
  border: none;
}

.vip-btn {
  background: linear-gradient(90deg, #ffd700, #ffae00);
  color: #111;
}

.vip-btn:hover {
  background: linear-gradient(90deg, #ffe55c, #ffbe33);
}

.purchase-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.purchase-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}