/* =========================================================
   BALLOT PAGE
   ========================================================= */

.ballot-container {
    width: min(100%, 900px);
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.ballot-form {
    width: 100%;
}


/* --------------------------------
   Ballot heading
-------------------------------- */

.ticket-heading {
    text-align: center;
    font-size: 22px;
    color: #333;
}


/* --------------------------------
   Individual ballot question
-------------------------------- */

.ballot-question {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    width: 100%;
    gap: 14px;

    margin: 0 0 28px;
    padding: 16px;

    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 10px;

    box-sizing: border-box;

    box-shadow:
            0 3px 10px rgba(0, 0, 0, 0.09);

    transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease,
            transform 0.2s ease;
}

.ballot-question:focus-within {
    border-color: #777777;

    box-shadow:
            0 5px 16px rgba(0, 0, 0, 0.14);
}


/* --------------------------------
   Ballot description
-------------------------------- */

.description-box {
    width: 100%;
    max-width: 75%;
    height: 150px;

    margin: 30px auto;
    padding: 10px;

    overflow: auto;

    background-color: #fafafa;
    border: 1px solid #cccccc;

    box-sizing: border-box;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #2b2b2b;

    white-space: pre-wrap;
}

/* Description scrollbar */

.description-box-ballot::-webkit-scrollbar {
    width: 10px;
}

.description-box-ballot::-webkit-scrollbar-track {
    background: #e8e8e8;
    border-radius: 10px;
}

.description-box-ballot::-webkit-scrollbar-thumb {
    background: #888888;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
}

.description-box-ballot::-webkit-scrollbar-thumb:hover {
    background: #666666;
}


/* =========================================================
   GENERAL CARDS
   ========================================================= */

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 20px;
    padding: 20px;
}


/* --------------------------------
   Standard card
-------------------------------- */


.card {
    width: 250px;
    height: 250px;
    overflow: hidden;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    background-color: #f0f0f0; /* Light gray background */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    justify-content: space-between; /* Space elements top and bottom */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid black;
}

.card:hover {
    transform: scale(1.05);

    box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.2);
}


.card-content {
    background-color: #333;
    padding: 5px 10px;
    width: 100%;
    text-align: center;
    height: auto;

}

.card-link {
    display: block;
    width: fit-content;

    color: inherit;
    text-decoration: none;
}

.card-title {
    margin: 0 0 4px;

    font-size: 14px;
    font-weight: bold;
}

.card-description {
    margin: 0;

    font-size: 12px;
}


/* --------------------------------
   Card answer status
-------------------------------- */

