/* Tebak Skor Premium Vanilla CSS */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #f8fafc;
    /* Clean light slate grey-white background */
    --bg-card: #ffffff;
    /* Pure white card backgrounds */
    --bg-input: #f1f5f9;
    /* Light grey inputs */
    --border-color: rgba(15, 23, 42, 0.08);
    /* Soft slate border */

    --primary: #2563eb;
    /* Professional Royal Blue */
    --primary-glow: rgba(37, 99, 235, 0.08);
    --success: #10b981;
    /* Emerald Green */
    --success-glow: rgba(16, 185, 129, 0.08);
    --warning: #d97706;
    /* Contrast Warning Amber */
    --warning-glow: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    /* Red */
    --danger-glow: rgba(220, 38, 38, 0.08);
    --info: #0891b2;
    /* Cyan/Teal Accent */
    --info-glow: rgba(8, 145, 178, 0.08);
    --purple: #7c3aed;
    /* Purple */
    --purple-glow: rgba(124, 58, 237, 0.08);

    --text-main: #0f172a;
    /* High contrast deep slate text */
    --text-muted: #475569;
    /* Slate grey text */
    --text-dark: #64748b;
    /* Slate border/icon labels */

    --font-outfit: 'Outfit', sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;

    --box-shadow-premium: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 16px -6px rgba(15, 23, 42, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-outfit);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
    background-color: rgba(37, 99, 235, 0.05);
}

.nav-item.active {
    border-left: 2px solid var(--primary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

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

/* Main Content Wrapper */
main {
    flex: 1;
    padding: 40px 0;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success);
    color: #fff;
    box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn:active {
    transform: translateY(0);
}

/* Cards & Layout Grid */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-normal);
    box-shadow: var(--box-shadow-premium);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 23, 42, 0.15);
}

