/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #000000 0%, #000000 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Variables CSS pour les couleurs des équipes */
:root {
    --quichons-color: #ff6b6b;
    --quichons-light: #ff8e8e;
    --quichons-dark: #ff4757;
    --quiches-color: #4ecdc4;
    --quiches-light: #7bed9f;
    --quiches-dark: #2ed573;
    --admin-color: #f39c12;
    --admin-dark: #e67e22;
}

/* ============= VERSION DESKTOP ============= */
.desktop {
    position: relative;
    overflow: hidden;
    /* pour contenir le ::before */
}

.desktop::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("background.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.2;
    /* <-- image à 50% */
    z-index: -1;
    /* reste derrière le contenu */
}

.desktop-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    color: white;
}

/* Scores en haut */
.scores-header {
    display: flex;
    justify-content: center;
    gap: 100px;
    margin-bottom: 30px;
    animation: slideDown 1s ease-out;
}

.score-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.score-badge:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.quiches-score {
    border-left: 5px solid var(--quiches-color);
}

.quichons-score {
    border-left: 5px solid var(--quichons-color);
}

.team-name {
    font-weight: bold;
    font-size: 1.2em;
}

.vote-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 1.5em;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    animation: pulse 2s infinite;
}

/* Contenu principal */
.main-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sections des équipes */
.team-section {
    flex: 1;
    text-align: center;
    padding: 20px;
}

.team-section h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #000;
    /* texte sombre à l'intérieur */
    -webkit-text-stroke: 2px #fff;
    /* contour blanc autour */
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    animation: glow 3s ease-in-out infinite;
}

.quiches-team h2 {
    color: var(--quiches-color);
}

.quichons-team h2 {
    color: var(--quichons-color);
}

.team-members {
    list-style: none;
    font-size: 1.5em;
}

.team-members li {
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quiches-team .team-members li:hover {
    background: var(--quiches-color);
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.quichons-team .team-members li:hover {
    background: var(--quichons-color);
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

/* Section centrale */
.center-section {
    flex: 1;
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

#qrcode-container {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

#qrcode-container:hover {
    transform: scale(1.02);
}

#qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#qrcode-container p {
    color: #333;
    font-weight: bold;
}

/* Timer */
.timer-display {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#timer {
    font-size: 3em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.timer-admin-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.timer-admin-controls input {
    width: 80px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
}

.timer-admin-controls button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: var(--admin-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.9em;
}

.timer-admin-controls button:hover {
    background: var(--admin-dark);
}

/* Votes récents */
.recent-votes {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-votes h3 {
    margin-bottom: 15px;
    text-align: center;
}

#votes-list {
    max-height: 200px;
    overflow-y: auto;

    /* Passage en grille 2 colonnes */
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.vote-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.vote-item.new-vote {
    animation: newVoteAlert 1s ease;
}

.vote-quiches {
    border-left: 4px solid var(--quiches-color);
}

.vote-quichons {
    border-left: 4px solid var(--quichons-color);
}

/* ============= VERSION MOBILE ============= */
.mobile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.mobile-container {
    width: 100%;
    max-width: 400px;
}

.vote-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.vote-container h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.team-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.team-btn {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quiches-btn {
    background: var(--quiches-color);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.quiches-btn:hover,
.quiches-btn:active {
    background: var(--quiches-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.quichons-btn {
    background: var(--quichons-color);
    color: white;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.quichons-btn:hover,
.quichons-btn:active {
    background: var(--quichons-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.success-message {
    background: rgba(46, 213, 115, 0.1);
    border: 2px solid #2ed573;
    border-radius: 15px;
    padding: 30px;
    color: #2ed573;
}

.success-message h2 {
    margin-bottom: 15px;
}

.vote-again-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.vote-again-btn:hover {
    background: #5a67d8;
}

/* ============= ADMINISTRATION ============= */
.admin-panel {
    background: rgba(243, 156, 18, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--admin-color);
}

.desktop-admin {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    z-index: 1000;
}

.mobile-admin {
    margin-bottom: 30px;
}

.admin-panel h2,
.admin-panel h3 {
    color: white;
    margin-bottom: 15px;
    text-align: center;
}

.admin-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-btn {
    background: var(--admin-dark);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease;
}

.admin-btn:hover {
    background: #d35400;
    transform: translateY(-2px);
}

.admin-input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
}

.timer-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.timer-controls input {
    width: 80px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    text-align: center;
}

/* ============= OVERLAYS ============= */
#video-overlay,
#end-sequence-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-video {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 10000;
}

#video-container {
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-container iframe,
#video-container video {
    width: 100%;
    height: 100%;
    border: none;
}

#end-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* L’item nouvellement arrivé “pulse” légèrement */
.vote-item.new-vote {
    animation: pulse-in 0.6s ease-out;
}

@keyframes pulse-in {
    0% {
        transform: scale(0.98);
        opacity: 0.0;
    }

    60% {
        transform: scale(1.02);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* ============= ANIMATIONS ============= */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {

    0%,
    100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    50% {
        text-shadow: 2px 2px 20px rgba(255, 255, 255, 0.5);
    }
}

@keyframes newVoteAlert {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }

    50% {
        transform: scale(1.02);
        background: rgba(255, 215, 0, 0.3);
    }

    100% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    #votes-list {
        grid-template-columns: 1fr;
    }

    .desktop .main-content {
        flex-direction: column;
        gap: 20px;
    }

    .team-section {
        padding: 10px;
    }

    .scores-header {
        gap: 20px;
        flex-wrap: wrap;
    }

    .desktop-admin {
        position: relative;
        width: 100%;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .team-buttons {
        flex-direction: column;
    }

    .vote-container {
        padding: 20px;
    }
}

/* ============= NOTIFICATIONS ============= */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.info {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.notification.success {
    background: linear-gradient(135deg, #2ed573, #2ed573);
}

.notification.warning {
    background: linear-gradient(135deg, #ffa502, #ff6348);
}

.notification.error {
    background: linear-gradient(135deg, #ff4757, #c44569);
}

/* ============= ANIMATIONS SUPPLÉMENTAIRES ============= */
.pressed {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.qr-hover {
    transform: scale(1.02) rotate(2deg);
}

.member-highlight {
    animation: memberGlow 0.3s ease;
}

.timer-ended {
    animation: timerAlert 1s infinite;
}

@keyframes memberGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
}

@keyframes timerAlert {

    0%,
    100% {
        color: #ff4757;
        text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
    }

    50% {
        color: #ffffff;
        text-shadow: 0 0 20px rgba(255, 71, 87, 1);
    }
}

/* ============= STYLES RESPONSIVE ADMIN ============= */
.mobile-responsive {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    margin: 10px 0 !important;
}

/* ============= AMÉLIORATION SCROLLBAR ============= */
#votes-list::-webkit-scrollbar {
    width: 8px;
}

#votes-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#votes-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#votes-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}