.card-answer {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 15%;
    padding: 4px 6px;

    box-sizing: border-box;

    color: #ffffff;

    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.answer-pending {
    background-color: #ffff00;
    color: #040101;

    font-family: "Agency FB", sans-serif;
    font-size: 24px;
    font-style: italic;
    letter-spacing: 0.2em;
}

.answer-yes {
    background-color: #0093ff;
    color: #000000;

    font-family: "Agency FB", sans-serif;
    font-size: 24px;
    letter-spacing: 0.2em;
}

.answer-no {
    background-color: #55ff78;
    color: #000000;

    font-family: "Agency FB", sans-serif;
    font-size: 24px;
    letter-spacing: 0.2em;
}

.answer-inconclusive {
    background-color: #808080;
    color: #000000;

    font-family: "Agency FB", sans-serif;
    font-size: 24px;
    letter-spacing: 0.2em;
}


/* --------------------------------
   Ticket card
-------------------------------- */

.card-ticket {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    width: 325px;
    height: 300px;

    overflow: hidden;

    background-color: #f0f0f0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    border: 2px solid #000000;

    font-family: sans-serif;
    color: #ffffff;

    box-shadow:
            0 2px 6px rgba(0, 0, 0, 0.15);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.card-ticket:hover {
    transform: scale(1.05);

    box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-content-ticket {
    height: 20%;
    padding: 5px 10px;

    background-color: #333333;
    opacity: 0.85;

    box-sizing: border-box;
}

.card-title-ticket {
    margin: 0 0 4px;

    font-size: 18px;
    font-weight: bold;
}

.card-description-ticket {
    margin: 0;

    font-size: 12px;
}


/* --------------------------------
   General description box
-------------------------------- */

.description-box {
    width: 100%;
    max-width: 75%;
    height: 150px;

    margin: 30px auto;
    padding: 10px;

    overflow: auto;

    background-color: #fafafa;
    border: 1px solid #cccccc;

    box-sizing: border-box;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #2b2b2b;
}


/* --------------------------------
   Timer
-------------------------------- */

.timer {
    color: #ff00ea;
}


/* =========================================================
   ENTER CONTEST BUTTON
   ========================================================= */

.enter-contest-btn {
    display: block;

    margin: 20px auto;
    padding: 12px 24px;

    background-color: #01b801;
    border: none;
    border-radius: 6px;

    color: #000000;

    font-family: "Agency FB", sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;

    cursor: pointer;

    box-shadow:
            0 4px 8px rgba(1, 184, 1, 0.6);

    transition:
            background-color 0.25s ease,
            box-shadow 0.25s ease,
            transform 0.15s ease;
}

.enter-contest-btn:hover {
    background-color: #019a01;

    box-shadow:
            0 6px 12px rgba(1, 154, 1, 0.8);
}

.enter-contest-btn:active {
    transform: scale(0.98);
}


/* =========================================================
   YES / NO BALLOT SELECTOR
   ========================================================= */

.glass-radio-group {
    --group-bg: #333333;
    --group-bg-dark: #242424;
    --border-color: #000000;
    --accent-gold: #ffd700;
    --yes-color: #01b801;
    --yes-color-dark: #008f00;
    --no-color: #ff0000;
    --no-color-dark: #c90000;

    position: relative;
    isolation: isolate;

    display: flex;

    width: 100%;
    min-height: 58px;
    height: auto;

    overflow: hidden;

    background:
            linear-gradient(
                    180deg,
                    var(--group-bg),
                    var(--group-bg-dark)
            );

    border: 2px solid var(--border-color);
    border-radius: 4px;

    box-sizing: border-box;

    box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            inset 0 0 0 1px rgba(255, 215, 0, 0.25);
}


/* Hidden radio buttons */

.glass-radio-group input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}


/* YES and NO labels */

.glass-radio-group label {
    position: relative;
    z-index: 3;

    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;

    min-width: 0;
    padding: 8px 6px;

    box-sizing: border-box;

    color: #ffffff;

    font-family: "Agency FB", sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.08em;
    line-height: 1.05;
    text-transform: uppercase;

    text-align: center;

    cursor: pointer;
    user-select: none;

    text-shadow:
            0 1px 2px rgba(0, 0, 0, 0.9);

    transition:
            color 0.2s ease,
            text-shadow 0.2s ease,
            transform 0.15s ease,
            background-color 0.2s ease;
}

.glass-radio-label-text {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;

    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
}


/* Neutral hover */

.glass-radio-group label:hover {
    color: var(--accent-gold);

    background-color: rgba(255, 255, 255, 0.04);

    text-shadow:
            0 0 7px rgba(255, 215, 0, 0.7),
            0 1px 2px rgba(0, 0, 0, 0.9);
}


/* Press effect */

.glass-radio-group label:active {
    transform: scale(0.97);
}


/* Center divider */

.glass-radio-group::after {
    content: "";

    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    z-index: 4;

    width: 2px;

    background:
            linear-gradient(
                    180deg,
                    transparent,
                    rgba(0, 0, 0, 0.95),
                    transparent
            );

    transform: translateX(-1px);

    pointer-events: none;
}


/* Sliding selection block */

.glass-glider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    z-index: 1;

    width: calc(50% - 3px);

    background-color: transparent;
    border: 1px solid #000000;
    border-radius: 3px;

    opacity: 0;

    transform: translateX(0);

    box-shadow:
            0 3px 8px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);

    transition:
            transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
            background 0.3s ease,
            opacity 0.2s ease,
            box-shadow 0.3s ease;
}


/* Subtle shine */

.glass-glider::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
            linear-gradient(
                    180deg,
                    rgba(255, 255, 255, 0.22),
                    rgba(255, 255, 255, 0.04) 42%,
                    rgba(0, 0, 0, 0.12)
            );

    pointer-events: none;
}


/* YES selected */

.glass-radio-group:has(
    input[name^="question"]:checked[value="yes"]
) .glass-glider {
    background:
            linear-gradient(
                    180deg,
                    var(--yes-color),
                    var(--yes-color-dark)
            );

    opacity: 1;

    transform: translateX(0);

    box-shadow:
            0 4px 10px rgba(1, 184, 1, 0.5),
            inset 0 0 0 2px #000000,
            inset 0 0 0 4px rgba(255, 215, 0, 0.25);
}


/* NO selected */

.glass-radio-group:has(
    input[name^="question"]:checked[value="no"]
) .glass-glider {
    background:
            linear-gradient(
                    180deg,
                    var(--no-color),
                    var(--no-color-dark)
            );

    opacity: 1;

    transform: translateX(100%);

    box-shadow:
            0 4px 10px rgba(255, 0, 0, 0.45),
            inset 0 0 0 2px #000000,
            inset 0 0 0 4px rgba(255, 215, 0, 0.25);
}


