/* =========================================================
   Global Reset & Base Styles
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0A0C0F;
    color: #EAEAEA;
    font-family: 'Rajdhani', sans-serif;
}


/* =========================================================
   Animated Background
   ========================================================= */

.background {
    position: fixed;
    inset: 0;
    z-index: -1;

    background:
        linear-gradient(
            rgba(255, 122, 0, 0.03),
            rgba(255, 122, 0, 0)
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            rgba(255, 255, 255, 0.03) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            rgba(255, 255, 255, 0.03) 50px
        ),
        #0A0C0F;

    animation: gridMove 15s linear infinite;
}

.background::before {
    content: "";
    position: absolute;

    width: 600px;
    height: 600px;

    top: -150px;
    right: -150px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 122, 0, 0.15),
            transparent 70%
        );
}

.background::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        repeating-linear-gradient(
            180deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.015) 3px
        );

    pointer-events: none;
}

@keyframes gridMove {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(50px);
    }
}


/* =========================================================
   Navigation
   ========================================================= */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px 50px;
    border-bottom: 1px solid #222;
}

nav ul {
    display: flex;
    gap: 30px;

    list-style: none;
}

nav a {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

nav a:hover {
    color: #FF7A00;
    font-weight: bold;
}

.logo {
    color: #FF7A00;
    font-size: 1.5rem;
    font-weight: bold;
}

.twitch-btn {
    background: #FF7A00;
    padding: 10px 20px;
    border-radius: 4px;
}

.twitch-btn:hover {
    background: #ffffff;
}


/* =========================================================
   Home Page - Hero
   ========================================================= */

.hero {
    min-height: 70vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
}

.hero h1 {
    color: #FF7A00;
    font-size: 4rem;
}

.hero p {
    margin-top: 10px;
    font-size: 1.4rem;
}

#countdown {
    margin-top: 25px;
    font-size: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 20px;

    margin-top: 25px;
}

.hero-buttons a {
    background: #13161D;
    border: 1px solid #FF7A00;
    color: white;

    padding: 12px 24px;

    text-decoration: none;
}


/* =========================================================
   Home Page - Trailer
   ========================================================= */

.trailer-section {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

.trailer-section h2 {
    color: #FF7A00;
    margin-bottom: 20px;
}

.trailer-frame {
    position: relative;

    width: 100%;
    aspect-ratio: 16 / 9;

    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.35);
    box-shadow: 0 0 25px rgba(255, 122, 0, 0.15);
}

.trailer-frame iframe {
    width: 100%;
    height: 100%;
}


/* =========================================================
   Home Page - Tournament Info Cards
   ========================================================= */

.info {
    padding: 80px 10%;
}

.info h2 {
    margin-bottom: 30px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

    gap: 20px;
}

.card {
    background: #13161D;
    padding: 20px;
}

.info .card:hover {
    border: 2px solid #FF7A00;
    scale: 1.06;
}


/* =========================================================
   Tournament Page - Header & Standings
   ========================================================= */

.page-header {
    padding: 80px 20px;
    text-align: center;
}

.page-header h1 {
    color: #FF7A00;
    font-size: 4rem;
}

.page-header p {
    margin-top: 10px;
    color: #aaa;
}

.standings {
    max-width: 1000px;
    margin: auto;
    padding: 60px 20px;
}

.standings h2 {
    color: #FF7A00;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #13161D;
    color: #FF7A00;

    text-align: left;
}

th,
td {
    padding: 16px;
    border-bottom: 1px solid #222;
}

tbody tr:hover {
    background: #13161D;
}


/* =========================================================
   Tournament Page - Progress, Matches & Finals
   ========================================================= */

.progress-section,
.current-match,
.schedule,
.results,
.finals {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.progress-section h2,
.current-match h2,
.schedule h2,
.results h2,
.finals h2 {
    color: #FF7A00;
    margin-bottom: 20px;
}

.progress-bar {
    height: 18px;

    background: #13161D;
    border: 1px solid #333;

    overflow: hidden;
}

.progress-fill {
    width: 50%;
    height: 100%;

    background: #FF7A00;
}

.progress-section p {
    margin-top: 10px;
}

.match-card {
    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.3);

    padding: 30px;
}

