
:root {
    --bg-1: #0b120d;
    --bg-2: #152419;
    --panel: rgba(14, 25, 16, 0.96);
    --panel-soft: rgba(255,255,255,0.035);
    --border: rgba(255,255,255,0.10);
    --text: #ffffff;
    --muted: rgba(255,255,255,0.66);
    --green: #b8ef54;
    --green-soft: #d7ff75;
    --danger: #ff7676;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background-color: #17251a;    
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 30%, #26382a 0%, var(--bg-2) 42%, var(--bg-1) 100%);
}

.account-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    width: min(94%, 980px);
    margin: 0 auto;
    padding: 18px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.topbar a {
    color: var(--green-soft);
    text-decoration: none;
    font-weight: 700;
}

.topbar a:hover {
    text-decoration: underline;
}

.account-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px 42px;
}

.account-card {
    width: min(94vw, 460px);
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.38);
}

.account-card h1 {
    margin: 0 0 8px;
    font-size: 30px;
    text-align: center;
    color: var(--green-soft);        
}

.account-card .lead {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.5;
    text-align: center;    
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(255,255,255,0.78);
}

.form-row input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 11px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.28);
    color: #fff;
    outline: none;
    font-size: 16px;
}

.form-row input:focus {
    border-color: rgba(184,239,84,0.62);
    box-shadow: 0 0 0 3px rgba(184,239,84,0.08);
}

.form-help {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.btn-primary {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--green);
    color: #13210e;
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.06);
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 11px;
    line-height: 1.45;
}

.alert-error {
    color: #ffd6d6;
    background: rgba(255, 80, 80, 0.10);
    border: 1px solid rgba(255, 118, 118, 0.24);
}

.alert-success {
    color: #eaffc1;
    background: rgba(184,239,84,0.08);
    border: 1px solid rgba(184,239,84,0.22);
}

.account-links {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.account-links a {
    color: var(--green-soft);
    font-weight: 700;
    text-decoration: none;
}

.account-links a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .topbar {
        padding-top: 12px;
        text-align: center;
        font-size: 13px;
    }

    .account-main {
        align-items: flex-start;
        padding-top: 24px;
    }

    .account-card {
        padding: 22px 17px;
    }

    .account-card h1 {
        font-size: 26px;
    }
}


/* =====================================================
   ŽEBŘÍČEK
   ===================================================== */

.leaderboard-card {
    width: min(96vw, 860px);
}

.leaderboard-head {
    display: block;

    text-align: center;

    margin-bottom: 18px;
}

.leaderboard-head h1 {
    margin: 0 0 6px;
    color: var(--green-soft);
    text-align: center;
}

.leaderboard-head .lead {
    margin: 0;

    text-align: center;
}

.leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
   justify-content: center;     
    gap: 7px;
    margin: 0 0 18px;
   justify-content: center;   
}

.leaderboard-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(184,239,84,0.18);
    background: rgba(184,239,84,0.06);
    color: var(--green-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.leaderboard-tab:hover {
    background: rgba(184,239,84,0.11);
}

.leaderboard-tab.active {
    background: var(--green);
    color: #13210e;
    border-color: var(--green);
}

.leaderboard-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(0,0,0,0.18);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    text-align: center;
    white-space: nowrap;
}

.leaderboard-table th {
    color: var(--green-soft);
    font-size: 12px;
    letter-spacing: 0.3px;
    background: rgba(255,255,255,0.025);
}