/* Default label appearance after selection */

.glass-radio-group:has(input:checked) label {
    color: #222222;
    text-shadow: none;
}


/* Selected label */

.glass-radio-group input:checked + label {
    color: #ffffff;

    text-shadow:
            0 1px 2px rgba(0, 0, 0, 0.9);
}


/* Keep selected label white on hover */

.glass-radio-group input:checked + label:hover {
    color: #ffffff;
}


/* Keyboard focus */

.glass-radio-group input:focus-visible + label {
    outline: 3px solid var(--accent-gold);
    outline-offset: -5px;

    box-shadow:
            inset 0 0 0 2px #000000;
}


/* Disabled question */

.glass-radio-group.is-disabled {
    opacity: 0.55;

    filter: grayscale(0.25);

    pointer-events: none;
}


/* Optional error state */

.glass-radio-group.has-error {
    border-color: #ff0000;

    box-shadow:
            0 0 0 2px rgba(255, 0, 0, 0.25),
            0 4px 8px rgba(0, 0, 0, 0.35);
}


/* Optional correct-answer display */

.glass-radio-group.is-correct {
    outline: 3px solid #01b801;
    outline-offset: 2px;
}


/* Optional incorrect-answer display */

.glass-radio-group.is-incorrect {
    outline: 3px solid #ff0000;
    outline-offset: 2px;
}


/* --------------------------------
   Unanswered animation
-------------------------------- */

.glass-radio-group:not(:has(input:checked)) {
    cursor: pointer;

    animation:
            radioPulse 2.4s ease-in-out infinite;

    will-change:
            transform,
            box-shadow;
}


/* Sweeping highlight */

.glass-radio-group:not(:has(input:checked))::before {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: -45%;
    z-index: 2;

    width: 28%;

    background:
            linear-gradient(
                    110deg,
                    transparent 0%,
                    rgba(255, 255, 255, 0.04) 22%,
                    rgba(255, 255, 255, 0.34) 50%,
                    rgba(255, 215, 0, 0.14) 62%,
                    transparent 100%
            );

    filter: blur(1px);

    opacity: 0;

    transform: skewX(-18deg);

    pointer-events: none;

    animation:
            radioSweep 4.8s ease-in-out infinite;

    will-change:
            left,
            opacity;
}


/* Breathing glow */

@keyframes radioPulse {
    0%,
    100% {
        transform: scale(1);

        box-shadow:
                0 4px 8px rgba(0, 0, 0, 0.35),
                0 0 0 0 rgba(255, 215, 0, 0),
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                inset 0 0 0 1px rgba(255, 215, 0, 0.25);
    }

    45% {
        transform: scale(1.012);

        box-shadow:
                0 7px 16px rgba(0, 0, 0, 0.42),
                0 0 14px 2px rgba(255, 215, 0, 0.34),
                inset 0 1px 0 rgba(255, 255, 255, 0.14),
                inset 0 0 0 2px rgba(255, 215, 0, 0.72);
    }

    60% {
        transform: scale(1.008);

        box-shadow:
                0 6px 13px rgba(0, 0, 0, 0.4),
                0 0 9px 1px rgba(255, 215, 0, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.11),
                inset 0 0 0 1px rgba(255, 215, 0, 0.5);
    }
}


/* One clean sweep followed by a pause */

@keyframes radioSweep {
    0%,
    12% {
        left: -45%;
        opacity: 0;
    }

    18% {
        opacity: 0.85;
    }

    38% {
        left: 118%;
        opacity: 0.72;
    }

    44%,
    100% {
        left: 118%;
        opacity: 0;
    }
}


/* =========================================================
   CONFIDENCE SELECTOR
   ========================================================= */

.confidence-selector {
    width: 100%;

    margin: 0;
    padding: 13px;

    background:
            linear-gradient(
                    180deg,
                    #f8f8f8,
                    #eeeeee
            );

    border: 1px solid #cccccc;
    border-radius: 8px;

    box-sizing: border-box;
}

.confidence-heading {
    padding: 0 7px;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #262626;
}

.confidence-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}


/* --------------------------------
   Confidence buttons
-------------------------------- */

.confidence-option {
    position: relative;

    display: block;

    min-width: 0;

    cursor: pointer;
    user-select: none;
}

.confidence-option input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}

