:root {
    --bni-red: #b11f24;
    --bni-ink: #252b33;
    --bni-muted: #697386;
    --bni-soft: #f5f7fb;
}

body {
    background: var(--bni-soft);
    color: var(--bni-ink);
}

body.doorprize-fullscreen .navbar.bg-bni {
    display: none;
}

body.doorprize-fullscreen main {
    padding-top: 1rem !important;
}

.bg-bni {
    background: var(--bni-red);
}

.page-title {
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.page-subtitle {
    color: var(--bni-muted);
    margin-bottom: 1.25rem;
}

.panel {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 6px 18px rgba(31, 45, 61, .05);
}

.login-logo {
    display: block;
    width: 100%;
    height: auto;

}

.table thead th {
    color: #4b5565;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 76px;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: min(260px, 100%);
}

.table-responsive {
    overflow-x: hidden;
}

.dataTables_wrapper > .row {
    margin-left: 0;
    margin-right: 0;
}

.dataTables_wrapper > .row > * {
    padding-left: 0;
    padding-right: 0;
}

.datatable-top .dataTables_filter {
    text-align: right;
}

.datatable-footer .dataTables_length {
    text-align: center;
}

.datatable-footer .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
}

.js-datatable {
    width: 100% !important;
    table-layout: fixed;
}

.js-datatable th,
.js-datatable td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.js-datatable th:last-child,
.js-datatable td:last-child {
    width: 160px;
    white-space: nowrap;
}

.js-datatable .btn {
    white-space: nowrap;
}

.badge-due {
    background: #fff3cd;
    color: #8a5a00;
}

.badge-done {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-late {
    background: #f8d7da;
    color: #842029;
}

.form-help {
    color: var(--bni-muted);
    font-size: .9rem;
}

.subpanel {
    border: 1px solid #e4e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: .85rem;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 30px;
}

.chapter-role-list {
    width: 100%;
    border-collapse: collapse;
}

.chapter-role-list td {
    padding: .18rem 0;
}

.switch-row input[type="checkbox"],
.chapter-role-list input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #c8d0dc;
    background: #dbe1ea;
    margin: 0 .45rem 0 0;
    vertical-align: -4px;
    position: relative;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
    flex: 0 0 auto;
}

.switch-row input[type="checkbox"]::after,
.chapter-role-list input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 28, 38, .18);
    transition: transform .16s ease;
}

.switch-row input[type="checkbox"]:checked,
.chapter-role-list input[type="checkbox"]:checked {
    background: var(--bni-red);
    border-color: var(--bni-red);
}

.switch-row input[type="checkbox"]:checked::after,
.chapter-role-list input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.switch-row label {
    margin: 0;
    line-height: 1.25;
    cursor: pointer;
}

.chapter-role-list label {
    margin: 0 0 .18rem 0;
    display: inline-block;
    line-height: 1.25;
    cursor: pointer;
}

.login-fields {
    display: none;
}

.login-fields.is-visible {
    display: block;
}

.message-preview {
    white-space: pre-wrap;
    min-width: 260px;
}

.doorprize-layout {
    position: relative;
}

.doorprize-page.is-compact .doorprize-header {
    display: none !important;
}

.doorprize-reopen {
    position: fixed;
    top: 15px;
    left: 30px;
    z-index: 1020;
    display: none;
}

.doorprize-icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: none /*1px solid rgba(177, 31, 36, .28)*/;
    border-radius: 8px;
    background: transparent; /*rgba(255, 255, 255, .72)*/
    color: grey;
    font-size: 1.1rem;
    line-height: 1;
}

.doorprize-icon-button:hover {
    background: #fff;
    border-color: rgba(177, 31, 36, .45);
}

.doorprize-page.is-compact .doorprize-reopen {
    display: inline-flex;
}

.doorprize-page.is-sidebar-open .doorprize-reopen {
    display: none;
}

.doorprize-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(20, 28, 38, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.doorprize-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    width: min(420px, 92vw);
    padding: 1rem;
    background: #fff;
    border-right: 1px solid #e4e8f0;
    box-shadow: 16px 0 40px rgba(20, 28, 38, .18);
    transform: translateX(-105%);
    transition: transform .24s ease;
}

.doorprize-page.is-sidebar-open .doorprize-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.doorprize-page.is-sidebar-open .doorprize-panel {
    transform: translateX(0);
}

.participant-list {
    display: grid;
    gap: .35rem;
    max-height: calc(100vh - 118px);
    overflow: auto;
    padding-right: .25rem;
}

.participant-row {
    display: flex;
    gap: .65rem;
    align-items: center;
    border: 1px solid #e7ebf2;
    border-radius: 8px;
    padding: .55rem .65rem;
    cursor: pointer;
    background: #fff;
}

.participant-row:hover {
    background: #f8fafc;
}

.doorprize-stage {
    min-height: 78vh;
    display: grid;
    gap: 1rem;
    align-content: center;
    justify-items: center;
}

.doorprize-page.is-compact .doorprize-stage {
    min-height: calc(100vh - 2rem);
}

.wheel-wrap {
    position: relative;
    width: min(82vh, 860px, 100%);
    aspect-ratio: 1;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.wheel-pointer {
    position: absolute;
    left: 50%;
    top: -2px;
    z-index: 2;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 42px solid var(--bni-ink);
    transform: translateX(-50%);
}

.doorprize-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.winner-box {
    text-align: center;
    border: 1px solid #e4e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-width: min(100%, 420px);
    background: #fff;
}

.winner-name {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--bni-ink);
}

.winner-active {
    border-color: #f0b429;
    box-shadow: 0 0 0 4px rgba(240, 180, 41, .18);
}

.winner-spotlight {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 4;
    display: grid;
    justify-items: center;
    gap: .25rem;
    min-width: min(92%, 520px);
    padding: 1.2rem 1.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    border: 3px solid #f0b429;
    box-shadow: 0 20px 60px rgba(20, 28, 38, .28);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.45);
    pointer-events: none;
}

.winner-spotlight.is-visible {
    animation: winnerPop 2.6s cubic-bezier(.16, 1, .3, 1) forwards;
}

.spotlight-label {
    color: var(--bni-muted);
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.spotlight-name {
    color: var(--bni-red);
    font-size: clamp(2rem, 6vw, 4.7rem);
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.celebration-canvas {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
}

@keyframes winnerPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.42) rotate(-6deg);
    }

    24% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.18) rotate(2deg);
    }

    42% {
        transform: translate(-50%, -50%) scale(.98) rotate(0deg);
    }

    78% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -58%) scale(.92) rotate(0deg);
    }
}

@media (max-width: 991.98px) {
    .participant-list {
        max-height: calc(100vh - 118px);
    }
}
