:root {
    --bg-main: #0B090A;
    --bg-secondary: #161A1D;

    --primary: #A4161A;
    --accent: #E5383B;

    --text-light: #D3D3D3;
    --text-soft: #F5F3F4;
    --white: #FFFFFF;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}

footer {
    background-color: var(--bg-secondary);
    text-align: center;
    padding: 10px;
}

/* Reset */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-light);
}

/* ================= NAVBAR SIMPLE ================= */

.navbar {
    background-color: #161A1D;
    color: var(--white);
    padding: 12px 24px;

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

    position: sticky;
    top: 0;
    z-index: 1000;

    border-bottom: 1px solid #2b2f33;
}

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

.logo-with-image {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo-rectangular {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

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

.nav-link,
.username-link {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 10px;
    border-radius: 8px;
}

.nav-link:hover,
.username-link:hover {
    color: var(--white);
    background-color: #2b2f33;
}

.username-link {
    background-color: #0B090A;
    border: 1px solid #2b2f33;
}

.logout-form,
.lang-form {
    margin: 0;
}

.logout-btn,
.login-btn {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    text-decoration: none;
    font-weight: bold;

    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.logout-btn:hover,
.login-btn:hover {
    background-color: var(--accent);
}

.lang-select {
    background-color: #0B090A;
    color: var(--text-soft);
    border: 1px solid #2b2f33;
    border-radius: 8px;
    padding: 8px;
    font-weight: bold;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
}

/* ================= MOBILE NAVBAR SIMPLE ================= */

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 10px 14px;
    }

    .site-logo-rectangular {
        height: 38px;
        max-width: 190px;
    }

    .hamburger {
        display: block;
    }

    .nav-right {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding-top: 14px;
    }

    .nav-right.active {
        display: flex;
    }

    .nav-link,
    .username-link,
    .login-btn,
    .logout-btn,
    .lang-select {
        width: 100%;
        max-width: 260px;
        text-align: center;
        box-sizing: border-box;
    }

    .logout-form,
    .lang-form {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}
/* ================= BOTONES ================= */

.login-btn,
.logout-btn {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

.login-btn:hover,
.logout-btn:hover {
    background-color: var(--accent);
}

/* ================= USER ================= */

.username {
    color: var(--text-soft);
    font-size: 14px;
}

/* ================= SELECT IDIOMA ================= */

.lang-form {
    margin: 0;
}

.lang-select {
    background-color: var(--bg-main);
    color: var(--text-soft);
    border: 1px solid var(--primary);
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
}

/* ================= CONTENIDO ================= */

.container {
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}

/* ================= CARDS ================= */

.card {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* ================= FOOTER ================= */

footer {
    background-color: var(--bg-secondary);
    text-align: center;
    padding: 10px;
    margin-top: 20px;
}

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

@media (max-width: 768px) {

    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }

    .container {
        padding: 10px;
    }

    .logo {
        font-size: 16px;
    }

    .login-btn,
    .logout-btn {
        padding: 5px 10px;
        font-size: 14px;
    }
}

/* ================= AUTH ================= */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70vh;
}

.auth-card {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);

    display: flex;
    flex-direction: column;
    align-items: center; /* 🔥 centra todo */
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* Inputs */
.auth-card input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    border: none;
    background-color: var(--bg-main);
    color: var(--text-soft);
}

/* Botón */
.auth-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary);
    border: none;
    border-radius: 6px;
    color: var(--white);
    cursor: pointer;
    margin-top: 10px;
}

.auth-btn:hover {
    background-color: var(--accent);
}

/* Link */
.auth-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 768px) {
    .auth-container {
        height: auto;
        padding: 20px;
    }

    .auth-card {
        padding: 20px;
    }
}

/* ================= FORM ================= */

.auth-form {
    width: 100%;              /* 🔥 ocupa todo el ancho del card */
    max-width: 320px;         /* 🔥 limita ancho visual */
    display: flex;
    flex-direction: column;
}

