/* ===========================
   OK PÕLVA KOBRAS – MODERN STYLE
   klasside loetelu taastatud originaalfaili järgi
   =========================== */

:root{
    --bg:#f5f7fa;
    --card:#ffffff;
    --text:#1f2933;
    --muted:#6b7280;
    --border:#e5e7eb;

    --accent:#ff9800;
    --accent-dark:#e68900;
    --accent-soft:#fff3e0;

    --row-alt:#f3f4f6;
    --row-hover:#e8f0fe;

    --shadow:0 4px 18px rgba(0,0,0,0.08);
    --radius:10px;

    --header-logo-size:38px;
    --header-logo-gap:14px;
    --header-right-pad:72px;

    --anchor-offset:60px;
}

html[data-theme="dark"]{
    --bg:#0f172a;
    --card:#1e293b;
    --text:#e2e8f0;
    --muted:#94a3b8;
    --border:#334155;

    --accent:#ff9800;
    --accent-dark:#ffad33;
    --accent-soft:#2d3748;

    --row-alt:#1f2937;
    --row-hover:#334155;

    --shadow:0 4px 18px rgba(0,0,0,0.4);
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    padding:20px 20px 8px 20px;
    font-family:"Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
    font-size:14px;
    line-height:1.5;
}

.header{
    position:sticky;
    top:0;
    z-index:500;
    background-color:var(--card);
    background-image:url('koprapea_small.png');
    background-repeat:no-repeat;
    background-size:var(--header-logo-size) var(--header-logo-size);
    background-position:right var(--header-logo-gap) center;
    padding:16px var(--header-right-pad) 16px 24px;
    font-size:20px;
    font-weight:700;
    box-shadow:var(--shadow);
    border-radius:var(--radius);
    margin-bottom:20px;
    line-height:1.2;
    box-sizing:border-box;
}

.headerlogo{
    max-height:60px;
    width:auto;
}

.box{
    background:var(--accent-soft);
    border-left:4px solid var(--accent);
    padding:12px 16px;
    border-radius:var(--radius);
    margin:10px 0;
    box-sizing:border-box;
}

.info{
    font-weight:600;
    color:var(--accent-dark);
}

.classheader{
    font-size:22px;
    font-weight:700;
    margin:30px 0 10px 0;
    padding-left:42px;
    background-image:url('kobras_pin.png');
    background-size:28px 28px;
    background-repeat:no-repeat;
    background-position:left center;
}

/* väiksem sihtkoha nihe, et klass algaks kõrgemalt */
.classinfo a:target::before,
[id]:target::before{
    content:"";
    display:block;
    height:var(--anchor-offset);
    margin-top:calc(-1 * var(--anchor-offset));
    pointer-events:none;
    visibility:hidden;
}

.resulttable{
    width:100%;
    border-collapse:collapse;
    background:var(--card);
    border-radius:var(--radius);
    overflow:hidden;
    box-shadow:var(--shadow);
}

.resulttable td{
    padding:8px 10px;
    border-bottom:1px solid var(--border);
    white-space:nowrap;
}

.resultheader{
    background:var(--accent);
    color:#fff;
    font-weight:600;
    font-size:14px;
}

.resultheader td{
    padding:10px;
}

.r0{
    background:#ffffff;
    font-weight:600;
}

.r1{
    background:var(--row-alt);
    font-weight:600;
}

.s0{
    background:#ffffff;
    font-family:monospace;
}

.s1{
    background:var(--row-alt);
    font-family:monospace;
}

.resulttable tr:hover{
    background:var(--row-hover);
}

.team0{
    background:#ffe0b2;
    font-weight:600;
}

.team1{
    background:#fff3e0;
    font-weight:600;
}

a{
    color:var(--accent-dark);
    text-decoration:none;
    font-weight:500;
}

a:hover{
    text-decoration:underline;
}

a.rlink{
    color:#fff;
}