.confidence-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 66px;
    padding: 8px 6px;

    background: #ffffff;
    border: 2px solid #c8c8c8;
    border-radius: 7px;

    box-sizing: border-box;

    text-align: center;

    transition:
            background-color 0.18s ease,
            border-color 0.18s ease,
            box-shadow 0.18s ease,
            transform 0.18s ease;
}

.confidence-option:hover .confidence-content {
    border-color: #8e8e8e;

    transform: translateY(-2px);

    box-shadow:
            0 4px 8px rgba(0, 0, 0, 0.12);
}

.confidence-option input:focus-visible
+ .confidence-content {
    outline: 3px solid rgba(40, 100, 200, 0.28);
    outline-offset: 2px;
}

.confidence-name {
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.1;
}

.confidence-points {
    margin-top: 5px;

    color: #5d5d5d;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
}


/* --------------------------------
   Selected confidence states
-------------------------------- */
/* Very Low */

.confidence-very-low input:checked
+ .confidence-content {
    background: #9ed9aa;
    border-color: #1f6f3d;

    color: #0b3518;

    box-shadow:
            0 0 0 2px rgba(31, 111, 61, 0.18),
            0 4px 9px rgba(0, 0, 0, 0.11);
}


/* Very High */

.confidence-very-high input:checked
+ .confidence-content {
    background: #ffd3d3;
    border-color: #a91f1f;

    color: #5a0000;

    box-shadow:
            0 0 0 2px rgba(169, 31, 31, 0.18),
            0 4px 9px rgba(0, 0, 0, 0.11);
}


.confidence-low input:checked
+ .confidence-content {
    background: #d8f3dc;
    border-color: #3b8c50;

    color: #174f25;

    box-shadow:
            0 0 0 2px rgba(59, 140, 80, 0.15),
            0 4px 9px rgba(0, 0, 0, 0.11);
}

.confidence-normal input:checked
+ .confidence-content {
    background: #fff2c8;
    border-color: #c58b16;

    color: #684600;

    box-shadow:
            0 0 0 2px rgba(197, 139, 22, 0.16),
            0 4px 9px rgba(0, 0, 0, 0.11);
}

.confidence-high input:checked
+ .confidence-content {
    background: #ffe4bf;
    border-color: #d67a00;
    color: #7a4300;
}

.confidence-option input:checked
+ .confidence-content {
    transform: translateY(-2px);
}

