/* ==========================================================================
   The judges' pages around the console: the bout list and the PIN page.

   They wear the site's own styles (tokens.css, site.css); this file only
   adds what is particular to them. The console itself is styled apart,
   in style.css.
   ========================================================================== */

/* --- The bar ------------------------------------------------------------- */

.panel-bar {
    min-height: 64px;
}

.panel-bar__title {
    display: none;
    padding-left: 16px;
    border-left: 1px solid var(--ink-600);
    color: var(--text-on-dark-muted);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-bar__aside {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.panel-bar__aside form {
    margin: 0;
}

.panel-bar__user {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-on-dark);
    font-size: 13px;
    white-space: nowrap;
}

/* A long name gives way, the badge next to it never does. */
.panel-bar__name {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-bar__aside .lang {
    margin-left: 6px;
}

.panel-bar__admin {
    display: none;
    flex: none;
    margin-right: 6px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--gold);
    color: var(--ink-900);
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.panel-bar .site-menu__account span {
    display: none;
}

@media (min-width: 640px) {
    .panel-bar__title,
    .panel-bar__user {
        display: inline-flex;
    }

    .panel-bar__admin {
        display: inline-block;
    }

    .panel-bar .site-menu__account span {
        display: inline;
    }
}

/* --- The bout list: a poster per bout ------------------------------------ */

.panel-list__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 24px;
    margin-bottom: 22px;
}

.panel-list__kicker {
    margin: 0 0 4px;
    color: var(--accent);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.panel-list__title {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.panel-list__count {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-list__lede {
    max-width: 60ch;
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 15px;
}

/* The rest of the bout's panel, under its poster. */
/* The panel of a bout: one light line fastened under its poster. */
.crew {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 16px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 14px;
}

.crew__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* The officials in two lines, filled a column at a time: the line is as
   tall under every bout, whoever and however many judge it. */
.crew__seats {
    display: grid;
    grid-template-rows: repeat(2, minmax(30px, auto));
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, max-content);
    align-items: center;
    gap: 4px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.crew__seat {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

/* A seat's roles as icons, side by side; the name of each is its
   tooltip. A side judge's icon carries the judge's letter. */
.crew__role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Each role a small chip: a thin edge, a shade off the line's ground. */
.crew__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text-soft);
    cursor: help;
}

/* The reader's own roles: green icons, nothing else marks the line. */
.crew__seat.is-you .crew__badge {
    background: var(--green-soft);
    color: var(--green);
}

.crew__badge .fa {
    font-size: 14px;
}

.crew__badge b {
    font-size: 11px;
    font-weight: 700;
}

.crew__name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.crew__none {
    color: var(--text-muted);
}

.crew__link {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Narrower than a laptop: the title and the link go on a line of their
   own above the officials, who get the whole width. */
@media (max-width: 999px) {
    .crew {
        grid-template-columns: 1fr auto;
    }

    .crew__seats,
    .crew__none {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* A phone has room for two side by side: the same pairs a line each,
   three lines kept whoever judges. */
@media (max-width: 599px) {
    .crew__seats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(30px, auto));
        grid-auto-flow: row;
        gap: 4px 16px;
    }
}

/* The poster gives up its lower corners to the line under it. */
.poster:has(+ .crew) {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* A role in the history: the bouts the user worked. */
.history-list tr.is-mine td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.role-chip {
    display: inline-block;
    margin: 1px 4px 1px 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.poster__alone {
    margin: -4px 0 0;
    color: var(--text-on-dark-muted);
    font-size: 12px;
}

/* The finished bouts this account worked. */
.history-list {
    margin-top: calc(var(--gap) * 1.5);
}

.panel-list__head--small {
    align-items: baseline;
    margin-bottom: 12px;
}

.panel-list__subtitle {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.history-list .data-table td {
    white-space: nowrap;
}

.history-list small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.history-list__date {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
}

.history-list .history-list__bout,
.history-list .history-list__bout:hover {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

/* The whole row is the link to the bout's page. */
.history-list tbody tr {
    position: relative;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.history-list tbody tr:hover {
    background: var(--surface-soft);
}

.history-list__bout::after {
    content: "";
    position: absolute;
    inset: 0;
}

.history-list__bout:focus-visible {
    outline: none;
}

.history-list tbody tr:has(.history-list__bout:focus-visible) {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.history-list__bout em {
    color: var(--text-muted);
    font-style: normal;
    font-weight: 400;
}

.history-list .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.history-list .dot--a {
    background: var(--red);
}

.history-list .dot--b {
    background: var(--accent);
}

.history-list__winner {
    font-weight: 600;
}

.history-list__winner--a {
    color: var(--red);
}

.history-list__winner--b {
    color: var(--accent);
}

.history-list__none {
    color: var(--text-muted);
}

.poster {
    --corner-a: var(--red);
    --corner-b: var(--accent);

    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) minmax(0, 1fr);
    overflow: hidden;
    border-radius: var(--radius);
    background:
        linear-gradient(rgba(23, 27, 32, 0.9), rgba(23, 27, 32, 0.96)),
        var(--ink-900) var(--poster-bg) center / cover no-repeat;
    color: var(--text-on-dark);
    box-shadow: var(--shadow-raised);
}

.poster + .poster,
.crew + .poster {
    margin-top: var(--gap);
}

/* The two corners' colours meet at the top. */
.poster::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 5px;
    background: linear-gradient(90deg, var(--corner-a) 50%, var(--corner-b) 50%);
}

.poster__fighter {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 420px;
    overflow: hidden;
}

.poster__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.poster:hover .poster__photo {
    transform: scale(1.03);
}

/* Each photo fades into the middle of the poster. */
.poster__fighter--1::after,
.poster__fighter--2::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(23, 27, 32, 0.95) 0%, rgba(23, 27, 32, 0.15) 45%, transparent 70%);
}

.poster__fighter--1::after {
    background:
        linear-gradient(90deg, transparent 55%, rgba(23, 27, 32, 0.85)),
        linear-gradient(0deg, rgba(23, 27, 32, 0.95) 0%, rgba(23, 27, 32, 0.15) 45%, transparent 70%);
}

.poster__fighter--2::after {
    background:
        linear-gradient(270deg, transparent 55%, rgba(23, 27, 32, 0.85)),
        linear-gradient(0deg, rgba(23, 27, 32, 0.95) 0%, rgba(23, 27, 32, 0.15) 45%, transparent 70%);
}

.poster__who {
    position: relative;
    z-index: 1;
    padding: 22px clamp(18px, 2.4vw, 30px);
}

.poster__fighter--2 .poster__who {
    text-align: right;
}

.poster__corner {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--corner-a);
    color: var(--white);
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.poster__fighter--2 .poster__corner {
    background: var(--corner-b);
}

.poster__name {
    margin-top: 10px;
    color: var(--white);
    font-size: clamp(22px, 2.6vw, 34px);
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    overflow-wrap: break-word;
}

.poster__name span {
    display: block;
    color: var(--text-on-dark-muted);
    font-size: 0.5em;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.poster__caption {
    margin: 6px 0 0;
    color: var(--text-on-dark-muted);
    font-size: 14px;
}

.poster__record {
    margin: 10px 0 0;
    color: var(--gold);
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.poster__record small {
    margin-left: 4px;
    color: var(--text-on-dark-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* The markup lists both fighters first; the middle goes between them. */
.poster__fighter--1 {
    grid-column: 1;
    grid-row: 1;
}

.poster__fighter--2 {
    grid-column: 3;
    grid-row: 1;
}

.poster__center {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 34px 20px 26px;
    text-align: center;
}

.poster__state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--ink-700);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.poster__state--live {
    background: var(--red);
    color: var(--white);
}

.poster__state--live::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--white);
    animation: poster-blink 1.2s infinite;
}

.poster__title {
    margin: 0;
    color: var(--text-on-dark);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.poster__time {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.poster__time time {
    color: var(--white);
    font-family: var(--font-head);
    font-size: clamp(40px, 4.6vw, 56px);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.poster__time small {
    margin-top: 6px;
    color: var(--text-on-dark-muted);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.poster__vs {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: var(--font-head);
    font-size: 16px;
    font-style: italic;
    font-weight: 800;
}

.poster__facts {
    display: flex;
    gap: 20px;
    margin: 0;
}

.poster__facts dt {
    color: var(--text-on-dark-muted);
    font-family: var(--font-head);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.poster__facts dd {
    margin: 2px 0 0;
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
}

.poster__roles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.poster__roles span {
    width: 100%;
    color: var(--text-on-dark-muted);
    font-family: var(--font-head);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.poster__roles b {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--ink-700);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.poster__roles b:first-of-type {
    background: var(--gold);
    color: var(--ink-900);
}

.poster__open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    min-height: 56px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--white);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(58, 138, 216, 0.35);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.poster__open:hover {
    background: var(--accent-strong);
    color: var(--white);
}

.poster__open:active {
    transform: scale(0.98);
}

.poster.is-live .poster__open {
    background: var(--red);
    box-shadow: 0 8px 24px rgba(226, 64, 59, 0.35);
}

.poster.is-live .poster__open:hover {
    background: var(--red-strong);
}

.panel-empty {
    padding: 56px 24px;
    text-align: center;
}

.panel-empty .fa {
    color: var(--line-strong);
    font-size: 44px;
}

.panel-empty h2 {
    margin-top: 16px;
    font-size: 18px;
    text-transform: uppercase;
}

.panel-empty p {
    margin: 8px 0 0;
    color: var(--text-muted);
}

/* A tablet held upright and a phone: both fighters on top, the rest below. */
@media (max-width: 899px) {
    .poster {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .poster__fighter--2 {
        grid-column: 2;
    }

    .poster__center {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-top: 20px;
    }

    .poster__fighter {
        min-height: clamp(260px, 60vw, 380px);
    }

    .poster__fighter--1::after,
    .poster__fighter--2::after {
        background: linear-gradient(0deg, rgba(23, 27, 32, 0.98) 0%, rgba(23, 27, 32, 0.2) 50%, transparent 75%);
    }

    .poster__who {
        padding: 14px;
    }

    .poster__caption {
        display: none;
    }

    /* Two names side by side: small enough that a long one stays whole. */
    .poster__name {
        font-size: clamp(14px, 4.6vw, 26px);
        overflow-wrap: normal;
        word-break: keep-all;
    }
}

@keyframes poster-blink {
    50% {
        opacity: 0.35;
    }
}

/* --- The PIN page -------------------------------------------------------- */

.panel--pin {
    background:
        linear-gradient(rgba(23, 27, 32, 0.86), rgba(23, 27, 32, 0.94)),
        var(--ink-900) url("../../website/images/breadcrumbs/bg-bout-1920x726.053aa4f0e0d3.jpg") center / cover no-repeat;
}

.pin {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px var(--gutter);
}

.pin__card {
    width: 100%;
    max-width: 420px;
    padding: clamp(24px, 6vw, 40px);
    border-top: 3px solid var(--accent);
    text-align: center;
}

.pin__card .brand {
    margin-bottom: 18px;
}

.pin__title {
    margin-top: 18px;
    font-size: 20px;
    text-transform: uppercase;
}

.pin__lede {
    margin: 10px 0 24px;
    color: var(--text-soft);
    font-size: 14px;
}

.pin__inputs {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 3vw, 14px);
    margin-bottom: 22px;
}

.pin-input {
    width: clamp(52px, 17vw, 64px);
    height: clamp(60px, 19vw, 72px);
    padding: 0;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pin-input:focus {
    outline: 0;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(58, 138, 216, 0.18);
}

.pin__error {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-left: 4px solid var(--red);
    border-radius: var(--radius-sm);
    background: var(--red-soft);
    color: var(--red-deep);
    font-size: 14px;
    text-align: left;
}

.pin__foot {
    margin: 18px 0 0;
    font-size: 13px;
}