.form-group {
    width: 100%;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-soft);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    background-color: #d3d3d3; /* más claro como en tu imagen */
    color: #000;
    box-sizing: border-box; /* 🔥 evita desbordes raros */
}

.form-error {
    background-color: #660708;
    color: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Admin*/
.admin-card {
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.admin-card:hover {
    background-color: var(--primary);
}

/* ================= NAVBAR ================= */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-secondary);
    padding: 10px 20px;
}

/* 🍔 icono */
.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--white);
}

/* menu normal */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* links */
.nav-link {
    color: var(--white);
    text-decoration: none;
}

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

@media (max-width: 768px) {

    .hamburger {
        display: block;
    }

    .nav-right {
        display: none; /* oculto por defecto */
        flex-direction: column;
        width: 100%;
        background-color: var(--bg-secondary);
        margin-top: 10px;
        padding: 10px 0;
    }

    .nav-right.active {
        display: flex; /* se muestra al abrir */
    }

    .nav-link,
    .login-btn,
    .logout-btn {
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .lang-form {
        width: 100%;
        text-align: center;
    }
}

.form-group select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    background-color: #d3d3d3;
    color: #000;
    box-sizing: border-box;
}

.league-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.league-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.league-table th,
.league-table td {
    padding: 12px;
    border-bottom: 1px solid #333;
    text-align: left;
}

.league-table th {
    color: var(--white);
    background-color: #1f2428;
}

.small-btn {
    display: inline-block;
    background-color: var(--primary);
    color: var(--white);
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    margin-right: 5px;
    font-size: 13px;
}

.small-btn:hover {
    background-color: var(--accent);
}

.danger-btn,
.danger-submit {
    background-color: #660708;
}

.danger-btn:hover,
.danger-submit:hover {
    background-color: #A4161A;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    background-color: #d3d3d3;
    color: #000;
    box-sizing: border-box;
}

/* ================= ADMIN DASHBOARD ================= */

.admin-dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-header {
    margin-bottom: 30px;
}

.admin-header h1 {
    color: var(--white);
    font-size: 34px;
    margin-bottom: 8px;
}