.confidence-option input:checked
+ .confidence-content::after {
    content: "Selected";

    margin-top: 5px;
    padding: 2px 6px;

    background: rgba(255, 255, 255, 0.72);
    border-radius: 10px;

    color: currentColor;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


/* Make point text match selected state */

.confidence-option input:checked
+ .confidence-content
.confidence-points {
    color: currentColor;
}


/* --------------------------------
   Confidence explanation
-------------------------------- */

.confidence-explanation {
    margin-top: 9px;

    color: #606060;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: center;
}


/* =========================================================
   CONTEST STATUS BUTTONS
   ========================================================= */

.entry-status-btn {
    display: block;

    padding: 12px 24px;

    background-color: #01b801;
    border: none;

    color: #000000;

    font-family: "Agency FB", sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;

    cursor: pointer;

    box-shadow:
            0 4px 8px rgba(1, 184, 1, 0.6);

    transition:
            background-color 0.25s ease,
            box-shadow 0.25s ease,
            transform 0.15s ease;
}

.entry-status-btn:hover {
    background-color: #019a01;

    box-shadow:
            0 6px 12px rgba(1, 154, 1, 0.8);
}

.entry-status-btn:active {
    transform: scale(0.98);
}

.entry-status-btn.closed {
    background-color: #ff0000;
    color: #000000;

    box-shadow: none;
}

.entry-status-btn.closed:hover {
    background-color: #ff1800;

    box-shadow:
            0 6px 12px rgba(255, 29, 29, 0.8);
}


/* --------------------------------
   Ballot submit button
-------------------------------- */

.ballot-submit-button {
    display: block;

    min-width: 190px;
    margin: 18px auto 0;

    border-radius: 6px;
}


/* --------------------------------
   Highlight text
-------------------------------- */

.highlight {
    color: #ffd700;
    font-weight: bold;
}


/* =========================================================
   BALLOT ERRORS
   ========================================================= */

.ballot-error {
    width: min(100%, 700px);

    margin: 18px auto;
    padding: 12px 16px;

    background: #ffe2e2;
    border: 1px solid #d83d3d;
    border-radius: 6px;

    box-sizing: border-box;

    color: #8a1111;

    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}


/* =========================================================
   MOBILE LAYOUT
   ========================================================= */

@media (max-width: 700px) {
    .ballot-container {
        padding: 12px;
    }

    .ballot-question {
        gap: 11px;

        margin-bottom: 20px;
        padding: 11px;
    }

    .description-box-ballot {
        height: 150px;
        padding: 10px;

        font-size: 14px;
    }

    .description-box {
        max-width: 100%;
    }

    .card-container {
        padding: 10px;
    }

    .card,
    .card-ticket {
        max-width: 100%;
    }
}


/* --------------------------------
   YES / NO mobile
-------------------------------- */

@media (max-width: 600px) {
    .glass-radio-group {
        min-height: 52px;

        border-radius: 3px;
    }

    .glass-radio-group label {
        padding: 8px;

        font-size: 17px;
        letter-spacing: 0.07em;
    }

    .glass-glider {
        top: 2px;
        bottom: 2px;
        left: 2px;

        width: calc(50% - 2px);
    }


    /* Confidence mobile */

    .confidence-selector {
        padding: 10px;
    }

    .confidence-options {
        gap: 5px;
    }

    .confidence-content {
        min-height: 60px;
        padding: 7px 3px;
    }

    .confidence-name {
        font-size: 0.88rem;
    }

    .confidence-points {
        font-size: 0.64rem;
    }

    .confidence-option input:checked
    + .confidence-content::after {
        font-size: 0.55rem;
    }
}


/* --------------------------------
   Very small screens
-------------------------------- */

@media (max-width: 390px) {
    .confidence-options {
        grid-template-columns: 1fr;
    }

    .confidence-content {
        min-height: 50px;
    }

    .confidence-option input:checked
    + .confidence-content::after {
        margin-top: 4px;
    }

    .ticket-heading {
        font-size: 19px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .card,
    .card-ticket,
    .enter-contest-btn,
    .entry-status-btn,
    .ballot-question,
    .confidence-content,
    .glass-radio-group label,
    .glass-glider {
        transition: none;
    }

    .glass-radio-group:not(:has(input:checked)),
    .glass-radio-group:not(:has(input:checked))::before {
        animation: none;
    }

    .glass-radio-group:not(:has(input:checked)) {
        box-shadow:
                0 4px 8px rgba(0, 0, 0, 0.35),
                0 0 10px rgba(255, 215, 0, 0.24),
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                inset 0 0 0 1px rgba(255, 215, 0, 0.45);
    }
}


     /* =========================================
    Contest Stats Container
 ========================================= */

 .contest-stats {
     display: grid;
     grid-template-columns:
        repeat(auto-fit, minmax(130px, 1fr));
     gap: 8px;

     width: 100%;
     margin: 8px 0 16px;
     padding: 8px;

     background-color: #f1f1f1;
     border: 1px solid #c5c5c5;
     border-radius: 5px;

     box-shadow:
             0 2px 6px rgba(0, 0, 0, 0.15);
 }


/* =========================================
   Standard Stat Cards
========================================= */

.contest-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 54px;
    padding: 7px 10px;

    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: 5px;

    text-align: center;

    transition:
            border-color 0.15s ease,
            box-shadow 0.15s ease,
            transform 0.15s ease;
}

.contest-stat:hover {
    border-color: #007bff;

    box-shadow:
            0 2px 5px rgba(0, 123, 255, 0.18);

    transform: translateY(-1px);
}

.contest-stat-label {
    display: block;
    margin-bottom: 2px;

    color: #666666;
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.contest-stat-value {
    display: block;

    color: #333333;
    font-family: Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.2;
}


/* =========================================
   Wide Timeline Cards
========================================= */

.contest-stat-wide {
    grid-column: span 2;
}


/* =========================================
   Prize Pool
========================================= */

.contest-stat-prize {
    border-color: #8fbfff;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #f5f9ff
            );
}

.contest-stat-prize .contest-stat-value {
    color: #007bff;
    font-size: 17px;
}

.contest-stat-prize:hover {
    border-color: #007bff;
}


/* =========================================
   Shared Entry and Contest Period Styling
========================================= */

.entry-period-timer,
.contest-period-timer {
    min-height: 70px;
    padding: 8px 12px;

    border-color: #a9bfd8;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #f4f7fa
            );
}

.entry-period-dates,
.contest-period-dates {
    color: #444444;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.entry-period-countdown,
.contest-period-countdown {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    padding-top: 4px;

    color: #356da8;
    border-top: 1px solid #dbe3eb;

    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;

    font-variant-numeric: tabular-nums;
}

.contest-date-separator {
    margin: 0 5px;
    color: #888888;
    font-weight: normal;
}


/* =========================================
   Entry Period States
========================================= */

/* Entries have not opened yet */
.entry-period-timer.entry-upcoming {
    border-color: #6ea4e6;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #f2f7fd
            );
}

