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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', Arial, sans-serif;
    background: #1c1c1e;
    color: #f0f0f0;
    min-height: 100vh;
}

.app { max-width: 860px; margin: 0 auto; }

/* NAV */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #232325;
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}
.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo img { width: 24px; height: 24px; object-fit: contain; }
.nav-logo span { font-size: 14px; font-weight: 500; }
.nav-links { display: flex; gap: 6px; }
.nav-btn {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.nav-btn.active, .nav-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,0.5); }
.avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: #3a3a3c;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 500; color: #fff;
}
.logout-link { color: rgba(255,255,255,0.3); font-size: 12px; text-decoration: none; }
.logout-link:hover { color: rgba(255,255,255,0.6); }
.discord-login-btn {
    background: #5865F2;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}
.discord-server-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(88,101,242,0.15);
    color: #7289da;
    border: 0.5px solid rgba(88,101,242,0.3);
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}
.discord-server-btn:hover { background: rgba(88,101,242,0.25); color: #fff; }

/* HERO */
.hero {
    padding: 20px 0 12px;
    background: #232325;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
}
.hero .hero-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hero h1 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 2px; }
.hero-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 4px; font-weight: 500; letter-spacing: 0.02em; }
.hero-info { font-size: 12px; color: rgba(255,255,255,0.4); }
.gu-logo { height: 52px; width: 52px; object-fit: contain; opacity: 0.9; flex-shrink: 0; }

/* STATS */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 12px 24px 0;
    position: sticky;
    top: 49px;
    z-index: 9;
    background: #1c1c1e;
}
.stat {
    background: #2c2c2e;
    border: 0.5px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 10px 16px;
}
.stat-num { font-size: 20px; font-weight: 500; }
.stat-label { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* TOURNAMENT PREDICTIONS */
.deadline-badge {
    font-size: 10px;
    color: rgba(255,200,50,0.8);
    background: rgba(255,200,50,0.1);
    border: 0.5px solid rgba(255,200,50,0.25);
    padding: 2px 8px;
    border-radius: 5px;
    margin-left: 8px;
    vertical-align: middle;
}

.tournament-card {
    margin: 0 16px 12px;
    background: #2c2c2e;
    border: 0.5px solid rgba(255,200,50,0.2);
    border-radius: 10px;
    overflow: hidden;
}

.tournament-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
}
.tournament-row:last-child { border-bottom: none; }

.tournament-label { display: flex; flex-direction: column; gap: 2px; }
.tournament-title { font-size: 13px; font-weight: 500; }
.tournament-pts {
    font-size: 10px;
    color: #ffc832;
    font-weight: 500;
}

.tournament-input {
    background: #3a3a3c;
    border: 0.5px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #f0f0f0;
    font-size: 13px;
    padding: 6px 10px;
    min-width: 180px;
    cursor: pointer;
}
.tournament-input:focus { outline: none; border-color: rgba(255,200,50,0.5); }
.tournament-input option { background: #2c2c2e; }

.tournament-input-num {
    width: 100px;
    background: #3a3a3c;
    border: 0.5px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #f0f0f0;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    text-align: center;
    -moz-appearance: textfield;
}
.tournament-input-num::-webkit-outer-spin-button,
.tournament-input-num::-webkit-inner-spin-button { -webkit-appearance: none; }
.tournament-input-num:focus { outline: none; border-color: rgba(255,200,50,0.5); }
.tournament-input-num:disabled,
.tournament-input:disabled {
    opacity: 0.5;
    cursor: default;
}

.tournament-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #232325;
    border-top: 0.5px solid rgba(255,255,255,0.06);
    gap: 12px;
    flex-wrap: wrap;
}
.tournament-info { font-size: 11px; color: rgba(255,255,255,0.35); }