.admin-header p {
    color: var(--text-light);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.admin-tile {
    background: linear-gradient(145deg, #161A1D, #1f2428);
    border: 1px solid #2b2f33;
    border-radius: 18px;
    padding: 28px;
    text-decoration: none;
    color: var(--text-soft);
    transition: 0.2s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.admin-tile:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    background: linear-gradient(145deg, #1f2428, #2b1012);
}

.admin-icon {
    font-size: 34px;
    margin-bottom: 15px;
}

.admin-tile h2 {
    color: var(--white);
    margin: 0 0 8px;
}

.admin-tile p {
    margin: 0;
    color: var(--text-light);
}

/* ================= LEAGUE PAGE ================= */

.league-page {
    max-width: 1100px;
    margin: 0 auto;
}

.league-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.league-header h1 {
    color: var(--white);
    font-size: 34px;
    margin-bottom: 6px;
}

.league-header p {
    margin: 0;
    color: var(--text-light);
}

.primary-action {
    display: inline-block;
    background-color: var(--primary);
    color: var(--white);
    padding: 11px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

.primary-action:hover {
    background-color: var(--accent);
}

.league-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.league-card {
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px solid #2b2f33;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.league-card h2 {
    color: var(--white);
    margin: 0 0 10px;
}

.ruleset-badge {
    display: inline-block;
    background-color: rgba(229, 56, 59, 0.18);
    color: var(--text-soft);
    border: 1px solid var(--primary);
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
}

.ruleset-badge.muted {
    border-color: #555;
    color: #aaa;
    background-color: rgba(255, 255, 255, 0.05);
}

.league-description {
    margin-top: 15px;
    min-height: 40px;
    color: var(--text-light);
}

.muted-text {
    color: #888;
}

.league-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.league-meta div {
    background-color: #0B090A;
    border-radius: 12px;
    padding: 12px;
}

.league-meta span {
    display: block;
    color: #999;
    font-size: 12px;
    margin-bottom: 4px;
}

.league-meta strong {
    color: var(--white);
}

.league-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.small-btn {
    display: inline-block;
    background-color: var(--primary);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}

.small-btn:hover {
    background-color: var(--accent);
}

.danger-btn,
.danger-submit {
    background-color: #660708;
}

.danger-btn:hover,
.danger-submit:hover {
    background-color: #A4161A;
}

.empty-state {
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px dashed #444;
    border-radius: 18px;
    padding: 45px 25px;
    text-align: center;
}

.empty-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.empty-state h2 {
    color: var(--white);
}

/* ================= FORM PAGE ================= */

.form-page {
    max-width: 850px;
    margin: 0 auto;
}

.form-card {
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px solid #2b2f33;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.wide-form-card {
    max-width: 800px;
    margin: 0 auto;
}

.form-title h1 {
    color: var(--white);
    margin: 0 0 8px;
}

.form-title p {
    color: var(--text-light);
    margin-bottom: 25px;
}

.league-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    border: none;
    background-color: #d3d3d3;
    color: #000;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions,
.delete-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.secondary-action {
    display: inline-block;
    color: var(--text-soft);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    background-color: #2b2f33;
}

.secondary-action:hover {
    background-color: #3a3f44;
}

.delete-card {
    max-width: 550px;
    margin: 0 auto;
}

.delete-card h1 {
    color: var(--white);
}

.delete-summary {
    background-color: #0B090A;
    border-radius: 14px;
    padding: 18px;
    margin: 20px 0;
}

.delete-summary h2 {
    color: var(--white);
    margin-top: 0;
}

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

@media (max-width: 768px) {
    .admin-grid,
    .league-cards,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .league-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .primary-action {
        width: 100%;
        text-align: center;
    }

    .form-actions,
    .delete-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .secondary-action,
    .auth-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

.json-preview {
    background-color: #0B090A;
    border: 1px solid #2b2f33;
    border-radius: 12px;
    padding: 14px;
    margin-top: 16px;
    max-height: 220px;
    overflow: auto;
}

.json-preview pre {
    margin: 0;
    color: var(--text-soft);
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.help-text {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
}

/* ================= SCORE REGISTER ================= */

.score-context {
    background-color: #0B090A;
    border: 1px solid #2b2f33;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 22px;
}

.score-context h2 {
    color: var(--white);
    margin: 0 0 10px;
}

.score-context p {
    color: var(--text-light);
    margin-bottom: 0;
}

.score-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #0B090A;
    border-radius: 14px;
    overflow: hidden;
}

.score-table th,
.score-table td {
    padding: 12px;
    border-bottom: 1px solid #2b2f33;
    text-align: left;
}

.score-table th {
    background-color: #1f2428;
    color: var(--white);
    font-size: 13px;
}

.score-table td {
    color: var(--text-soft);
}

.score-table select,
.score-table input {
    width: 100%;
    min-width: 120px;
    padding: 9px;
    border-radius: 8px;
    border: none;
    background-color: #d3d3d3;
    color: #000;
    box-sizing: border-box;
}

.input-error {
    color: #ffb3b3;
    font-size: 12px;
    margin-top: 5px;
}

.score-result-card {
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px solid #2b2f33;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.score-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.score-result-header h2 {
    color: var(--white);
    margin: 0;
}

@media (max-width: 768px) {
    .score-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

.mini-results {
    margin-top: 18px;
    background-color: #0B090A;
    border-radius: 12px;
    overflow: hidden;
}

.mini-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 12px;
    border-bottom: 1px solid #2b2f33;
}

.mini-result-row:last-child {
    border-bottom: none;
}

.mini-result-row span {
    color: var(--text-soft);
}

.mini-result-row strong {
    color: var(--white);
}

.ranking-table td:first-child {
    font-weight: bold;
    color: var(--white);
}

/* ================= PLAYER PROFILE ================= */

.profile-filters {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    background-color: #161A1D;
    border: 1px solid #2b2f33;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group span {
    color: var(--text-light);
    font-size: 13px;
    margin-right: 6px;
}

.filter-btn {
    display: inline-block;
    background-color: #2b2f33;
    color: var(--text-soft);
    text-decoration: none;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 13px;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary);
    color: var(--white);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.profile-stat-card {
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px solid #2b2f33;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.profile-stat-card span {
    display: block;
    color: #999;
    font-size: 13px;
    margin-bottom: 8px;
}

.profile-stat-card strong {
    color: var(--white);
    font-size: 28px;
}

.profile-chart-card {
    margin-bottom: 24px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
    max-height: 320px;
}

#placementChart {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.player-link {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: bold;
}

.player-link:hover {
    color: var(--accent);
}

@media (max-width: 900px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        box-sizing: border-box;
    }

    .chart-wrapper {
        height: 240px;
        max-height: 240px;
    }
}

.username-link {
    text-decoration: none;
    color: var(--text-soft);
    font-weight: bold;
}

.username-link:hover {
    color: var(--accent);
}

.footer-link {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: bold;
}

.footer-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ================= USER ADMIN ================= */

.user-filter-card {
    margin-bottom: 24px;
}

.user-filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.user-filter-actions {
    margin-top: 0;
}

.role-badge,
.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.role-user {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
}

.role-mod {
    background-color: rgba(255, 193, 7, 0.16);
    color: #ffd166;
}

.role-admin {
    background-color: rgba(229, 56, 59, 0.18);
    color: #ffb3b3;
}

.status-badge.active {
    background-color: rgba(46, 204, 113, 0.15);
    color: #7bed9f;
}

.status-badge.inactive {
    background-color: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    margin-top: 28px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.password-section {
    border-top: 1px solid #2b2f33;
    padding-top: 20px;
    margin-top: 10px;
}

.password-section h2 {
    color: var(--white);
    margin: 0 0 6px;
    font-size: 20px;
}

.password-section p {
    color: var(--text-light);
    margin: 0;
}

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

    .user-filter-actions {
        justify-content: flex-start;
    }
}

/* ================= HOME HERO ================= */

.home-hero {
    max-width: 1150px;
    margin: 0 auto 36px;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.home-hero-content,
.home-hero-card {
    background: linear-gradient(145deg, #161A1D, #1f2428);
    border: 1px solid #2b2f33;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.hero-kicker {
    display: inline-block;
    color: var(--accent);
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.home-hero h1 {
    color: var(--white);
    font-size: 44px;
    margin: 0 0 14px;
}

.home-hero p {
    color: var(--text-light);
    max-width: 680px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.home-hero-card {
    display: grid;
    gap: 14px;
}

.hero-stat {
    background-color: #0B090A;
    border-radius: 16px;
    padding: 18px;
}

.hero-stat span {
    display: block;
    color: #999;
    font-size: 13px;
    margin-bottom: 8px;
}

.hero-stat strong {
    color: var(--white);
    font-size: 24px;
}

/* ================= NEWS CAROUSEL ================= */

.news-section {
    max-width: 1150px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 18px;
}

.section-header h2 {
    color: var(--white);
    font-size: 30px;
    margin: 0 0 6px;
}

.section-header p {
    color: var(--text-light);
    margin: 0;
}

.news-carousel {
    position: relative;
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    gap: 12px;
    align-items: center;
}

.news-track-wrapper {
    overflow: hidden;
    border-radius: 22px;
}

.news-track {
    display: flex;
    transition: transform 0.35s ease;
}

.news-slide {
    min-width: 100%;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px solid #2b2f33;
    border-radius: 22px;
    overflow: hidden;
    min-height: 340px;
}

.news-image {
    background-size: cover;
    background-position: center;
    min-height: 340px;
}

.news-image-placeholder {
    background: radial-gradient(circle at center, #2b2f33, #0B090A);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.news-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-badge {
    display: inline-block;
    width: fit-content;
    background-color: rgba(229, 56, 59, 0.18);
    color: var(--text-soft);
    border: 1px solid var(--primary);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    margin-bottom: 14px;
}

.news-badge.muted {
    border-color: #555;
    color: #aaa;
    background-color: rgba(255, 255, 255, 0.05);
}

.news-content h3 {
    color: var(--white);
    font-size: 30px;
    margin: 0 0 12px;
}

.news-content p {
    color: var(--text-light);
    line-height: 1.6;
}

.news-actions {
    margin-top: 18px;
}

.carousel-btn {
    height: 46px;
    width: 46px;
    border: none;
    border-radius: 999px;
    background-color: #161A1D;
    color: var(--white);
    font-size: 34px;
    cursor: pointer;
    border: 1px solid #2b2f33;
}

.carousel-btn:hover {
    background-color: var(--primary);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: none;
    background-color: #555;
    cursor: pointer;
}

.carousel-dot.active {
    width: 26px;
    background-color: var(--primary);
}

/* ================= NEWS ADMIN ================= */

.news-admin-card {
    overflow: hidden;
}

.admin-news-image {
    height: 150px;
    border-radius: 14px;
    margin-bottom: 16px;
    background-size: cover;
    background-position: center;
    background-color: #0B090A;
}

.admin-news-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 42px;
}

.news-admin-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .news-carousel {
        grid-template-columns: 1fr;
    }

    .carousel-btn {
        display: none;
    }

    .news-slide {
        grid-template-columns: 1fr;
    }

    .news-image {
        min-height: 220px;
    }

    .home-hero h1 {
        font-size: 34px;
    }

    .news-content h3 {
        font-size: 24px;
    }
}


/* ================= HOME SOCIAL CARD ================= */

.home-social-card {
    background: linear-gradient(145deg, #161A1D, #1f2428);
    border: 1px solid #2b2f33;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
}

.social-card-header h2 {
    color: var(--white);
    font-size: 30px;
    margin: 0 0 10px;
}

.social-card-header p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

.social-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #0B090A;
    border: 1px solid #2b2f33;
    border-radius: 18px;
    padding: 18px;
    text-decoration: none;
    transition: 0.2s ease;
}

.social-link-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    background: linear-gradient(145deg, #0B090A, #2b1012);
}

.social-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background-color: rgba(229, 56, 59, 0.18);
    border: 1px solid var(--primary);
    color: var(--white);
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link-card span {
    display: block;
    color: #999;
    font-size: 13px;
    margin-bottom: 4px;
}

.social-link-card strong {
    color: var(--white);
    font-size: 20px;
}

.instagram-card:hover .social-icon {
    background-color: var(--primary);
}

/* ================= LOGO ================= */

.logo-with-image {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
}

.logo-with-image span {
    font-weight: bold;
}


/* ================= LOGO RECTANGULAR ================= */

.site-logo-rectangular {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-with-image {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-left .logo {
    padding: 0;
}

.site-logo-rectangular {
    height: 56px;
}

@media (max-width: 768px) {
    .site-logo-rectangular {
        height: 38px;
    }
}

/* ================= HERO LOGO ACTIONS ================= */

.hero-actions-with-logo {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-mini-logo {
    width: 95px;
    height: auto;
    object-fit: contain;
    display: block;
}

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

@media (max-width: 600px) {
    .hero-actions-with-logo {
        align-items: center;
    }

    .hero-mini-logo {
        width: 76px;
    }

    .hero-buttons {
        flex: 1;
        min-width: 180px;
    }

    .hero-buttons .primary-action,
    .hero-buttons .secondary-action {
        width: 100%;
        text-align: center;
    }
}

/* ================= SCORE REGISTER CARDS ================= */

.score-entry-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.score-entry-card {
    background: linear-gradient(145deg, #0B090A, #161A1D);
    border: 1px solid #2b2f33;
    border-radius: 16px;
    padding: 18px;
}

.score-entry-title {
    color: var(--white);
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 14px;
}

.score-entry-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.score-entry-card .form-group {
    margin-bottom: 0;
}

.score-entry-card label {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    margin-bottom: 6px;
}

.score-entry-card select,
.score-entry-card input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border-radius: 8px;
}

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

    .score-entry-fields {
        grid-template-columns: 1fr;
    }

    .score-entry-card {
        padding: 16px;
    }

    .score-form .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .score-form .form-actions .auth-btn,
    .score-form .form-actions .secondary-action {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}


/* ================= USER LIST MOBILE CARDS ================= */

.user-mobile-list {
    display: none;
}

.desktop-table {
    display: block;
}

@media (max-width: 768px) {
    .desktop-table {
        display: none;
    }

    .user-mobile-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .user-mobile-card {
        background: linear-gradient(145deg, #161A1D, #1d2226);
        border: 1px solid #2b2f33;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    }

    .user-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
    }

    .user-mobile-name {
        font-size: 17px;
    }

    .user-mobile-header p {
        margin: 5px 0 0;
        color: var(--text-light);
        font-size: 13px;
        word-break: break-word;
    }

    .user-mobile-info {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 12px;
    }

    .user-mobile-info div {
        background-color: #0B090A;
        border-radius: 12px;
        padding: 10px;
    }

    .user-mobile-info span {
        display: block;
        color: #999;
        font-size: 11px;
        margin-bottom: 4px;
    }

    .user-mobile-info strong {
        color: var(--white);
        font-size: 13px;
    }

    .user-mobile-actions {
        margin-top: 14px;
    }

    .user-mobile-actions .small-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ================= PLAYER PROFILE MOBILE FRIENDLY ================= */

.profile-history-mobile {
    display: none;
}

.desktop-table {
    display: block;
}

@media (max-width: 768px) {
    .league-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .league-header .primary-action {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .profile-filters {
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        min-width: 70px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .profile-stat-card {
        padding: 14px;
    }

    .profile-stat-card strong {
        font-size: 24px;
    }

    .score-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-wrapper {
        height: 240px;
        max-height: 240px;
    }

    .desktop-table {
        display: none;
    }

    .profile-history-mobile {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .profile-history-card {
        background: linear-gradient(145deg, #0B090A, #161A1D);
        border: 1px solid #2b2f33;
        border-radius: 16px;
        padding: 16px;
    }

    .profile-history-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
    }

    .history-date {
        display: block;
        color: #999;
        font-size: 12px;
        margin-bottom: 5px;
    }

    .profile-history-top h3 {
        margin: 0;
        font-size: 17px;
        color: var(--white);
    }

    .placement-pill {
        background-color: rgba(229, 56, 59, 0.18);
        border: 1px solid var(--primary);
        color: var(--white);
        font-weight: bold;
        border-radius: 999px;
        padding: 7px 11px;
        white-space: nowrap;
    }

    .profile-history-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }

    .profile-history-grid div {
        background-color: #161A1D;
        border-radius: 12px;
        padding: 10px;
    }

    .profile-history-grid span {
        display: block;
        color: #999;
        font-size: 11px;
        margin-bottom: 4px;
    }

    .profile-history-grid strong {
        color: var(--white);
        font-size: 14px;
    }

    .final-score-box {
        grid-column: 1 / -1;
    }

    .final-score-box strong {
        font-size: 22px;
    }

    .history-detail-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

@media (max-width: 420px) {
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-history-grid {
        grid-template-columns: 1fr;
    }

    .final-score-box {
        grid-column: auto;
    }
}

/* ================= RANKING MOBILE FRIENDLY ================= */

.ranking-mobile-list {
    display: none;
}

@media (max-width: 768px) {
    .ranking-mobile-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ranking-mobile-card {
        background: linear-gradient(145deg, #0B090A, #161A1D);
        border: 1px solid #2b2f33;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    }

    .ranking-mobile-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        align-items: center;
        margin-bottom: 14px;
    }

    .ranking-position {
        width: 42px;
        height: 42px;
        border-radius: 999px;
        background-color: rgba(229, 56, 59, 0.18);
        border: 1px solid var(--primary);
        color: var(--white);
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ranking-player-info {
        min-width: 0;
    }

    .ranking-player-name {
        display: block;
        font-size: 17px;
        margin-bottom: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ranking-player-info span {
        color: #999;
        font-size: 12px;
    }

    .ranking-total {
        color: var(--white);
        font-size: 24px;
        font-weight: bold;
        text-align: right;
    }

    .ranking-mobile-stats {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

    .ranking-mobile-stats div {
        background-color: #161A1D;
        border-radius: 12px;
        padding: 10px 6px;
        text-align: center;
    }

    .ranking-mobile-stats span {
        display: block;
        color: #999;
        font-size: 11px;
        margin-bottom: 4px;
    }

    .ranking-mobile-stats strong {
        color: var(--white);
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .ranking-mobile-header {
        grid-template-columns: auto 1fr;
    }

    .ranking-total {
        grid-column: 1 / -1;
        text-align: left;
        background-color: #161A1D;
        border-radius: 12px;
        padding: 10px;
        font-size: 22px;
    }

    .ranking-total::before {
        content: "Total: ";
        color: #999;
        font-size: 13px;
        font-weight: normal;
    }

    .ranking-mobile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ================= GAME LOG RESPONSIVE ================= */

.game-log-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(360px, 1fr));
    gap: 22px;
}

.game-log-card {
    min-width: 0;
}

.mini-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.mini-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.mini-placement {
    color: var(--text-light);
    font-weight: bold;
    flex: 0 0 auto;
}

.mini-player-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-score {
    flex: 0 0 auto;
    min-width: 56px;
    text-align: right;
    color: var(--white);
}

@media (max-width: 850px) {
    .game-log-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .game-log-card {
        padding: 18px;
    }

    .mini-result-row {
        gap: 10px;
    }

    .mini-player-name {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }

    .mini-score {
        min-width: 48px;
    }

    .league-actions .small-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ================= LEAGUE BANNERS ================= */

.league-banner {
    width: 100%;
    min-height: 260px;
    margin-bottom: 24px;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #2b2f33;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.league-banner-overlay {
    min-height: 260px;
    padding: 32px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    background: linear-gradient(
        to top,
        rgba(11, 9, 10, 0.92),
        rgba(11, 9, 10, 0.35),
        rgba(11, 9, 10, 0.08)
    );
}

.league-banner-overlay h2 {
    color: var(--white);
    font-size: 34px;
    margin: 0 0 8px;
}

.league-banner-overlay p {
    color: var(--text-soft);
    max-width: 720px;
    margin: 0;
    line-height: 1.5;
}

.league-card-banner {
    height: 140px;
    margin: -22px -22px 18px;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-bottom: 1px solid #2b2f33;
}

@media (max-width: 768px) {
    .league-banner {
        min-height: 180px;
        border-radius: 16px;
        margin-bottom: 18px;
    }

    .league-banner-overlay {
        min-height: 180px;
        padding: 20px;
    }

    .league-banner-overlay h2 {
        font-size: 24px;
    }

    .league-banner-overlay p {
        font-size: 14px;
    }

    .league-card-banner {
        height: 110px;
        margin: -18px -18px 16px;
    }
}



/* ================= RESOURCES ================= */

.resource-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 22px;
}

.resource-card {
    background: linear-gradient(145deg, #161A1D, #1d2226);
    border: 1px solid #2b2f33;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.resource-image {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: #0B090A;
}

.resource-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 58px;
}

.resource-content {
    padding: 20px;
}

.resource-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.resource-content h2 {
    color: var(--white);
    margin: 0 0 10px;
    font-size: 22px;
}

.resource-content p {
    color: var(--text-light);
    line-height: 1.5;
}

.resource-open-btn {
    margin-top: 14px;
}

@media (max-width: 768px) {
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .resource-image {
        height: 140px;
    }

    .resource-filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .resource-filters .filter-btn {
        text-align: center;
    }
}

.email-link {
    color: var(--accent);
    font-weight: bold;
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}