.entry-period-timer.entry-upcoming
.entry-period-countdown {
    color: #1f6bc1;
    border-top-color: #d6e4f5;
}


/* Entries are currently open */
.entry-period-timer.entry-open {
    border-color: #4caf50;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #eef9ef
            );
}

.entry-period-timer.entry-open
.entry-period-countdown {
    color: #2f8b35;
    border-top-color: #d4e8d6;
}


/* Entries are closed */
.entry-period-timer.entry-closed {
    border-color: #d32f2f;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #fff1f1
            );
}

.entry-period-timer.entry-closed
.entry-period-countdown {
    color: #b71c1c;
    border-top-color: #f0caca;
}


/* =========================================
   Contest Period States
========================================= */

/* Contest has not started yet */
.contest-period-timer.contest-upcoming {
    border-color: #6ea4e6;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #f2f7fd
            );
}

.contest-period-timer.contest-upcoming
.contest-period-countdown {
    color: #1f6bc1;
    border-top-color: #d6e4f5;
}


/* Contest is currently active */
.contest-period-timer.contest-active {
    border-color: #4caf50;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #eef9ef
            );
}

.contest-period-timer.contest-active
.contest-period-countdown {
    color: #2f8b35;
    border-top-color: #d4e8d6;
}


/* Contest has ended */
.contest-period-timer.contest-ended {
    border-color: #777777;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #ededed
            );
}

.contest-period-timer.contest-ended
.contest-period-countdown {
    color: #555555;
    border-top-color: #d4d4d4;
}


/* =========================================
   Invalid or Missing Dates
========================================= */

.entry-period-timer.timer-invalid,
.contest-period-timer.timer-invalid {
    border-color: #d32f2f;

    background:
            linear-gradient(
                    180deg,
                    #ffffff,
                    #fff3f3
            );
}

.entry-period-timer.timer-invalid
.entry-period-countdown,
.contest-period-timer.timer-invalid
.contest-period-countdown {
    color: #b71c1c;
    border-top-color: #f0caca;
}


/* =========================================
   Optional Status Badge
========================================= */

