body {
    background-image: url("../bg.jpg");
    background-repeat: repeat;
    background-position: top center;
    background-size: 400px auto;
    background-attachment: scroll;

    font-family: "Mona Sans", "Mona Sans Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #000000;
    max-width: 100%;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3 {
    color: #f8f0fb;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

h1 {
    font-size: 3rem;
    margin-bottom: 30px;
}

h3 {
    font-size: 2rem;
    margin-top: 40px;
}

.container {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.btn-primary {
    color: #fff;
    background-color: #8B0200;
    border: 3px solid #5a0100;
    border-radius: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 15px 40px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.6);
}

.btn-primary:hover {
    background-color: #a60300;
    border-color: #8B0200;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.8);
}

.btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
}

.choice-container {
    position: relative;
    padding: 10px;
}

.choice-img {
    width: 100%;
    max-height: 42vh;
    object-fit: contain;
    object-position: center;
    cursor: pointer;
    border: 5px solid #777;
    transition: all 0.3s ease;
    filter: grayscale(20%) contrast(110%);
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.7);
    background-color: #1a1a1a;
}

.choice-img:hover {
    transform: translate(-4px, -4px);
    border-color: #8B0200;
    filter: grayscale(0%) contrast(120%) brightness(105%);
    box-shadow: 12px 12px 0px rgba(139, 2, 0, 0.5);
}

.choice-img:active {
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.9);
}

.choice-container p {
    color: #8B0200;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.placeholder-box {
    min-height: 200px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px dashed #777;
    background-color: #1a1a1a;
    margin: 10px;
}

.placeholder-box p {
    color: #777;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === ALERTS === */
.alert {
    margin: 20px auto;
    max-width: 600px;
    font-weight: 600;
    border: 3px solid;
    border-radius: 0;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
}

.alert-success {
    background-color: #1a3a1a;
    border-color: #2d5a2d;
    color: #90ee90;
}

.alert-danger {
    background-color: #3a1a1a;
    border-color: #5a2d2d;
    color: #ff6b6b;
}

#leaderboard {
    background-color: #1a1a1a;
    border: 5px solid #777;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.7);
    margin-bottom: 50px;
}

#leaderboard thead {
    background-color: #8B0200;
    color: #fff;
}

#leaderboard thead th {
    text-align: center;
    padding: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
}

#leaderboard tbody tr {
    background-color: #2d2d2d;
    border-bottom: 2px solid #3a3a3a;
}

#leaderboard tbody tr:hover {
    background-color: #3a3a3a;
}

.leaderboard-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    object-position: center;
    border: 3px solid #777;
    filter: grayscale(20%);
    transition: all 0.3s ease;
}

.leaderboard-img:hover {
    filter: grayscale(0%);
    transform: scale(1.1);
    border-color: #8B0200;
}

#leaderboard tbody td {
    padding: 15px;
    color: #1a1a1a;
    vertical-align: middle;
    border: none;
}

#leaderboard tbody td:nth-child(1) {
    color: #000000 !important;
    font-weight: 800 !important;
    opacity: 1 !important;
}

#leaderboard tbody td:nth-child(2) {
    color: #8B0200;
    font-weight: 700;
    font-size: 1.3rem;
}

/* DataTables custom styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #000000 !important;
    background-color: #2d2d2d !important;
    border: 2px solid #777 !important;
    border-radius: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #fff !important;
    background-color: #8B0200 !important;
    border-color: #8B0200 !important;
}

.dataTables_wrapper .dataTables_info {
    color: #999;
}

#colorCorrect {
    color: #1a202c;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-family: sans-serif;
}

#heading {
    color: #7c3aed;
    background-color: #f5f3ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.loading-active {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

#vote-badge {
    background-color: #f5f3ff;
    color: #7c3aed;
    border: 3px solid #7c3aed;
    font-weight: 800;
    padding: 8px 15px;
    box-shadow: 4px 4px 0px rgba(124, 58, 237, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================
   MOBILE — 768px and below
   ============================================= */
