html:has(body.contest-page){
    min-height:100%;
    background:#06121e;
}

body.contest-page{
    min-height:100vh;
    color:#eef6ff;
    background:#06121e;
    position:relative;
    isolation:isolate;
}

body.contest-page::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background:
        radial-gradient(circle at 0% 0%, rgba(255,193,7,.18), transparent 30%),
        radial-gradient(circle at 85% 8%, rgba(37,99,235,.17), transparent 32%),
        linear-gradient(180deg,#071624 0%,#081c2d 48%,#06121e 100%);
    background-repeat:no-repeat;
    background-size:cover;
}

body.contest-page footer,
body.contest-page .site-footer{
    background:transparent;
}

.contest-wrap{
    width:min(1160px, calc(100% - 32px));
    margin:0 auto;
    padding:44px 0 72px;
    position:relative;
    z-index:1;
}

.contest-hero{
    display:grid;
    grid-template-columns:1.1fr .9fr;
    gap:28px;
    align-items:stretch;
}

.contest-kicker{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    padding:8px 13px;
    border-radius:999px;
    background:rgba(255,193,7,.1);
    border:1px solid rgba(255,193,7,.25);
    color:#ffd56a;
    font-size:13px;
    font-weight:900;
    letter-spacing:.02em;
}

.contest-hero h1,
.contest-ranking-only h1{
    margin:16px 0 18px;
    font-size:clamp(38px, 5vw, 68px);
    line-height:.98;
    letter-spacing:-.04em;
    font-weight:950;
    color:#fff;
}

.contest-hero p,
.contest-section-head p{
    margin:0;
    max-width:680px;
    color:rgba(238,246,255,.78);
    font-size:18px;
    line-height:1.7;
}

.contest-prizes{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    margin-top:28px;
}

.contest-prizes div,
.contest-hero__card,
.contest-box,
.contest-my-stats,
.contest-ranking,
.contest-rules,
.contest-empty{
    border:1px solid rgba(255,255,255,.1);
    background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
    box-shadow:0 24px 70px rgba(0,0,0,.24);
    border-radius:26px;
}