.contest-status {
    display: inline-block;
    align-self: center;

    padding: 3px 8px;

    border-radius: 4px;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.contest-status.is-open {
    color: #ffffff;
    background-color: #4caf50;
    border: 1px solid #388e3c;
}

.contest-status.is-closed {
    color: #ffffff;
    background-color: #d32f2f;
    border: 1px solid #a92323;
}


/* =========================================
   Tablet Layout
========================================= */

@media (max-width: 700px) {
    .contest-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .contest-stat-wide {
        grid-column: 1 / -1;
    }

    .entry-period-dates,
    .contest-period-dates {
        font-size: 10px;
    }
}


/* =========================================
   Mobile Layout
========================================= */

@media (max-width: 420px) {
    .contest-stats {
        grid-template-columns: 1fr;
    }

    .contest-stat-wide {
        grid-column: auto;
    }

    .entry-period-timer,
    .contest-period-timer {
        min-height: 66px;
    }
}
/* More compact overrides */

.contest-stats {
    grid-template-columns:
        repeat(auto-fit, minmax(115px, 1fr));

    gap: 5px;
    margin: 5px 0 10px;
    padding: 5px;
}

.contest-stat {
    min-height: 44px;
    padding: 5px 7px;
}

.contest-stat-label {
    margin-bottom: 1px;
    font-size: 9px;
    letter-spacing: 0.6px;
}

.contest-stat-value {
    font-size: 14px;
}

.contest-stat-prize .contest-stat-value {
    font-size: 16px;
}

.entry-period-timer,
.contest-period-timer {
    min-height: 56px;
    padding: 6px 8px;
}

.entry-period-dates,
.contest-period-dates {
    font-size: 10px;
    line-height: 1.2;
}

.entry-period-countdown,
.contest-period-countdown {
    min-height: 14px;
    margin-top: 3px;
    padding-top: 3px;
    font-size: 12px;
}

.contest-date-separator {
    margin: 0 3px;
}

.contest-status {
    padding: 2px 6px;
    font-size: 10px;
}

@media (max-width: 420px) {
    .entry-period-timer,
    .contest-period-timer {
        min-height: 54px;
    }
}

.refund-notice {
    margin: 12px 0;
    padding: 12px 16px;

    background: #fff3f3;
    border: 1px solid #d32f2f;
    border-left: 5px solid #d32f2f;
    border-radius: 5px;

    color: #7a0000;
    font-size: 14px;
}

/* =========================================================
   COMMUNITY CONSENSUS
   ========================================================= */
.consensus-card {
    width: min(100%, 700px);
    margin: 24px auto;
    padding: 18px 20px;

    background: linear-gradient(180deg, #f7f8fa 0%, #e9edf1 100%);
    border: 1px solid #b8c2cc;
    border-radius: 10px;

    box-sizing: border-box;

    box-shadow:
            0 5px 14px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.consensus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
}

.consensus-header h3 {
    margin: 0;

    color: #343b45;

    font-family: "Agency FB", "Segoe UI", sans-serif;
    font-size: 27px;
    font-weight: bold;
    letter-spacing: 0.04em;
}

.consensus-header span {
    padding: 5px 10px;

    background: #343b45;
    border: 1px solid #20252b;
    border-radius: 5px;

    color: #ffffff;

    font-family: "Agency FB", "Segoe UI", sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            0 2px 5px rgba(0, 0, 0, 0.18);
}

.consensus-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 7px;

    font-family: "Agency FB", "Segoe UI", sans-serif;
    font-size: 25px;
    font-weight: bold;
    letter-spacing: 0.08em;
}

.consensus-labels strong:first-child {
    color: #b72d32;
}

.consensus-labels strong:last-child {
    color: #2b7b4c;
}


/* --------------------------------
   Consensus meter
-------------------------------- */
.consensus-card {
    width: min(100%, 700px);
    margin: 24px auto;
    padding: 18px;

    background: linear-gradient(
            180deg,
            #f8fafc 0%,
            #e3e8ed 100%
    );

    border: 1px solid #aeb8c2;
    border-radius: 9px;
    box-sizing: border-box;

    box-shadow:
            0 6px 16px rgba(0, 0, 0, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
}


/* --------------------------------
   Header
-------------------------------- */

.consensus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    margin-bottom: 14px;
}

.consensus-header h3 {
    margin: 0;

    color: #252b31;

    font-family: "Agency FB", "Segoe UI", sans-serif;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.consensus-header span {
    padding: 5px 11px;

    background: linear-gradient(
            180deg,
            #3e4853,
            #262c33
    );

    border: 1px solid #171b20;
    border-radius: 5px;

    color: #ffffff;

    font-family: "Agency FB", "Segoe UI", sans-serif;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    box-shadow:
            0 2px 5px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
}


/* --------------------------------
   NO / YES labels
-------------------------------- */

.consensus-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 5px;

    font-family: "Agency FB", "Segoe UI", sans-serif;
    font-size: 25px;
    font-weight: bold;
    letter-spacing: 0.12em;
}

.consensus-labels strong:first-child {
    color: #d4141b;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.consensus-labels strong:last-child {
    color: #078c36;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}


/* --------------------------------
   Meter
-------------------------------- */

.consensus-meter {
    position: relative;
    isolation: isolate;

    width: 100%;
    height: 38px;

    background: linear-gradient(
            90deg,
            #a90008 0%,
            #ec1822 18%,
            #ff656a 34%,
            #dadde0 48%,
            #dadde0 52%,
            #65d27e 66%,
            #0db745 82%,
            #067a2e 100%
    );

    border: 2px solid #252a30;
    border-radius: 5px;

    box-sizing: border-box;
    overflow: visible;

    box-shadow:
            inset 0 3px 5px rgba(0, 0, 0, 0.3),
            inset 0 -1px 0 rgba(255, 255, 255, 0.25),
            0 3px 7px rgba(0, 0, 0, 0.22);
}

.consensus-meter::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 1;

    background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.38) 0%,
            rgba(255, 255, 255, 0.05) 48%,
            rgba(0, 0, 0, 0.16) 100%
    );

    border-radius: 3px;
    pointer-events: none;
}


/* --------------------------------
   Center line
-------------------------------- */

.consensus-center {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 50%;
    z-index: 3;

    width: 3px;

    background: #22272d;

    transform: translateX(-50%);

    box-shadow:
            1px 0 0 rgba(255, 255, 255, 0.5),
            -1px 0 0 rgba(255, 255, 255, 0.2);
}


/* --------------------------------
   Marker
-------------------------------- */
/* --------------------------------
   Consensus marker
-------------------------------- */

