 /* -----------------------------------------------css------------------------------------------------------------ */

        :root {
            --primary-color: #16d9f3;
            --secondary-color: #35e76f;
            --background-color: #06131a;
            --text-color: #f3fbff;
            --card-bg: #0b202a;
            --border-color: #167487;
            --header-bg: #071820;
            --header-border: #16d9f3;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--background-color);
            color: var(--text-color);
            margin: 0;
            padding: 0;
            line-height: 1.6;
            scroll-behavior: smooth;
            padding-bottom: 60px; /* Add padding to prevent content from being hidden by the fixed panel */
        }

        header {
            background-color: var(--header-bg);
            padding: 2rem;
            color: var(--text-color);
            text-align: center;
            border-bottom: 2px solid var(--primary-color);
            position: relative;
        }

        header h1 {
            font-size: 2.5rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin: 0;
            text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
        }

        nav {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            background-color: var(--header-bg);
            padding: 0.5rem;
            border-bottom: 2px solid var(--secondary-color);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        nav a {
            color: var(--text-color);
            text-decoration: none;
            padding: 0.75rem 1.5rem;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: background-color 0.3s ease, color 0.3s ease;
            border-radius: 4px;
            cursor: pointer;
        }

        nav a:hover {
            background-color: var(--primary-color);
            color: var(--background-color);
        }

        /* Specific style for the logged-in player link to make it stand out slightly */
        #nav-player-link i, #nav-admin-link i {
            margin-right: 0.5rem;
        }

        #nav-admin-link {
            color: var(--secondary-color);
            display: none; /* Hidden by default */
        }

        main {
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        section {
            background-color: var(--card-bg);
            padding: 2rem;
            border-radius: 8px;
            margin-bottom: 2rem;
            border: 1px solid var(--border-color);
        }

        h2 {
            color: var(--primary-color);
            text-align: center;
            border-bottom: 2px solid var(--secondary-color);
            padding-bottom: 0.5rem;
            margin-top: 0;
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }

        h3 {
            color: var(--secondary-color);
            margin-top: 0;
            text-align: left;
        }

        ul {
            list-style: none;
            padding-left: 0;
        }

        .card-container {
            display: grid;
            gap: 1.5rem;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        }

        .card-item {
            background-color: var(--background-color);
            padding: 1rem;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
            text-align: center;
            cursor: pointer; /* Makes cards clickable */
            position: relative;
        }

        .card-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
        }

        .card-item img {
            max-width: 100%;
            height: auto;
            border-radius: 4px;
            border: 2px solid var(--primary-color);
            max-height: 250px;
            object-fit: contain;
            background-color: #000;
        }

        .card-details {
            text-align: left;
            margin-top: 1rem;
            font-size: var(--ui-subtitle, 0.9rem);
        }

        .news-date {
            font-size: var(--ui-body, 0.8rem);
            color: #aaa;
            margin-bottom: 1rem;
            display: block;
        }

        /* --- Updated Leaderboard Styling --- */
        .ranking-table-container {
            width: 100%;
            overflow-x: hidden; /* Pinatay ang horizontal scroll */
            margin-top: 1.5rem;
            border-radius: 8px;
            background-color: var(--background-color);
            border: 1px solid var(--border-color);
        }

        .leaderboard {
            width: 100%;
            border-collapse: collapse;
            /* Tinanggal ang min-width para sumakto sa screen */
        }

        .leaderboard th, .leaderboard td {
            padding: 0.5rem;
            border-bottom: 1px solid var(--border-color);
            text-align: center;
            word-wrap: break-word;
            font-size: var(--ui-body, 0.85rem);
        }

        .leaderboard th {
            background-color: var(--primary-color);
            color: var(--background-color);
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: bold;
            position: sticky;
            top: 0;
        }

        .leaderboard tr:nth-child(even) { background-color: #1a1a1a; }
        .leaderboard tr:hover { background-color: #2a2a2a; }
        .leaderboard td:first-child { font-weight: bold; color: var(--secondary-color); }
        .leaderboard th:nth-child(1), .leaderboard td:nth-child(1),
        .leaderboard th:nth-child(2), .leaderboard td:nth-child(2) {
            width: 10%; /* Liliitan ang Rank columns */
            white-space: nowrap; /* Pipigilan bumaba ang number rank */
        }

        .leaderboard th:nth-child(4), .leaderboard td:nth-child(4) {
            width: 20%; /* Lalaparan ang Player Name column */
        }


        .video-responsive {
            position: relative;
            padding-bottom: 56.25%; /* 16:9 aspect ratio */
            height: 0;
            overflow: hidden;
            max-width: 100%;
            background: var(--background-color);
            margin: 1rem auto;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
        }

        .video-responsive iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }

        .market-item .buy-button {
            background-color: var(--primary-color);
            color: var(--background-color);
            padding: 0.75rem 1.5rem;
            border-radius: 4px;
            text-decoration: none;
            font-weight: bold;
            text-transform: uppercase;
            display: block;
            margin-top: 1rem;
            transition: background-color 0.3s ease;
        }

        .market-item .buy-button:hover { background-color: #00c853; }

        /* Lock-in social media panel */
        .social-panel {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: var(--header-bg);
            border-top: 2px solid var(--primary-color);
            display: flex;
            justify-content: center;
            padding: 1rem 0;
            z-index: 1000;
            box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.5);
        }

        .social-panel a {
            color: var(--text-color);
            font-size: var(--ui-title, 1.5rem);
            margin: 0 1rem;
            transition: color 0.3s ease, transform 0.3s ease;
        }

        .social-panel a:hover {
            color: var(--primary-color);
            transform: scale(1.2);
        }

        footer {
            text-align: center;
            padding: 1rem;
            background-color: var(--header-bg);
            color: var(--text-color);
            margin-top: 2rem;
            border-top: 2px solid var(--primary-color);
        }

        .card-section-group {
            border-top: 2px solid var(--border-color);
            margin-top: 2rem;
            padding-top: 2rem;
        }

        /* New styles for the picture buttons */
        .featured-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-top: 2rem;
        }

        .featured-buttons a {
            display: block;
            text-decoration: none;
            color: var(--text-color);
            text-align: center;
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .featured-buttons a:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
        }

        .featured-buttons img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            border-radius: 8px;
            border: 2px solid var(--primary-color);
        }

        .featured-buttons .button-label {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.7);
            padding: 0.5rem;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .news-details { text-align: left; }
        .news-details h3 { border-bottom: 2px solid var(--secondary-color); padding-bottom: 0.5rem; }

        .back-button {
            display: inline-block;
            background-color: var(--secondary-color);
            color: var(--background-color);
            padding: 0.75rem 1.5rem;
            border-radius: 4px;
            text-decoration: none;
            font-weight: bold;
            text-transform: uppercase;
            margin-top: 1rem;
            transition: background-color 0.3s ease;
        }

        .back-button:hover { background-color: #ffb300; }

        .latest-news-card {
            background-color: var(--background-color);
            border: 2px solid var(--primary-color);
        }

        .latest-news-card .read-more {
            display: block;
            margin-top: 1rem;
            color: var(--primary-color);
            font-weight: bold;
            text-decoration: none;
            text-align: center;
        }

        .ranking-tabs {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 2rem;
        }

        .ranking-tabs button {
            background-color: #2c2c2c;
            color: var(--text-color);
            border: none;
            padding: 0.75rem 1.5rem;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            cursor: pointer;
            transition: color 0.3s ease, background-color 0.3s ease;
            border-radius: 9999px;
        }

        .ranking-tabs button.active {
            background-color: var(--primary-color);
            color: var(--background-color);
        }

        .ranking-tabs button:not(.active):hover { background-color: #4a4a4a; }

        /* Folder Style Tabs for Card Database */
        .folder-tabs {
            display: flex;
            align-items: flex-end;
            border-bottom: 2px solid var(--primary-color);
            margin-bottom: 1rem;
            gap: 2px;
            flex-wrap: nowrap;
        }

        .folder-tabs button { flex: 1 1 0; min-width: 0;
            background-color: #2c2c2c;
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-bottom: none;
            padding: 0.6rem 0.4rem;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            cursor: pointer;
            border-radius: 8px 8px 0 0;
            transition: background-color 0.2s, color 0.2s, padding 0.2s;
            white-space: nowrap;
        }

        .folder-tabs button.active {
            background-color: var(--primary-color);
            color: var(--background-color);
            border-color: var(--primary-color);
            padding-top: 1rem;
            padding-bottom: 0.5rem;
            margin-bottom: -1px;
        }

        .folder-tabs button:not(.active):hover {
            background-color: #4a4a4a;
        }

        .ranking-content { display: none; }
        .ranking-content.active { display: block; }

        .player-name-link {
            text-decoration: underline;
            color: var(--secondary-color);
            cursor: pointer;
        }

        .modal {
            display: none;
            position: fixed;
            z-index: 1001;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.8);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            justify-content: center;
            align-items: center;
        }
        .modal-content {
            background-color: var(--card-bg);
            padding: 2rem;
            border-radius: 8px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.5);
            position: relative;
            max-height: 90vh;
            overflow-y: auto;
        }
        .modal-close {
            position: absolute;
            top: 10px;
            right: 20px;
            color: var(--text-color);
            font-size: 2rem;
            font-weight: bold;
            cursor: pointer;
            z-index: 10;
        }

        .step-by-step-container {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }
        .gameplay-step {
            background-color: var(--background-color);
            padding: 1.5rem;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
            text-align: left;
        }
        .gameplay-step h3 {
            color: var(--secondary-color);
            border-bottom: 2px solid var(--primary-color);
            padding-bottom: 0.5rem;
            margin-top: 0;
        }
        .gameplay-step h4 {
            color: var(--primary-color);
            margin-bottom: 0.5rem;
            margin-top: 1.5rem;
        }
        .gameplay-step ul {
            list-style: disc;
            padding-left: 1.5rem;
            margin-top: 0.5rem;
        }
        .gameplay-step li { margin-bottom: 0.5rem; }
        .gameplay-step strong { color: var(--primary-color); }
        .gameplay-content p { margin-bottom: 1rem; }

        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            color: var(--text-color);
            font-size: var(--ui-title, 1.5rem);
            cursor: pointer;
            padding: 0.5rem;
        }

        .login-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin-top: 1rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .form-group label {
            font-weight: bold;
            font-size: var(--ui-subtitle, 0.9rem);
            color: var(--secondary-color);
        }

        .form-group input, .form-group textarea, .form-group select {
            padding: 0.75rem;
            border-radius: 4px;
            border: 1px solid var(--border-color);
            background-color: var(--background-color);
            color: var(--text-color);
            font-family: inherit;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 100px;
        }

        .login-button {
            background-color: var(--primary-color);
            color: var(--background-color);
            border: none;
            padding: 0.75rem;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.3s ease;
            width: 100%;
            margin-top: 1rem;
        }

        .login-button:hover { background-color: #00c853; }

        .logout-button, .delete-btn {
            background-color: #ff4444;
            color: white;
            border: none;
            padding: 0.75rem;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        .logout-button { width: 100%; margin-top: 1rem; }
        .logout-button:hover, .delete-btn:hover { background-color: #cc0000; }
        .edit-btn {
            background-color: #2196F3;
            color: white;
            border: none;
            padding: 0.4rem 0.8rem;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.3s ease;
            font-size: var(--ui-body, 0.8rem);
        }
        .edit-btn:hover { background-color: #0b7dda; }

        .delete-btn {
            padding: 0.4rem 0.8rem;
            font-size: var(--ui-body, 0.8rem);
            position: absolute;
            top: 10px;
            right: 10px;
        }

        /* Rulebook Format Buttons */
        .format-btn {
            background-color: #333;
            border: 1px solid var(--border-color);
            color: white;
            padding: 4px 8px;
            cursor: pointer;
            border-radius: 4px;
            font-size: var(--ui-caption, 0.75rem);
            font-weight: bold;
            transition: background-color 0.2s;
        }
        .format-btn:hover { background-color: #555; }

        .register-link {
            text-align: center;
            margin-top: 1rem;
            font-size: var(--ui-subtitle, 0.9rem);
        }

        .register-link a { color: var(--primary-color); text-decoration: none; }
        .register-link a:hover { text-decoration: underline; }

        .player-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-top: 1rem;
        }

        .stat-card {
            background-color: var(--background-color);
            padding: 1rem;
            border-radius: 8px;
            flex: 1;
            min-width: 150px;
            text-align: center;
            border: 1px solid var(--border-color);
        }

        .stat-value {
            font-size: var(--ui-title, 1.5rem);
            font-weight: bold;
            color: var(--primary-color);
            margin-bottom: 0.5rem;
        }
        .stat-label { font-size: var(--ui-subtitle, 0.9rem); color: #aaa; }

        /* Card List UI */
        .card-list-item {
            padding: 0.75rem 1rem;
            font-size: var(--ui-body, 0.8rem);
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            transition: background-color 0.2s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .card-list-item:hover { background-color: #333; }
        .card-list-item:last-child { border-bottom: none; }
        .card-list-number {
            color: var(--secondary-color);
            font-weight: bold;
            margin-right: 0.5rem;
            min-width: 45px;
        }
        .selected-card-item {
            background-color: var(--primary-color);
            color: var(--background-color);
        }
        .selected-card-item .card-list-number { color: var(--background-color); }

        /* New Cards Database Layout Redesign */
        .cards-database-layout {
            display: flex;
            gap: 2rem;
            align-items: stretch;
        }
        .cards-detail-section {
            flex: 2;
            min-width: 0;
            display: flex;
            flex-direction: column;
        }
        .cards-list-section {
            flex: 1;
            min-width: 300px;
            max-width: 350px;
            display: flex;
            flex-direction: column;
        }

        /* Updated to handle pagination (removed fixed height & scrollbar) */
        #card-list-container {
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background-color: var(--background-color);
            display: flex;
            flex-direction: column;
        }

        /* Pagination Buttons */
        .pagination-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }
        .pagination-controls button {
            background-color: var(--card-bg);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            padding: 0.5rem 1rem;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            transition: background-color 0.2s;
        }
        .pagination-controls button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background-color: var(--background-color);
        }
        .pagination-controls button:hover:not(:disabled) {
            background-color: var(--primary-color);
            color: var(--background-color);
        }
        .page-indicator {
            font-size: var(--ui-subtitle, 0.9rem);
            font-weight: bold;
            color: var(--secondary-color);
        }

        .filter-select {
            flex: 1;
            padding: 0.75rem;
            border-radius: 4px;
            border: 1px solid var(--border-color);
            background-color: var(--background-color);
            color: var(--text-color);
            font-family: inherit;
        }

        #card-details-container {
            height: 100%;
            overflow: hidden;
            display: flex;
            gap: 2rem;
            box-sizing: border-box;
        }
        .card-detail-media {
            flex: 1;
            max-width: 320px;
            display: flex;
            flex-direction: column;
        }
        .card-detail-image {
            width: 100%;
            border-radius: 8px;
            border: 2px solid var(--primary-color);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
            background-color: #000;
            object-fit: contain;
            max-height: calc(75vh - 220px); /* Leave room for video */
        }
        .card-detail-text {
            flex: 1.5;
            overflow-y: auto;
            padding-right: 1rem;
            text-align: left;
        }

        /* Custom scrollbar for text area */
        .card-detail-text::-webkit-scrollbar { width: 8px; }
        .card-detail-text::-webkit-scrollbar-track { background: var(--background-color); border-radius: 4px; }
        .card-detail-text::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
        .card-detail-text::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

        /* Deck Builder Layout */
        .deck-builder-layout {
            display: flex;
            gap: 1rem;
            align-items: stretch;
            height: auto; /* Changed from 75vh */
            min-height: 75vh;
        }
        .db-section {
            background-color: var(--card-bg);
            border-radius: 8px;
            border: 1px solid var(--border-color);
            padding: 1rem;
            display: flex;
            flex-direction: column;
        }
        .deck-pool-section {
            flex: 1;
            min-width: 0;
        }
        .deck-preview-section {
            flex: 1;
            min-width: 0;
            align-items: center;
            overflow-y: auto;
            text-align: center;
        }
        .deck-current-section {
            flex: 1;
            min-width: 0;
            background-color: #111;
            border-color: var(--primary-color);
        }
        .deck-list {
            flex: 1;
            overflow-y: auto;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            background: var(--background-color);
            margin-top: 1rem;
        }
        .deck-list-item {
            padding: 0.5rem 0.8rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: var(--ui-body, 0.8rem);
            cursor: pointer;
        }
        .deck-list-item:hover { background-color: #333; }
        .add-card-btn {
            background-color: var(--primary-color);
            color: var(--background-color);
            border: none;
            border-radius: 4px;
            padding: 0.25rem 0.5rem;
            cursor: pointer;
            font-weight: bold;
        }
        .remove-card-btn {
            background-color: #ff4444;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 0.25rem 0.5rem;
            cursor: pointer;
        }
        .deck-controls {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .profile-header {
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 2rem;
            border-bottom: 2px solid var(--border-color);
        }
        .profile-avatar-large {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 3px solid var(--primary-color);
            margin-bottom: 1rem;
        }

        /* Master Admin Forms */
        .admin-form-container {
            background-color: var(--background-color);
            padding: 1.5rem;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
        }

        .admin-list-container {
            max-height: 400px;
            overflow-y: auto;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background-color: #1a1a1a;
        }

        .admin-list-item {
            padding: 1rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        /* PDF Small Bar Style */
        .pdf-small-bar {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-color: #e53935; /* Professional PDF red */
            color: #ffffff;
            padding: 0.4rem 0.8rem;
            border-radius: 4px;
            text-decoration: none;
            font-weight: bold;
            margin-top: 0.5rem;
            transition: background-color 0.3s ease, transform 0.2s ease;
            font-size: var(--ui-body, 0.8rem);
        }
        .pdf-small-bar:hover {
            background-color: #d32f2f;
            color: #ffffff;
            transform: translateY(-2px);
        }
        .pdf-small-bar i {
            margin-right: 0.5rem;
            font-size: var(--ui-subtitle, 1rem);
        }

        @media (max-width: 768px) {
            .stat-card { min-width: 120px; }
            .cards-database-layout { flex-direction: column-reverse; }
            .cards-list-section { max-width: 100%; }
            #card-list-container { max-height: none; }
            #card-details-container { height: auto; flex-direction: column; overflow: visible; }
            .card-detail-media { max-width: 100%; }
            .card-detail-image { max-height: 400px; }
            .card-detail-text { overflow-y: visible; max-height: none; padding-right: 0; }
            .deck-builder-layout { flex-direction: column; height: auto; }
            .db-section { height: auto; min-height: 300px; }
            nav { flex-direction: column; display: none; }
            nav.active { display: flex; }
            .mobile-menu-btn { display: block; position: absolute; left: 1rem; top: 2.5rem; z-index: 10; }
            .header-logo-box { padding-left: 3.5rem !important; }
            .header-logo-box img { max-height: 45px !important; }
            header h1 { font-size: var(--ui-title, 1.4rem) !important; }
        }

        /* --- MAIN RANKINGS PAGE SPECIFIC STYLING --- */
        .main-rankings-table {
            table-layout: fixed;
            width: 100%;
            min-width: 0;
        }

        .main-rankings-table th, .main-rankings-table td {
            padding: 0.6rem 0.4rem;
            font-size: var(--ui-body, 0.8rem);
            white-space: normal;
            word-wrap: break-word;
            text-align: center;
        }

        /* Adjusted Column Widths (6 Columns) */
        .main-rankings-table th:nth-child(1), .main-rankings-table td:nth-child(1) { width: 12%; } /* Global */
        .main-rankings-table th:nth-child(2), .main-rankings-table td:nth-child(2) { width: 38%; text-align: left; } /* Player Name */
        .main-rankings-table th:nth-child(3), .main-rankings-table td:nth-child(3) { width: 20%; } /* Continent-[Rank] */
        .main-rankings-table th:nth-child(4), .main-rankings-table td:nth-child(4) { width: 10%; } /* W */
        .main-rankings-table th:nth-child(5), .main-rankings-table td:nth-child(5) { width: 10%; } /* L */
        .main-rankings-table th:nth-child(6), .main-rankings-table td:nth-child(6) { width: 10%; } /* Points */

        .clickable-player {
            cursor: pointer;
            color: white;
            font-weight: bold;
            text-decoration: underline;
            transition: color 0.2s;
        }
        .clickable-player:hover {
            color: var(--primary-color);
        }

        /* Compact futuristic layout */
        * { box-sizing: border-box; }
        body {
            background:
                radial-gradient(circle at 80% 0, rgba(22,217,243,.12), transparent 32rem),
                linear-gradient(135deg, #030b10, var(--background-color));
            line-height: 1.4;
            padding-bottom: 46px;
        }
        header {
            padding: .65rem 1rem;
            background: linear-gradient(90deg, #06131a, #0a2631, #06131a);
            border-bottom: 1px solid rgba(22,217,243,.65);
        }
        header > div { max-width: 1400px !important; }
        .header-logo-box img { max-height: 52px !important; }
        header h1 {
            font-size: clamp(1.25rem, 2.5vw, 2rem);
            text-shadow: 0 0 18px rgba(22,217,243,.28);
        }
        nav {
            padding: .25rem .75rem;
            gap: .15rem;
            background: rgba(7,24,32,.96);
            border-bottom: 1px solid var(--border-color);
            backdrop-filter: blur(10px);
        }
        nav a {
            padding: .55rem .8rem;
            font-size: var(--ui-caption, .75rem);
            letter-spacing: .5px;
        }
        nav a:hover {
            background: rgba(22,217,243,.14);
            color: var(--primary-color);
            box-shadow: inset 0 -2px var(--primary-color);
        }
        main {
            max-width: 1400px;
            padding: 1rem;
        }
        section {
            padding: 1.25rem;
            margin-bottom: 1rem;
            border-color: rgba(22,217,243,.35);
            background: linear-gradient(145deg, rgba(11,32,42,.96), rgba(5,19,26,.96));
            box-shadow: 0 12px 32px rgba(0,0,0,.25);
        }
        h2 {
            font-size: clamp(1.15rem, 2vw, 1.6rem);
            padding-bottom: .4rem;
            margin-bottom: .8rem;
            border-bottom-width: 1px;
        }
        h3 { margin-bottom: .55rem; }
        p { margin-top: .45rem; margin-bottom: .65rem; }
        .card-container {
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: .75rem;
        }
        .card-item {
            padding: .8rem;
            background: linear-gradient(145deg, #0b222c, #07171e);
            border-color: rgba(22,217,243,.35);
            box-shadow: 0 5px 15px rgba(0,0,0,.28);
        }
        .card-item:hover {
            transform: translateY(-2px);
            border-color: var(--primary-color);
            box-shadow: 0 8px 22px rgba(22,217,243,.12);
        }
        .card-item img { max-height: 210px; border-width: 1px; }
        .card-section-group {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top-width: 1px;
        }
        .homepage-sections {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }
        .homepage-sections .card-section-group {
            margin-top: 0;
            min-width: 0;
        }
        .featured-buttons {
            grid-template-columns: repeat(4, 1fr);
            gap: .75rem;
            margin-top: 1rem;
        }
        .featured-buttons img { height: 105px; border-width: 1px; }
        .featured-buttons a:hover { transform: translateY(-2px); }
        .ranking-table-container { margin-top: .75rem; }
        .leaderboard th, .leaderboard td { padding: .4rem; }
        .ranking-tabs {
            gap: .35rem;
            margin-bottom: 1rem;
        }
        .ranking-tabs button {
            padding: .5rem .85rem;
            font-size: var(--ui-caption, .75rem);
            background: #0b2631;
            border: 1px solid rgba(22,217,243,.25);
        }
        .form-group { gap: .4rem; }
        .form-group input, .form-group textarea, .form-group select,
        .filter-select {
            padding: .6rem;
            background: #061820;
        }
        .login-form { gap: .65rem; }
        .login-button, .back-button,
        .market-item .buy-button {
            padding: .6rem .9rem;
        }
        .modal-content {
            padding: 1.25rem;
            background: linear-gradient(145deg, #0c2732, #07171e);
            border: 1px solid var(--border-color);
        }
        .step-by-step-container { gap: .8rem; }
        .gameplay-step { padding: 1rem; }
        .player-stats { gap: .5rem; margin-top: .5rem; }
        .stat-card { padding: .65rem; min-width: 120px; }
        .admin-form-container {
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .admin-panel { background: rgba(8,27,35,.94) !important; }
        .social-panel {
            justify-content: space-between;
            align-items: center;
            padding: .5rem 1rem;
            background: rgba(7,24,32,.97);
            border-top-width: 1px;
        }
        .social-links { display: flex; align-items: center; }
        .social-panel a {
            font-size: var(--ui-heading, 1.15rem);
            margin-right: 1.4rem;
        }
        .social-panel p {
            margin: 0;
            font-size: var(--ui-caption, .7rem);
            color: #a9bcc4;
            text-align: right;
        }

        @media (max-width: 900px) {
            .homepage-sections { grid-template-columns: 1fr; }
            .featured-buttons { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 768px) {
            header { padding: .55rem; }
            .mobile-menu-btn { top: .85rem; }
            main { padding: .6rem; }
            section { padding: .8rem; }
            .header-logo-box img { max-height: 40px !important; }
            .featured-buttons img { height: 90px; }
            .card-container { grid-template-columns: 1fr; }
        }

        .home-slider { position: relative; margin-top: 1rem; }
        .slider-track { min-height: 390px; overflow: hidden; }
        .home-slide { display: none; padding: 0 4rem; }
        .home-slide.active { display: block; min-height: 390px; animation: homeSlideIn .5s ease; }
        @keyframes homeSlideIn { from { opacity: 0; transform: translateX(6%); } }
        .slider-arrow {
            position: absolute;
            top: 50%;
            z-index: 2;
            width: 32px;
            height: 48px;
            border: 1px solid var(--border-color);
            background: rgba(3,16,21,.8);
            color: var(--primary-color);
            font-size: var(--ui-title, 1.4rem);
            cursor: pointer;
            transform: translateY(-50%);
        }
        .slider-arrow:hover { background: var(--primary-color); color: #031015; }
        .slider-prev { left: .5rem; }
        .slider-next { right: .5rem; }
        .gameplay-preview {
            min-height: 390px;
            padding: 1.2rem 3rem;
            display: flex;
            align-items: center;
            background: url('https://i.imgur.com/p4S7PGp.png') right 50%/auto 145% no-repeat;
        }
        .gameplay-preview div { max-width: 420px; }
        .gameplay-preview a { color: var(--primary-color); font-weight: bold; cursor: pointer; }
        @media (max-width: 600px) {
            .slider-track, .home-slide.active { min-height: 360px; }
            .home-slide { padding: 0 2.75rem; }
            .gameplay-preview { min-height: 360px; padding: 1rem; background-position: 78% 22%; background-size: auto 125%; }
        }

        /* Unified cinematic homepage */
        #home { position: relative; min-height: 650px; padding: 0; border: 0; background: #031015; box-shadow: none; overflow: hidden; }
        #home > h2, #home > p { position: absolute; left: 8%; z-index: 3; width: 38%; text-align: left !important; }
        #home > h2 { top: 70px; border: 0; font-size: clamp(2rem,4vw,3.8rem); line-height: .95; color: var(--text-color); }
        #home > p { top: 245px; color: #b9c8ce; }
        #home .home-slider { margin: 1.5rem 0 0; }
        #home .slider-track, #home .home-slide.active { min-height: 500px; }
        #home .home-slide { padding: 0 6%; }
        #home .gameplay-preview { min-height: 500px; padding: 280px 2% 2rem; align-items: flex-start; background-position: 82% 45%; background-size: auto 135%; }
        #home .gameplay-preview div { max-width: 38%; }
        #home .gameplay-preview h3 { font-size: var(--ui-heading, 1.25rem); }
        #home .gameplay-preview, #home .card-item, #home .ranking-table-container, #home .featured-buttons img { border: 0; box-shadow: none; }
        #home .card-item { background: rgba(3,16,21,.7); }
        #home .slider-arrow { width: auto; height: auto; padding: .5rem; border: 0; background: transparent; font-size: 2rem; }
        #home .slider-arrow:hover { background: transparent; color: var(--secondary-color); }
        #home .featured-buttons { position: absolute; z-index: 4; left: 6%; right: 6%; bottom: 25px; margin: 0; padding: 0; border: 0; gap: .7rem; }
        #home .featured-buttons a, #home .featured-buttons img { border-radius: 0; }
        #home .featured-buttons img { height: 105px; }
        @media (max-width: 600px) {
            #home { min-height: 680px; }
            #home > h2, #home > p { left: 12%; width: 76%; }
            #home > h2 { top: 35px; font-size: var(--ui-title, 1.8rem); }
            #home > p { top: 135px; }
            #home .slider-track, #home .home-slide.active { min-height: 480px; }
            #home .home-slide { padding: 0 2.75rem; }
            #home .gameplay-preview { min-height: 480px; padding: 275px 0 1rem; background-position: 80% 40%; background-size: auto 105%; }
            #home .gameplay-preview div { max-width: 100%; }
            #home .featured-buttons { grid-template-columns: repeat(2,1fr); bottom: 15px; }
            #home .featured-buttons img { height: 75px; }
        }
/* ------------------------------------------------css----------------------------------------------------------- */
    

/* Styles used by the dashboard, deck builder and profile. */
.ds-b { width:auto; margin:0; padding:0.25rem 0.5rem; font-size: var(--ui-caption, 0.75rem); } .ds-b.on { background:var(--secondary-color); color:#000; }


                        .db-top-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; align-items: stretch; min-height: 320px; margin-bottom: 1.5rem; }
                        .db-section { background-color: var(--card-bg); border-radius: 8px; border: 1px solid var(--border-color); padding: 1rem; display: flex; flex-direction: column; min-width: 0; }

                        /* Standard LTR flow pero pababa ang bilang (1-10 sa kaliwa) */
                        .tactic-grid-3col {
                            display: grid;
                            grid-template-columns: repeat(3, 1fr);
                            grid-template-rows: repeat(10, auto);
                            grid-auto-flow: column;
                            gap: 0.5rem;
                            margin-top: 0.5rem;
                        }

                        .draggable-item { cursor: grab; border: 1px solid transparent; transition: border-color 0.2s, opacity 0.2s; }
                        .draggable-item:active { cursor: grabbing; opacity: 0.5; border-color: var(--primary-color); }

                        /* Ire-reset sa normal (1 column pababa) kapag binuksan sa Mobile Phone */
                        @media (max-width: 850px) {
                            .db-top-row { grid-template-columns: 1fr; }
                            .tactic-grid-3col { grid-template-columns: 1fr; grid-auto-flow: row; }
                        }
                    


                    /* CSS para maging magkapantay ang Kaliwa at Kanan */
                    .profile-grid-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: stretch; }
                    @media (max-width: 850px) { .profile-grid-layout { grid-template-columns: 1fr; } }
                    .small-deck-slot { padding: 0.5rem; min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 4px; border: 1px solid; }
                    /* CSS para magkasya ang 4 buttons sa isang hilera */
                    .bottom-action-btn { flex: 1; margin: 0; padding: 0.6rem 0.2rem; font-size: var(--ui-caption, 0.75rem); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 0.3rem; }
                


                    /* Balanse at walang horizontal scroll */
                    .admin-grid, .admin-grid-cards { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: stretch; min-width: 0; }
                    .admin-panel.form-group { display: none; }
                    .admin-panel.form-group.open { display: flex; position: fixed; z-index: 1003; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(760px,94vw); max-height: 92vh; overflow-y: auto; }
                    #admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1002; }
                    #admin-overlay.open { display: block; }
					.admin-panel { background: var(--card-bg); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); display: flex; flex-direction: column; box-sizing: border-box; min-width: 0; }
                    .compact-input { min-width: 0; width: 100%; box-sizing: border-box; padding: 0.4rem !important; font-size: var(--ui-body, 0.8rem) !important; margin-bottom: 0 !important; border-radius: 4px; border: 1px solid var(--border-color); background-color: var(--background-color); color: var(--text-color); font-family: inherit; }

                    /* MGA BAGONG CSS PARA SA CARDS PAGE */
                    .filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; width: 100%; margin-bottom: 1rem; }
                    .filter-search-full { grid-column: span 2; }
                    .folder-tabs-compact { display: flex; width: 100%; justify-content: space-between; border-bottom: 2px solid var(--primary-color); margin-bottom: 1rem; gap: 2px; }
                    .folder-tabs-compact button { flex: 1; padding: 0.5rem 0.1rem; font-size: var(--ui-caption, 0.75rem); text-align: center; border-radius: 6px 6px 0 0; background: #ececec; color: #fff; border: 1px solid var(--border-color); border-bottom: none; cursor: pointer; white-space: nowrap; transition: 0.2s; }
                    .folder-tabs-compact button.active { background: var(--primary-color); color: #000; padding-top: 0.8rem; font-weight: bold; }
                    .compact-filter-input { width: 100%; box-sizing: border-box; padding: 0.6rem; border-radius: 4px; border: 1px solid var(--border-color); background-color: var(--background-color); color: var(--text-color); font-size: var(--ui-body, 0.8rem); font-family: inherit; }
                