/* ==========================================================================
   1. VARIABLES & BASE SETUP
   ========================================================================== */
:root {
  --bg: #030814;
  --panel: #091426;
  --panel2: #0d1b30;
  --line: #ffffff18;
  --text: #f6f9ff;
  --muted: #a6b4c8;
  --cyan: #35dcff;
  --blue: #4f8cff;
  --purple: #a56cff;
  --green: #63ed9d;
  --orange: #ff9a4d;
  --shadow: 0 28px 80px #0008;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: 
    radial-gradient(circle at 15% 5%, #12325b 0, transparent 32%),
    radial-gradient(circle at 90% 20%, #261450 0, transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
  
  /* --- التعديل المضاف هنا --- */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    linear-gradient(#ffffff04 1px, transparent 1px),
    linear-gradient(90deg, #ffffff04 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  z-index: -2;
}

/* ==========================================================================
   2. BACKGROUND SCENE & ANIMATIONS
   ========================================================================== */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(5px);
  opacity: .22;
}

.orb.a {
  width: 420px;
  height: 420px;
  background: #00d9ff;
  top: -220px;
  right: -100px;
}

.orb.b {
  width: 360px;
  height: 360px;
  background: #9147ff;
  bottom: -170px;
  left: -100px;
}

.grid3d {
  position: absolute;
  left: -20%;
  bottom: -40%;
  width: 140%;
  height: 75%;
  background: 
    linear-gradient(#36dcff19 1px, transparent 1px),
    linear-gradient(90deg, #36dcff19 1px, transparent 1px);
  background-size: 70px 70px;
  transform: perspective(520px) rotateX(62deg);
  mask-image: linear-gradient(to top, black, transparent);
}

.float {
  position: absolute;
  font-size: 72px;
  opacity: .08;
  animation: drift 9s ease-in-out infinite;
}

.f1 { right: 9%; top: 20%; }
.f2 { left: 8%; top: 52%; animation-delay: 1.2s; }
.f3 { left: 17%; top: 27%; animation-delay: 2.4s; }
.f4 { right: 15%; top: 70%; animation-delay: 3.5s; }

@keyframes drift {
  50% {
    transform: translateY(-28px) rotateY(25deg) rotateX(8deg);
  }
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  position: sticky;
  top: 0;
  z-index: 50;
  background: #030814d9;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: 235px;
  height: 64px;
  object-fit: contain;
  object-position: right center;
  filter: drop-shadow(0 8px 22px #0008);
}

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  font-weight: 800;
  color: #dbe5f2;
  text-decoration: none;
}

.nav a:hover {
  color: var(--cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: #fff;
  background: #ffffff08;
  font-weight: 900;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--cyan), #6d78ff);
  color: #03101b;
}

.btn.danger {
  background: #ff4d4d18;
  color: #ff9d9d;
}

.btn.ok {
  background: #63ed9d18;
  color: #8affb8;
}

/* ==========================================================================
   4. HERO SECTION & 3D CUBE
   ========================================================================== */
.hero {
  max-width: 1240px;
  margin: auto;
  min-height: 760px;
  padding: 80px 5vw;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 60px;
  align-items: center;
}

.eyebrow {
  color: var(--cyan);
  font-weight: 900;
  letter-spacing: 1px;
}

.hero h1 {
  font-size: clamp(48px, 6.5vw, 92px);
  line-height: 1.03;
  margin: 18px 0;
}

.gradient {
  background: linear-gradient(90deg, #fff, #7beaff, #b78cff);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.hero p {
  font-size: 20px;
  line-height: 2;
  color: var(--muted);
  max-width: 760px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0;
}

.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #ffffff07;
  border-radius: 999px;
  color: #dce6f4;
}

/* 3D Visual Block */
.hero3d {
  perspective: 1200px;
}

.cube {
  position: relative;
  padding: 34px;
  border-radius: 36px;
  background: linear-gradient(145deg, #173b67, #081221 62%);
  border: 1px solid #ffffff22;
  box-shadow: 35px 45px 100px #000b, inset 0 1px #ffffff2b;
  transform: rotateY(-10deg) rotateX(5deg);
  transition: .6s;
}

.cube:hover {
  transform: rotateY(0) rotateX(0) translateY(-10px);
}

.cube:after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid #35dcff25;
  border-radius: 27px;
  pointer-events: none;
}

.cube img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.cube h3 {
  font-size: 27px;
  margin: 24px 0 10px;
}

.cube p {
  color: var(--muted);
  line-height: 1.9;
}

.mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.mini div {
  padding: 18px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff07;
  text-align: center;
  font-weight: 900;

  animation: miniFloat 3s ease-in-out infinite;
  transition: transform .3s ease, border-color .3s ease;
}

.mini div:nth-child(2) {
  animation-delay: .5s;
}

.mini div:nth-child(3) {
  animation-delay: 1s;
}

/* ==========================================================================
   5. GENERAL SECTIONS, PAGES, CARDS & FORMS
   ========================================================================== */
.section {
  max-width: 1240px;
  margin: auto;
  padding: 90px 5vw;
}

.section h2 {
  font-size: 46px;
  margin: 0 0 16px;
}

.section > p {
  color: var(--muted);
  line-height: 2;
  max-width: 850px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}

.card {
  background: linear-gradient(145deg, #0e1d33, #07101d);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 55px #0005;
}

.card .icon { font-size: 42px; }
.card h3 { font-size: 25px; }
.card p { color: var(--muted); line-height: 1.95; }
.card .tag { color: var(--cyan); font-weight: 900; }

.page{
    width:min(1200px,92%);
    margin:auto;
    padding-top:120px;
}

.page h1 {
  font-size: 58px;
  margin: 0 0 14px;
}

.lead {
  font-size: 19px;
  line-height: 2;
  color: var(--muted);
  max-width: 900px;
}

.prose {
  font-size: 19px;
  line-height: 2.2;
  color: #dbe4ef;
  max-width: 980px;
  white-space: pre-line;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 35px;
}

/* Forms */
.form {
  max-width: 700px;
  margin: 35px auto;
  background: #091426cc;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  margin: 15px 0 7px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid #ffffff18;
  background: #050d19;
  color: #fff;
  font: inherit;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: #35dcff66;
}

/* Tabs & UI Components */
.tabs {
  display: flex;
  gap: 10px;
  margin: 25px 0;
}

.tab {
  padding: 13px 18px;
  border-radius: 13px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 900;
}

.tab.active {
  background: #35dcff18;
  border-color: #35dcff66;
}

.notice {
  margin-top: 18px;
  padding: 18px;
  border-radius: 15px;
  background: #35dcff12;
  border: 1px solid #35dcff30;
}

/* Match & Schedule */
.schedule {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.match {
  display: grid;
  grid-template-columns: 150px 1fr 160px;
  gap: 15px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #091426cc;
}

.match small {
  color: var(--muted);
}

/* ==========================================================================
   6. GAMING ORBIT & TOURNAMENT SCHEDULE
   ========================================================================== */
.gaming-orbit {
  height: 230px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  place-items: center;
  position: relative;
}

.gaming-orbit span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #ffffff0b;
  border: 1px solid #ffffff20;
  font-size: 48px;
  box-shadow: 0 20px 45px #0008;
  transform: translateZ(30px);

  animation: orbitFloat 4s ease-in-out infinite;
  transition: transform .3s ease;
}

.gaming-orbit span:nth-child(2) {
  animation-delay: .6s;
}

.gaming-orbit span:nth-child(3) {
  animation-delay: 1.2s;
}

.gaming-orbit span:nth-child(4) {
  animation-delay: 1.8s;
}

.gaming-orbit span:nth-child(2) { transform: translate(25px, 10px) rotate(-7deg); }
.gaming-orbit span:nth-child(3) { transform: translate(-15px, -8px) rotate(8deg); }
.gaming-orbit span:nth-child(4) { transform: translate(30px, -20px) rotate(-5deg); }

.tournament-schedule {
  display: grid;
  gap: 24px;
  margin-top: 34px;
}

.tournament-schedule-card {
  background: linear-gradient(145deg, #0e1d33, #07101d);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 24px 65px #0005;
}

.schedule-head h2 {
  font-size: 34px;
  margin: 12px 0 8px;
}

.schedule-head p {
  color: var(--muted);
  line-height: 1.9;
  max-width: 900px;
}

.schedule-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.schedule-columns section {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #ffffff05;
}

.schedule-columns h3 {
  margin-top: 0;
}

.schedule-line {
  padding: 12px 0;
  border-bottom: 1px solid #ffffff12;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-line:last-child {
  border-bottom: 0;
}

.schedule-line small {
  width: 100%;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  line-height: 1.8;
}

.schedule-winner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 15px;
  background: #9b63ff12;
  border: 1px solid #9b63ff30;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
footer {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 20px;
  border-top: 1px solid var(--line);
  background: #040b14cc;
  backdrop-filter: blur(10px);
  color: var(--muted);

  /* --- التعديل المضاف هنا --- */
  margin-top: auto; 
}

footer strong {
  color: #dbe9f7;
  font-weight: 900;
}

footer .admin-login,
.admin-login {
  color: #dce6f2;
  text-decoration: none;
  font-weight: 800;
  transition: .2s;
}

footer .admin-login:hover,
.admin-login:hover {
  color: var(--cyan);
}

footer .copyright {
  color: #92a3b8;
  font-weight: 800;
}

footer sup {
  font-size: .7em;
  margin-right: 3px;
}

/* ==========================================================================
   8. MEDIA QUERIES & MOBILE RESPONSIVENESS
   ========================================================================== */
.mobile-only {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  width: 52px;
  height: 52px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff08;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 60;
  transition: .25s ease;
}

.mobile-menu-toggle:hover{
    background:#ffffff12;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: auto;
  background: #fff;
  border-radius: 99px;
  transition: .2s;
}

.mobile-menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 12px;
    left: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #050d19f2;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px #000b;
  }

  .nav.open {
    display: flex;
  }

  .nav a,
  .nav a:not(.primary-link) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
  }

  .nav a:hover {
    background: #ffffff09;
  }

  .nav .btn {
    margin-top: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 55px;
  }

  .hero3d {
    display: none;
  }

  .cards,
  .grid {
    grid-template-columns: 1fr;
  }

  .page h1 { font-size: 42px; }
  .section h2 { font-size: 36px; }
  .match { grid-template-columns: 1fr; }
  .mobile-only { display: block; }

  footer {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .brand img {
    width: 180px;
    height: 54px;
  }

  .mini {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 850px) {
  .schedule-columns {
    grid-template-columns: 1fr;
  }

  .brand img {
    width: 200px;
    height: 56px;
  }

  .gaming-orbit {
    height: 180px;
  }
}

/* ==========================================
   RESPONSIVE FOUNDATION
========================================== */

*,
*::before,
*::after{
    box-sizing:border-box;
}

html{
    overflow-x:hidden;
    scroll-behavior:smooth;
}

body{
    overflow-x:hidden;
}

img,
video,
canvas{
    max-width:100%;
    height:auto;
    display:block;
}

.container,
.page{
    width:min(1200px,100%);
    margin-inline:auto;
}

table{
    width:100%;
}

.tablewrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

input,
select,
textarea,
button{
    font:inherit;
}

/* ==========================================
   TABLET
========================================== */

@media (max-width:992px){

    section{
        padding:70px 24px;
    }

    .page{
        padding-inline:24px;
    }

    h1{
        font-size:2.4rem;
    }

    h2{
        font-size:2rem;
    }

}



/* ==========================================
   MOBILE
========================================== */

@media (max-width:768px){

    header{
        padding:15px 20px;
    }

    .page{
        padding-inline:18px;
    }

    section{
        padding:55px 18px;
    }

    h1{
        font-size:2rem;
        line-height:1.3;
    }

    h2{
        font-size:1.6rem;
    }

    p{
        line-height:1.9;
    }

    .btn{
        width:100%;
    }

}

/* ==========================================
   HEADER MOBILE
========================================== */

.mobile-menu-toggle{
    display:none;
    width:46px;
    height:46px;
    border:none;
    background:transparent;
    cursor:pointer;
    padding:0;
}

.mobile-menu-toggle span{
    display:block;
    width:28px;
    height:3px;
    margin:5px auto;
    border-radius:10px;
    background:#fff;
    transition:.3s;
}

@media (max-width:768px){

    body:not(.admin-page) header{
        position:fixed;
        top:0;
        left:0;
        width:100%;
        z-index:1000;

        display:flex;
        align-items:center;
        justify-content:space-between;

        backdrop-filter:blur(12px);
        background:rgba(5,10,20,.92);
    }

    .brand img{
        width:60px;
    }

    .mobile-menu-toggle{
        display:block;
    }

    .nav{
    position:absolute;
    top:100%;
    right:0;
    width:100%;

    display:none;
    flex-direction:column;
    gap:8px;
    padding:18px;

    background:#08101f;
    border-top:1px solid rgba(255,255,255,.08);

    z-index:9999;
}

    .nav.open{
        display:flex;
        z-index:9999;
    }

    .nav a{
        width:100%;
        text-align:center;
        padding:14px;
        text-decoration:none;
        border-radius:12px;
    }

}

/* ==========================================
   HOME PAGE - MOBILE
========================================== */

@media (max-width:768px){

    .hero{
        display:flex;
        flex-direction:column;
        gap:40px;
        text-align:center;
        padding:120px 20px 60px;
    }

    .hero>div{
        width:100%;
    }

    .hero h1{
        font-size:2rem;
        line-height:1.3;
    }

    .hero p{
        font-size:15px;
        line-height:1.9;
    }

    .actions{
        display:flex;
        flex-direction:column;
        gap:15px;
        margin-top:25px;
    }

    .actions .btn{
        width:100%;
        justify-content:center;
        text-decoration:none;
    }

    .meta{
        display:flex;
        flex-direction:column;
        gap:12px;
        margin-top:25px;
    }

    .pill{
        width:100%;
        justify-content:center;
    }

    .hero3d{
        width:100%;
        display:flex;
        justify-content:center;
    }

   .cube{
    width:100%;
    max-width:340px;

    animation: heroFloat 6s ease-in-out infinite;
    transform-style: preserve-3d;
    transition: transform .35s ease, box-shadow .35s ease;
}

}

/* ==========================================
   CARDS - MOBILE
========================================== */

@media (max-width:768px){

    .cards{
        display:grid;
        grid-template-columns:1fr;
        gap:20px;
        margin-top:30px;
    }

    .card{
        width:100%;
        margin:0;
        padding:24px;
    }

    .card h3{
        font-size:1.2rem;
    }

    .card p{
        font-size:15px;
        line-height:1.8;
    }

    .icon{
        margin-inline:auto;
    }

}

/* ==========================================
   FOOTER - MOBILE
========================================== */

@media (max-width:768px){

    footer{
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:18px;
        text-align:center;
        padding:30px 20px;
    }

    .admin-login{
        width:100%;
        max-width:320px;
        text-align:center;
    }

    .copyright{
        font-size:14px;
    }

}

/* ==========================================
   REGISTER PAGE - MOBILE
========================================== */

@media (max-width:768px){

    form{
        width:100%;
    }

    .form-grid{
        display:grid;
        grid-template-columns:1fr;
        gap:18px;
    }

    .field{
        width:100%;
    }

    input,
    select,
    textarea{
        width:100%;
        min-height:52px;
        font-size:16px;
    }

    textarea{
        min-height:120px;
        resize:vertical;
    }

    button,
    .btn{
        width:100%;
        min-height:52px;
        justify-content:center;
    }

    .modal{
        width:95%;
        max-width:95%;
        margin:auto;
    }

}

/* ==========================================
   PAGES - MOBILE
========================================== */

@media (max-width:768px){

    .section{
        padding:60px 18px;
    }

    .lead{
        font-size:15px;
        line-height:1.9;
    }

    .tournament-grid,
    .event-grid,
    .schedule-grid,
    .grid,
    .cards{
        display:grid;
        grid-template-columns:1fr;
        gap:20px;
    }

    .tournament-card,
    .event-card,
    .tournament-schedule-card{
        width:100%;
        padding:22px;
    }

    .schedule-columns{
        display:flex;
        flex-direction:column;
        gap:20px;
    }

    .schedule-columns section{
        width:100%;
    }

    .schedule-line{
        word-break:break-word;
    }

    .schedule-winner{
        text-align:center;
        margin-top:20px;
    }

}

/* ==========================================
   FINAL MOBILE FIXES
========================================== */

@media (max-width:768px){

    *{
        max-width:100%;
    }

    body{
        overflow-x:hidden;
    }

    .page,
    .container,
    .section{
        width:100%;
        overflow:visible;
    }

    table{
        display:block;
        width:100%;
        overflow-x:auto;
        white-space:nowrap;
        border-collapse:collapse;
    }

    iframe{
        width:100%;
    }

    pre,
    code{
        white-space:pre-wrap;
        word-break:break-word;
    }

    .modal,
    .popup,
    .dialog{
        width:95%;
        max-width:95%;
        margin:auto;
    }

    .btn{
        text-decoration:none;
    }

    a{
        word-break:break-word;
    }

}

/* ==========================================
   BUTTON FIXES
========================================== */

.btn,
.btn:hover,
.btn:focus,
.btn:active,
.actions a,
.actions a:hover,
.actions a:focus,
.actions a:active{
    text-decoration:none !important;
}

a{
    text-decoration:none;
}

/* ==========================================
   BUTTON ANIMATION
========================================== */

.btn{
    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.btn:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 30px rgba(74,180,255,.25);
}

@keyframes heroFloat{

    0%{
        transform:translateY(0) rotateX(0deg) rotateY(0deg);
    }

    25%{
        transform:translateY(-8px) rotateX(2deg) rotateY(-2deg);
    }

    50%{
        transform:translateY(-14px) rotateX(0deg) rotateY(2deg);
    }

    75%{
        transform:translateY(-8px) rotateX(-2deg) rotateY(-2deg);
    }

    100%{
        transform:translateY(0) rotateX(0deg) rotateY(0deg);
    }

}

@keyframes miniFloat{

    0%,100%{
        transform:translateY(0);
    }

    50%{
        transform:translateY(-8px);
    }

}

@keyframes miniFloat{

    0%,100%{
        transform:translateY(0);
    }

    50%{
        transform:translateY(-8px);
    }

}

@keyframes orbitFloat {

  0%,100% {
    transform: translateZ(30px) translateY(0);
  }

  50% {
    transform: translateZ(30px) translateY(-10px);
  }

}

/* ==========================================
   TOURNAMENT BRACKET
   ========================================== */

.game-tabs{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin:34px 0 26px;
}

.game-tab{
    padding:13px 22px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#ffffff08;
    color:#dbe5f2;
    font-weight:900;
    cursor:pointer;
    transition:.25s ease;
}

.game-tab:hover{
    border-color:#35dcff55;
    background:#35dcff0d;
}

.game-tab.active{
    background:linear-gradient(
        135deg,
        #35dcff20,
        #6d78ff20
    );
    border-color:#35dcff66;
    color:var(--cyan);
    box-shadow:0 8px 30px #0004;
}

.bracket-content{
    width:100%;
}

.bracket-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:28px;
    padding:24px;
    border:1px solid var(--line);
    border-radius:22px;
    background:linear-gradient(
        145deg,
        #0e1d33,
        #07101d
    );
}

.bracket-header h2{
    margin:8px 0 0;
    font-size:32px;
}

.bracket-status{
    padding:9px 15px;
    border-radius:999px;
    border:1px solid #35dcff35;
    background:#35dcff10;
    color:var(--cyan);
    font-weight:900;
    white-space:nowrap;
}

.bracket{
    display:flex;
    gap:70px;
    width:100%;
    overflow-x:auto;
    padding:20px 10px 35px;
    direction:ltr;
    scrollbar-width:thin;
}

.bracket-round{
    flex:0 0 260px;
    display:flex;
    flex-direction:column;
    gap:22px;
}

.bracket-round h3{
    margin:0;
    padding:12px 16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#ffffff07;
    color:var(--cyan);
    text-align:center;
    font-size:17px;
}

.bracket-round-matches{
    display:flex;
    flex-direction:column;
    gap:22px;
}

.bracket-match{
    position:relative;
    border:1px solid var(--line);
    border-radius:18px;
    background:linear-gradient(
        145deg,
        #0e1d33,
        #07101d
    );
    box-shadow:0 15px 40px #0005;
    overflow:hidden;
    direction:rtl;
}

.bracket-player{
    min-height:48px;
    padding:12px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    color:#eef5ff;
    font-weight:800;
}

.bracket-player:first-child{
    border-bottom:1px solid #ffffff12;
}

.bracket-vs{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    padding:3px 7px;
    border-radius:6px;
    background:var(--panel2);
    border:1px solid var(--line);
    color:var(--muted);
    font-size:9px;
    font-weight:900;
    z-index:2;
}

.bracket-score{
    min-width:25px;
    text-align:center;
    color:var(--cyan);
    font-weight:900;
}

.bracket-winner{
    margin-top:8px;
    padding:17px 20px;
    border-radius:17px;
    border:1px solid #a56cff35;
    background:#a56cff0d;
    color:var(--muted);
    text-align:center;
}

.bracket-winner strong{
    color:#fff;
    margin-right:6px;
}

.bracket-empty{
    padding:40px 25px;
    border:1px dashed var(--line);
    border-radius:20px;
    color:var(--muted);
    text-align:center;
    background:#ffffff04;
}

/* ==========================================
   BRACKET - MOBILE
   ========================================== */

@media (max-width:768px){

    .game-tabs{
        display:grid;
        grid-template-columns:1fr;
        gap:10px;
    }

    .game-tab{
        width:100%;
    }

    .bracket-header{
        flex-direction:column;
        align-items:stretch;
        text-align:center;
    }

    .bracket-status{
        align-self:center;
    }

    .bracket{
        gap:35px;
        padding-inline:5px;
    }

    .bracket-round{
        flex-basis:235px;
    }

}


/* ==========================================
   WINNER
   ========================================== */

.bracket-winner{
    position:relative;
    margin:35px auto 0;
    max-width:500px;
    font-size:16px;
}

.bracket-winner strong{
    color:#35dcff;
    font-size:18px;
}

/* ==========================================
   MOBILE BRACKET HORIZONTAL SCROLL FIX
   ========================================== */

@media (max-width: 768px){

    .bracket-content{
        width:100%;
        max-width:100%;
        min-width:0;
        overflow:hidden;
    }

    .bracket{
        display:flex;
        width:100%;
        max-width:100%;
        min-width:0;

        overflow-x:auto;
        overflow-y:visible;

        -webkit-overflow-scrolling:touch;
        touch-action:auto;

        overscroll-behavior-x:contain;

        padding:20px 20px 40px;

        /* نخلي الشجرة نفسها هي اللي تتحرك */
        direction:ltr;
    }

    .bracket-round{
        flex:0 0 260px;
        min-width:260px;
    }

    .bracket-match{
        width:100%;
        min-width:0;
    }

    .bracket-player{
        min-width:0;
        overflow:hidden;
    }

    .bracket-player span{
        min-width:0;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }

    /* منع الصفحة نفسها من التحرك أفقيًا */
    html,
    body{
        max-width:100%;
        overflow-x:hidden;
    }
}

/* ==========================================
   BRACKET TYPOGRAPHY
   ========================================== */

/* أسماء اللاعبين */
.bracket-player{
    font-size:15px;
    line-height:1.4;
    font-weight:800;
}

/* النتيجة */
.bracket-score{
    font-size:15px;
    font-weight:900;
}

/* VS */
.bracket-vs{
    font-size:9px;
    font-weight:900;
    letter-spacing:.4px;
}

/* أسماء الأدوار */
.bracket-round h3{
    font-size:17px;
    font-weight:900;
    line-height:1.4;
}

/* اسم البطولة */
.bracket-header h2{
    font-size:32px;
    font-weight:900;
    line-height:1.3;
}

/* الفائز */
.bracket-winner{
    font-size:15px;
    font-weight:800;
}

.bracket-winner strong{
    font-size:18px;
    font-weight:900;
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width:768px){

    .bracket-round h3{
        font-size:15px;
    }

    .bracket-player{
        font-size:14px;
    }

    .bracket-score{
        font-size:14px;
    }

    .bracket-vs{
        font-size:8px;
    }

    .bracket-header h2{
        font-size:26px;
    }

    .bracket-winner{
        font-size:14px;
    }

    .bracket-winner strong{
        font-size:17px;
    }

}

/* ==========================================
   BRACKET CONNECTORS - FINAL SHAPE
   ========================================== */

/* إلغاء الوصلات الأفقية القديمة */
.bracket-round:not(:last-child)
.bracket-match-wrap::after{
    content:none;
}


/* المباراة الأولى من كل زوج:
   خط أفقي قصير يصل إلى العمودي */
.bracket-round:not(:last-child)
.bracket-match-wrap:nth-child(odd)::after{
    content:"";

    position:absolute;
    top:50%;
    right:-35px;

    width:35px;
    height:2px;

    background:#35dcff66;

    transform:translateY(-50%);
}


/* المباراة الثانية من كل زوج:
   الخط يخرج منها إلى الجولة التالية */
.bracket-round:not(:last-child)
.bracket-match-wrap:nth-child(even)::after{
    content:"";

    position:absolute;
    top:50%;
    right:-70px;

    width:70px;
    height:2px;

    background:#35dcff66;

    transform:translateY(-50%);
}

