.ipps-open, .ipps-toolbar button {
    border: 0;
    border-radius: .4rem;
    background: #176247;
    color: #fff;
    padding: .65rem .95rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ipps-open { margin: 0 0 1rem; }
.ipps-dialog {
    box-sizing: border-box;
    width: min(94vw, 76rem);
    max-height: 92vh;
    margin: auto;
    padding: 0;
    border: .0625rem solid #335668;
    border-radius: .6rem;
    background: #102b38;
    color: #fff;
}
.ipps-dialog::backdrop { background: rgb(5 18 24 / 75%); }
.ipps-toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #102b38;
    gap: .55rem;
    flex-wrap: wrap;
    padding: .65rem 1rem;
}
.ipps-toolbar select { font: inherit; max-width: 100%; }
.ipps-sheet {
    box-sizing: border-box;
    padding: 1.15rem;
    background: #102d38 !important;
    color: #fff;
    font: 1rem/1.2 system-ui, sans-serif;
}
.ipps-dialog .ipps-sheet .ipps-brand {
    margin: 0 0 .85rem;
    padding: 0;
    text-align: center;
    background: #102d38 !important;
    color: #fff !important;
}
.ipps-dialog .ipps-sheet .ipps-brand img {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 12rem;
    margin: 0 auto .45rem;
    object-fit: contain;
    border-radius: .35rem;
}
.ipps-dialog .ipps-sheet .ipps-brand p {
    margin: 0 0 .45rem;
    color: #fff !important;
    font: 800 2em/1.1 system-ui, sans-serif;
}
.ipps-dialog .ipps-sheet .ipps-brand h1 {
    margin: 0;
    padding: .4em .25em;
    border-block: 2px solid #f1cd49;
    background: #163d49 !important;
    color: #fff !important;
    font: 800 clamp(1.05rem, 2.4vw, 1.65rem)/1.15 system-ui, sans-serif;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}
