/* =========================================================
   BASE
   ========================================================= */
:root {
    --vc-bg: #eef3fb;
    --vc-card: #ffffff;
    --vc-border: #dbe3f0;
    --vc-text: #1f2937;
    --vc-muted: #6b7280;
    --vc-blue-1: #114aa6;
    --vc-blue-2: #0d47a1;
    --vc-blue-3: #1d4ed8;
    --vc-green: #198754;
    --vc-red: #dc3545;
    --vc-yellow: #ffc107;
    --vc-gray: #6c757d;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--vc-bg);
    color: var(--vc-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

a {
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-weight: 700;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
}

/* =========================================================
   LAYOUT SHELL
   ========================================================= */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: #dfe5ee;
}

.main-shell {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-shell {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.25rem;
}

/* =========================================================
   SHARED SIDEBAR / TOPBAR THEME
   ========================================================= */
.desktop-sidebar,
.mobile-drawer,
.mobile-topbar {
    color: #e2e8f0;
    background: linear-gradient(180deg, #111827 0%, #0f172a 45%, #020617 100%);
}

/* =========================================================
   DESKTOP SIDEBAR
   ========================================================= */
.desktop-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 30;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, #111827 0%, #0f172a 45%, #020617 100%) !important;
}

    /* verhindert altes Lila auf inneren Bereichen */
    .desktop-sidebar .nav-wrapper,
    .desktop-sidebar .nav-main,
    .desktop-sidebar .nav-scroll,
    .desktop-sidebar .nav-legal {
        background: transparent !important;
    }

/* =========================================================
   BRANDING
   ========================================================= */
.sidebar-top,
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-top {
    justify-content: center;
}

.sidebar-brand {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 1.42rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

    .sidebar-brand:hover {
        text-decoration: none;
    }

.brand-main,
.brand-live {
    color: #f8fafc;
}

.brand-dot {
    margin: 0 0.03em;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* =========================================================
   NAV STRUCTURE
   ========================================================= */
.nav-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.nav-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 0.5rem 1rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.nav-section-title {
    padding: 0.75rem 0.9rem 0.4rem;
    color: rgba(203, 213, 225, 0.65);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =========================================================
   NAV ITEMS
   ========================================================= */
.nav-link,
.nav-link-button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.8rem 0.9rem;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: #cbd5e1;
    text-align: left;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .nav-link:hover,
    .nav-link-button:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #f8fafc;
        text-decoration: none;
    }

    .nav-link.active,
    .nav-link-button.active {
        background: rgba(56, 189, 248, 0.14);
        color: #7dd3fc;
        border-color: rgba(56, 189, 248, 0.18);
        font-weight: 600;
    }

.nav-link-button {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font: inherit;
    outline: none;
    box-shadow: none;
}

.nav-icon {
    width: 22px;
    min-width: 22px;
    text-align: center;
    font-size: 1rem;
}

.nav-form {
    margin: 0;
    width: 100%;
}

    .nav-form button,
    .nav-form .nav-link-button {
        width: 100%;
        border: 1px solid transparent !important;
        border-radius: 14px;
        background: transparent !important;
        color: #cbd5e1 !important;
        box-shadow: none !important;
    }

        .nav-form button:hover,
        .nav-form .nav-link-button:hover {
            background: rgba(255, 255, 255, 0.06) !important;
            color: #f8fafc !important;
        }

/* =========================================================
   LEGAL LINKS
   ========================================================= */
.nav-legal {
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.85rem 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.nav-legal-link {
    padding: 0.2rem 0.2rem;
    color: #94a3b8;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

    .nav-legal-link:hover,
    .nav-legal-link.active {
        color: #e2e8f0;
        text-decoration: none;
    }

/* =========================================================
   MOBILE TOPBAR
   ========================================================= */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    min-height: 60px;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-topbar-title {
    color: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .mobile-topbar-title.brand-inline {
        display: inline-flex;
        align-items: baseline;
        text-decoration: none;
        font-family: Inter, "Segoe UI", Arial, sans-serif;
        font-size: 1.08rem;
        font-weight: 700;
        letter-spacing: -0.03em;
        line-height: 1;
    }

        .mobile-topbar-title.brand-inline:hover {
            text-decoration: none;
        }

/* =========================================================
   MOBILE DRAWER
   ========================================================= */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 60;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
}

    .mobile-drawer.open {
        transform: translateX(0);
    }

.mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

    .mobile-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

/* =========================================================
   MOBILE BUTTONS
   ========================================================= */
.mobile-menu-toggle,
.mobile-drawer-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .mobile-menu-toggle:hover,
    .mobile-drawer-close:hover {
        background: rgba(56, 189, 248, 0.12);
        color: #7dd3fc;
    }

/* =========================================================
   GENERIC UI
   ========================================================= */
.card {
    background: var(--vc-card);
    border: 1px solid var(--vc-border);
    border-radius: 18px;
    box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.04);
}

    .card .card-body {
        padding: 1.25rem;
    }

    .card .card-header {
        padding: 0.95rem 1.1rem;
        background: #f5f7fb;
        border-bottom: 1px solid #e5e7eb;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        font-weight: 600;
    }

.btn {
    border-radius: 12px;
}

.btn-sm {
    border-radius: 10px;
}

.badge {
    padding: 0.45em 0.7em;
    border-radius: 999px;
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 12px;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    font-size: 0.96rem;
}

    .table td,
    .table th {
        vertical-align: middle;
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

.table-hover tbody tr:hover {
    background-color: #f7f9fc;
}

/* =========================================================
   DASHBOARD / HOME
   ========================================================= */
.dashboard-grid,
.home-dashboard-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-card,
.home-dashboard-card {
    height: 100%;
}

.dashboard-top-grid,
.home-top-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.dashboard-bottom-grid,
.home-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-card-header,
.home-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-title-small,
.home-title-small {
    color: var(--vc-muted);
    font-size: 0.95rem;
}

/* =========================================================
   VIEWER TOURNAMENT
   ========================================================= */
.viewer-tournament-page {
    max-width: 100%;
}

.viewer-tournament-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.viewer-round-column-wrapper .card-header {
    padding: 0.9rem 1rem;
    font-size: 1.05rem;
}

.viewer-rounds-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    overflow: visible;
    padding-bottom: 0;
}

.viewer-round-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    align-items: start;
}

.viewer-round-column {
    min-width: 0;
}

.viewer-round-card {
    height: 100%;
}

.viewer-round-matches {
    display: grid;
    gap: 0.9rem;
}

.match-card {
    border-width: 2px;
    border-radius: 18px;
}

    .match-card .card-body {
        padding: 1rem;
    }

.match-player-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid #ececec;
}

    .match-player-row:last-child {
        border-bottom: none;
    }

.match-player-name {
    min-width: 0;
    word-break: break-word;
    font-size: 1rem;
    line-height: 1.25;
}

.match-player-score {
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.match-player-row.winner .match-player-name,
.match-player-row.winner .match-player-score {
    color: var(--vc-green);
    font-weight: 700;
}

.match-player-row.loser {
    opacity: 0.78;
}

.live-match-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #1f2937;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
}

.tournament-standings-card .table {
    font-size: 0.96rem;
}

/* Desktop: möglichst viele Durchgänge nebeneinander */
@media (min-width: 1200px) {
    .viewer-round-columns {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

/* Tablet + Handy quer: 2 Spalten */
@media (max-width: 1199px) and (min-width: 769px) {
    .viewer-round-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Handy hoch: 1 Spalte */
@media (max-width: 768px), (max-width: 950px) and (orientation: portrait) {
    .viewer-round-columns {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   LIVE MATCHES OVERVIEW
   ========================================================= */
.live-match-card {
    border-width: 2px;
    border-radius: 20px;
    box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.04);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

    .live-match-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.6rem 1.2rem rgba(0, 0, 0, 0.08);
    }

.live-match-card-open {
    border-color: #f1c40f;
}

.live-match-card-running {
    border-color: var(--vc-red);
}

.live-match-card-paused {
    border-color: var(--vc-gray);
}

.live-match-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.live-match-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.live-match-status-open {
    background: #fff3cd;
    color: #8a6d00;
}

.live-match-status-running {
    background: var(--vc-red);
    color: white;
}

.live-match-status-paused {
    background: var(--vc-gray);
    color: white;
}

.live-match-tournament-name {
    margin-top: 0.9rem;
    color: var(--vc-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.live-match-score {
    color: #111827;
    font-size: 2.7rem;
    line-height: 1;
    font-weight: 800;
    text-align: center;
}

.live-match-scoreboard {
    display: grid;
    gap: 1rem;
}

.live-match-scoreboard-score {
    color: #111827;
    font-size: 3.1rem;
    line-height: 1;
    font-weight: 800;
    text-align: center;
}

.live-match-scoreboard-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: start;
}

.live-match-scoreboard-player {
    min-height: 2.6em;
    color: #111827;
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
}

.live-match-scoreboard-player-left {
    text-align: left;
}

.live-match-scoreboard-player-right {
    text-align: right;
}

.live-match-players {
    display: grid;
    gap: 0.45rem;
}

.live-match-player {
    color: #111827;
    font-size: 1.1rem;
    line-height: 1.2;
    font-weight: 700;
}

.live-match-footer {
    color: var(--vc-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* =========================================================
   LIVE SCORING (billard.live Theme)
   ========================================================= */
.live-match-page {
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 1.25rem;
    border-radius: 22px;
    background: linear-gradient(180deg, #111827 0%, #0f172a 45%, #020617 100%);
    color: #f8fafc;
}

.live-match-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-header-left {
    text-align: left;
}

.live-header-center {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.live-header-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.live-match-tournament {
    font-size: 2rem;
    font-weight: 700;
}

.live-match-subtitle {
    color: rgba(248, 250, 252, 0.72);
    font-size: 1.1rem;
}

.live-score-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.live-player-card {
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
    color: #f8fafc;
}

.live-player-name {
    margin-bottom: 0.75rem;
    font-size: 2.25rem;
    font-weight: 700;
}

.live-player-handicap {
    margin-bottom: 1.5rem;
    color: rgba(248, 250, 252, 0.72);
    font-size: 1.15rem;
}

.live-score-number {
    margin: 2.5rem 0;
    font-size: 10rem;
    line-height: 1;
    font-weight: 800;
}

.live-score-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: auto;
}

.live-score-btn {
    min-width: 95px;
    min-height: 75px;
    font-size: 2rem;
    font-weight: 700;
}

    .live-score-btn.btn-primary {
        background-color: #0ea5e9;
        border-color: #0ea5e9;
    }

        .live-score-btn.btn-primary:hover {
            background-color: #0284c7;
            border-color: #0284c7;
        }

.live-match-page .alert-info {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.live-match-page .alert-danger {
    background: rgba(220, 53, 69, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

/* =========================================================
   TOURNAMENTS / PLAYERS / FORMS
   ========================================================= */
.tournaments-create-card .card-body,
.tournaments-table-card .card-body {
    padding: 1.25rem;
}

.participants-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.5rem 1rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--vc-border);
    border-radius: 14px;
    background: #f8fafc;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0;
    font-size: 0.95rem;
}

    .participant-item input {
        margin: 0;
    }

.participant-rating {
    color: var(--vc-muted);
    font-size: 0.9rem;
}

.players-actions,
.match-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

    .players-actions .btn,
    .match-actions .btn {
        white-space: nowrap;
    }

/* =========================================================
   TOURNAMENT DETAILS
   ========================================================= */
.tournament-details-page {
    max-width: 100%;
}

.tournament-hero-card {
    border-width: 2px;
}

.tournament-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.tournament-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.tournament-stat-box {
    padding: 1rem;
    border: 1px solid var(--vc-border);
    border-radius: 16px;
    background: #f8fafc;
}

.tournament-stat-label {
    margin-bottom: 0.35rem;
    color: var(--vc-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tournament-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.tournament-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tournament-round-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-player-cell {
    font-weight: 500;
}

.match-score-input {
    width: 74px;
}

.match-row-live {
    background: rgba(220, 53, 69, 0.07);
}

.match-row-paused {
    background: rgba(108, 117, 125, 0.08);
}

/* =========================================================
   SEASON RANKING
   ========================================================= */
.season-ranking-page {
    max-width: 100%;
}

.season-ranking-hero-card {
    border-width: 2px;
}

.season-ranking-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.season-ranking-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.season-ranking-summary-box {
    min-width: 110px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--vc-border);
    border-radius: 16px;
    background: #f8fafc;
}

.season-ranking-summary-label {
    margin-bottom: 0.25rem;
    color: var(--vc-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.season-ranking-summary-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.season-player-link {
    font-weight: 500;
}

.season-ranking-table tbody tr.ranking-top4 {
    background: rgba(25, 135, 84, 0.12);
}

.season-ranking-table tbody tr.ranking-top8 {
    background: rgba(255, 193, 7, 0.18);
}

/* =========================================================
   PLAYER HISTORY
   ========================================================= */
.player-history-page {
    max-width: 100%;
}

.player-history-hero-card {
    border-width: 2px;
}

.player-history-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-history-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.player-history-summary-box {
    min-width: 130px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--vc-border);
    border-radius: 16px;
    background: #f8fafc;
}

.player-history-summary-label {
    margin-bottom: 0.25rem;
    color: var(--vc-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.player-history-summary-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.player-history-tournament-card {
    border-width: 1px;
}

.player-history-tournament-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-history-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.player-history-stat-box {
    padding: 0.9rem 1rem;
    border: 1px solid var(--vc-border);
    border-radius: 16px;
    background: #f8fafc;
}

.player-history-stat-label {
    margin-bottom: 0.3rem;
    color: var(--vc-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.player-history-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
}

/* =========================================================
   RESPONSIVE TABLES
   ========================================================= */
@media (max-width: 1024px) {
    .season-ranking-table th:nth-child(6),
    .season-ranking-table td:nth-child(6),
    .season-ranking-table th:nth-child(8),
    .season-ranking-table td:nth-child(8) {
        display: none;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .season-ranking-table th:nth-child(4),
    .season-ranking-table td:nth-child(4),
    .season-ranking-table th:nth-child(5),
    .season-ranking-table td:nth-child(5),
    .season-ranking-table th:nth-child(6),
    .season-ranking-table td:nth-child(6),
    .season-ranking-table th:nth-child(7),
    .season-ranking-table td:nth-child(7),
    .season-ranking-table th:nth-child(8),
    .season-ranking-table td:nth-child(8) {
        display: none;
    }
}

@media (max-width: 1024px) {
    .tournament-standings-card th:nth-child(5),
    .tournament-standings-card td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .tournament-standings-card th:nth-child(4),
    .tournament-standings-card td:nth-child(4),
    .tournament-standings-card th:nth-child(5),
    .tournament-standings-card td:nth-child(5),
    .tournament-standings-card th:nth-child(6),
    .tournament-standings-card td:nth-child(6) {
        display: none;
    }
}

.season-ranking-table th,
.season-ranking-table td,
.tournament-standings-card th,
.tournament-standings-card td {
    white-space: nowrap;
}

    .season-ranking-table td:nth-child(2),
    .season-ranking-table th:nth-child(2),
    .tournament-standings-card td:nth-child(2),
    .tournament-standings-card th:nth-child(2) {
        white-space: normal;
    }

/* =========================================================
   RESPONSIVE LAYOUT / MOBILE / TABLET
   ========================================================= */
@media (max-width: 1024px) {
    .dashboard-top-grid,
    .home-top-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-bottom-grid,
    .home-bottom-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 991.98px) {
    .desktop-sidebar {
        display: none !important;
    }

    .mobile-topbar {
        display: flex !important;
    }

    .main-shell,
    .content-shell {
        width: 100%;
        min-width: 0;
    }

    .content-shell {
        padding: 1rem;
    }

    .mobile-drawer {
        display: flex;
    }
}

@media (min-width: 992px) {
    .mobile-topbar,
    .mobile-drawer,
    .mobile-backdrop {
        display: none !important;
    }

    .desktop-sidebar {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .content-shell {
        padding: 0.85rem;
    }

    .card {
        border-radius: 16px;
    }

        .card .card-body {
            padding: 1rem;
        }

    h3 {
        font-size: 2rem;
        line-height: 1.1;
    }

    h4 {
        font-size: 1.35rem;
    }

    h5 {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.95rem;
    }

    .btn-sm {
        padding: 0.4rem 0.65rem;
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.8rem;
    }

    .season-ranking-summary,
    .player-history-summary,
    .tournament-stats-grid,
    .player-history-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .season-ranking-summary-box,
    .player-history-summary-box,
    .tournament-stat-box,
    .player-history-stat-box {
        min-width: 0;
        padding: 0.75rem;
    }

    .table {
        font-size: 0.92rem;
    }

        .table td,
        .table th {
            padding-top: 0.65rem;
            padding-bottom: 0.65rem;
            padding-left: 0.45rem;
            padding-right: 0.45rem;
        }

    .viewer-tournament-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-card .card-body {
        padding: 0.9rem;
    }

    .match-player-row {
        gap: 0.5rem;
        padding: 0.35rem 0;
    }

    .match-player-name {
        font-size: 0.96rem;
    }

    .match-player-score {
        font-size: 1.2rem;
    }

    .live-match-card .card-body {
        padding: 0.9rem;
    }

    .live-match-score {
        font-size: 2.1rem;
    }

    .live-match-scoreboard-score {
        font-size: 2.4rem;
    }

    .live-match-player,
    .live-match-scoreboard-player {
        font-size: 1rem;
    }

    .match-actions {
        gap: 0.35rem;
    }

        .match-actions .btn {
            padding: 0.35rem 0.55rem;
            font-size: 0.8rem;
        }

    .match-score-input {
        width: 62px;
    }

    .participants-box {
        grid-template-columns: 1fr;
        max-height: 220px;
    }

    .participant-item {
        font-size: 0.92rem;
    }

    .dashboard-bottom-grid,
    .home-bottom-grid {
        grid-template-columns: 1fr;
    }

    .live-match-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .live-header-left,
    .live-header-right {
        justify-content: center;
        text-align: center;
    }

    .live-score-layout {
        grid-template-columns: 1fr;
    }

    .live-player-card {
        min-height: 0;
        padding: 1.5rem 1rem;
    }

    .live-player-name {
        font-size: 1.6rem;
    }

    .live-player-handicap {
        font-size: 1rem;
    }

    .live-score-number {
        font-size: 4.5rem;
        margin: 1.5rem 0;
    }

    .live-score-btn {
        min-width: 78px;
        min-height: 62px;
        font-size: 1.55rem;
    }
}

/* Landscape phone / small height */
@media (max-width: 950px) and (orientation: landscape) {
    .content-shell {
        padding: 0.7rem;
    }

    .match-card .card-body {
        padding: 0.8rem;
    }

    .match-player-row {
        gap: 0.4rem;
        padding: 0.28rem 0;
    }

    .match-player-name {
        font-size: 0.92rem;
    }

    .match-player-score {
        font-size: 1.05rem;
    }

    .match-card .badge {
        padding: 0.28rem 0.55rem;
        font-size: 0.72rem;
    }
}

/* Very small devices */
@media (max-width: 480px) {
    .content-shell {
        padding: 0.6rem;
    }

    h3 {
        font-size: 1.7rem;
    }

    .card .card-body {
        padding: 0.85rem;
    }

    .season-ranking-summary,
    .player-history-summary,
    .tournament-stats-grid,
    .player-history-stats-grid {
        grid-template-columns: 1fr;
    }

    .live-match-tournament {
        font-size: 1.35rem;
    }

    .live-match-subtitle {
        font-size: 0.95rem;
    }

    .live-match-header {
        padding: 1rem;
    }

    .live-player-card {
        min-height: 0;
        padding: 1.2rem 0.9rem;
    }

    .live-player-name {
        font-size: 1.25rem;
    }

    .live-score-number {
        font-size: 3.3rem;
    }

    .live-score-btn {
        min-width: 72px;
        min-height: 58px;
        font-size: 1.5rem;
    }

    .live-match-score {
        font-size: 1.85rem;
    }

    .live-match-scoreboard-score {
        font-size: 2rem;
    }

    .match-player-name {
        font-size: 0.92rem;
    }

    .match-player-score {
        font-size: 1.1rem;
    }

    .match-card .card-body {
        padding: 0.8rem;
    }
}