.contest-prizes div{padding:20px;}
.contest-prizes-note{margin-top:12px!important;font-size:14px!important;color:rgba(238,246,255,.62)!important;line-height:1.5!important;}
.contest-prizes strong{display:block;color:#ffc107;font-size:13px;text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px;}
.contest-prizes span{display:block;color:#fff;font-size:22px;font-weight:950;line-height:1.12;}

.contest-hero__card{padding:24px;}
.contest-hero__card h2{margin:16px 0 8px;color:#fff;font-size:28px;font-weight:950;}
.contest-hero__card p{color:rgba(238,246,255,.7);font-size:15px;margin-bottom:20px;}

.contest-status{
    display:inline-flex;
    padding:8px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:900;
    background:rgba(148,163,184,.14);
    color:#cbd5e1;
}
.contest-status.is-active{background:rgba(34,197,94,.13);color:#86efac;border:1px solid rgba(34,197,94,.25);}
.contest-status.is-waiting{background:rgba(250,204,21,.14);color:#fde68a;border:1px solid rgba(250,204,21,.28);}
.contest-status.is-ended{background:rgba(239,68,68,.13);color:#fecaca;border:1px solid rgba(239,68,68,.25);}

.contest-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:100%;
    border:0;
    border-radius:999px;
    padding:14px 18px;
    margin-top:10px;
    font-weight:950;
    text-decoration:none;
    cursor:pointer;
    transition:.18s ease;
}
.contest-btn:hover{transform:translateY(-1px);text-decoration:none;}
.contest-btn--primary{background:linear-gradient(135deg,#ffc107,#ffb300);color:#111827;box-shadow:0 16px 34px rgba(255,193,7,.24);}
.contest-btn--ghost{background:rgba(255,255,255,.07);color:#fff;border:1px solid rgba(255,255,255,.12);}

.contest-form{display:grid;gap:12px;}
.contest-check{display:flex;gap:10px;align-items:flex-start;color:rgba(238,246,255,.82);font-size:14px;line-height:1.45;}
.contest-check input{margin-top:4px;accent-color:#ffc107;}

.contest-alert{padding:12px 14px;border-radius:16px;margin:14px 0;font-weight:800;font-size:14px;}
.contest-alert--success{background:rgba(34,197,94,.14);color:#bbf7d0;border:1px solid rgba(34,197,94,.26);}
.contest-alert--warning{background:rgba(245,158,11,.14);color:#fde68a;border:1px solid rgba(245,158,11,.26);}
.contest-alert--danger{background:rgba(239,68,68,.14);color:#fecaca;border:1px solid rgba(239,68,68,.26);}
.contest-alert--info{background:rgba(59,130,246,.14);color:#bfdbfe;border:1px solid rgba(59,130,246,.26);}

.contest-joined{padding:16px;border-radius:20px;background:rgba(34,197,94,.1);border:1px solid rgba(34,197,94,.22);margin:18px 0;}
.contest-joined strong,.contest-joined span,.contest-joined small{display:block;}
.contest-joined strong{font-size:20px;color:#fff;margin-bottom:6px;}
.contest-joined span{font-size:28px;font-weight:950;color:#86efac;}
.contest-joined small{color:rgba(238,246,255,.68);margin-top:4px;}

.contest-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:22px;}
.contest-box{padding:24px;}
.contest-box h2,.contest-my-stats h2,.contest-ranking h2,.contest-rules h2{margin:0 0 14px;color:#fff;font-weight:950;}
.contest-box p,.contest-rules li{color:rgba(238,246,255,.78);line-height:1.7;}
.contest-box--warning{background:linear-gradient(180deg, rgba(245,158,11,.12), rgba(255,255,255,.035));border-color:rgba(245,158,11,.2);}
.contest-list{margin:0;padding-left:20px;color:rgba(238,246,255,.8);line-height:1.75;}

.contest-my-stats,.contest-ranking,.contest-rules{margin-top:22px;padding:24px;}
.contest-stats-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.contest-stats-row div{padding:16px;border-radius:20px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);}
.contest-stats-row strong{display:block;font-size:30px;color:#ffc107;font-weight:950;}
.contest-stats-row span{display:block;color:rgba(238,246,255,.7);font-weight:800;font-size:13px;}

.contest-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;}
.contest-section-head--top{align-items:flex-end;margin-bottom:24px;}
.contest-section-head a:not(.contest-btn){color:#ffd56a;font-weight:900;text-decoration:none;}

.contest-table-wrap{overflow:auto;border-radius:20px;border:1px solid rgba(255,255,255,.08);}
.contest-table{width:100%;border-collapse:collapse;min-width:620px;background:rgba(6,18,30,.34);}
.contest-table th,.contest-table td{padding:14px 16px;text-align:left;border-bottom:1px solid rgba(255,255,255,.07);}
.contest-table th{color:rgba(238,246,255,.62);font-size:12px;text-transform:uppercase;letter-spacing:.04em;}
.contest-table td{color:rgba(238,246,255,.88);font-weight:750;}
.contest-table tr.is-me td{background:rgba(255,193,7,.1);}
.contest-table td strong{color:#ffc107;font-weight:950;}
.contest-empty{padding:24px;color:rgba(238,246,255,.74);font-weight:800;}

.contest-rules ol{margin:0;padding-left:22px;}
.contest-ranking-only{padding-top:36px;}

@media (max-width: 860px){
    .contest-wrap{width:min(100% - 22px, 1160px);padding:26px 0 calc(76px + env(safe-area-inset-bottom));}
    .contest-hero,.contest-grid{grid-template-columns:1fr;}
    .contest-hero h1,.contest-ranking-only h1{font-size:42px;}
    .contest-stats-row{grid-template-columns:1fr 1fr;}
    .contest-prizes{grid-template-columns:1fr 1fr;}
    .contest-prizes div:first-child{grid-column:1 / -1;}
    .contest-hero__card,.contest-box,.contest-my-stats,.contest-ranking,.contest-rules{padding:18px;border-radius:22px;}
    .contest-section-head{align-items:flex-start;flex-direction:column;}
    .contest-section-head .contest-btn{width:auto;padding-left:20px;padding-right:20px;}
}

.contest-check a,
.contest-faq a,
.contest-rules a{
    color:#ffd56a;
    font-weight:950;
    text-decoration:none;
}
.contest-check a:hover,
.contest-faq a:hover,
.contest-rules a:hover{text-decoration:underline;}

.contest-steps{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    margin-top:22px;
}
.contest-step,
.contest-faq,
.contest-faq-grid article{
    border:1px solid rgba(255,255,255,.1);
    background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
    box-shadow:0 24px 70px rgba(0,0,0,.18);
    border-radius:26px;
}
.contest-step{padding:22px;}
.contest-step span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    border-radius:14px;
    background:linear-gradient(135deg,#ffc107,#ffb300);
    color:#111827;
    font-weight:950;
    margin-bottom:14px;
}
.contest-step h2{
    margin:0 0 10px;
    color:#fff;
    font-size:22px;
    font-weight:950;
}
.contest-step p,
.contest-faq-grid p,
.contest-section-head p{
    margin:0;
    color:rgba(238,246,255,.76);
    line-height:1.65;
}

.contest-faq{margin-top:22px;padding:24px;}
.contest-faq-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.contest-faq-grid article{
    padding:18px;
    box-shadow:none;
    background:rgba(255,255,255,.055);
}
.contest-faq-grid h3{
    margin:0 0 8px;
    color:#fff;
    font-size:18px;
    font-weight:950;
}

.contest-rules li{
    margin-bottom:18px;
}
.contest-rules li:last-child{margin-bottom:0;}

@media (max-width: 860px){
    .contest-steps,
    .contest-faq-grid{grid-template-columns:1fr;}
    .contest-step,
    .contest-faq{padding:18px;border-radius:22px;}
}


@media (max-width: 560px){
    .contest-wrap{
        width:min(100% - 18px, 1160px);
        padding-top:18px;
        padding-bottom:calc(88px + env(safe-area-inset-bottom));
    }
    .contest-hero{
        gap:16px;
    }
    .contest-hero h1,
    .contest-ranking-only h1{
        font-size:clamp(34px, 10vw, 42px);
        line-height:1.02;
        margin:14px 0;
    }
    .contest-hero p,
    .contest-section-head p{
        font-size:15px;
        line-height:1.6;
    }
    .contest-prizes{
        grid-template-columns:1fr;
        gap:10px;
        margin-top:20px;
    }
    .contest-prizes div:first-child{
        grid-column:auto;
    }
    .contest-prizes div,
    .contest-step,
    .contest-faq-grid article,
    .contest-hero__card,
    .contest-my-stats,
    .contest-ranking,
    .contest-rules,
    .contest-faq{
        border-radius:18px;
    }
    .contest-prizes div{
        padding:16px;
    }
    .contest-prizes span{
        font-size:20px;
    }
    .contest-hero__card h2{
        font-size:23px;
    }
    .contest-btn{
        min-height:48px;
        padding:13px 16px;
    }
    .contest-stats-row{
        grid-template-columns:1fr;
    }
    .contest-table th,
    .contest-table td{
        padding:12px 13px;
        font-size:13px;
    }
    .contest-table{
        min-width:560px;
    }
    .contest-rules ol{
        padding-left:18px;
    }
    .contest-rules li{
        margin-bottom:16px;
    }
}

/* Referral bonus */
.contest-ref-bonus-mini{margin-top:14px;display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(250,204,21,.28);background:rgba(250,204,21,.10);color:#fef3c7;border-radius:999px;padding:9px 13px;font-weight:800;font-size:13px}
.contest-referral-box{margin:20px 0;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);gap:16px;align-items:center;border:1px solid rgba(255,255,255,.12);background:linear-gradient(135deg,rgba(245,158,11,.16),rgba(34,197,94,.08));border-radius:24px;padding:20px;box-shadow:0 18px 45px rgba(0,0,0,.20)}
.contest-referral-box h2{margin:0 0 8px;font-size:24px}.contest-referral-box p{margin:0;color:rgba(255,255,255,.78);line-height:1.55}.contest-referral-copy{display:flex;flex-direction:column;gap:8px}.contest-referral-copy input{width:100%;border:1px solid rgba(255,255,255,.18);background:rgba(15,23,42,.86);color:#fff;border-radius:14px;padding:12px 13px;font-weight:700}.contest-referral-copy small{color:rgba(255,255,255,.66);line-height:1.45}.contest-table small{color:rgba(255,255,255,.58);font-size:11px}
@media(max-width:760px){.contest-ref-bonus-mini{border-radius:16px;align-items:flex-start;line-height:1.35}.contest-referral-box{grid-template-columns:1fr;border-radius:18px;padding:16px}.contest-referral-box h2{font-size:20px}.contest-referral-copy input{font-size:13px}.contest-table small{display:block;margin-top:2px}}

/* =====================================================
   MOBILE FIX — /konkurs/
   Lepszy układ landing page na telefonie/PWA
===================================================== */

*{
    box-sizing:border-box;
}

body.contest-page{
    overflow-x:hidden;
}

.contest-wrap,
.contest-wrap *{
    -webkit-tap-highlight-color:transparent;
}

@media (max-width: 640px){
    body.contest-page::before{
        background:
            radial-gradient(circle at 15% 0%, rgba(255,193,7,.16), transparent 26%),
            radial-gradient(circle at 85% 8%, rgba(37,99,235,.13), transparent 30%),
            linear-gradient(180deg,#071624 0%,#081a2a 55%,#06121e 100%);
    }

    .contest-wrap{
        width:100%;
        max-width:100%;
        padding:14px 12px calc(92px + env(safe-area-inset-bottom));
    }

    .contest-hero{
        display:flex;
        flex-direction:column;
        gap:14px;
    }

    .contest-hero__copy,
    .contest-hero__card,
    .contest-step,
    .contest-my-stats,
    .contest-ranking,
    .contest-rules,
    .contest-faq,
    .contest-referral-box,
    .contest-empty{
        width:100%;
        max-width:100%;
    }

    .contest-kicker{
        width:100%;
        justify-content:center;
        text-align:center;
        padding:8px 10px;
        font-size:12px;
        line-height:1.25;
        white-space:normal;
    }

    .contest-hero h1,
    .contest-ranking-only h1{
        margin:13px 0 10px;
        font-size:clamp(30px, 9vw, 38px);
        line-height:1.04;
        letter-spacing:-.035em;
    }

    .contest-hero p,
    .contest-section-head p,
    .contest-step p,
    .contest-faq-grid p,
    .contest-box p,
    .contest-rules li{
        font-size:14px;
        line-height:1.55;
    }

    .contest-prizes{
        display:grid;
        grid-template-columns:1fr;
        gap:9px;
        margin-top:16px;
    }

    .contest-prizes div,
    .contest-hero__card,
    .contest-step,
    .contest-my-stats,
    .contest-ranking,
    .contest-rules,
    .contest-faq,
    .contest-referral-box{
        border-radius:18px;
        box-shadow:0 14px 36px rgba(0,0,0,.18);
    }

    .contest-prizes div{
        padding:14px;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
    }

    .contest-prizes strong{
        margin:0;
        font-size:12px;
        min-width:max-content;
    }

    .contest-prizes span{
        font-size:16px;
        text-align:right;
    }

    .contest-prizes-note{
        margin-top:9px!important;
        font-size:12px!important;
    }

    .contest-ref-bonus-mini{
        display:flex;
        width:100%;
        margin-top:12px;
        padding:10px 12px;
        border-radius:16px;
        font-size:12px;
        line-height:1.35;
    }

    .contest-hero__card{
        padding:16px;
    }

    .contest-status{
        width:100%;
        justify-content:center;
        text-align:center;
        font-size:12px;
        line-height:1.25;
        padding:8px 10px;
        white-space:normal;
    }

    .contest-hero__card h2{
        margin:13px 0 7px;
        font-size:21px;
        line-height:1.15;
    }

    .contest-hero__card p{
        margin-bottom:14px;
        font-size:13px;
        line-height:1.5;
    }

    .contest-btn{
        min-height:46px;
        padding:12px 14px;
        margin-top:9px;
        font-size:14px;
        line-height:1.15;
    }

    .contest-check{
        gap:9px;
        font-size:13px;
        line-height:1.45;
    }

    .contest-alert{
        padding:11px 12px;
        border-radius:14px;
        font-size:13px;
        line-height:1.45;
    }

    .contest-steps{
        display:grid;
        grid-template-columns:1fr;
        gap:12px;
        margin-top:14px;
    }

    .contest-step{
        padding:16px;
        display:grid;
        grid-template-columns:42px 1fr;
        column-gap:12px;
        align-items:start;
    }

    .contest-step span{
        width:36px;
        height:36px;
        margin:0;
        border-radius:13px;
        grid-row:1 / span 2;
    }

    .contest-step h2{
        margin:0 0 5px;
        font-size:18px;
        line-height:1.2;
    }

    .contest-my-stats,
    .contest-ranking,
    .contest-rules,
    .contest-faq{
        margin-top:14px;
        padding:16px;
    }

    .contest-my-stats h2,
    .contest-ranking h2,
    .contest-rules h2,
    .contest-faq h2{
        font-size:20px;
        line-height:1.2;
    }

    .contest-stats-row{
        grid-template-columns:1fr 1fr;
        gap:9px;
    }

    .contest-stats-row div{
        padding:12px;
        border-radius:15px;
    }

    .contest-stats-row strong{
        font-size:24px;
    }

    .contest-stats-row span{
        font-size:11px;
        line-height:1.25;
    }

    .contest-section-head{
        gap:10px;
        margin-bottom:12px;
    }

    .contest-section-head a:not(.contest-btn){
        display:inline-flex;
        align-items:center;
        justify-content:center;
        min-height:40px;
        padding:9px 13px;
        border-radius:999px;
        background:rgba(255,193,7,.12);
        border:1px solid rgba(255,193,7,.22);
    }

    .contest-table-wrap{
        width:100%;
        max-width:100%;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        border-radius:16px;
    }

    .contest-table{
        min-width:520px;
    }

    .contest-table th,
    .contest-table td{
        padding:10px 11px;
        font-size:12px;
        white-space:nowrap;
    }

    .contest-faq-grid{
        display:grid;
        grid-template-columns:1fr;
        gap:10px;
    }

    .contest-faq-grid article{
        padding:14px;
        border-radius:16px;
    }

    .contest-faq-grid h3{
        font-size:16px;
        line-height:1.25;
    }

    .contest-referral-box{
        margin:14px 0;
        padding:16px;
        grid-template-columns:1fr;
        gap:12px;
    }

    .contest-referral-box h2{
        font-size:20px;
    }

    .contest-referral-copy input{
        min-width:0;
        font-size:12px;
        padding:11px 12px;
    }
}

@media (max-width: 380px){
    .contest-wrap{
        padding-left:10px;
        padding-right:10px;
    }

    .contest-hero h1,
    .contest-ranking-only h1{
        font-size:29px;
    }

    .contest-prizes div{
        align-items:flex-start;
        flex-direction:column;
        gap:4px;
    }

    .contest-prizes span{
        text-align:left;
    }

    .contest-stats-row{
        grid-template-columns:1fr;
    }
}

/* =====================================================
   iPhone / PWA SAFE AREA FIX — /konkurs/
   Zapobiega ucinaniu góry strony pod paskiem systemowym iOS.
===================================================== */
@media (max-width: 768px){
    body.contest-page .app-header{
        padding-top:calc(env(safe-area-inset-top, 0px) + 10px) !important;
        padding-bottom:10px !important;
        min-height:calc(env(safe-area-inset-top, 0px) + 62px) !important;
        background:#071321 !important;
    }

    body.contest-page .contest-wrap{
        padding-top:18px !important;
    }
}

@media (display-mode: standalone) and (max-width: 768px){
    body.contest-page{
        background:#06121e;
    }

    body.contest-page .app-header{
        padding-top:calc(env(safe-area-inset-top, 0px) + 12px) !important;
        min-height:calc(env(safe-area-inset-top, 0px) + 64px) !important;
    }
}