.stat-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-info .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.blue {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.stat-icon.green {
    background-color: var(--success-glow);
    color: var(--success);
}

.stat-icon.warning {
    background-color: var(--warning-glow);
    color: var(--warning);
}

.stat-icon.purple {
    background-color: var(--purple-glow);
    color: var(--purple);
}

.stat-icon.danger {
    background-color: var(--danger-glow);
    color: var(--danger);
}

/* Dashboard Content Grid */
.grid-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

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

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 26px;
    box-shadow: var(--box-shadow-premium);
    margin-bottom: 30px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Match Cards */
.match-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-card {
    background-color: rgba(15, 23, 42, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition-fast);
}

.match-card:hover {
    background-color: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.12);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.match-date-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-teams-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.match-team {
    flex: 1;
    font-weight: 600;
    font-size: 1.05rem;
}

.match-team.home {
    text-align: right;
}

.match-team.away {
    text-align: left;
}

.match-versus {
    font-size: 0.8rem;
    color: var(--text-dark);
    font-weight: 700;
    text-transform: uppercase;
    background-color: rgba(15, 23, 42, 0.05);
    padding: 4px 10px;
    border-radius: 30px;
}

.match-scores-final {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 800;
    background-color: rgba(15, 23, 42, 0.05);
    padding: 6px 16px;
    border-radius: var(--border-radius-sm);
    letter-spacing: 2px;
}

.match-score-separator {
    color: var(--text-dark);
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(15, 23, 42, 0.04);
    padding-top: 14px;
    margin-top: 4px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-draft {
    background-color: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.badge-open {
    background-color: var(--success-glow);
    color: var(--success);
}

.badge-locked {
    background-color: var(--warning-glow);
    color: var(--warning);
}

.badge-finished {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.badge-calculated {
    background-color: var(--purple-glow);
    color: var(--purple);
}

.badge-cancelled {
    background-color: var(--danger-glow);
    color: var(--danger);
}

.badge-user {
    background-color: var(--success-glow);
    color: var(--success);
}

.badge-admin {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.badge-import {
    background-color: var(--purple-glow);
    color: var(--purple);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.score-prediction-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.score-prediction-input input {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    text-align: center;
    font-weight: 800;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-outfit);
}

.score-prediction-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    outline: none;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 16px 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

td {
    padding: 16px 20px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.03);
    color: var(--text-main);
}

tr:hover td {
    background-color: rgba(15, 23, 42, 0.01);
}

.ranking-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-1 {
    background-color: #ffd700;
    color: #000;
}

.rank-2 {
    background-color: #c0c0c0;
    color: #000;
}

.rank-3 {
    background-color: #cd7f32;
    color: #fff;
}

.rank-other {
    background-color: rgba(15, 23, 42, 0.06);
    color: var(--text-muted);
}

/* Alerts / Notifications */
.alert {
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: var(--success-glow);
    color: var(--success);
    border-left-color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background-color: var(--danger-glow);
    color: var(--danger);
    border-left-color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Legal framing specific styles */
.rules-container {
    max-width: 800px;
    margin: 0 auto;
}

.rules-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--box-shadow-premium);
}

.rules-card h2 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.rules-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
}

.rules-highlight {
    background-color: rgba(59, 130, 246, 0.04);
    border: 1px dashed var(--primary);
    border-radius: var(--border-radius-md);
    padding: 24px;
    margin: 24px 0;
}

.rules-highlight p {
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: 500;
}

.rules-highlight p:last-child {
    margin-bottom: 0;
}

.rules-list {
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.rules-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Auth Pages Specific */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--box-shadow-premium);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Footer Styling */
footer {
    background-color: #f1f5f9;
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: auto;
}

footer p {
    margin-bottom: 6px;
}

/* Pagination UI */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    row-gap: 8px;
    margin-top: 24px;
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.pagination li a:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background-color: var(--primary-glow);
}

.pagination li.active span {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination li.disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mini Audit Note in history */
.audit-notice {
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: rgba(59, 130, 246, 0.05);
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary);
    margin-top: 10px;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-10 {
    gap: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-10 {
    margin-top: 10px;
}

/* Interactive Tabs Styling */
.tabs-container {
    display: inline-flex;
    background-color: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: 30px;
    margin-bottom: 24px;
    gap: 6px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 24px;
    color: var(--text-muted);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 30px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-main);
    background-color: rgba(15, 23, 42, 0.05);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--info));
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.tab-count {
    background-color: rgba(15, 23, 42, 0.08);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    transition: var(--transition-fast);
}

.tab-btn.active .tab-count {
    background-color: rgba(255, 255, 255, 0.25);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Participant Recap Links */
.participant-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.participant-link:hover {
    color: var(--info);
    text-decoration: underline;
}

/* Live score custom style rules */
.badge-live-pulse {
    background-color: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.live-dot-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.live-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.live-match-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--box-shadow-premium);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.live-match-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 15px 30px -10px rgba(15, 23, 42, 0.08);
}

.live-match-card.active-live {
    border-color: rgba(220, 38, 38, 0.3);
}

.live-match-card.active-live::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--danger);
}

.live-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.live-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.live-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.15rem;
}

.live-team-name {
    color: var(--text-main);
}