.ipps-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr) minmax(0, 1.14fr);
    gap: .65em;
    align-items: start;
}
.ipps-panel {
    background: #31606a;
    border: 1px solid #5ecb8e;
    border-radius: .45em;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.ipps-panel-head { padding: .58em; background: #185841; }
.ipps-panel-head h2 {
    margin: 0;
    color: #fff;
    font: 800 1.2em/1.12 system-ui, sans-serif;
    text-transform: uppercase;
}
.ipps-panel-head .ipps-round { margin: .2em 0 0; color: #ffdd65; font-weight: 700; }
.ipps-round:empty { display: none; }
.ipps-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: .35em;
}
.ipps-match strong {
    background: #087143;
    border-radius: .2em;
    padding: .22em .4em;
    white-space: nowrap;
}
.ipps-match, .ipps-next, .ipps-empty { padding: .47em .5em; }
.ipps-match, .ipps-next { border-top: 1px solid #65818a; }
.ipps-match:nth-child(even), .ipps-next:nth-child(even), .ipps-panel tbody tr:nth-child(even) {
    background: #3c7079;
}
.ipps-next small { display: block; color: #e2edf0; margin-top: .18em; }
.ipps-panel table { width: 100%; border-collapse: collapse; margin: 0; color: inherit; font: inherit; }
.ipps-panel th, .ipps-panel td {
    padding: .27em .35em;
    border-bottom: 1px solid #65818a;
    text-align: left;
    vertical-align: middle;
}
.ipps-panel th { background: #204955; }
.ipps-panel :is(th, td):is(:first-child, :last-child) { text-align: center; }
.ipps-panel td:last-child, .ipps-panel td:first-child { font-weight: 700; }
.ipp-wrap .ipp-table-wrap tbody tr > :first-child.ipps-first, .ipps-sheet .ipps-first { background: #087039; color: #fff; }
.ipp-wrap .ipp-table-wrap tbody tr > :first-child.ipps-playoff, .ipps-sheet .ipps-playoff { background: #155eb2; color: #fff; }
.ipp-wrap .ipp-table-wrap tbody tr > :first-child.ipps-playout, .ipps-sheet .ipps-playout { background: #a44712; color: #fff; }
.ipp-wrap .ipp-table-wrap tbody tr > :first-child.ipps-last, .ipps-sheet .ipps-last { background: #ba2432; color: #fff; }
.ipps-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .3em 1em;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: .8em 0 0;
    font-size: .85em;
}
.ipps-legend span {
    display: inline-block;
    width: .8em;
    height: .8em;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: .15em;
    margin-right: .25em;
}
@media screen and (max-width: 720px) {
    .ipps-columns { grid-template-columns: 1fr; }

}
@media print {
    @page { size: A4 landscape; margin: 7mm; }
    body:has(> .ipps-dialog[open]) > :not(.ipps-dialog) { display: none !important; }
    body:has(> .ipps-dialog[open]) { margin: 0 !important; padding: 0 !important; background: white !important; }
    .ipps-dialog[open] {
        position: static;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: none;
        margin: 0;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }
    .ipps-dialog::backdrop, .ipps-toolbar { display: none; }
    .ipps-sheet { print-color-adjust: exact; -webkit-print-color-adjust: exact; font-size: 9pt; }
    .ipps-dialog .ipps-sheet .ipps-brand img { max-height: 30mm; }
    .ipps-dialog .ipps-sheet .ipps-brand h1 { font-size: 15pt; }
    .ipps-panel :is(tr, .ipps-match, .ipps-next) { break-inside: avoid; }
}

.ipps-sheet:is([data-style="light"], [data-style="blue"]) {
    background: linear-gradient(180deg, #123f70, #071b31 35%, #123a30) !important;
}
.ipps-dialog .ipps-sheet:is([data-style="light"], [data-style="blue"]) .ipps-brand {
    background: transparent !important;
}
.ipps-dialog .ipps-sheet:is([data-style="light"], [data-style="blue"]) .ipps-brand h1 {
    background: #071f41 !important;
    border-color: #ffdf32;
}
.ipps-sheet:is([data-style="light"], [data-style="blue"]) .ipps-panel {
    border-color: #cad7e6;
    border-radius: .65em;
}
.ipps-sheet[data-style="light"] .ipps-panel {
    background: #f5f8fc;
    color: #0a2445;
}
.ipps-sheet[data-style="light"] .ipps-panel-head,
.ipps-sheet[data-style="light"] .ipps-panel th,
.ipps-sheet[data-style="light"] .ipps-match strong {
    background: #0b315d;
    color: #fff;
}
.ipps-sheet[data-style="light"] .ipps-panel th {
    color: #fff;
}
.ipps-sheet[data-style="light"] :is(.ipps-match:nth-child(even), .ipps-next:nth-child(even), tbody tr:nth-child(even)) {
    background: #e3edf8;
}
.ipps-sheet[data-style="light"] :is(.ipps-match, .ipps-next, th, td) {
    border-color: #c4d2e3;
}
.ipps-sheet[data-style="light"] .ipps-next small {
    color: #2b4d70;
}
.ipps-sheet[data-style="blue"] .ipps-panel {
    background: #0a274c;
    color: #fff;
}
.ipps-sheet[data-style="blue"] :is(.ipps-match:nth-child(even), .ipps-next:nth-child(even), tbody tr:nth-child(even)) {
    background: #103762;
}
.ipps-sheet[data-style="blue"] .ipps-panel-head {
    background: #ffde28;
}
.ipps-sheet[data-style="blue"] .ipps-panel-head :is(h2, .ipps-round) {
    color: #071b31;
}
.ipps-sheet[data-style="blue"] .ipps-panel:nth-child(2) .ipps-panel-head {
    background: #087143;
}
.ipps-sheet[data-style="blue"] .ipps-panel:nth-child(2) .ipps-panel-head h2 {
    color: #fff;
}
.ipps-sheet[data-style="blue"] .ipps-panel th {
    background: #061c36;
}
.ipps-sheet[data-style="blue"] .ipps-match strong {
    background: #ffde28;
    color: #071b31;
}

.ipps-stadium-brand { display: none; }
.ipps-sheet[data-style^="stadium-"] {
    background: linear-gradient(180deg, #04152d 20%, transparent 65%),
        url("campo.jpg") center bottom / cover no-repeat #04152d !important;
}
.ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-brand {
    background: transparent !important;
}
.ipps-sheet[data-style^="stadium-"] .ipps-stadium-brand {
    display: block;
    margin: 0 0 .35em;
    aspect-ratio: 7.887;
    background: url("testata.jpg") center top / 100% auto no-repeat #04152d;
    border-radius: .45em;
}
.ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-brand :is(img, p) { display: none; }
.ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-brand h1 {
    background: #04152d !important;
    border-color: #ffda25;
}
.ipps-sheet[data-style^="stadium-"] .ipps-panel {
    border: 2px solid var(--ipps-border);
    border-radius: .75em;
    background: var(--ipps-row);
    color: var(--ipps-ink);
}
.ipps-sheet[data-style^="stadium-"] .ipps-panel-head {
    text-align: center;
    background: #061d40;
    border-bottom: 3px solid #ffda25;
}
.ipps-sheet[data-style^="stadium-"] :is(.ipps-panel th, .ipps-match strong) {
    background: #08284d;
    color: #fff;
}
.ipps-sheet[data-style^="stadium-"] :is(.ipps-match:nth-child(even), .ipps-next:nth-child(even), tbody tr:nth-child(even)) {
    background: var(--ipps-alternate);
}
.ipps-sheet[data-style^="stadium-"] :is(.ipps-match, .ipps-next, th, td) {
    border-color: var(--ipps-divider);
}
.ipps-sheet[data-style^="stadium-"] .ipps-next small { color: inherit; }
.ipps-sheet[data-style^="stadium-"] .ipps-legend li {
    padding: .2em .5em;
    border-radius: .3em;
    background: #061d40;
}
.ipps-sheet[data-style="stadium-light"] {
    --ipps-border: #f3f7ff;
    --ipps-row: #f6f9ff;
    --ipps-ink: #081e3e;
    --ipps-alternate: #dcebf9;
    --ipps-divider: #b6cbe2;
}
.ipps-sheet[data-style="stadium-night"] {
    --ipps-border: #2fb7f5;
    --ipps-row: #051a35;
    --ipps-ink: #fff;
    --ipps-alternate: #0c2b50;
    --ipps-divider: #255787;
}
.ipps-sheet[data-style="stadium-night"] .ipps-match strong { background: #0c54a4; }
@media print {
    .ipps-sheet[data-style^="stadium-"] .ipps-stadium-brand { max-height: 53mm; }
}

/* The stadium layouts share one image header and keep the league title inside it. */
.ipps-sheet[data-style^="stadium-"] {
    padding: .6em 1.65em 2.45em;
    font: 1rem/1.12 "Arial Narrow", Arial, sans-serif;
    background-size: 100% 100%, 100% auto !important;
}
.ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-brand {
    position: relative;
    margin: 0 0 .58em;
}
.ipps-sheet[data-style^="stadium-"] .ipps-stadium-brand {
    margin: 0;
}
.ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-brand h1 {
    position: absolute;
    inset: 81% auto auto 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    width: 44%;
    padding: 0 .1em;
    border: 0;
    background: transparent !important;
    font: 900 clamp(.55rem, 1.6vw, 1.4rem)/1.07 "Arial Narrow", Arial, sans-serif;
    text-wrap: balance;
    overflow-wrap: normal;
}
.ipps-sheet[data-style^="stadium-"] .ipps-columns {
    gap: .68em;
    align-items: stretch;
}
.ipps-sheet[data-style^="stadium-"] .ipps-panel {
    display: flex;
    flex-direction: column;
}
.ipps-sheet[data-style^="stadium-"] .ipps-panel-head {
    display: grid;
    place-content: center;
    min-height: 3.65em;
    box-sizing: border-box;
    padding: .3em .22em .4em;
}
.ipps-sheet[data-style^="stadium-"] .ipps-panel-head h2 {
    font: italic 900 clamp(.95rem, 1.95vw, 1.75rem)/1 "Arial Narrow", Arial, sans-serif;
}
.ipps-sheet[data-style^="stadium-"] .ipps-round { font-size: .79em; }
.ipps-sheet[data-style^="stadium-"] :is(.ipps-match, .ipps-next) {
    padding: .3em .48em;
    font-size: .86em;
    font-weight: 700;
}
.ipps-sheet[data-style^="stadium-"] :is(th, td) {
    padding: .24em .35em;
    font-size: .86em;
}
.ipps-next-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: .35em;
    align-items: center;
}
.ipps-next-pair span:first-child { text-align: right; }
.ipps-next-pair strong {
    padding: .13em .55em;
    border-radius: .2em;
    background: #08284d;
    color: #fff;
}
.ipps-sheet[data-style="stadium-night"] .ipps-next-pair strong { background: #0c54a4; }
.ipps-next small { margin-top: .13em; }
.ipps-sheet[data-style^="stadium-"] .ipps-next small { text-align: center; font-weight: 400; }
.ipps-sheet[data-style^="stadium-"] .ipps-match strong { padding: .16em .4em; }
@media screen and (max-width: 720px) {
    .ipps-sheet[data-style^="stadium-"] { padding-inline: .5em; }
}
@media print {
    .ipps-sheet[data-style^="stadium-"] { font-size: 9pt; }
    .ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-brand h1 { font-size: 12pt; }
    .ipps-sheet[data-style^="stadium-"] .ipps-panel-head h2 { font-size: 16pt; }
}

/* Inset the live panels while the stadium artwork spans the full sheet. */
.ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-columns {
    box-sizing: border-box;
    width: 88% !important;
    max-width: 100%;
    margin-inline: auto !important;
}
@media screen and (max-width: 720px) {
    .ipps-dialog .ipps-sheet[data-style^="stadium-"] .ipps-columns {
        width: 94% !important;
    }
}

.ipp-wrap .ipp-table-wrap tbody tr > :first-child:is(.ipps-first, .ipps-last, .ipps-playoff, .ipps-playout) {
    font-weight: 700;
}