.live {
    box-shadow: 0 0 25px rgba(255, 122, 0, 0.25);
}

.live-tag {
    color: #FF7A00;
    font-weight: bold;

    margin-bottom: 20px;
}

.match-teams {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 30px;
}

.team-box {
    background: #0A0C0F;
    border: 1px solid #333;

    padding: 20px 40px;
}

.vs {
    color: #FF7A00;
    font-size: 1.5rem;
    font-weight: bold;
}

.match {
    background: #13161D;

    padding: 18px;
    margin-bottom: 15px;
}

.upcoming {
    border-left: 4px solid #666;
}

.completed {
    border-left: 4px solid #00D5FF;
}

.final-card {
    display: flex;
    justify-content: space-around;
    align-items: center;

    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.3);

    padding: 30px;
}


/* =========================================================
   Admin Login Page
   ========================================================= */

.login-box {
    width: 400px;

    margin: 150px auto;
    padding: 30px;

    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.3);
}

.login-box h1 {
    color: #FF7A00;
    margin-bottom: 20px;
}

.login-box input {
    width: 100%;

    padding: 12px;
    margin-bottom: 15px;

    background: #0A0C0F;
    border: 1px solid #333;
    color: white;
}

.login-box button {
    width: 100%;

    padding: 12px;

    background: #FF7A00;
    border: none;

    cursor: pointer;
}


/* =========================================================
   Admin Dashboard
   ========================================================= */

.dashboard {
    max-width: 1200px;
    margin: auto;
    padding: 50px 20px;
}

.dashboard h1 {
    color: #FF7A00;
    margin-bottom: 40px;
}

.admin-section {
    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.25);

    padding: 25px;
    margin-bottom: 30px;
}

.admin-section h2 {
    color: #FF7A00;
    margin-bottom: 20px;
}

.admin-section input,
.admin-section select {
    width: 100%;

    padding: 12px;
    margin-bottom: 15px;

    background: #0A0C0F;
    border: 1px solid #333;
    color: white;
}

.admin-section button {
    background: #FF7A00;
    border: none;

    padding: 12px 20px;

    cursor: pointer;
}

.team-editor {
    background: #0A0C0F;
    border: 1px solid rgba(255, 122, 0, 0.25);

    padding: 20px;
    margin-bottom: 25px;
}

.team-editor h3,
.team-editor h4 {
    color: #FF7A00;
    margin-bottom: 15px;
}

.player-editor {
    border: 1px solid #333;

    padding: 15px;
    margin-bottom: 15px;
}

.checkbox-row {
    display: flex;
    align-items: center;

    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.player-editor textarea {
    width: 100%;
    min-height: 80px;

    padding: 12px;

    background: #0A0C0F;
    border: 1px solid #333;
    color: white;

    resize: vertical;
}


/* =========================================================
   Teams Page - Layout
   ========================================================= */

.teams-page {
    max-width: 1100px;
    margin: auto;
    padding: 60px 20px;
}

.team-selector {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 40px;
    margin-bottom: 50px;

    text-align: center;
}

.team-selector h1 {
    color: #FF7A00;
    font-size: 4rem;
    letter-spacing: 2px;
}

.team-selector p {
    color: #aaa;
    font-size: 1.2rem;
}

.arrow-btn {
    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.5);
    color: #FF7A00;

    padding: 15px 22px;

    font-size: 2rem;
    cursor: pointer;
}

.arrow-btn:hover {
    background: #FF7A00;
    color: #0A0C0F;
}

.lobby-panel {
    background: rgba(19, 22, 29, 0.9);
    border: 1px solid rgba(255, 122, 0, 0.35);
    box-shadow: 0 0 25px rgba(255, 122, 0, 0.12);

    padding: 30px;
}

