/*
 * The tables of the widgets of an event (ranking, fixtures): their look and what they show at a width.
 *
 * Looks: bright by default ('bright'), 'dark', a color of the match widget for the head and the own teams
 * (also with 'dark'), and 'preset': a dark look with gold.
 *
 * Widths: the table fills the width it gets and leaves out what it can do without first, the widget
 * itself is the container the queries measure (so a scale factor counts as well). Names come short ('.s')
 * or full ('.w'); the marks of the teams (logo or color) show only with 'marks'.
 */

body {
    margin: 0;
    padding: 0;
    background: transparent;
    text-rendering: geometricPrecision;
    font-family: Helvetica, Arial, sans-serif;
}

.widget-main {
    --surface: #F8F8F8;
    --text: #202020;
    --muted: #707070;
    --line: rgba(0, 0, 0, 0.08);
    --stripe: transparent;
    --head: var(--neutral);
    --on-head: var(--on-neutral);
    --highlight: var(--accent);
    --on-highlight: var(--on-accent);
    --own: transparent;
    box-sizing: border-box;
    container-type: inline-size;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--surface);
    color: var(--text);
    font-size: 1rem;
    transform-origin: top left;
}

.widget-main:is(.rounded) {
    border-radius: 0.5rem;
}

.widget-main.dark {
    --surface: #202020;
    --text: #F2F2F2;
    --muted: #A0A0A0;
    --line: rgba(255, 255, 255, 0.1);
}

/* a color: the head in it as well */
.widget-main:is(.gold, .copper, .sky, .ocean, .silver, .sunset, .sun, .jungle) {
    --head: var(--accent);
    --on-head: var(--on-accent);
    --highlight: var(--accent-light);
}

/* 'preset': a dark look with gold, without a ground and margins of its own (made to sit on a dark page), the
   first row light */
.widget-main.preset {
    --surface: transparent;
    --text: #BDB9BB;
    --muted: #7B8495;
    --line: transparent;
    --stripe: #4D5855;
    --row: #292F2E;
    --head: #A07511;
    --on-head: #333333;
    --highlight: #A07511;
    --on-highlight: #333333;
    --own: #73311B;
    padding: 0;
    border-radius: 0;
}

.widget-main.preset tbody tr td {
    background-color: var(--row);
}

.widget-main.preset tbody tr:nth-child(2n + 1) td {
    background-color: var(--stripe);
}

.widget-main.preset tbody tr.own td {
    background-color: var(--own);
}

/* its cells: the type, the spacing and the head of classic tables, without lines, rounding or bold */
.preset table {
    font-family: sans-serif;
    font-size: 17px;
    line-height: 1.15;
}

.preset th,
.preset td {
    padding: 0.5em;
    font-size: inherit;
    font-weight: normal;
    white-space: nowrap;
    border: 0;
}

.preset th:first-child,
.preset th:last-child {
    border-radius: 0;
}

.preset tr.own td {
    font-weight: normal;
}

.widget-main.empty {
    visibility: hidden;
}

.title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.25rem 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.title .event-logo {
    height: 1.75rem;
}

.title .day:empty,
.title .event-logo[hidden],
.notitle .title {
    display: none;
}

.title .day {
    color: var(--muted);
    font-size: 1rem;
    font-weight: normal;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 0.3rem 0.5rem;
    background-color: var(--head);
    color: var(--on-head);
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

th:first-child {
    border-radius: 0.3rem 0 0 0.3rem;
}

th:last-child {
    border-radius: 0 0.3rem 0.3rem 0;
}

td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

tbody tr:nth-child(2n) td {
    background-color: var(--stripe);
}

tbody tr.own td {
    background-color: var(--own);
}

/* names: full where there is room, the short ones below; a name too long for its column ends in '…' */
.team .name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team .s {
    display: none;
}

/* the marks of the teams, only with 'marks': in a long list the colors are restless */
th.mark,
td.mark {
    display: none;
    padding: 0.3rem 0.2rem;
}

.marks th.mark,
.marks td.mark {
    display: table-cell;
}

.mark.logo {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}

.mark.color {
    display: block;
    width: 0.9rem;
    height: 0.9rem;
    margin: 0 0.3rem;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.6);
}

@container (max-width: 20rem) {
    .team .w {
        display: none;
    }

    .team .s {
        display: block;
    }
}