.leaderboard-table td {
    font-size: 13px;
    color: rgba(255,255,255,0.86);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.leaderboard-table tbody tr.me {
    background: rgba(184,239,84,0.07);
}

.rank-cell {
    width: 52px;
    font-weight: 900;
    color: var(--green-soft) !important;
}

.player-cell {
    font-weight: 800;
    color: #fff !important;
}

.score-cell {
    font-weight: 900;
    color: var(--green) !important;
}

.when-cell {
    color: rgba(255,255,255,0.58) !important;
    font-size: 12px !important;
    line-height: 1.25;
    text-align: center;
}

.empty-state {
    padding: 26px 16px;
    text-align: center;
    color: var(--muted);
}

.leaderboard-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Sloupec PC / Mobil */
.col-device {
    text-align: center !important;
    white-space: nowrap;
}

/* Na užším displeji zařízení schováme, aby nevznikal vodorovný posuvník. */
@media (max-width: 760px) {
    .leaderboard-table .col-device {
        display: none;
    }
}

@media (max-width: 600px) {
    .leaderboard-card {
        width: calc(100vw - 16px);
        padding-left: 12px;
        padding-right: 12px;
    }

    .leaderboard-head {
        display: block;
    }

    .leaderboard-tabs {
        gap: 5px;
    }

    .leaderboard-tab {
        flex: 1 1 calc(50% - 5px);
        padding-left: 8px;
        padding-right: 8px;
    }
}


/* Užší okna: tabulka se má zmenšit, ne vytvořit vodorovný posuvník. */
@media (max-width: 760px) {

    .leaderboard-table-wrap {
        overflow-x: hidden;
    }

    .leaderboard-table {
        width: 100%;
        table-layout: fixed;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 9px 5px;
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .leaderboard-table th:nth-child(1),
    .leaderboard-table td:nth-child(1) {
        width: 11%;
        text-align: center;
    }

    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) {
        width: 36%;
    }

    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) {
        width: 13%;
        text-align: center;
    }

    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4) {
        width: 12%;
        text-align: center;
    }

    .leaderboard-table th:nth-child(7),
    .leaderboard-table td:nth-child(7) {
        width: 11%;
        text-align: center;
    }

    .leaderboard-table th:nth-child(8),
    .leaderboard-table td:nth-child(8) {
        width: 17%;
    }

    /*
     * Na úzkém displeji schováme dva pomocné tie-break sloupce.
     * Pořadí se podle nich stále počítá na serveru, jen se nezobrazují.
     */
    .leaderboard-table .col-protectors,
    .leaderboard-table .col-misses {
        display: none;
    }

    .when-cell {
        white-space: normal !important;
        line-height: 1.25;
    }

    .leaderboard-note {
        font-size: 11px;
    }
}

@media (max-width: 500px) {

    .leaderboard-card {
        width: calc(100vw - 10px);
        padding: 16px 10px 18px;
        border-radius: 16px;
    }

    .leaderboard-head {
        margin-bottom: 12px;
    }

    .leaderboard-head h1 {
        font-size: 25px;
    }

    .leaderboard-head .lead {
        margin-bottom: 0;
        font-size: 13px;
    }

    .leaderboard-tabs {
        margin-bottom: 12px;
    }

    .leaderboard-tab {
        min-height: 32px;
        font-size: 12px;
        padding: 6px 8px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px;
        font-size: 10px;
    }

    .player-cell {
        font-size: 11px !important;
    }

    .score-cell {
        font-size: 11px !important;
    }

    .when-cell {
        font-size: 9px !important;
    }
}

/* =====================================================
   LOGO MARYJANE.LEGAL
   Používá se např. nahoře v žebříčku.
   ===================================================== */

.maryjane-logo-link {
    display: block;

    width: fit-content;

    margin:
        0 auto 16px;

    line-height: 0;

    text-decoration: none;
}


.maryjane-logo {
    display: block;

    width:
        min(70vw, 280px);

    height: auto;

    margin:
        0 auto;

    object-fit:
        contain;
}

.logogamexzone {
    display: block;

    width:
        min(40vw, 160px);

    height: auto;

    margin:
        0 auto;

    object-fit:
        contain;
}


@media (max-width: 600px) {

    .maryjane-logo {
        width:
            min(68vw, 230px);
    }
    
    .logogamexzone {
        width:
            min(30vw, 140px);
    }

}


/* =====================================================
   STRÁNKOVÁNÍ – ŽEBŘÍČEK A HISTORIE HER
   ===================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 18px 0 4px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(184,239,84,0.18);
    border-radius: 999px;
    background: rgba(184,239,84,0.06);
    color: var(--green-soft);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.pagination-btn:hover {
    background: rgba(184,239,84,0.11);
}

.pagination-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pagination-info {
    color: var(--muted);
    font-size: 12px;
}

.pagination-info strong {
    color: var(--green-soft);
}


/* =====================================================
   ODKAZY POD ŽEBŘÍČKEM
   ===================================================== */

.leaderboard-links {
    line-height: 1.8;
}