#klassList{
    z-index:1000;
    float:right;
    top:72px;
    right:10px;
    bottom:2px;
    position:fixed;
    display:block;
    overflow-y:auto;
    overflow-x:hidden;
    margin:10px 10px 10px 10px;
    text-align:right;
    color:#FFFFFF;
    white-space:pre-wrap;
    background-color:#FF9900;
    width:max-content;
    padding:5px 5px 5px 5px;
    text-decoration:none;
    border-radius:3px 3px 3px 3px;
    box-shadow:2px 2px 2px #EB7500;
    opacity:0.8;
}

/* klasside loetelu tekst valgeks */
#klassList,
#klassList a,
#klassList a:link,
#klassList a:visited,
#klassList a:active,
#klassList a:hover{
    color:#FFFFFF;
    text-decoration:none;
}

#klassList a:hover{
    text-decoration:none;
}

pre{
    font-family:monospace;
    background:var(--card);
    padding:12px;
    border-radius:var(--radius);
    overflow:auto;
    margin-top:0;
    margin-bottom:8px;
    box-sizing:border-box;
}

.clblock{
    margin-bottom:8px;
}

.footinfo{
    margin:0;
    padding:0;
    border:0 none transparent;
    vertical-align:text-bottom;
    border-collapse:collapse;
    width:100%;
    line-height:1.1;
    box-sizing:border-box;
}

.miniList{
    height:20px !important;
    width:150px !important;
}

.normalList{
    height:110px !important;
    width:90% !important;
    font-size:1.1em;
    white-space:normal !important;
}

.btnClass{
    background-color:#FF9900;
    border:1px black solid;
    border-radius:5px;
}

.sticky{
    position:fixed;
    top:0;
    width:100%;
}

/* Smartphone – originaalfaili loogika */
@media only screen and (max-width:480px){
    #klassList{
        float:left;
        top:75px;
        right:0px;
        bottom:0px;
        position:fixed;
        display:inline-block;
        margin:5px 5px 5px 5px;
        text-align:right;
        white-space:nowrap;
        width:max-content;
        padding:5px 5px 5px 5px;
        text-decoration:none;
        border-radius:3px 3px 3px 3px;
        box-shadow:2px 2px 2px #d0d0d0;
        opacity:0.8;
    }
}

@media only screen and (max-width:920px){
    .headerlogo, .header{
        width:50%;
        height:auto;
    }

    .classinfo{
        font-size:11pt;
    }
}

@page{
    size:A4 portrait;
    margin:10mm;
}

@media print{
    html, body{
        background:#fff !important;
        color:#000 !important;
    }

    body{
        margin:0 auto;
        padding:0;
        width:190mm;          /* hoiab printimisel A4 proportsiooni */
        max-width:190mm;
    }

    .header,
    .box,
    .clblock,
    .footinfo{
        width:190mm;
        max-width:190mm;
        box-sizing:border-box;
    }

    .header{
        position:static;
        top:auto;
        z-index:auto;
        box-shadow:none;
        border:none;
        border-radius:0;
        margin:0 0 8mm 0;
        background-color:#fff;
        background-image:url('koprapea_small.png');
        background-repeat:no-repeat;
        background-position:right 4mm center;
        background-size:9mm 9mm;
        padding:2mm 16mm 2mm 0;
        min-height:11mm;
        line-height:1.2;
        overflow:visible;
        page-break-after:avoid;
        break-after:avoid;
    }

    .box{
        margin:0 0 6mm 0;
        page-break-after:avoid;
        break-after:avoid;
    }

    .classinfo,
    .classheader,
    pre,
    .clblock{
        page-break-inside:avoid;
        break-inside:avoid;
    }

    pre{
        display:inline-block; /* ei veni täislaiuseks */
        min-width:0;
        max-width:190mm;
        margin-top:0;
        margin-bottom:3mm;
        padding:0;
        border-radius:0;
        background:#fff;
        box-shadow:none;
        white-space:pre;
        overflow:visible;
    }

    .footinfo{
        margin:0;
        padding:0;
    }

    #klassList,
    .btnClass,
    .noprint{
        display:none !important;
    }

    .resulttable{
        box-shadow:none;
    }
}