.consensus-marker {
    position: absolute;
    top: 50%;
    left: var(--consensus-position);
    z-index: 5;

    width: 10px;
    height: 54px;

    background: linear-gradient(
            90deg,
            #8f9aa4 0%,
            #dce3e8 20%,
            #ffffff 48%,
            #ffffff 52%,
            #c3ccd4 78%,
            #7d8994 100%
    );

    border: 2px solid #15191d;
    border-radius: 4px;

    transform: translate(-50%, -50%);
    transform-origin: center;

    box-shadow:
            0 5px 10px rgba(0, 0, 0, 0.42),
            0 1px 2px rgba(0, 0, 0, 0.55),
            0 0 0 2px rgba(255, 255, 255, 0.25);

    will-change: left, transform;

    animation:
            consensus-swing 0.75s cubic-bezier(.18, .72, .22, 1) both,
            consensus-lock 0.28s ease-out 1.55s both;
}


/* Bright metallic center */

.consensus-marker::before {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 50%;

    width: 2px;

    background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 1),
            rgba(255, 255, 255, 0.55)
    );

    border-radius: 2px;

    transform: translateX(-50%);
}


/* Pointer */

.consensus-marker::after {
    position: absolute;
    left: 50%;
    bottom: -8px;

    width: 0;
    height: 0;

    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #15191d;

    transform: translateX(-50%);

    filter: drop-shadow(
            0 2px 1px rgba(0, 0, 0, 0.28)
    );
}


/* --------------------------------
   Main sweep
-------------------------------- */

@keyframes consensus-swing {
    0% {
        left: 50%;
        transform:
                translate(-50%, -50%)
                rotate(0deg);
    }

    14% {
        left: 10%;
        transform:
                translate(-50%, -50%)
                rotate(-2deg);
    }

    29% {
        left: 90%;
        transform:
                translate(-50%, -50%)
                rotate(2deg);
    }

    44% {
        left: 22%;
        transform:
                translate(-50%, -50%)
                rotate(-1.5deg);
    }

    59% {
        left: 78%;
        transform:
                translate(-50%, -50%)
                rotate(1.5deg);
    }

    72% {
        left: 35%;
        transform:
                translate(-50%, -50%)
                rotate(-1deg);
    }

    83% {
        left: 66%;
        transform:
                translate(-50%, -50%)
                rotate(1deg);
    }

    91% {
        left: 47%;
        transform:
                translate(-50%, -50%)
                rotate(-0.5deg);
    }

    100% {
        left: var(--consensus-position);
        transform:
                translate(-50%, -50%)
                rotate(0deg);
    }
}


/* --------------------------------
   Small lock-in movement
-------------------------------- */

@keyframes consensus-lock {
    0% {
        transform:
                translate(-50%, -50%)
                scale(1);
    }

    35% {
        transform:
                translate(-50%, -50%)
                scale(1.08);
    }

    65% {
        transform:
                translate(-50%, -50%)
                scale(0.97);
    }

    100% {
        transform:
                translate(-50%, -50%)
                scale(1);

        box-shadow:
                0 5px 10px rgba(0, 0, 0, 0.42),
                0 1px 2px rgba(0, 0, 0, 0.55),
                0 0 0 2px rgba(255, 255, 255, 0.3),
                0 0 11px rgba(255, 255, 255, 0.4);
    }
}


/* --------------------------------
   Percentages
-------------------------------- */

.consensus-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;

    margin-top: 13px;

    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.consensus-details span {
    padding: 4px 7px;

    border: 1px solid transparent;
    border-radius: 4px;
}

.consensus-details span:first-child {
    color: #a80f16;

    background: rgba(190, 24, 31, 0.08);
    border-color: rgba(190, 24, 31, 0.12);
}

.consensus-details span:last-child {
    color: #087c32;

    background: rgba(8, 140, 54, 0.08);
    border-color: rgba(8, 140, 54, 0.12);
}


/* --------------------------------
   Response count
-------------------------------- */

.consensus-responses {
    margin-top: 10px;
    padding-top: 9px;

    border-top: 1px solid #c3cbd3;

    color: #606b75;

    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}


/* --------------------------------
   Reduced motion
-------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .consensus-marker {
        animation: none;
    }
}


/* --------------------------------
   Mobile
-------------------------------- */

@media (max-width: 700px) {
    .consensus-card {
        margin: 18px auto;
        padding: 13px;
    }

    .consensus-header {
        margin-bottom: 12px;
    }

    .consensus-header h3 {
        font-size: 23px;
    }

    .consensus-header span {
        font-size: 16px;
    }

    .consensus-labels {
        font-size: 21px;
    }

    .consensus-meter {
        height: 34px;
    }

    .consensus-marker {
        width: 8px;
        height: 46px;
    }

    .consensus-details {
        margin-top: 11px;
        font-size: 12px;
    }
}