.link-separator {
    display: inline-block;
    margin: 0 7px;
    color: rgba(255,255,255,0.32);
}


/* =====================================================
   HISTORIE VŠECH ODEHRANÝCH HER
   ===================================================== */

.history-card {
    width: min(97vw, 980px);
}

.history-summary {
    margin: 0 0 14px;
    padding: 9px 12px;
    border: 1px solid rgba(184,239,84,0.12);
    border-radius: 11px;
    background: rgba(184,239,84,0.045);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.history-summary strong {
    color: var(--green-soft);
}

.accuracy-cell {
    font-weight: 800;
    color: #d7ff75 !important;
}

@media (max-width: 760px) {

    .history-table .col-protectors,
    .history-table .col-misses,
    .history-table .col-device {
        display: none;
    }

    .history-table th,
    .history-table td {
        padding: 9px 4px;
    }

    .history-table .col-accuracy {
        width: 18%;
    }

    .history-table .col-when {
        width: 25%;
    }
}

@media (max-width: 500px) {

    .history-card {
        width: calc(100vw - 10px);
        padding: 16px 10px 18px;
    }

    .history-table .col-combo {
        display: none;
    }

    .pagination {
        gap: 6px;
    }

    .pagination-btn {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .pagination-info {
        width: 100%;
        order: -1;
        text-align: center;
    }

    .leaderboard-links .link-separator {
        display: none;
    }

    .leaderboard-links a {
        display: block;
    }
}

/* =====================================================
   ŽEBŘÍČEK – VLASTNÍ ČASOVÉ OBDOBÍ
   ===================================================== */

.custom-period-wrap {
    margin: -8px 0 18px;
    text-align: center;
}

.custom-period-toggle {
    border: 1px solid rgba(184,239,84,0.18);
    cursor: pointer;
    font-family: inherit;
}

.custom-period-panel {
    display: none;
    margin: 10px auto 0;
    padding: 12px;
    border: 1px solid rgba(184,239,84,0.14);
    border-radius: 14px;
    background: rgba(0,0,0,0.18);
}

.custom-period-panel.open {
    display: block;
}

.custom-period-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.custom-period-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-period-label {
    color: var(--green-soft);
    font-size: 12px;
    font-weight: 900;
}

.custom-date-input,
.custom-hour-select {
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 9px;
    outline: none;
    background: rgba(255,255,255,0.055);
    color: #fff;
    font: inherit;
    font-size: 13px;
}

.custom-date-input {
    width: 142px;
    cursor: pointer;
}

.custom-hour-select {
    width: 78px;
    cursor: pointer;
}

.custom-hour-select option {
    background: #17251a;
    color: #fff;
}

.custom-date-input:focus,
.custom-hour-select:focus {
    border-color: rgba(184,239,84,0.48);
    box-shadow: 0 0 0 2px rgba(184,239,84,0.08);
}

.custom-period-submit {
    min-height: 36px;
    padding: 7px 16px;
    border: 0;
    border-radius: 9px;
    background: var(--green);
    color: #13210e;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
}

.custom-period-submit:hover {
    filter: brightness(1.07);
}

.custom-period-error {
    margin-top: 9px;
    color: #ff9c68;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 600px) {
    .custom-period-wrap {
        margin-top: -4px;
        margin-bottom: 12px;
    }

    .custom-period-toggle {
        width: 100%;
    }

    .custom-period-panel {
        padding: 10px 7px;
    }

    .custom-period-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .custom-period-group {
        display: grid;
        grid-template-columns: 26px minmax(0, 1fr) 76px;
        width: 100%;
    }

    .custom-date-input,
    .custom-hour-select {
        width: 100%;
        min-width: 0;
        font-size: 12px;
    }

    .custom-period-submit {
        width: 100%;
    }
}


/* =====================================================
   NÁVOD KE HŘE
   ===================================================== */

.guide-main {
    width: 100%;
    padding: 28px 16px 48px;
}

.guide-card {
    width: min(96vw, 980px);
    margin: 0 auto;
    padding: 30px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.38);
}

.guide-head { text-align: center; }
.guide-head h1 { margin: 0 0 10px; color: var(--green-soft); font-size: 32px; }
.guide-head p { max-width: 720px; margin: 0 auto; color: var(--muted); line-height: 1.55; }
.guide-head strong { color: #fff; }

.guide-head-logo {
    display: block;

    width:
        min(72vw, 270px);

    height: auto;

    margin:
        0 auto;

    object-fit:
        contain;
}


/* Na mobilu logo trochu menší */
.mode-mobile .guide-head-logo {
    width:
        min(68vw, 230px);
}

.guide-callout {
    max-width: 760px; margin: 24px auto 30px; padding: 14px 18px;
    border: 1px solid rgba(184,239,84,0.20); border-radius: 13px;
    background: rgba(184,239,84,0.07); color: rgba(255,255,255,0.82);
    text-align: center; line-height: 1.5;
}
.guide-callout strong { color: var(--green-soft); }

.guide-section { margin-top: 34px; }
.guide-section h2 { margin: 0 0 8px; text-align: center; color: var(--green-soft); font-size: 23px; }
.guide-section-text { max-width: 760px; margin: 0 auto 18px; text-align: center; color: var(--muted); line-height: 1.5; }

.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.guide-grid-protectors { grid-template-columns: repeat(2, minmax(0, 250px)); justify-content: center; }
.guide-creature {
    min-width: 0; padding: 16px 12px; border: 1px solid rgba(255,255,255,0.09);
    border-radius: 15px; background: rgba(255,255,255,0.035); text-align: center;
}
.guide-creature-golden {
    border-color: rgba(255,211,74,0.42);
    background: radial-gradient(circle at 50% 30%, rgba(255,215,72,0.14), rgba(255,255,255,0.035) 66%);
}
.guide-image-wrap { height: 105px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.guide-image-wrap img { max-width: 160px; max-height: 100px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 7px 8px rgba(0,0,0,0.32)); }
.guide-creature-golden .guide-image-wrap img { max-width: 172px; max-height: 110px; filter: drop-shadow(0 0 9px rgba(255,207,44,0.34)) drop-shadow(0 7px 8px rgba(0,0,0,0.32)); }
.guide-creature h3 { margin: 4px 0 5px; font-size: 17px; color: #fff; }
.guide-creature p { margin: 8px auto 0; max-width: 250px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.guide-points { color: var(--green-soft); font-size: 15px; font-weight: 900; }
.guide-points-special { color: #ffd95a; font-size: 17px; text-shadow: 0 0 12px rgba(255,217,90,0.28); }
.guide-points-bad { color: #ff8b8b; }

.guide-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; max-width: 780px; margin: 18px auto 0; }
.guide-rule-grid > div { padding: 14px; border-radius: 12px; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.07); }
.guide-rule-grid strong { display: block; margin-bottom: 5px; color: var(--green-soft); font-size: 13px; }
.guide-rule-grid span { color: var(--muted); font-size: 13px; line-height: 1.45; }

.guide-finish { text-align: center; }
.guide-finish p { max-width: 720px; margin: 0 auto 18px; color: var(--muted); line-height: 1.5; }
.guide-play-btn {
    display: inline-flex; min-height: 46px; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 12px; background: var(--green); color: #13210e;
    text-decoration: none; font-weight: 900;
}
.guide-play-btn:hover { filter: brightness(1.06); }

@media (max-width: 760px) {
    .guide-main { padding: 22px 8px 34px; }
    .guide-card { width: calc(100vw - 12px); padding: 22px 12px; border-radius: 16px; }
    .guide-head h1 { font-size: 26px; }
    .guide-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
    .guide-grid-protectors { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .guide-image-wrap { height: 90px; }
    .guide-image-wrap img { max-width: 130px; max-height: 84px; }
    .guide-creature-golden .guide-image-wrap img { max-width: 145px; max-height: 94px; }
    .guide-creature { padding: 13px 7px; }
    .guide-rule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .guide-card { padding-left: 8px; padding-right: 8px; }
    .guide-creature h3 { font-size: 15px; }
    .guide-image-wrap { height: 78px; }
    .guide-image-wrap img { max-width: 112px; max-height: 74px; }
    .guide-creature-golden .guide-image-wrap img { max-width: 126px; max-height: 80px; }
}

.site-copyright {
    padding: 18px 12px 14px;
    text-align: center;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.6;
}
