/* KUGL – ekipni zapisnik. Samostojne posebnosti; brez vpliva na TC. */
:root {
    --k-navy: #061e35;
    --k-blue: #10446f;
    --k-red: #cf1024;
    --k-line: #6fb6ee;
    --k-light: #eaf5ff;
}

* {
    box-sizing: border-box;
}

body.kugl-zapisnik-page {
    margin: 0;
    color: #f7fbff;
    background: #050b13;
    font: 15px/1.35 Arial,Helvetica,sans-serif;
}

.kugl-page {
    width: min(1390px,calc(100% - 28px));
    margin: 24px auto 48px;
    padding: 14px 15px 26px;
    border: 1px solid #245e91;
    border-radius: 15px;
    background: linear-gradient(146deg,#092a4d 0%,#071c33 55%,#061321 100%);
    box-shadow: 0 14px 38px #0007;
}

.kugl-head {
    margin-bottom: 14px;
}

.kugl-banner {
    min-height: 116px;
    display: grid;
    grid-template-columns: minmax(155px, 1fr) minmax(0, 2fr) minmax(155px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 3px solid #4ec6ff;
    background: linear-gradient(120deg,#30061c 0%,#071b32 30%,#003a70 48%,#081329 65%,#7d0418 89%,#092d50 100%);
    position: relative;
    overflow: hidden;
}

.kugl-banner:before,.kugl-banner:after {
    content: "";
    position: absolute;
    width: 350px;
    height: 2px;
    transform: rotate(-33deg);
    background: #46c8ff;
    box-shadow: 0 0 9px #47bfff;
    opacity: .6;
}

.kugl-banner:before {
    top: 15px;
    left: 22%;
}

.kugl-banner:after {
    bottom: 15px;
    right: -50px;
    background: #fb2947;
    box-shadow: 0 0 9px #f33;
}

/* ==========================================
   GLAVA – BV LOGOTIP IN NASLOV
========================================== */
.kugl-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.kugl-brand img {
    display: block;
    width: min(100%, 205px);
    height: auto;
    object-fit: contain;
}

.kugl-heading {
    position: relative;
    z-index: 1;
    min-width: 0;
    text-align: center;
    text-shadow: 0 3px 5px #000;
}

.kugl-heading strong {
    display: block;
    font-size: clamp(26px, 3.5vw, 49px);
    font-weight: 1000;
    line-height: 1.08;
    letter-spacing: 1px;
}

.kugl-heading span {
    display: block;
    margin-top: 3px;
    font-size: clamp(14px, 1.5vw, 23px);
    font-style: italic;
    font-weight: 800;
}

.kugl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 9px 0;
    padding: 9px;
    background: #061628;
    border: 1px solid #66b6ec;
    border-radius: 13px;
}

.kugl-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: #fff;
    background: #0a2c51;
    border: 1px solid #3d80b4;
    border-radius: 7px;
    padding: 5px 7px;
    white-space: nowrap;
    font-size: 13px;
}

.kugl-chip strong {
    display: inline-block;
    border-radius: 5px;
    padding: 5px 12px;
    min-width: 50px;
    text-align: center;
    background: linear-gradient(#fff,#c4e4ff);
    color: #081b34;
    font-size: 14px;
}

.kugl-versus {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    align-items: center;
    gap: 0;
    min-height: 90px;
    border: 2px solid #b5e3ff;
    border-radius: 14px;
    background: #05172b;
    overflow: hidden;
    box-shadow: 0 0 10px #32a9e544;
}

.kugl-team {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 90px;
    padding: 12px 20px;
    font-size: clamp(20px,2.7vw,31px);
    font-weight: 900;
    font-style: italic;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 3px #000;
}

.kugl-team small {
    font-size: 12px;
    margin-top: 2px;
    font-style: normal;
}

.kugl-home {
    background: linear-gradient(90deg,#8d0716,#e3182d 55%,#5a0712);
}

.kugl-away {
    text-align: right;
    background: linear-gradient(90deg,#071b3d,#034b8b 60%,#082651);
}

.kugl-team.bolj {
    box-shadow: inset 0 -5px #4bd670;
}

.kugl-team.slab {
    box-shadow: inset 0 -5px #fb6778;
}

.kugl-team.iz {
    box-shadow: inset 0 -5px #80bfff;
}

.kugl-scor {
    position: relative;
    z-index: 1;

    margin: 0 -4px;
    padding: 6px 25px;

    border: 2px solid #d6f5ff;
    border-radius: 16px;

    background:
        radial-gradient(
            ellipse at 50% 50%,
            #32d94a 0%,
            #0c9a2b 35%,
            #04621a 70%,
            #023d10 100%
        );

    white-space: nowrap;

    font-weight: 1000;
    font-size: clamp(35px, 4.2vw, 62px);

    color: #ffffff;

    text-shadow:
        0 3px 5px #000;

    box-shadow:
        0 0 12px rgba(47, 225, 80, 0.45),
        0 4px 12px rgba(0, 0, 0, 0.5);
}

.kugl-scor span {
    color: #ffffff;

    text-shadow:
        0 0 8px rgba(190, 255, 200, 0.9),
        0 0 16px rgba(65, 255, 100, 0.7);
}

/* ==========================================
   KUGL – KONČNI REZULTAT
========================================== */

.kugl-scor {
    position: relative;
    z-index: 1;

    margin: 0 -4px;
    padding: 6px 25px;

    border: 2px solid #e0ffff;
    border-radius: 16px;

    background:
        radial-gradient(
            ellipse at 50% 50%,
            #158e2d 0%,
            #087020 40%,
            #034b12 75%,
            #012f0b 100%
        );

    color: #ffffff;
    white-space: nowrap;

    font-weight: 1000;
    font-size: clamp(35px, 4.2vw, 62px);

    text-shadow:
        0 3px 5px rgba(0, 0, 0, 0.85);

    box-shadow:
        0 0 10px rgba(75, 255, 120, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.5);

    transform: skewX(-10deg);
}

.kugl-scor span {
    display: inline-block;

    color: #ffffff;

    text-shadow:
        0 0 8px rgba(200, 255, 210, 0.9),
        0 0 15px rgba(60, 255, 100, 0.65);

    transform: skewX(10deg);
}

.kugl-section {
    margin-top: 15px;
}

.kugl-section h2 {
    margin: 0 0 8px;
    border: 2px solid #d2eaff;
    border-radius: 9px 9px 0 0;
    background: linear-gradient(#f31935,#aa061c 60%,#690c19);
    box-shadow: 0 3px 10px #0004;
    text-align: center;
    font-size: 21px;
    padding: 9px 12px;
    font-weight: 1000;
    letter-spacing: .7px;
}

.kugl-tablebar {
    display: grid;
    grid-template-columns: 45px 1fr 72px 1fr;
    margin-bottom: 5px;
    align-items: center;
    text-align: center;
    color: white;
    font-weight: 900;
}

.kugl-tablebar>* {
    padding: 9px 3px;
    background: linear-gradient(#fa2941,#a8091e);
    border: 1px solid #9bd1ff;
}

.kugl-tablebar>*:first-child {
    background: linear-gradient(#2173ae,#073b67);
    border-radius: 8px 0 0 8px;
}

.kugl-tablebar>*:last-child {
    border-radius: 0 8px 8px 0;
}

.kugl-duel {
    display: grid;
    grid-template-columns: 45px minmax(0,1fr) 72px minmax(0,1fr);
    gap: 4px;
    margin: 0 0 7px;
    min-width: 0;
    align-items: stretch;
    border: 1px solid #7cc6ff;
    border-radius: 10px;
    padding: 4px;
    background: linear-gradient(#2773aa,#0a3964);
    box-shadow: 0 2px 6px #0007;
}

.kugl-duelnum {
    background: linear-gradient(#327cb9,#06335e);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 1000;
    font-size: 31px;
    text-shadow: 0 2px 3px #001;
}

.kugl-player {
    display: grid;
    grid-template-columns: minmax(125px,36%) minmax(0,64%);
    min-width: 0;
    min-height: 125px;
    overflow: hidden;
    border: 1px solid #93b9d2;
    border-radius: 6px;
    background: #dfefff;
}

.kugl-player-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px;
    color: #0b1c35;
    background: linear-gradient(110deg,#fff,#d6e8fa);
    font-size: clamp(12px,1.25vw,17px);
    line-height: 1.15;
}

.kugl-player-name strong {
    overflow-wrap: anywhere;
}

/* Fotografije ohranijo izvirno razmerje stranic; brez krožnega izreza. */
.kugl-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 104px;
    flex: 0 0 84px;
    overflow: hidden;
    border: 1px solid #91b6d1;
    border-radius: 7px;
    background: #d9e9f6;
}

.kugl-avatar img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.kugl-avatar-fallback {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(#b8d0e3, #7395af);
}

.kugl-scroll {
    min-width: 0;
    overflow-x: auto;
}

.kugl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(10px,.9vw,13px);
    line-height: 1.1;
    color: #071a32;
    white-space: nowrap;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.kugl-table th {
    background: linear-gradient(#286a9f,#073b6a);
    color: #fff;
    font-size: clamp(9px,.75vw,11px);
}

.kugl-table th,.kugl-table td {
    padding: 5px 3px;
    text-align: center;
    border: 1px solid #9db7cd;
}

.kugl-table td {
    background: #f8fbff;
}

.kugl-table tr:nth-child(even) td {
    background: #e5f1fb;
}

.kugl-table .kugl-tot {
    font-weight: 1000;
}

.kugl-table tfoot td {
    background: #b6d9f4;
    font-weight: 1000;
    border-top: 2px solid #286898;
}

.kugl-table td.bolj,.kugl-stat .bolj,.kugl-et.bolj {
    background: #9af18e!important;
    color: #083c10!important;
}

.kugl-table td.slab,.kugl-stat .slab,.kugl-et.slab {
    background: #f8a4aa!important;
    color: #63121b!important;
}

.kugl-table td.iz,.kugl-stat .iz,.kugl-et.iz {
    background: #bbdefd!important;
    color: #123d64!important;
}

.kugl-et {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    align-content: center;
    gap: 3px;
    border-radius: 7px;
    border: 2px solid #c3e6ff;
    font-weight: 1000;
    font-size: 23px;
    min-width: 0;
}

.kugl-et small {
    width: 100%;
    font-size: 11px;
    text-align: center;
}

.kugl-et span {
    font-size: 16px;
}

.kugl-mini {
    grid-column: 1 / -1;
    padding: 4px 8px;
    font-size: 12px;
    color: #fff;
    background: #ac2834;
    border-radius: 4px;
}

/* ==========================================
   EKIPNI SEŠTEVKI – KOMPAKTNI DVE VRSTICI
   1. vrstica: kegljaški rezultati
   2. vrstica: točke, povprečje, razlika
========================================== */
.kugl-summary {
    padding: 11px 13px 13px;
    border: 2px solid #88caff;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(135deg, #09294c, #104c7b);
}

.kugl-summary-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 17px;
    text-align: center;
}

.kugl-summary-teams strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kugl-summary-teams span {
    color: #bcdffc;
    font-size: 11px;
    font-weight: 800;
}

.kugl-summary-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.kugl-summary-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #80b9df;
    border-radius: 7px;
    background: #e6f3ff;
}

.kugl-summary-label {
    padding: 5px 6px;
    color: #ffffff;
    background: linear-gradient(#215d8e, #07355d);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
}

.kugl-summary-values {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 3px;
    padding: 3px;
    background: #d8eafb;
}

.kugl-summary-values strong {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 37px;
    padding: 4px 3px;
    border-radius: 4px;
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* ==========================================
   EKIPNE TOČKE – KONČNI REZULTAT
   Manjša številka pred končno vrednostjo se
   pokaže samo, če se točke iz dvobojev razlikujejo.
========================================== */
.kugl-summary-values strong.kugl-et-final {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.kugl-et-prej {
    font-size: 0.65em;
    font-weight: 800;
    line-height: 1;
    opacity: 0.85;
}

.kugl-summary-values > span {
    align-self: center;
    color: #254b68;
    font-weight: 900;
}

.kugl-summary-values .bolj {
    color: #073b12;
    background: #9af18e;
}

.kugl-summary-values .slab {
    color: #64121c;
    background: #f8a4aa;
}

.kugl-summary-values .iz {
    color: #123d64;
    background: #bbdefd;
}

.kugl-summary-difference .kugl-summary-values {
    display: flex;
    justify-content: center;
}

.kugl-summary-difference .kugl-summary-values strong {
    width: 100%;
    max-width: 190px;
}

.kugl-people {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
    margin-top: 12px;
}

.kugl-person {
    border: 1px solid #89c8f3;
    border-radius: 9px;
    background: linear-gradient(#0e4778,#072844);
    padding: 8px 10px;
}

.kugl-person small {
    display: block;
    color: #b7e3ff;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
}

.kugl-person strong {
    display: block;
    padding: 10px 8px;
    border-radius: 6px;
    background: linear-gradient(#fff,#cde6fa);
    color: #102a41;
    text-align: center;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.kugl-alert {
    padding: 16px;
    border: 1px solid #c44b5b;
    border-radius: 12px;
    background: #3d1721;
}

.kugl-empty {
    padding: 16px;
    text-align: center;
}

.kugl-back {
    text-align: center;
    color: #89bad9;
    font-size: 12px;
    margin-top: 17px;
}

@media(max-width:1050px) {
    .kugl-page {
        width: calc(100% - 16px);
        padding: 10px;
    }

    .kugl-duel {
        grid-template-columns: 34px minmax(0,1fr) 54px minmax(0,1fr);
    }

    .kugl-tablebar {
        grid-template-columns: 34px 1fr 54px 1fr;
    }

    .kugl-player {
        grid-template-columns: 1fr;
    }

    .kugl-player-name {
        min-height: 52px;
    }

    .kugl-avatar {
        width: 64px;
        height: 82px;
        flex-basis: 64px;
    }

    .kugl-et {
        font-size: 17px;
    }

}

@media(max-width:650px) {
    .kugl-banner {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: center;
    }

    .kugl-brand {
        justify-content: center;
    }

    .kugl-brand img {
        width: 160px;
    }

    .kugl-meta {
        justify-content: center;
    }

    .kugl-chip {
        font-size: 11px;
    }

    .kugl-chip strong {
        font-size: 12px;
        padding: 4px 6px;
    }

    .kugl-team {
        padding: 8px;
        font-size: 17px;
        min-height: 78px;
    }

    .kugl-team small {
        font-size: 9px;
    }

    .kugl-scor {
        font-size: 28px;
        padding: 5px 9px;
    }

    .kugl-tablebar {
        display: none;
    }

    .kugl-duel {
        grid-template-columns: 32px minmax(0,1fr);
        gap: 5px;
        padding: 5px;
    }

    .kugl-duelnum {
        grid-row: 1/4;
    }

    .kugl-player {
        grid-column: 2;
        grid-template-columns: minmax(0,1fr);
        min-height: 0;
    }

    .kugl-et {
        grid-column: 2;
        grid-row: 2;
        min-height: 40px;
    }

    .kugl-player-g {
        grid-row: 3;
    }

    .kugl-player-name {
        min-height: 36px;
    }

    .kugl-scroll {
        overflow-x: auto;
    }

    .kugl-table {
        font-size: 11px;
    }

    .kugl-table th {
        font-size: 10px;
    }

    .kugl-table th,.kugl-table td {
        padding: 4px 2px;
    }

    .kugl-summary {
        padding: 10px 5px;
    }

    .kugl-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .kugl-summary-teams {
        font-size: 13px;
    }

    .kugl-summary-teams span {
        font-size: 9px;
    }

    .kugl-summary-label {
        font-size: 11px;
    }

    .kugl-summary-values strong {
        font-size: 15px;
    }

    .kugl-people {
        grid-template-columns: 1fr;
    }

}

@media print {
    body.kugl-zapisnik-page {
        background: white;
    }

    .kugl-page {
        margin: 0;
        width: 100%;
        max-width: none;
        box-shadow: none;
        padding: 0;
        border: 0;
    }

    .kugl-duel,.kugl-head,.kugl-people,.kugl-summary {
        break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .kugl-back {
        display: none;
    }

}

