/* ----- BASE & RESET ----- */
html {
    font-size: 16px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 20% 30%, #0c1122, #02040c);
    font-family: 'Inter', sans-serif;
    color: #f0f4ff;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 247, 255, 0.05);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #00f7ff;
    border-radius: 10px;
}

/* ----- LAYOUT (Sidebar + Topbar + Main) ----- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    height: 100vh;
    background: rgba(6, 10, 18, 0.96);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 247, 255, 0.3);
    z-index: 1100;
    overflow-y: scroll;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 28px 20px 20px 20px;
    border-bottom: 1px solid rgba(0, 247, 255, 0.2);
    margin-bottom: 8px;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff, #00f7ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}
.logo i {
    background: linear-gradient(135deg, #00f7ff, #b388ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 28px;
}

.nav-group {
    margin: 8px 12px 16px 12px;
}
.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6c86a3;
    margin-bottom: 12px;
    padding-left: 12px;
}
.nav-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav-group li {
    margin: 2px 0;
    border-radius: 14px;
    transition: all 0.2s ease;
}
.nav-group li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    color: #b8c7e7;
    font-size: 14px;
    font-weight: 500;
    border-radius: 14px;
    transition: all 0.2s;
    position: relative;
}
.nav-group li a i {
    width: 22px;
    font-size: 18px;
    text-align: center;
    color: #6c86a3;
    transition: 0.2s;
}
.nav-group li:hover {
    background: rgba(0, 247, 255, 0.08);
}
.nav-group li:hover a,
.nav-group li:hover a i {
    color: #00f7ff;
}
.nav-group li.active {
    background: linear-gradient(135deg, rgba(0, 247, 255, 0.12), rgba(179, 136, 255, 0.06));
    border-left: 3px solid #00f7ff;
}
.nav-group li.active a,
.nav-group li.active a i {
    color: #00f7ff;
    text-shadow: 0 0 6px #00f7ff;
}
.nav-badge {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 30px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 6px #ef4444;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 16px 24px;
    border-top: 1px solid rgba(0, 247, 255, 0.2);
}
.user-session {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 40px;
    padding: 8px 12px;
    margin-bottom: 16px;
}
.session-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00f7ff, #b388ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    box-shadow: 0 0 12px rgba(0, 247, 255, 0.4);
}
.session-info {
    flex: 1;
}
.session-name {
    font-weight: 600;
    font-size: 14px;
    color: #ecf3ff;
    margin-bottom: 2px;
}
.logout-link {
    font-size: 11px;
    color: #a0b4d4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.2s;
}
.logout-link:hover {
    color: #ff4d6d;
}
.footer-meta {
    font-size: 10px;
    color: #4a5a7a;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 1050;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background: rgba(15, 25, 45, 0.85);
    backdrop-filter: blur(12px);
    padding: 6px 24px;
    border-bottom: 1px solid rgba(0, 247, 255, 0.25);
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    margin-left: auto;
}
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 16px;
    border-radius: 40px;
}
.user-name-welcome {
    font-size: 13px;
    color: #ccddf8;
}
.auth-btn {
    background: transparent;
    border: 1px solid #00e5ff;
    color: #00e5ff;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}
.auth-btn:hover {
    background: #00e5ff;
    color: black;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 30, 45, 0.6);
    backdrop-filter: blur(12px);
    padding: 4px 12px 4px 6px;
    border-radius: 40px;
    border: 1px solid rgba(0, 247, 255, 0.25);
}
.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #9d4edd, #3b9eff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}
.notification-bell {
    position: relative;
    color: #f3f4f6;
    font-size: 20px;
    margin-right: 8px;
}
.notification-bell .badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}
.mark-read-btn {
    background: rgba(0, 247, 255, 0.15);
    border: 1px solid #00e5ff;
    color: #00e5ff;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 11px;
}

.main {
    margin-left: 260px;
    padding-top: 60px;
    padding-left: 30px;
    padding-right: 30px;
    padding-bottom: 40px;
    min-height: 100vh;
}

/* ----- COMPONENTS ----- */
.glass-card,
.card {
    background: rgba(12, 18, 28, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    border: 1px solid rgba(0, 247, 255, 0.25);
    padding: 24px;
    transition: all 0.2s;
}
.glass-card:hover,
.card:hover {
    border-color: rgba(0, 247, 255, 0.5);
}

.btn {
    background: transparent;
    border: 1px solid #00f7ff;
    color: #00f7ff;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.btn:hover {
    background: #00f7ff;
    color: #0a0c14;
    box-shadow: 0 0 12px #00f7ff;
    transform: translateY(-2px);
}
.btn-primary {
    background: #00f7ff;
    color: #0a0c14;
}
.btn-primary:hover {
    background: transparent;
    color: #00f7ff;
}
.btn-danger {
    border-color: #ff4d6d;
    color: #ff4d6d;
}
.btn-danger:hover {
    background: #ff4d6d;
    color: #0a0c14;
}

input, textarea, select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 247, 255, 0.3);
    border-radius: 40px;
    padding: 10px 16px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    border-color: #00f7ff;
    box-shadow: 0 0 8px rgba(0, 247, 255, 0.3);
}
label {
    font-size: 0.8rem;
    color: #b0c4e0;
    display: block;
    margin-bottom: 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 32px 0 20px;
    border-bottom: 1px solid rgba(0, 247, 255, 0.2);
    padding-bottom: 10px;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a0e9ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.section-title i {
    font-size: 1.3rem;
    background: linear-gradient(135deg, #00f7ff, #b388ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.view-all {
    font-size: 0.8rem;
    background: rgba(0, 247, 255, 0.1);
    padding: 5px 14px;
    border-radius: 40px;
    border: 1px solid rgba(0, 247, 255, 0.4);
    transition: 0.2s;
}
.view-all:hover {
    background: #00f7ff;
    color: #0a0c14;
    transform: translateX(3px);
}

.tournament-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}
.tournament-card,
.filler-card {
    background: rgba(12, 20, 32, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 18px;
    border: 1px solid rgba(0, 247, 255, 0.2);
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
}
.tournament-card:hover {
    transform: translateY(-4px);
    border-color: #00f7ff;
    box-shadow: 0 12px 20px -12px rgba(0, 247, 255, 0.3);
}
/* FIX: reduce card height on index */
.tournament-card {
    gap: 8px;
    padding: 18px 16px;
}
.tournament-card .tourn-details {
    gap: 4px;
}
.tournament-card .tourn-footer {
    margin-top: 0;
}

.card-game-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 10px;
}
.tourn-name {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #b3f0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tourn-prize {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    color: #ffd966;
    border: 1px solid #ffd966;
}
.tourn-details {
    font-size: 12px;
    color: #b0c4e0;
    margin: 8px 0;
}
.tourn-progress {
    height: 3px;
    background: #1e2a3a;
    border-radius: 10px;
    margin: 8px 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00e5ff, #b388ff);
    border-radius: 10px;
}
.tourn-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}
.stage-badge {
    background: rgba(0, 247, 255, 0.15);
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 10px;
}