/* TOOLBAR */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 115px;
    z-index: 9;
    background: #1c1c1e;
}
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-btn.active, .filter-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* SECTION LABEL */
.section-label {
    padding: 12px 24px 6px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* MATCHES */
.matches { padding: 0 16px 4px; }

.match {
    background: #2c2c2e;
    border: 0.5px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 10px 16px;
    display: grid;
    grid-template-columns: 1fr 220px 72px;
    align-items: center;
    gap: 0;
    margin-bottom: 5px;
}
.match.needs-prediction {
    border-color: rgba(255,200,50,0.4);
    background: #2e2c24;
}
.match.prediction-saved {
    border-color: rgba(96,165,250,0.2);
    background: #232830;
}
.match.match-played {
    border-color: rgba(74,222,128,0.2);
    background: #1e2923;
}
.match.match-locked {
    border-color: rgba(255,255,255,0.05);
    background: #252525;
    opacity: 0.7;
}

.match-teams { display: flex; align-items: center; padding-right: 16px; }
.team { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; flex: 1; }
.team.away { justify-content: flex-end; }
.flag-img {
    width: 22px; height: 15px;
    object-fit: cover;
    border-radius: 2px;
    border: 0.5px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.vs { font-size: 10px; color: rgba(255,255,255,0.25); padding: 0 10px; flex-shrink: 0; }

.score-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-left: 0.5px solid rgba(255,255,255,0.06);
    border-right: 0.5px solid rgba(255,255,255,0.06);
    padding: 4px 16px;
    overflow: hidden;
}
.score-row {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
}
.score-label {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    text-align: right;
    padding-right: 10px;
    white-space: nowrap;
}
.score-values { display: flex; align-items: center; gap: 5px; }

.score-num {
    width: 32px; height: 28px;
    background: #1a1a1c;
    border: 0.5px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}

.score-input {
    width: 32px; height: 28px;
    background: #3a3a3c;
    border: 0.5px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 14px; font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:focus { outline: none; border-color: rgba(255,255,255,0.4); }
.score-input:disabled {
    background: #2a2a2c;
    color: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.07);
    cursor: default;
}
.score-input.empty {
    background: #3d3820;
    border: 1px solid rgba(255,200,50,0.5);
    color: #ffc832;
}
.score-input.empty::placeholder { color: rgba(255,200,50,0.35); }
.score-input.editing {
    background: #3a3a3c;
    border-color: rgba(255,200,50,0.5);
    color: #ffc832;
}
.score-dash { font-size: 12px; color: rgba(255,255,255,0.2); }

.pts-row { display: grid; grid-template-columns: 58px auto; align-items: center; }
.pts { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 5px; white-space: nowrap; display: inline-block; }
.pts-3 { color: #4ade80; background: rgba(74,222,128,0.1); border: 0.5px solid rgba(74,222,128,0.25); }
.pts-2 { color: #60a5fa; background: rgba(96,165,250,0.1); border: 0.5px solid rgba(96,165,250,0.25); }
.pts-1 { color: #fbbf24; background: rgba(251,191,36,0.1); border: 0.5px solid rgba(251,191,36,0.25); }
.pts-0 { color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); border: 0.5px solid rgba(255,255,255,0.08); }

.match-right {
    display: flex; flex-direction: column; align-items: flex-end;
    justify-content: center; gap: 4px; padding-left: 12px; height: 100%;
}
.match-date { font-size: 10px; color: rgba(255,255,255,0.3); text-align: right; line-height: 1.6; }
.lock-label { font-size: 10px; color: rgba(255,255,255,0.25); }
.todo-badge {
    font-size: 10px; color: rgba(255,200,50,0.8);
    background: rgba(255,200,50,0.1); border: 0.5px solid rgba(255,200,50,0.25);
    padding: 2px 6px; border-radius: 5px;
}
.saved-badge {
    font-size: 10px; color: rgba(100,220,100,0.8);
    background: rgba(100,220,100,0.08); border: 0.5px solid rgba(100,220,100,0.2);
    padding: 2px 6px; border-radius: 5px;
}
.edit-btn {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
}
.edit-btn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }

/* SAVE BAR */
.save-btn-main {
    background: #f0f0f0;
    color: #1c1c1e;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
.save-btn-main:hover { background: #d8d8d8; }
.save-btn-main:disabled { opacity: 0.6; cursor: default; }

/* LEADERBOARD */
.leaderboard-wrap { padding: 0 20px 24px; }
.lb-table { display: flex; flex-direction: column; gap: 4px; }
.lb-header {
    display: grid;
    grid-template-columns: 32px 1fr 60px 70px 70px 60px;
    padding: 8px 16px;
    font-size: 10px; color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.lb-row {
    display: grid;
    grid-template-columns: 32px 1fr 60px 70px 70px 60px;
    padding: 12px 16px;
    background: #2c2c2e;
    border: 0.5px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    font-size: 13px; align-items: center;
}
.lb-first { border-color: rgba(255,200,50,0.3); background: #2e2c24; }
.lb-rank { color: rgba(255,255,255,0.35); font-size: 11px; }
.lb-pts { font-weight: 500; color: #ffc832; }
.empty-msg { padding: 32px; text-align: center; color: rgba(255,255,255,0.3); font-size: 13px; }

/* HOW TO PLAY */
.howtoplay-wrap { padding: 20px 24px 40px; max-width: 680px; }
.howtoplay-section { margin-bottom: 32px; }
.howtoplay-section h2 { font-size: 20px; font-weight: 500; margin-bottom: 10px; letter-spacing: -0.01em; }
.howtoplay-section h3 { font-size: 15px; font-weight: 500; margin-bottom: 10px; color: #f0f0f0; }
.howtoplay-section p { font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.7; margin-bottom: 8px; }
.howtoplay-section ul { padding-left: 20px; margin-top: 8px; }
.howtoplay-section ul li { font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.8; }
.howtoplay-section strong { color: #f0f0f0; }

.points-table { background: #2c2c2e; border: 0.5px solid rgba(255,255,255,0.07); border-radius: 10px; overflow: hidden; }
.points-row { display: grid; grid-template-columns: 1fr auto; padding: 10px 16px; align-items: center; border-bottom: 0.5px solid rgba(255,255,255,0.06); font-size: 13px; color: rgba(255,255,255,0.65); }
.points-row:last-child { border-bottom: none; }
.points-row-header { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.08em; background: #232325; }

.commands-table { background: #2c2c2e; border: 0.5px solid rgba(255,255,255,0.07); border-radius: 10px; overflow: hidden; }
.command-row { display: grid; grid-template-columns: auto 1fr; padding: 10px 16px; align-items: center; gap: 16px; border-bottom: 0.5px solid rgba(255,255,255,0.06); font-size: 13px; color: rgba(255,255,255,0.65); }
.command-row:last-child { border-bottom: none; }
.command-name { font-family: monospace; background: #3a3a3c; color: #ffc832; padding: 3px 8px; border-radius: 5px; font-size: 12px; white-space: nowrap; }

/* Floating save button op mobiel */
.floating-save {
    display: none;
}
.desktop-save {
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    position: fixed;
    bottom: 32px;
    right: calc(50% - 430px);
    z-index: 100;
    background: #f0f0f0;
    color: #1c1c1e;
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.desktop-save:hover { background: #d8d8d8; }
.desktop-save:disabled { opacity: 0.6; }

.back-to-top {
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    position: fixed;
    bottom: 32px;
    left: calc(50% - 430px);
    z-index: 100;
    background: #2c2c2e;
    color: #f0f0f0;
    border: 0.5px solid rgba(255,255,255,0.15);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.back-to-top:hover { background: #3a3a3c; }

@media (min-width: 601px) {
    .desktop-save { display: block; }
    .back-to-top { display: block; }
}
@media (max-width: 600px) {
    .floating-save {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 16px;
        z-index: 100;
        background: #f0f0f0;
        color: #1c1c1e;
        border: none;
        padding: 12px 20px;
        border-radius: 24px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
        transition: background 0.15s;
    }
    .floating-save:disabled { opacity: 0.6; }
}

/* MOBILE */
@media (max-width: 600px) {
    html, body { overflow-x: hidden; width: 100%; }

    .nav {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .nav-logo span { font-size: 12px; }
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 4px;
    }
    .nav-btn { padding: 4px 10px; font-size: 11px; }
    .nav-right { gap: 6px; }
    .discord-server-btn span { display: none; }
    .discord-login-btn { font-size: 11px; padding: 5px 10px; }

    .hero { padding: 12px 0 10px; }
    .hero .hero-inner { padding: 0 12px; }
    .hero h1 { font-size: 17px; }
    .hero-info { font-size: 11px; }
    .gu-logo { height: 38px; width: 38px; }

    .stats {
        padding: 8px 12px;
        gap: 4px;
    }
    .stat { padding: 8px 10px; }
    .stat-num { font-size: 18px; }
    .stat-label { font-size: 9px; }

    /* Sticky toolbar op mobiel */
    .toolbar {
        position: sticky;
        top: 82px;
        z-index: 9;
        background: #1c1c1e;
        padding: 8px 12px;
        border-bottom: 0.5px solid rgba(255,255,255,0.06);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    .filter-bar { gap: 4px; }
    .filter-btn { padding: 4px 8px; font-size: 10px; }
    .save-btn-main { padding: 6px 12px; font-size: 11px; border-radius: 16px; }

    /* Wedstrijden op mobiel — verticale layout */
    .matches { padding: 0 8px 4px; }

    .match {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    /* Teams bovenaan op volle breedte */
    .match-teams {
        display: flex;
        align-items: center;
        padding-right: 0;
        width: 100%;
    }
    .team {
        font-size: 13px;
        flex: 1;
        white-space: normal;
        overflow: visible;
        max-width: none;
    }
    .team.away { justify-content: flex-end; }
    .flag-img { width: 20px; height: 13px; }
    .vs { padding: 0 8px; font-size: 10px; }

    /* Scores en datum op één rij */
    .match-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .score-col {
        border-left: none;
        border-right: none;
        padding: 0;
        flex: 1;
        gap: 4px;
        overflow: visible;
    }
    .score-row {
        grid-template-columns: 44px 1fr;
    }
    .score-label { font-size: 9px; padding-right: 6px; }
    .score-num { width: 28px; height: 26px; font-size: 13px; }
    .score-input { width: 28px; height: 26px; font-size: 13px; }
    .score-dash { font-size: 11px; }

    .pts-row { grid-template-columns: 44px auto; }
    .pts { font-size: 10px; padding: 2px 6px; }

    .match-right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-left: 0;
        height: auto;
        width: 100%;
    }
    .match-date { font-size: 10px; text-align: right; }
    .lock-label { font-size: 10px; }
    .todo-badge { font-size: 10px; }
    .saved-badge { font-size: 10px; }

    .section-label { padding: 10px 12px 4px; }

    /* Tournament */
    .tournament-card { margin: 0 8px 12px; }
    .tournament-row { grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; }
    .tournament-input { min-width: 100%; width: 100%; }
    .tournament-input-num { width: 100%; }
    .tournament-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
    .tournament-footer .save-btn-main { width: 100%; text-align: center; border-radius: 8px; }

    /* Leaderboard */
    .leaderboard-wrap { padding: 0 12px 24px; }
    .lb-header { grid-template-columns: 28px 1fr 50px 55px; padding: 6px 10px; }
    .lb-row { grid-template-columns: 28px 1fr 50px 55px; padding: 10px 10px; font-size: 12px; }
    .lb-header span:nth-child(5),
    .lb-header span:nth-child(6),
    .lb-row span:nth-child(5),
    .lb-row span:nth-child(6) { display: none; }

    /* How to play */
    .howtoplay-wrap { padding: 14px 12px 32px; }
    .command-row { grid-template-columns: 1fr; gap: 4px; }
    .points-row { font-size: 12px; }
}