
:root {
    --pink: #ffc9de;
    --pink-dark: #ff8fbf;
    --blue: #b9e6ff;
    --blue-dark: #6fc6f2;
    --purple: #e3c7f7;
    --cream: #fff8f0;
    --text: #5a4463;
    --text-soft: #8a7793;
    --white: #ffffff;
    --radius: 22px;
    --radius-sm: 14px;
    --shadow: 0 10px 30px rgba(180, 130, 170, 0.18);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    overflow-x: hidden;
    font-family: 'Quicksand', sans-serif;
    color: var(--text);
    background-image:
        linear-gradient(180deg, rgba(234,247,255,0.18) 0%, rgba(253,238,252,0.15) 45%, rgba(255,248,240,0.2) 100%),
        url('/assets/img/fond.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .brand {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
}

a { color: inherit; text-decoration: none; }

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(180, 130, 170, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--pink-dark);
}

.nav-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.nav-links a { font-weight: 600; color: var(--text); }
.nav-links a:hover { color: var(--pink-dark); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cream);
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    font-weight: 600;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.badge-voter {
    background: var(--blue-dark);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.nav-btn {
    background: linear-gradient(135deg, var(--pink-dark), var(--purple));
    color: white !important;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(255, 143, 191, 0.35);
    transition: transform 0.15s ease;
}
.nav-btn:hover { transform: translateY(-2px); }

.nav-btn-ghost {
    background: transparent;
    color: var(--text-soft) !important;
    box-shadow: none;
    font-weight: 600;
}

.page {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 100px;
    box-sizing: border-box;
}

.hero {
    text-align: center;
    padding: 40px 20px 20px;
}

.hero h1 {
    font-size: 2.6rem;
    color: var(--pink-dark);
    margin-bottom: 8px;
}

.hero p {
    color: var(--text-soft);
    font-size: 1.1rem;
}

.hero-bubble {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--pink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 20px auto 32px;
    padding: 26px 30px;
    text-align: center;
}
.hero-bubble p {
    color: var(--text-soft);
    font-size: 1.1rem;
    margin: 0;
}

.section-title {
    font-size: 1.5rem;
    margin: 40px 0 18px;
    color: var(--text);
}

.contest-grid, .submission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-4px); }

.contest-card { padding: 0 0 20px; }

.contest-card-banner {
    height: 110px;
    background: linear-gradient(135deg, var(--blue), var(--pink));
}

.contest-card-body { padding: 16px 20px 0; }

.contest-card h3 { margin: 0 0 6px; font-size: 1.2rem; }

.contest-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.status-active { background: #d6f7df; color: #1f9d55; }
.status-upcoming { background: #ffe9c2; color: #b9770e; }
.status-closed { background: #eee0f5; color: #8a5db3; }

.submission-card { padding-bottom: 16px; }

.submission-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--cream);
    overflow: hidden;
}

.submission-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.submission-body { padding: 14px 18px 16px; }

.submission-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 6px;
}

.submission-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.submission-bubble {
    cursor: pointer;
}

.bubble-hint {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pink-dark);
}

.criterion-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 4px;
}

.criterion-help {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-bottom: 14px;
    line-height: 1.4;
}

.score-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.score-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--pink);
    background: white;
    color: var(--pink-dark);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.score-btn:hover { background: var(--pink); color: white; }
.score-btn.selected { background: var(--pink-dark); color: white; border-color: var(--pink-dark); }

.vote-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(90, 68, 99, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.vote-modal-overlay[hidden] {
    display: none;
}

.vote-modal-shell {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: calc(900px + 2 * 62px);
    width: 100%;
}

.vote-modal {
    position: relative;
    background: var(--cream);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(90, 68, 99, 0.4);
    max-width: 900px;
    width: 100%;
    height: min(640px, 90vh);
    overflow: hidden;
}

.vote-modal-content {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    height: 100%;
}

.vote-modal-image-wrap {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}
.vote-modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vote-modal-panel {
    height: 100%;
    padding: 32px 28px;
    overflow-y: auto;
}
.vote-modal-panel h3 {
    margin: 0 0 16px;
    font-size: 1.4rem;
    color: var(--pink-dark);
}

.vote-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.vote-modal-arrow {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--pink-dark);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(90, 68, 99, 0.25);
}
.vote-modal-arrow:hover { background: white; }

.wizard-step-indicator {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}
.wizard-nav button {
    background: linear-gradient(135deg, var(--pink-dark), var(--purple));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.wizard-nav button:disabled { opacity: 0.35; cursor: not-allowed; }
#wizardPrevBtn {
    background: transparent;
    color: var(--text-soft);
    box-shadow: none;
}

.admin-delete-zone {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--pink);
}

