/* ── Winners page ─────────────────────────────────────────────────────────── */
.winner-border-gold   { border-color: #FFD700 !important; }
.winner-border-silver { border-color: #A8A9AD !important; }
.winner-border-bronze { border-color: #CD7F32 !important; }

/* Photo area: full card width, square */
.winner-card-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #1a1a1a;
    overflow: hidden;
}
.winner-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.winner-adult-mask {
    display: none;
    position: absolute;
    inset: 0;
    background: #6c757d;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
}
/* Rank + medal badge overlaid on photo */
.winner-card-rank {
    position: absolute;
    top: 0;
    left: 0;
    padding: .4rem .6rem;
    display: flex;
    align-items: center;
    gap: .3rem;
    background: linear-gradient(135deg, rgba(0,0,0,.65) 0%, transparent 100%);
}
/* Info bar below photo */
.winner-card-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: .6rem .75rem;
    gap: .5rem;
}
.winner-card-left  { min-width: 0; flex: 1 1 0; }
.winner-card-right { flex-shrink: 0; }

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8f9fa;
}

main {
    flex: 1;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    border-radius: 1rem;
    padding: 4rem 1rem;
}

.hero .text-muted {
    color: #adb5bd !important;
}

/* ── Gallery thumbnails ───────────────────────────────────────────────────── */
.gallery-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
}

.gallery-card {
    transition: transform .15s, box-shadow .15s;
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15) !important;
}

/* ── Photo selection (submit.php) ─────────────────────────────────────────── */
.photo-select-card {
    position: relative;
    transition: transform .15s, box-shadow .15s;
    border: 2px solid transparent;
    border-radius: .5rem;
    overflow: hidden;
}

.photo-select-card.selected {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25,135,84,.25);
}

.photo-select-card:hover:not(.opacity-50) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.check-overlay {
    display: none;
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(255,255,255,.85);
    border-radius: 50%;
    line-height: 1;
}

.photo-select-card.selected .check-overlay {
    display: block;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    border-radius: .75rem;
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: .5px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
    margin-top: auto;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
    border-radius: .75rem;
}

/* ── Pairwise voting arena ────────────────────────────────────────────────── */
.vote-instructions {
    font-size: 1.1rem;
}

.vote-arena {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.vote-option {
    flex: 1;
    position: relative;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: .75rem;
    overflow: hidden;
    background: #1a1a1a;
    padding: 0;
    transition: border-color .2s, transform .15s, box-shadow .2s;
    /* Remove default button styling */
    appearance: none;
    -webkit-appearance: none;
}

.vote-option:hover {
    border-color: #0d6efd;
    transform: scale(1.015);
    box-shadow: 0 8px 30px rgba(13,110,253,.3);
    z-index: 1;
}

.vote-option.chosen {
    border-color: #198754;
    box-shadow: 0 0 0 4px rgba(25,135,84,.4);
}

.vote-option img {
    width: 100%;
    height: 480px;
    object-fit: contain;
    display: block;
}

.vote-label {
    position: absolute;
    bottom: 2.5rem;
    left: 0;
    right: 0;
    background: rgba(13,110,253,.85);
    color: #fff;
    text-align: center;
    padding: .6rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
}

.vote-option:hover .vote-label {
    opacity: 1;
    transform: translateY(0);
}

.vote-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.6);
    color: rgba(255,255,255,.85);
    font-size: .8rem;
    padding: .35rem .6rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    flex-shrink: 0;
    font-size: 1.4rem;
    font-weight: 900;
    color: #6c757d;
    background: #f8f9fa;
    user-select: none;
}

/* ── FAQ / About markdown content ────────────────────────────────────────── */
.faq-content h2, .about-content h2, .rules-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid #dee2e6;
    color: #212529;
}

.faq-content h2:first-child, .about-content h2:first-child, .rules-content h2:first-child {
    margin-top: 0;
}

.faq-content strong, .about-content strong, .rules-content strong {
    display: block;
    margin-top: 1rem;
    margin-bottom: .2rem;
    color: #343a40;
}

.faq-content hr, .about-content hr, .rules-content hr {
    margin: 1.75rem 0;
    border-color: #dee2e6;
}

/* ── Responsive tweaks ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .vote-arena {
        flex-direction: column;
    }
    .vote-option img {
        height: 300px;
    }
    .vs-divider {
        min-width: unset;
        min-height: 44px;
        background: transparent;
    }
    .gallery-thumb { height: 120px; }
}

/* ── Avatar cropper ───────────────────────────────────────────────────────── */
#cropCanvas {
    max-width: 256px;
    max-height: 256px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: grab;
    touch-action: none;
}

#cropCanvas:active {
    cursor: grabbing;
}

.crop-instructions {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.crop-instructions ul {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.crop-instructions li {
    margin-bottom: 0.25rem;
}