/* My tournaments & matches */
.my-tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.my-tournament-card,
.match-card-item {
    background: rgba(10, 18, 30, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 16px;
    border-left: 4px solid #00f7ff;
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
}
.my-tournament-card:hover,
.match-card-item:hover {
    transform: translateX(6px);
    border-left-width: 6px;
    background: rgba(20, 30, 50, 0.9);
}
.match-players-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 30px;
    margin: 12px 0;
    font-weight: 500;
}
.match-vs {
    color: #00e5ff;
    font-weight: 700;
    background: rgba(0, 229, 255, 0.2);
    padding: 2px 10px;
    border-radius: 30px;
}
.match-time {
    font-size: 12px;
    color: #99aacc;
    display: flex;
    align-items: center;
    gap: 6px;
}
.match-time i {
    color: #00e5ff;
}

/* Pending reports */
.pending-reports-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.pending-report-item {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    padding: 16px;
}
.accept-btn, .reject-btn {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    border: none;
}
.accept-btn {
    background: transparent;
    border: 1px solid #00ff88;
    color: #00ff88;
}
.accept-btn:hover {
    background: #00ff88;
    color: black;
}
.reject-btn {
    background: transparent;
    border: 1px solid #ff4d6d;
    color: #ff4d6d;
}
.reject-btn:hover {
    background: #ff4d6d;
    color: black;
}