.lobby-panel h2 {
    color: #FF7A00;
    margin-bottom: 20px;
}


/* =========================================================
   Teams Page - Player List
   ========================================================= */

.player-list {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.player-card {
    display: grid;
    grid-template-columns: 80px 1fr 140px;
    align-items: center;

    background: #0A0C0F;
    border: 1px solid #2a2f38;

    padding: 16px;

    cursor: pointer;
    transition: 0.2s;
}

.player-card:hover {
    border: 1px solid #FF7A00;
    box-shadow: 0 0 18px rgba(255, 122, 0, 0.25);

    transform: translateX(8px);
}

.player-number {
    color: #FF7A00;
    font-weight: bold;
}

.player-name-section {
    display: flex;
    align-items: center;

    gap: 12px;
}

.player-emblem {
    width: 48px;
    height: 48px;

    object-fit: cover;

    background: #111;
    border: 1px solid rgba(255, 122, 0, 0.25);
}

.player-card:hover .player-emblem {
    border-color: #FF7A00;
}

.player-name {
    font-size: 1.4rem;
    font-weight: bold;
}

.player-role {
    color: #00D5FF;
    text-align: right;
}

.captain {
    border: 1px solid rgba(255, 122, 0, 0.6);
}

.captain .player-name {
    color: #FF7A00;
}


/* =========================================================
   Teams Page - Player Info Panel
   ========================================================= */

.player-info {
    margin-top: 25px;
    padding: 25px;

    background: #0A0C0F;
    border-left: 4px solid #FF7A00;

    animation: infoPop 0.2s ease;
}

.player-profile-header {
    display: flex;
    align-items: center;

    gap: 20px;
    margin-bottom: 20px;
}

.profile-emblem {
    display: block;

    width: 96px;
    height: 96px;

    object-fit: cover;

    margin-bottom: 20px;

    border: 2px solid #FF7A00;
}

.player-info h3,
.player-profile-header h3 {
    color: #FF7A00;
    font-size: 2rem;
    margin-bottom: 10px;
}

.player-profile-header h3 {
    margin: 0;
    font-size: 2.2rem;
}

.player-status {
    color: #00D5FF;

    margin-top: 5px;

    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

    gap: 10px;
    margin-bottom: 15px;
}

.player-note {
    color: #aaa;
}

@keyframes infoPop {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   Draft Pool
   ========================================================= */

.draft-pool-section{
    max-width:1100px;
    margin:60px auto;
    padding:30px;
    background:rgba(19,22,29,.9);
    border:1px solid rgba(255,122,0,.35);
    box-shadow:0 0 25px rgba(255,122,0,.12);
}

.draft-pool-section h2{
    color:#FF7A00;
    margin-bottom:10px;
}

.draft-pool-section > p{
    color:#aaa;
    margin-bottom:25px;
}

.draft-pool{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:20px;
}

.draft-player-card{
    background:#0A0C0F;
    border:1px solid #2a2f38;
    padding:18px;
    transition:.2s;
}

.draft-player-card:hover{
    border-color:#FF7A00;
    box-shadow:0 0 18px rgba(255,122,0,.25);
    transform:translateY(-4px);
}

.draft-player-header{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:15px;
}

.draft-player-header h3{
    color:#FF7A00;
    font-size:1.5rem;
}

.draft-player-card p{
    margin-bottom:8px;
}

/* =========================================================
   Admin Dashboard - Player Editor
   ========================================================= */

.player-create-box{
    background:#0A0C0F;
    border:1px solid rgba(255,122,0,.25);
    padding:20px;
    margin-bottom:25px;
}

.player-create-box h3{
    color:#FF7A00;
    margin-bottom:15px;
}

.player-create-box textarea,
.player-editor textarea{
    width:100%;
    min-height:80px;
    padding:12px;
    margin-bottom:15px;
    background:#0A0C0F;
    border:1px solid #333;
    color:white;
    resize:vertical;
}

.danger-btn{
    background:#7a1f1f !important;
    color:white;
    margin-left:10px;
}

/* =========================================================
   Responsive Styles
   ========================================================= */

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .match-teams,
    .final-card {
        flex-direction: column;
    }

    .final-card {
        gap: 20px;
    }

    .team-selector {
        gap: 15px;
    }

    .team-selector h1 {
        font-size: 2.4rem;
    }

    .player-card {
        grid-template-columns: 50px 1fr;
        gap: 8px;
    }

    .player-role {
        grid-column: 2;
        text-align: left;
    }
}


/* =========================================================
   Admin Dashboard - Tabbed Control Panel
   ========================================================= */

.dashboard-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 76px);
}