.admin-delete-btn {
    background: transparent;
    border: 2px solid #ffb3c4;
    color: #c23b52;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.admin-delete-btn:hover { background: #ffe1e6; }

.admin-delete-confirm p {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c23b52;
    margin: 0 0 10px;
}

.admin-delete-confirm-actions {
    display: flex;
    gap: 10px;
}

.admin-delete-yes, .admin-delete-cancel {
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    border: none;
}
.admin-delete-yes {
    background: #e2445c;
    color: white;
}
.admin-delete-yes:hover { background: #c23b52; }
.admin-delete-cancel {
    background: var(--cream);
    color: var(--text-soft);
}
.admin-delete-cancel:hover { background: #f0e6dc; }

@media (max-width: 640px) {
    
    .vote-modal-shell { gap: 0; position: relative; }
    .vote-modal-arrow {
        position: absolute;
        top: 20vh;
        transform: translateY(-50%);
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
        z-index: 20;
    }
    #voteModalPrev { left: 8px; }
    #voteModalNext { right: 8px; }
    .vote-modal { height: 90vh; }
    .vote-modal-content { grid-template-columns: 1fr; grid-template-rows: 40vh 1fr; overflow-y: auto; }
    .vote-modal-image-wrap { height: 40vh; }
    .vote-modal-panel { height: auto; padding: 24px 20px; }
    .vote-modal-close { width: 40px; height: 40px; font-size: 1.4rem; }
    .score-btn { width: 38px; height: 38px; }
}

.vote-done, .vote-disabled {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--cream);
    padding: 8px 14px;
    border-radius: 999px;
    display: inline-block;
}

.result-score {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--blue-dark);
}

.tie-break-box {
    padding: 24px;
    margin-bottom: 30px;
    border: 2px dashed var(--pink-dark);
}

.tie-break-vote-btn {
    background: linear-gradient(135deg, var(--pink-dark), var(--purple));
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}
.tie-break-vote-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state {
    text-align: center;
    color: var(--text-soft);
    padding: 40px 0;
}

.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 600;
}
.alert-error { background: #ffe1e6; color: #c23b52; }
.alert-success { background: #d6f7df; color: #1f9d55; }

.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(180, 130, 170, 0.12);
    z-index: 40;
}

.mascot-wrap {
    position: fixed;
    z-index: 50;
}
.mascot-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}
.mascot-bottom-right { right: 12px; bottom: 52px; }
.mascot-bottom-left { left: 12px; bottom: 52px; }
.mascot-top-right { right: 12px; top: 76px; }
.mascot-top-left { left: 12px; top: 76px; }

.mascot-bubble {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 14px;
    width: 230px;
    max-width: 60vw;
    background: var(--white);
    border: 2px solid var(--pink);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text);
    box-shadow: var(--shadow);
}
.mascot-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 24px;
    border: 10px solid transparent;
    border-top-color: var(--white);
}

@media (max-width: 640px) {
    .mascot-wrap { max-width: 90px !important; width: 90px !important; }
    .mascot-bottom-right, .mascot-bottom-left { bottom: 64px; }
    .mascot-bubble { width: 180px; font-size: 0.72rem; padding: 10px 12px; }
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--cream);
    font-size: 0.9rem;
}
.admin-table th { background: var(--cream); font-weight: 700; }

.admin-form {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 30px;
}
.admin-form label { display: block; font-weight: 700; margin: 12px 0 6px; }
.admin-form input, .admin-form textarea, .admin-form select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--cream);
    font-family: inherit;
    font-size: 1rem;
}
.admin-form button {
    margin-top: 16px;
    background: linear-gradient(135deg, var(--pink-dark), var(--purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.duration-row {
    display: flex;
    gap: 12px;
}
.duration-row label {
    display: flex;
    flex-direction: column;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-soft);
    margin: 0;
    flex: 1;
}
.duration-row input {
    margin-top: 4px;
}

@media (max-width: 640px) {
    .navbar {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
        row-gap: 10px;
    }
    .nav-logo-img { height: 30px; }
    .nav-links {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: flex-start;
    }
    .nav-user span:not(.badge-voter) {
        display: none;
    }
    .nav-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .page {
        padding: 24px 16px 100px;
    }

    .hero { padding: 24px 10px 10px; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 0.95rem; }

    .hero-bubble {
        margin: 14px auto 24px;
        padding: 18px 20px;
        border-radius: var(--radius-sm);
    }
    .hero-bubble p { font-size: 0.95rem; }

    .section-title { font-size: 1.2rem; margin: 28px 0 14px; }

    .contest-grid, .submission-grid {
        grid-template-columns: 1fr;
    }

    .admin-form { padding: 16px; }

    .duration-row {
        flex-wrap: wrap;
    }
    .duration-row label {
        flex: 1 1 calc(50% - 6px);
        min-width: 90px;
    }

    .tie-break-box { padding: 16px; }

    .admin-delete-confirm-actions {
        flex-wrap: wrap;
    }
}