/* =============================================
   MOBILE — 768px and below
   ============================================= */
@media (max-width: 768px) {

    /* --- Typography --- */
    h1 {
        font-size: 1.6rem;
        letter-spacing: 1px;
        margin-bottom: 16px;
    }

    h3 {
        font-size: 1.3rem;
        margin-top: 24px;
    }

    /* --- Layout --- */
    .container {
        padding: 0 12px;
    }

    .container .row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
    }

    /* --- Choice cards: FIXED SIZING LOGIC --- */
    .choice-container {
        padding: 8px 4px;
        margin-bottom: 4px;
    }

    .choice-img-wrapper {
        width: 100%;
        /* FIXED BOX: Square ratio prevents vertical bloat */
        aspect-ratio: 1 / 1;
        /* SAFETY CAP: Box will never exceed 32% of screen height */
        max-height: 32vh;

        background-color: #1a1a1a;
        border: 4px solid #777;
        box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.7);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }

    .choice-img-wrapper:active {
        box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.9);
        transform: translate(2px, 2px);
    }

    .choice-img {
        width: 100%;
        height: 100%;
        max-height: none;
        /* ZOOM LOGIC: Fills the fixed box without stretching */
        object-fit: cover;
        object-position: center;
        border: none;
        box-shadow: none;
        background-color: transparent;
        filter: grayscale(10%) contrast(110%);
        transition: filter 0.3s ease, transform 0.3s ease;
    }

    .choice-img:hover,
    .choice-img:focus {
        transform: scale(1.04);
        filter: grayscale(0%) contrast(120%) brightness(105%);
        box-shadow: none;
    }

    .choice-img:active {
        transform: scale(1.1);
        /* Interactive zoom when clicked */
        box-shadow: none;
    }

    .choice-container p {
        font-size: 0.85rem;
        margin-top: 6px;
        letter-spacing: 0.5px;
    }

    /* --- Placeholder --- */
    .placeholder-box {
        min-height: 140px !important;
        margin: 6px 4px;
        border-width: 3px;
    }

    .placeholder-box p {
        font-size: 1rem;
    }

    /* --- Button --- */
    .btn-primary {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
        letter-spacing: 1px;
        box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.6);
    }

    .btn-primary:active {
        transform: translate(2px, 2px);
        box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);
    }

    /* --- Alerts --- */
    .alert {
        margin: 12px 4px;
        font-size: 0.9rem;
        padding: 10px 14px;
        box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
    }

    /* --- Leaderboard --- */
    #leaderboard {
        border-width: 3px;
        box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.7);
        margin-bottom: 30px;
        font-size: 0.82rem;
    }

    #leaderboard thead th {
        padding: 10px 6px;
        font-size: 0.78rem;
        letter-spacing: 0.5px;
    }

    #leaderboard tbody td {
        padding: 10px 6px;
        vertical-align: middle;
    }

    #leaderboard tbody td:nth-child(2) {
        font-size: 1rem;
    }

    .leaderboard-img {
        width: 52px;
        height: 52px;
        border-width: 2px;
    }

    /* --- Vote badge --- */
    #vote-badge {
        font-size: 0.8rem;
        padding: 6px 10px;
        letter-spacing: 0.5px;
        box-shadow: 2px 2px 0px rgba(124, 58, 237, 0.3);
    }
}

/* =============================================
   SMALL PHONES — 480px and below
   ============================================= */
@media (max-width: 480px) {

    h1 {
        font-size: 1.3rem;
    }

    .choice-img-wrapper {
        /* Tighter aspect ratio and max-height for tiny screens */
        aspect-ratio: 1 / 1;
        max-height: 28vh;
        border-width: 3px;
    }

    .leaderboard-img {
        width: 38px;
        height: 38px;
    }

    #leaderboard {
        font-size: 0.75rem;
    }

    #leaderboard thead th,
    #leaderboard tbody td {
        padding: 7px 4px;
    }

    .btn-primary {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
}