.admin-sidebar {
    position: sticky;
    top: 0;

    height: calc(100vh - 76px);
    padding: 25px;

    background: rgba(10, 12, 15, 0.92);
    border-right: 1px solid rgba(255, 122, 0, 0.25);
}

.admin-sidebar h2 {
    color: #FF7A00;
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.admin-tab {
    width: 100%;

    display: block;

    padding: 14px;
    margin-bottom: 10px;

    background: #13161D;
    border: 1px solid #333;
    color: #EAEAEA;

    text-align: left;
    font-family: inherit;
    font-weight: bold;

    cursor: pointer;
    transition: 0.2s;
}

.admin-tab.active,
.admin-tab:hover {
    border-color: #FF7A00;
    color: #FF7A00;
    box-shadow: 0 0 14px rgba(255, 122, 0, 0.15);
}

.admin-content {
    padding: 35px;
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;
    margin-bottom: 25px;
}

.admin-panel-header h1 {
    color: #FF7A00;
    margin-bottom: 5px;
}

.admin-panel-header p {
    color: #aaa;
}

.overview-grid,
.manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));

    gap: 20px;
}

.overview-card,
.admin-card {
    background: rgba(19, 22, 29, 0.92);
    border: 1px solid rgba(255, 122, 0, 0.25);

    padding: 20px;
}

.overview-card span {
    display: block;

    color: #aaa;
    margin-bottom: 8px;

    text-transform: uppercase;
    letter-spacing: 1px;
}

.overview-card strong {
    color: #FF7A00;
    font-size: 1.6rem;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;
    margin-bottom: 18px;
}

.admin-card-header h3 {
    color: #FF7A00;
}

.admin-card-header span {
    color: #00D5FF;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.compact-section {
    max-width: 760px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));

    gap: 15px;
}

.form-grid.three-col {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.admin-section label,
.admin-card label {
    display: block;

    color: #aaa;
    margin-bottom: 6px;

    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-card input,
.admin-card select,
.admin-card textarea,
.player-create-box input,
.player-create-box select,
.player-create-box textarea {
    width: 100%;

    padding: 12px;
    margin-bottom: 15px;

    background: #0A0C0F;
    border: 1px solid #333;
    color: white;

    font-family: inherit;
}

.admin-card textarea,
.player-create-box textarea {
    min-height: 80px;
    resize: vertical;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.secondary-btn {
    background: #13161D;
    border: 1px solid rgba(255, 122, 0, 0.5);
    color: #FF7A00;

    padding: 12px 20px;

    cursor: pointer;
}

.secondary-btn:hover {
    background: #FF7A00;
    color: #0A0C0F;
}

.player-create-box {
    margin-bottom: 25px;
}

.player-create-box h2 {
    color: #FF7A00;
    margin-bottom: 18px;
}

.danger-btn {
    background: #7a1f1f !important;
    color: white;
}

#matchesContainer{
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.match-admin-card{
    min-width: 0;
}

.match-admin-score-row{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.match-admin-status-row{
    margin-bottom: 15px;
}

.match-admin-status-row select{
    width: 100%;
}

@media (max-width: 900px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-content {
        padding: 20px;
    }

    .admin-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid.three-col {
        grid-template-columns: 1fr;
    }
}