.live-team-score {
    font-size: 1.6rem;
    font-weight: 800;
    background-color: var(--bg-input);
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.live-match-card.active-live .live-team-score {
    background-color: var(--danger-glow);
    color: var(--danger);
}

.live-card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.live-status-badge {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.75rem;
}

/* --- Medium Desktop/Tablet Responsive (769px - 1150px) --- */
@media (max-width: 1150px) and (min-width: 769px) {
    .nav-links {
        gap: 12px;
    }
    .nav-item {
        font-size: 0.82rem;
        padding: 6px 10px;
    }
    .logo {
        font-size: 1.15rem;
    }
    .nav-auth span {
        display: none !important;
    }
}

/* --- Mobile Responsive Enhancements (Screen width < 768px) --- */
@media (max-width: 768px) {

    /* Hide top nav links and user name label on mobile top header */
    header nav,
    .nav-auth span {
        display: none !important;
    }

    .navbar {
        height: 56px;
        justify-content: space-between;
    }

    /* Make logout button in header compact */
    .nav-auth {
        margin-left: auto;
    }

    .nav-auth form button {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    /* Reduce body layout padding to avoid whitespace wastage */
    main {
        padding-top: 20px !important;
        padding-bottom: 90px !important;
        /* extra bottom padding for bottom nav */
    }

    .container {
        padding: 0 20px;
    }

    /* --- Page Header (flex row to column on mobile) --- */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 18px;
    }

    .page-title h1 {
        font-size: 1.3rem;
    }

    .page-title p {
        font-size: 0.85rem;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- Cards --- */
    .card {
        padding: 14px;
        margin-bottom: 18px;
        border-radius: var(--border-radius-sm);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 14px;
    }

    .card-header h2 {
        font-size: 1.1rem;
    }

    .auth-card {
        padding: 24px 16px;
    }

    /* --- Tabs Container (scrollable on mobile) --- */
    .tabs-container {
        display: flex !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 18px;
        padding: 4px;
        gap: 4px;
    }

    .tabs-container::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* --- Transform match list tables (public pages) into card blocks --- */
    #tab-content-today table,
    #tab-content-upcoming table,
    #tab-content-finished table,
    .tab-content table {
        display: block;
        width: 100%;
    }

    .tab-content thead {
        display: none !important;
    }

    .tab-content tbody {
        display: block;
        width: 100%;
    }

    .tab-content tr {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        padding: 16px 14px;
        margin-bottom: 12px;
        background-color: var(--bg-card);
        box-shadow: var(--box-shadow-premium);
        text-align: center;
        transition: var(--transition-fast);
    }

    .tab-content tr:hover {
        transform: translateY(-2px);
    }

    .tab-content td {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: 4px 0 !important;
        text-align: center !important;
    }

    .tab-content td:last-child {
        padding-bottom: 0 !important;
    }

    /* Kickoff Date Cell */
    .tab-content td:nth-child(1) {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    /* Teams vs Team Cell */
    .tab-content td:nth-child(2) {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-main);
        margin-bottom: 8px;
    }

    /* Score Result Cell */
    .tab-content td:nth-child(3) {
        font-size: 1.3rem;
        font-weight: 800;
        letter-spacing: 1px;
        background-color: var(--bg-input);
        display: inline-block !important;
        width: auto !important;
        padding: 5px 20px !important;
        border-radius: var(--border-radius-sm);
        margin: 0 auto;
        color: var(--primary);
    }

    /* --- Standings Table (keep as table but compact) --- */
    .table-responsive table {
        min-width: 100%;
        table-layout: fixed;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 10px 4px !important;
        font-size: 0.78rem !important;
    }

    /* Column-specific widths on mobile to prevent squishing */
    .standings-table th:nth-child(1),
    .standings-table td:nth-child(1) {
        width: 45px !important;
        min-width: 45px !important;
        max-width: 45px !important;
        text-align: center !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    .standings-table th:nth-child(2),
    .standings-table td:nth-child(2) {
        width: auto !important;
        max-width: 200px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .standings-table th:nth-child(3),
    .standings-table td:nth-child(3),
    .standings-table th:nth-child(4),
    .standings-table td:nth-child(4),
    .standings-table th:nth-child(5),
    .standings-table td:nth-child(5),
    .standings-table th:nth-child(6),
    .standings-table td:nth-child(6),
    .standings-table th:nth-child(7),
    .standings-table td:nth-child(7) {
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        text-align: center !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    .standings-table th:nth-child(8),
    .standings-table td:nth-child(8) {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        text-align: center !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    .ranking-badge {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }

    /* Shorten standings table headers < 480px */
    @media (max-width: 480px) {
        .standings-table th {
            font-size: 0 !important;
            padding: 8px 3px !important;
        }

        .standings-table th::after {
            font-size: 0.75rem !important;
            display: inline-block !important;
            font-weight: 700;
            text-align: center !important;
        }

        .standings-table th:nth-child(1)::after {
            content: "#";
        }

        .standings-table th:nth-child(2)::after {
            content: "Nama";
        }

        .standings-table th:nth-child(3)::after {
            content: "🗳️";
        }

        .standings-table th:nth-child(4)::after {
            content: "⏳";
        }

        .standings-table th:nth-child(5)::after {
            content: "🏁";
        }

        .standings-table th:nth-child(6)::after {
            content: "✅";
        }

        .standings-table th:nth-child(7)::after {
            content: "❌";
        }

        .standings-table th:nth-child(8)::after {
            content: "⭐";
        }

        .standings-table th:nth-child(2),
        .standings-table td:nth-child(2) {
            max-width: 115px !important;
        }
    }

    /* --- Match Card Layout (User match list, Admin match list) --- */
    .match-card {
        padding: 14px;
        gap: 12px;
    }

    .match-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .match-date-time {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 0.8rem;
    }

    .match-date-time span[style*="margin-left"] {
        margin-left: 0 !important;
    }

    .match-teams-score {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    .match-team {
        font-size: 1rem;
    }

    .match-team.home,
    .match-team.away {
        text-align: center;
    }

    .match-scores-final {
        font-size: 1.5rem;
        padding: 4px 14px;
    }

    .match-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }

    .match-footer>div {
        width: 100%;
        text-align: center;
    }

    .match-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .match-footer div[style*="display: flex"] {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .match-footer div[style*="display: flex"] .btn {
        width: 100%;
    }

    /* --- Prediction History & Recap Tables → Card Layout --- */
    .table-responsive:not(.standings-table) table {
        display: block;
        width: 100%;
    }

    .table-responsive:not(.standings-table) thead {
        display: none !important;
    }

    .table-responsive:not(.standings-table) tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .table-responsive:not(.standings-table) tr {
        display: flex;
        flex-wrap: wrap;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        padding: 14px;
        background-color: var(--bg-card);
        box-shadow: var(--box-shadow-premium);
        gap: 4px 10px;
        align-items: center;
    }

    .table-responsive:not(.standings-table) td {
        border: none !important;
        padding: 3px 0 !important;
        font-size: 0.85rem !important;
    }

    /* First column (Match name) takes full width as card title */
    .table-responsive:not(.standings-table) td:first-child {
        width: 100% !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid var(--border-color) !important;
        margin-bottom: 4px;
    }

    /* All other tds flow as flex items */
    .table-responsive:not(.standings-table) td:not(:first-child) {
        flex: 1 1 auto;
        text-align: center !important;
        min-width: 0;
    }

    /* Audit notice inside prediction history */
    .audit-notice {
        font-size: 0.75rem;
        padding: 8px 10px;
        margin-top: 6px;
    }

    /* --- Grid Content (Dashboard 2-column → 1-column) --- */
    .grid-content {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    /* --- Grid Stats --- */
    .grid-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-info h3 {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    .stat-info .stat-value {
        font-size: 1.3rem;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    /* --- Live Score Page --- */
    .live-score-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .live-match-card {
        padding: 16px;
        gap: 12px;
    }

    .live-card-header {
        font-size: 0.8rem;
    }

    .live-team-row {
        font-size: 1rem;
    }

    .live-team-name {
        font-size: 0.95rem;
    }

    .live-team-score {
        font-size: 1.3rem;
        min-width: 40px;
        height: 40px;
    }

    .live-card-footer {
        padding-top: 10px;
        font-size: 0.8rem;
    }

    /* --- Score Prediction Input (Tebak Skor form) --- */
    .score-prediction-input {
        gap: 10px;
    }

    .score-prediction-input input {
        width: 70px;
        height: 70px;
        font-size: 1.6rem;
    }

    /* --- Rules Card --- */
    .rules-card {
        padding: 24px 16px;
    }

    .rules-highlight {
        padding: 12px !important;
        font-size: 0.8rem !important;
    }

    .rules-highlight p {
        margin-bottom: 8px;
    }

    /* --- Buttons --- */
    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* --- Footer --- */
    footer {
        padding: 20px 0 !important;
        padding-bottom: calc(20px + 65px + env(safe-area-inset-bottom, 0px)) !important;
        font-size: 0.8rem;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    /* --- Pagination --- */
    .pagination li a,
    .pagination li span {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Tampilkan maksimal 5 tombol paginasi di mobile: Prev, Pertama, Aktif, Terakhir, Next */
    .pagination li:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none !important;
    }

    /* --- Bottom Navigation Bar (Mobile Only) --- */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 99999 !important;
        box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
        padding-left: 6px;
        padding-right: 6px;

        /* Force hardware GPU acceleration */
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: transform;
    }

    .mobile-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 600;
        gap: 2px;
        transition: var(--transition-fast);
        flex: 1;
        height: 100%;
        position: relative;
        min-width: 0;
    }

    .mobile-nav-link:hover,
    .mobile-nav-link.active {
        color: var(--primary);
    }

    .mobile-nav-icon {
        font-size: 1.2rem;
        transition: transform 0.2s ease;
    }

    .mobile-nav-link.active .mobile-nav-icon {
        transform: scale(1.15);
    }

    /* Active indicator dot */
    .mobile-nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background-color: var(--primary);
    }
}

/* === Extra adjustments for very small screens (width < 400px, e.g. iPhone SE) === */
@media (max-width: 400px) {
    .container {
        padding: 0 16px;
    }

    main {
        padding-top: 14px !important;
        padding-bottom: 85px !important;
    }

    .page-title h1 {
        font-size: 1.15rem;
    }

    .page-title p {
        font-size: 0.78rem;
    }

    .card {
        padding: 12px;
    }

    .card-header h2 {
        font-size: 1rem;
    }

    /* Bottom nav: icon only */
    .mobile-bottom-nav {
        height: 54px;
        height: calc(54px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-nav-link span:not(.mobile-nav-icon) {
        display: none !important;
    }

    .mobile-nav-icon {
        font-size: 1.4rem;
    }

    .mobile-nav-link.active::after {
        bottom: 6px;
    }

    /* Tabs */
    .tab-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Match card content */
    .tab-content tr {
        padding: 12px 10px;
    }

    .tab-content td:nth-child(2) {
        font-size: 0.95rem;
    }

    .tab-content td:nth-child(3) {
        font-size: 1.1rem;
        padding: 4px 14px !important;
    }

    /* Match cards */
    .match-card {
        padding: 12px;
        gap: 10px;
    }

    .match-team {
        font-size: 0.9rem;
    }

    .match-scores-final {
        font-size: 1.3rem;
    }

    /* Grid stats 1 column on very small */
    .grid-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-info h3 {
        font-size: 0.65rem;
    }

    .stat-info .stat-value {
        font-size: 1.15rem;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    /* Score input */
    .score-prediction-input input {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    /* Live cards */
    .live-match-card {
        padding: 14px;
    }

    .live-team-name {
        font-size: 0.85rem;
    }

    .live-team-score {
        font-size: 1.15rem;
        min-width: 36px;
        height: 36px;
    }

    /* Tables in prediction history/recap card */
    .table-responsive:not(.standings-table) td {
        font-size: 0.78rem !important;
    }

    .table-responsive:not(.standings-table) td:first-child {
        font-size: 0.85rem !important;
    }

    /* Buttons */
    .btn {
        padding: 7px 12px;
        font-size: 0.8rem;
    }

    .btn-sm {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    /* Footer */
    footer {
        padding-bottom: calc(18px + 60px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Pagination */
    .pagination li a,
    .pagination li span {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    /* Standings table tighter */
    .table-responsive:not(.standings-table) th,
    .table-responsive:not(.standings-table) td {
        padding: 8px 4px !important;
        font-size: 0.72rem !important;
    }

    .standings-table th {
        font-size: 0 !important;
        padding: 8px 2px !important;
    }

    .standings-table td {
        padding: 8px 2px !important;
        font-size: 0.72rem !important;
    }

    /* Column-specific widths on very small screens to fit perfectly */
    .standings-table th:nth-child(1),
    .standings-table td:nth-child(1) {
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
    }

    .standings-table th:nth-child(2),
    .standings-table td:nth-child(2) {
        max-width: 100px !important;
    }

    .standings-table th:nth-child(3),
    .standings-table td:nth-child(3),
    .standings-table th:nth-child(4),
    .standings-table td:nth-child(4),
    .standings-table th:nth-child(5),
    .standings-table td:nth-child(5),
    .standings-table th:nth-child(6),
    .standings-table td:nth-child(6),
    .standings-table th:nth-child(7),
    .standings-table td:nth-child(7) {
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
    }

    .standings-table th:nth-child(8),
    .standings-table td:nth-child(8) {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }

    .ranking-badge {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
}

/* === Ultra-small screens (width < 340px) === */
@media (max-width: 340px) {
    .container {
        padding: 0 12px;
    }

    .page-title h1 {
        font-size: 1.05rem;
    }

    .match-team {
        font-size: 0.85rem;
    }

    .grid-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        flex-direction: row;
        gap: 12px;
    }

    .standings-table th:nth-child(2),
    .standings-table td:nth-child(2) {
        max-width: 70px !important;
    }
}

/* Hide mobile bottom nav by default on desktop screen sizes */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}