/* Games grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}
.game-card, .game-item {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 247, 255, 0.3);
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    background: rgba(12, 18, 28, 0.6);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.game-card:hover, .game-item:hover {
    transform: scale(1.02);
    border-color: #00f7ff;
    box-shadow: 0 10px 30px rgba(0, 247, 255, 0.3);
}
.game-card img, .game-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    background: #1a1f30;
}
.game-item .game-thumb {
    height: 160px;
}
.game-item:hover .game-thumb, .game-card:hover img {
    transform: scale(1.1);
}
.game-info {
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    text-align: center;
}
.game-item .game-info {
    background: linear-gradient(to top, rgba(12, 18, 28, 0.95), rgba(12, 18, 28, 0.8));
    padding: 15px;
}
.game-name {
    font-size: 14px;
    font-weight: 600;
}
.game-item .game-name {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #b3f0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 5px;
    display: block;
}
.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #99aacc;
}
.game-players {
    display: flex;
    align-items: center;
    gap: 5px;
}
.game-players i {
    color: #00f7ff;
}
.game-badge {
    background: rgba(0, 247, 255, 0.15);
    padding: 3px 8px;
    border-radius: 30px;
    font-size: 11px;
    border: 1px solid #00f7ff;
    color: #00f7ff;
}

/* Tabs */
.tabs-header {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    padding: 4px;
    width: fit-content;
}
.tab-btn {
    padding: 5px 16px;
    border-radius: 40px;
    background: transparent;
    color: #b8c7e7;
    cursor: pointer;
    border: none;
    font-size: 13px;
}
.tab-btn.active {
    background: linear-gradient(135deg, #00f7ff, #a855f7);
    color: #0a0c14;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    padding: 12px 8px;
    color: #00f7ff;
    border-bottom: 1px solid rgba(0, 247, 255, 0.3);
    font-size: 14px;
}
td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}
tr:hover td {
    background: rgba(0, 247, 255, 0.03);
}
.win {
    color: #00ff88;
    font-weight: 600;
}
.loss {
    color: #ff4d6d;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 5px 12px;
    border-radius: 30px;
    border: 1px solid #00f7ff;
    color: #00f7ff;
    font-size: 13px;
}
.pagination a:hover {
    background: #00f7ff;
    color: #0a0c14;
}
.pagination .active {
    background: #00f7ff;
    color: #0a0c14;
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

.empty-state, .no-results {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 50px;
    text-align: center;
    color: #99aacc;
}

/* Hero slideshow & sections */
.hero-section {
    background: rgba(12, 18, 28, 0.5);
    backdrop-filter: blur(18px);
    border-radius: 28px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 247, 255, 0.3);
}
.hero-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #b3f0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.hero-sub {
    font-size: 15px;
    color: #c0d0f0;
}

.hero-slideshow {
    height: 300px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 30px -12px #000;
    border: 1px solid rgba(0, 247, 255, 0.3);
    position: relative;
}
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    opacity: 0;
    transition: opacity 1s;
}
.hero-slide.active {
    opacity: 1;
}
.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0a0c14, transparent 60%);
}
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 30px;
    z-index: 2;
}
.tourney-tag {
    background: rgba(0, 247, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 4px 12px;
    border-radius: 30px;
    display: inline-block;
    font-size: 12px;
    margin-bottom: 10px;
}
.countdown {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.countdown-item {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid #00f7ff;
    font-weight: 700;
    font-size: 14px;
}
.slideshow-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 3;
}
.slideshow-btn {
    background: rgba(0, 0, 0, 0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #00f7ff;
    border: 1px solid #00f7ff;
}
.slideshow-dots {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    gap: 6px;
}
.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}
.dot.active {
    background: #00f7ff;
    transform: scale(1.2);
}

/* Particles & orb */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
.parallax-orb {
    position: fixed;
    top: -30%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle at 30% 50%, rgba(0, 247, 255, 0.1), transparent 70%);
    filter: blur(80px);
    animation: orbMove 20s infinite alternate;
    z-index: -2;
}
@keyframes orbMove {
    0% { transform: translate(0,0) scale(1); opacity:0.4; }
    100% { transform: translate(15%,15%) scale(1.3); opacity:0.7; }
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1200px) {
    .games-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) {
    .tournament-grid, .games-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    .sidebar .logo span,
    .sidebar .nav-group-label,
    .sidebar .nav-group li a span,
    .sidebar .session-info,
    .sidebar .footer-meta {
        display: none;
    }
    .sidebar .nav-group li a {
        justify-content: center;
        padding: 12px;
    }
    .sidebar .nav-group li a i {
        margin: 0 auto;
        font-size: 22px;
    }
    .sidebar .user-session {
        justify-content: center;
        padding: 8px;
    }
    .sidebar .session-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .sidebar-footer {
        padding: 16px 8px;
    }
    .top-bar {
        left: 70px;
    }
    .main {
        margin-left: 70px;
        padding-top: 60px;
    }
}
@media (max-width: 700px) {
    .tournament-grid, .games-grid, .my-tournament-grid {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 1.2rem;
    }
}
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .top-bar {
        justify-content: center;
    }
    .glass-card, .card {
        padding: 16px;
    }
    .btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}