/* ----------- Global Font & Base ----------- */
html {
  box-sizing: border-box;
  font-size: 100%;
}
*, *:before, *:after {

}

body, header, nav, main, .nav-link, .notnotjosh-btn, button, h1 {
  font-family: 'Inter', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  /* New: full-page, extra-smooth multi-color diagonal gradient */
  background: linear-gradient(120deg, #040e81 0%, #3324a7 40%, #66538a 70%, #b9b9b9 100%);
  color: #fff;
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-attachment: fixed; /* Ensures the gradient covers everything */
}
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 60% 10%, rgba(126,63,246,0.23) 0, transparent 80%);
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  background: #181a20;
  box-shadow: 0 2px 12px rgba(0,0,0,0.13);
  z-index: 100;
}
main {
  padding: 60px 10px 20px;
  flex: 1;
}

/* ----------- Navigation & Hamburger ----------- */
.main-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 10px; position: relative;
}
.nav-toggle {
  background: none; border: none; cursor: pointer; display: block;
  width: 24px; height: 18px; z-index: 110; position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  display: block;
  background: #fff;
  height: 2px; width: 100%; border-radius: 2px; position: absolute;
  transition: 0.22s;
}
.nav-toggle span { top: 8px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span::after { transform: translateY(-6px) rotate(-45deg); }

.nav-links {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px; list-style: none; width: 100%;
  margin-top: 8px; position: absolute; top: 48px; left: 0;
  background: #181a20; padding: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  z-index: 105;
}
.nav-links.active { display: flex; }
.nav-link {
  color: #fff; text-decoration: none; font-weight: 500;
  font-size: 0.95rem; width: 100%; padding: 8px 0;
  transition: color 0.18s;
}
.nav-link.active,
.nav-link:hover { color: #40dfff; border-bottom: 2px solid #ffe600; padding-bottom: 4px; }

.notnotjosh-btn {
  background: #ffe600; color: #191919;
  font-weight: 600; padding: 0 12px; height: 30px;
  border-radius: 4px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 111;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1;
}
@media (min-width: 600px) {
  .main-nav { height: 62px; padding: 0 36px; }
  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important; position: static; flex-direction: row; gap: 28px;
    align-items: center; margin: 0; width: auto; background: transparent; padding: 0; box-shadow: none;
  }
  .nav-link { font-size: 1rem; padding: 0; width: auto; }
  .notnotjosh-btn { padding: 0 26px; height: 36px; }
  main { padding-top: 80px; }
}
.nav-links.active { width: calc(100% - 80px); }

/* ----------- Hero & Status ----------- */
.hero {
  margin: 0 auto; 

}
.hero-title {
  font-size: 1.3rem; font-weight: 700;
  margin: 12px 0;
  text-shadow: 0 2px 12px #23296d;
}
@media (min-width: 600px) {
  .hero-title { font-size: 2rem; margin: 16px 0; }
}
.tiktok-handle { color: #40dfff; font-weight: 500; margin-bottom: 12px; margin-left:2rem; }
.tiktok-handle a { color: #fff; text-decoration: underline; }
.live-status { display: flex; align-items: center; font-weight: 600; margin-bottom: 6px; margin-left:2rem;}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fd3359; margin-right: 6px;
  box-shadow: 0 0 7px #fd3359a1;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* ----------- Leaderboard ----------- */
.live-leaderboard {
  width: 100%; overflow-x: auto; margin: 20px 0;
}
.live-leaderboard table { width: 100%; border-collapse: collapse; }
.live-leaderboard th, .live-leaderboard td {
  padding: 8px 10px; text-align: left; font-size: 0.9rem;
}
.live-leaderboard th {
  
  color: #40dfff; font-weight: 600;
}
.live-leaderboard tr:not(:last-child) td {
  border-bottom: 1px solid rgba(64,223,255,0.05);
}
@media (min-width: 600px) {
  .live-leaderboard th, .live-leaderboard td { padding: 12px 16px; font-size: 1rem; }
}

/* ----------- Utility ----------- */
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 1rem; right: 1rem;
  background-color: rgba(0,0,0,0.8); color: #fff;
  padding: 0.75rem 1rem; border-radius: 4px;
  opacity: 0; transform: translateY(100%);
  transition: transform 0.3s, opacity 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ----------- Buttons ----------- */
.join-btn {
  background: #ffe600; color: #23296d; font-weight: 600;
  border: none; border-radius: 18px; padding: 8px 16px;
  font-size: 0.95rem; box-shadow: 0 2px 8px rgba(63,94,251,0.08);
  cursor: pointer; transition: background 0.15s;
  margin: 10px auto; display: block;
}
.join-btn:hover { background: #fff066; color: #23296d; }

/* ----------- Tournament List & Card ----------- */
.tourney-list {
  list-style: none;
  padding: 0;
  max-width: 950px;
  width: 95%;
  height:60%;
}
.tourney-list li { margin-bottom: 0.75rem; }
.tourney-list a {
  display: block; padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px; color: #fff; text-decoration: none;
  font-size: 1.1rem; transition: background 0.2s, transform 0.2s;
}
.tourney-list > div {
  margin-bottom: 0.75rem; /* previously might be 1.5rem+ */
}
.tourney-card {
  background: linear-gradient(135deg, rgba(13,16,61,0.98), rgba(30,34,94,0.98) 60%, #23296d 100%);
  border-radius: 22px;
  box-shadow: 0 8px 32px #040e8188;
  width: 100%;            /* Full width of parent container */
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.14s;
  border: 2.5px solid transparent;
  padding: 2rem 2.5rem;
  box-sizing: border-box;
  margin-bottom: 1.5rem;
}
@media (min-width: 650px) {
  .tourney-list, .t-card, .tourney-rules-box {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 650px) {
  .tourney-list, .tourney-card, .tourney-rules-box {
    width: 99%;
    min-width: 0;
    max-width: 99vw;
    padding-left: 0.3em;
    padding-right: 0.3em;
  }
}
.tourney-list a:hover { background: rgba(255,255,255,0.15); transform: translateX(4px); }
{
  margin: 0 auto; padding: 2rem 2.5rem;
  background: rgba(0, 0, 0, 0.50);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.tourney-card {
  margin: 40px auto; padding: 2rem 2.5rem;
  background: rgba(0, 0, 0, 0.50);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.tourney-card:hover { 
  box-shadow: 0 12px 36px #0008; }
.tourney-title {
  font-size: 2rem; 
  font-weight: bold; 
  color: #ffe653;
  cursor: pointer; 
  text-shadow: 0 3px 10px #0009; 
  display: inline-block;
}
.tourney-meta { font-size: 1.1em; margin-bottom: 1rem; color: #7ee0ff; }
.expand-arrow {
  font-size: .7em; color: #ffe653; margin-left: 0.6em; vertical-align: middle;
  transition: transform 0.15s; display: inline-block;
}
.expand-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.expand-arrow.expanded {
  transform: rotate(90deg);
}
.tourney-join-btn {
  background: #fe2c55; border: none; color: #fff; font-size: 1.2em;
  font-weight: bold; border-radius: 4px; padding: 0.5em 2.5em;
  cursor: pointer; margin-top: 1.3em; box-shadow: 0 2px 12px #040e8166;
  transition: background 0.1s; text-decoration: none;
}
.tourney-join-btn:hover { 
  background: #fe2c55; 
  text-shadow: 0 3px 15px #000;
  box-shadow: 0 12px 36px #0008; 
}
.tourney-main-header {
  text-align: left; color: #fff; margin: 2rem 0 2rem 2rem;
  font-size: 2.3rem; font-weight: 800; letter-spacing: -0.5px;
  text-shadow: 0 3px 15px #0007;
}
.tourney-badge {
  display: inline-block; margin-top: 1.3em;
  background: #6874ec; color: #ffe653;
  border-radius: 0.75em; padding: 0.5em 2.5em;
  font-size: 1.2em; font-weight: bold; letter-spacing: 1px;
  box-shadow: 0 2px 12px #040e8166;
}
@media (max-width: 600px) {
  .tourney-card { padding: 1.1rem 0.6rem 0.8rem 0.6rem; }
  .tourney-main-header { margin-left: 0.6rem; }
  .join-modal-content { padding: 1.3rem; }
}

/* ----------- Bracket (Tree) ----------- */
.bracket-tree, .bracket-container {
  display: flex; flex-direction: row; gap: 3rem;
  justify-content: center; align-items: flex-start; margin: 2rem 0;
  overflow-x: auto;
}
.bracket-round {
  display: flex; 
  flex-direction: column; 
  min-width: 160px; 
  position: relative;
  background: #191d3a; 
  border-radius: 12px; 
  padding: 14px 10px 10px 10px;
  box-shadow: 0 2px 12px 0 #040e81aa;
  justify-content: center;
  gap: 2rem;
  position: relative;
}
.round-label, .bracket-round-title {
  text-align: center; font-weight: bold; color: #ffe653;
  margin-bottom: 1rem; font-size: 1.1em;
  text-shadow: 1px 2px #040e81;
}
.bracket-match {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid #5e5eff;
  min-width: 120px;
}

.bracket-player {
  color: #fff; padding: 0.25em 0.6em; border-radius: 0.7em;
  font-weight: 700; margin: 0.2em 0;
  background: rgba(80, 62, 195, 0.22); transition: 0.2s;
  text-shadow: 0 2px 6px #040e8166;
}
.bracket-player.winner, .bracket-player a.won {
  color: #7ee0ff !important; background: linear-gradient(90deg, #181c4b 30%, #34c5ff44 100%);
  box-shadow: 0 0 0 2px #7ee0ff77, 0 2px 8px #7ee0ff33;
}
.bracket-player.empty { color: #8187aa; background: none; }
.bracket-vs { color: #ffe653; font-size: 1.1em; margin: 0.2em 0 0.1em 0; font-weight: bold; }
.bracket-player a { color: #ffe653; cursor: pointer; text-decoration: underline dotted; }
.bracket-admin .bracket-player a:hover {
  text-shadow: 0 0 3px #ffe653, 0 0 7px #23265e;
}
.bracket-winner-label { 
  color: #7ee0ff; 
  font-size: 0.98em;
   margin-top: 3px; 
   text-align: center; 
  }
.bracket-avatar { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
@media (max-width: 900px) {
  .bracket-tree, .bracket-container { gap: 14px; }
  .bracket-round {   min-width: 200px; flex-shrink: 0; padding: 10px 5px; }
}
.bracket-tree {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 3rem;
  width: 100%;
}
@media (max-width: 768px) {
  .bracket-tree {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 1rem;
    gap: 1.2rem;
  }

  .bracket-round {
    margin-top: 0 !important;  /* Remove the pyramid stagger */
    min-width: 180px;          /* Ensure each round has enough space */
  }

  .bracket-match {
    min-width: 160px;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}
/* ----------- Admin Styles ----------- */
#admin-container {
  background: rgba(0, 0, 0, 0.25);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 2rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
.admin-con {
  background: rgba(0, 0, 0, 0.25);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 2rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  width:90%;
}
  /* === Admin Title and Headers === */
.admin-title,
.admin-container h2,
.admin-detail-panel h3,
.admin-detail-panel h4 {
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 5px #000;
}
#live-container {
  max-width: 700px; margin: 40px auto; padding: 2rem 2.5rem;
  background: rgba(30, 34, 94, 0.98);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.container {width: 90%; margin: 6rem auto; padding: 2rem; background: rgba(0,0,0,0.50); border-radius: 18px; }
h1 { margin-top: 10px; }
.admin-section { margin-bottom: 2rem; }
.admin-list { list-style: none; padding: 0; }
.admin-list > li {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.05); margin-bottom: 7px;
  border-radius: 7px; padding: 7px 12px;
}
/* === Form Inputs === */
.admin-form input,
.admin-player-form input {
  padding: 0.6rem;
  margin: 0.4rem 0.4rem 0.4rem 0;
  border: none;
  border-radius: 8px;
  background-color: #202040;
  color: #fff;
  font-size: 0.9rem;
}

.admin-form button,
.admin-player-form button,
.admin-btn {
  padding: 0.6rem 1rem;
  margin: 0.4rem;
  border: none;
  background-color: #ffca28;
  color: #000;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.admin-btn:hover {
  background-color: #ffd740;
}
/* === Tournament List === */
.admin-tourney-list {
  list-style: none;
  padding: 0;
}

.admin-tourney-item {
  background: #1c1c2b;
  border-radius: 8px;
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin-bottom: 10px;
  border-radius: 8px;
  flex-wrap: wrap;
}
.tourney-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 1rem;
}

.tourney-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}
.admin-tourney-detail,.admin-tourney-header{
width:100%;
}

.admin-player-count {
  margin: 0 0.5rem;
  font-size: 0.9rem;
  color: #aaa;
}

/* === Player List === */
.admin-player-list {
  list-style: none;
  padding: 0;
}

.admin-player-list li {
  margin: 0.4rem 0;
  color: #fff;
}

.remove-player-btn {
  background: #ff5252;
  color: #fff;
}

.admin-form { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.admin-form input { border-radius: 5px; border: 1px solid #ccc; padding: 5px 8px; font-size: 1rem; }
.admin-section-title { margin-bottom: 8px; }
.admin-matches-table { width: 100%; border-collapse: collapse; margin-top: 0.5em; }
.admin-matches-table th, .admin-matches-table td {
  border: 1px solid #2533a1; padding: 4px 7px; background: rgba(255,255,255,0.09);
}
.player-info { font-weight: 600; font-size: 1.05em; }
.admin-flex-row { flex-direction: row; }
.admin-hidden { display: none !important; }
#admin-detail {
  background: rgba(30,30,50,0.96); border-radius: 12px;
  padding: 18px 22px; margin-top: 1em;
}
@media (max-width: 600px) {
  .container { padding: 0.5em; }
  .admin-form { flex-direction: column; align-items: flex-start; }
  .admin-matches-table th, .admin-matches-table td { font-size: 0.92em; }
}
.winner-btn {
  background: #7ee0ff; border: none; color: #111; font-weight: bold;
  cursor: pointer; border-radius: 7px; padding: 2px 10px; margin: 0 3px;
  transition: background 0.2s, color 0.2s;
}
.winner-btn.won { background: #a561f7; color: #fff; }
.winner-btn:disabled { background: #444; color: #bbb; cursor: not-allowed; }
/* === Editable Fields === */
.admin-editable {
  cursor: pointer;
  border-bottom: 1px dashed #ccc;
  display: inline-block;
}

.admin-editing input {
  border: none;
  background: #303050;
  color: #fff;
  padding: 0.4rem;
  border-radius: 6px;
}

/* === Snackbar === */
.admin-snackbar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  display: none;
  z-index: 9999;
  font-weight: bold;
}
.admin-snackbar.show {
  display: block;
  animation: fadeInOut 2.5s ease;
}
@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateY(10px); }
  10%  { opacity: 1; transform: translateY(0); }
  90%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

/* === Updated Bracket Container === */
#admin-matches-container {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* === Round Label === */
#admin-matches-container h3,
.round-title {
  color: #ffe082;
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* === Bracket Match Card === */
.bracket-match {
  background: #1a1f3a;
  border: 2px solid #3949ab;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  min-width: 180px;
  box-shadow: 0 0 10px rgba(57, 73, 171, 0.5);
}

.bracket-match b {
  color: #fff;
  display: block;
  margin: 0.5rem 0;
}

.bracket-match span {
  color: #aaa;
}

/* === Form Input === */
.admin-player-form input {
  background: #202040;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
}

/* === Add Player Button === */
.admin-player-form button {
  background: #ffca28;
  color: #000;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: bold;
  transition: all 0.2s ease-in-out;
}
.admin-player-form button:hover {
  background: #ffd740;
}

/* === Remove Button === */
.remove-player-btn {
  background: #ff5252;
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease-in-out;
}
.remove-player-btn:hover {
  background: #ff7961;
}

/* === Detail Panel Box === */
.admin-detail-panel {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

/* === Tournament Header Labels === */
.admin-detail-panel > h3 span,
.admin-detail-panel > div span {
  font-size: 1.1rem;
  color: #fff;
  display: inline-block;
  margin-bottom: 0.4rem;
}


.join-modal {
  display: none; position: fixed; z-index: 100; left: 0; top: 0;
  width: 100vw; height: 100vh; background: rgba(10,16,60,0.85);
  justify-content: center; align-items: center;
}
.join-modal-content {
  background: #1e2044; border-radius: 1rem; padding: 2.2rem 2.2rem 1.5rem 2.2rem;
  border: 2.5px solid #ffe653; color: #fff;
  box-shadow: 0 6px 32px #040e8142; max-width: 350px; margin: auto;
  position: relative;
}
.join-modal-close {
  color: #ffe653; font-size: 2em; font-weight: bold;
  position: absolute; right: 18px; top: 12px; cursor: pointer;
}
.join-modal label { display: block; margin: 1.2em 0 0.5em 0; font-weight: 600; }
.join-modal input {
  width: 98%; font-size: 1.15em; padding: 0.5em; margin-top: 0.15em;
  border: 1.5px solid #6874ec; border-radius: 0.5em;
  background: #181c4b; color: #ffe653;
}
.login-main{
  max-width: 300px; margin: 40px auto; padding: 2rem 2.5rem;
  background: rgba(19, 23, 80, 0.98);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.site-footer {
  background: #181a20;
  color: #bbb;
  padding: 22px 0 16px 0;
  font-size: 1rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.07);
  margin-top: 2rem;
}
.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 20px;
}
.footer-link {
  color: #40dfff;
  margin: 0 7px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.footer-link:hover {
  color: #ffe600;
}
.footer-divider {
  color: #fff;
  opacity: 0.3;
  margin: 0 4px;
}
.footer-right {
  display: flex;
  gap: 10px;
}
.footer-social {
  display: inline-flex;
  align-items: center;
}
.footer-icon {
  width: 26px;
  height: 26px;
  filter: brightness(1.3);
}
@media (max-width: 700px) {
  .footer-content {
    flex-direction: column;
    gap: 7px;
    text-align: center;
    padding: 0 7px;
  }
}
.tourney-list,
.tourney-rules-box {
  max-width: 650px;     /* Match both for alignment, adjust as needed */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.5em;
  padding-right: 0.5em;
}
.tourney-rules-toggle {
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  color: #f5c91b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.tourney-rules-content {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.tourney-rules-bar {
  display: flex;
  justify-content: space-between;
  align-items: center; /* ✅ vertical alignment fix */
  padding: 0.75rem 1rem;
}
.tourney-rules-content ul {
  margin: 0; padding-left: 1.3em;
  color: #ffe653;
  font-size: 1em;
}
.tourney-rules-content li {
  margin-bottom: 0.35em;
}
.tourney-rules-content a {
  color:white;
}
@media (max-width: 600px) {
  .main-nav {
    flex-direction: row;
    height: 52px;
    padding: 0 7px;
  }
  .nav-links.active {
    width: calc(100% - 70px);
    min-width: 0;
    left: 0;
  }
}

/* Modal improvements */
.join-modal {
  display: none; 
  position: fixed; 
  z-index: 100; 
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(10,16,60,0.85);
  justify-content: center; align-items: center;
}
.join-modal-content {
  background: #1e2044;
  border-radius: 1rem;
  padding: 2.2rem 1.3rem 1.5rem 1.3rem;
  border: 2.5px solid #ffe653;
  color: #fff;
  box-shadow: 0 6px 32px #040e8142;
  max-width: 360px;
  margin: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.join-modal-close {
  color: #ffe653;
  font-size: 2em;
  font-weight: bold;
  position: absolute;
  right: 18px; top: 12px;
  cursor: pointer;
  z-index: 10;
}
.modal-title {
  margin-top: 0;
  font-size: 1.45em;
  font-weight: 800;
  margin-bottom: 0.6em;
  color: #fff;
  text-align: center;
  letter-spacing: -1px;
}
.modal-note {
  background: rgba(255,230,83,0.13);
  color: #ffe653;
  padding: 12px 16px;
  border-radius: 7px;
  font-size: 1em;
  margin-bottom: 1.2em;
  font-weight: 500;
  text-align: left;
}
.modal-link {
  color: #7ee0ff;
  font-weight: 600;
  text-decoration: underline;
  margin-left: 0.13em;
}
.modal-label {
  display: block;
  color: #fff;
  font-weight: 600;
  margin: 0.7em 0 0.2em 0;
  font-size: 1.05em;
}
.modal-input {
  display: block;
  width: 100%;
  padding: 0.5em 0.9em;
  margin-top: 0.25em;
  border: 1.5px solid #6874ec;
  border-radius: 0.6em;
  background: #181c4b;
  color: #ffe653;
  font-size: 1.1em;
  font-weight: 600;
}
.modal-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  margin: 1.3em 0 1.4em 0;
}
.modal-checkbox {
  transform: scale(1.2);
  margin-top: 3px;
  accent-color: #ffe653;
}
.modal-checkbox-text {
  color: #fff;
  font-size: 1em;
  font-weight: 500;
  line-height: 1.3;
}
.modal-join-btn {
  width: 100%;
  margin-top: 0.7em;
  padding: 12px 0;
  font-size: 1.14em;
  border-radius: 0.7em;
  background: #ffe653;
  color: #1e2044;
  font-weight: 800;
  box-shadow: 0 3px 13px #040e8166;
}
@media (max-width: 540px) {
  .join-modal-content {
    padding: 1.2rem 0.5rem;
    max-width: 95vw;
  }
  .modal-title {
    font-size: 1.1em;
  }
}
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1; /* Keep it behind all content */
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #040e81, #474ea1); /* Fortnite-inspired gradient */
}
table {
  width: 100%;
  border-collapse: collapse;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  text-align: center;
  background-color: rgba(15, 15, 30, 0.90);
  border-radius: 12px;
}
/* Shared box styling */
.tourney-box-style {
  background: rgba(0, 0, 0, 0.65); /* semi-transparent black */
  border-radius: 12px;
  margin-bottom: 1rem !important;

  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  box-sizing: border-box;
}
.tourney-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}
/* Specific components using it */
.tourney-rules-box,
#tourney-list,
.join-modal-content {
  max-width: 100%;
  color: white;
}

.bracket-wrapper {
  background: rgba(0, 0, 0, 0.5); /* Slightly see-through black */
  border-radius: 18px;
 padding-bottom: 2rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);

  margin: 0 auto 2rem auto;
    display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3rem;
  overflow-x: auto;
}
.bracket-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.triangle {
  display: inline-block;
  transition: transform 0.3s ease;
}

.triangle.rotated {
  transform: rotate(0deg);
}
.tourney-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
}

.tourney-rules-left {
  display: flex;
  align-items: center;
}

.tourney-user-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
  margin-right: 10px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #2196F3;
}
input:checked + .slider:before {
  transform: translateX(32px);
}
.live-label {
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 1rem;
  margin-left: 5px;
}

.live-label.live {
  background-color: #0f0;
  color: #000;
}

.live-label.offline {
  background-color: #d11a2a;
  color: #fff;
}
.live-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #d11a2a; /* red for "offline" */
  transition: .4s;
  border-radius: 28px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #00c853; /* green for "Live" */
}

input:checked + .slider::before {
  transform: translateX(22px);
}

.live-status-label {
  font-weight: bold;
  font-size: 1.1rem;
  color: #d11a2a;
  transition: color 0.3s ease;
}

input:checked ~ #live-label {
  color: #00c853;
}
.inline-message {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95em;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.inline-message.success {
  background-color: #1e7e34;
  color: white;
  opacity: 1;
}

.inline-message.error {
  background-color: #c62828;
  color: white;
  opacity: 1;
}
.live-total-likes{
  margin-left:2rem ;
}
.golden-user {
  background: linear-gradient(90deg, #ffd700, #fff8dc, #ffd700);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-weight: bold;
  animation: shimmer 1.5s infinite;
}
.golden-leader {
  background: linear-gradient(90deg, #fff4b0, #ffe067);
  color: #111 !important;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(255, 214, 0, 0.4);
}

.golden-leader td {
  padding: 10px;
  font-size: 1rem;
  color: #222;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 600px) {
  .golden-leader td {
    font-size: 0.9rem;
    padding: 8px 6px;
  }
}

@keyframes shimmer {
  0% { text-shadow: 0 0 5px #ffd700; }
  50% { text-shadow: 0 0 15px #fff8dc, 0 0 5px #ffd700; }
  100% { text-shadow: 0 0 5px #ffd700; }
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.like-animate {
  animation: pop 0.3s ease-out;
}
  .like-burst-wrapper {
    position: relative;
    display: inline-block;
  }
  #likeExplosionContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
  }
  .sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff176, #fbc02d, transparent);
    border-radius: 50%;
    animation: sparkle-fade 0.6s ease-out forwards;
  }

  @keyframes sparkle-fade {
    0% {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
    100% {
      transform: scale(0.5) translateY(-20px);
      opacity: 0;
    }
  }
  /* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.15s ease-in-out; /* faster + more shake */
}

/* Sparkles */
.sparkle-container {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff176, #fbc02d, transparent);
  border-radius: 50%;
  animation: sparkle-burst 0.6s ease-out forwards;
}

@keyframes sparkle-burst {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.6) translateY(-20px);
    opacity: 0;
  }
}
.rank-bump {
  animation: bump 0.4s ease-out;
}

@keyframes bump {
  0% {
    transform: translateY(10px) scale(0.95);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-2px) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
