/* FICHIER: css/fortune_wheel.css */
/* Styles dédiés pour la roue de la fortune - DAYZ AIDE 4 ans */

/* Variables CSS pour la cohérence */
:root {
    --fortune-primary: #FFD700;
    --fortune-secondary: #FF6B35;
    --fortune-bg: linear-gradient(135deg, #1a2531, #2e3b4e);
    --fortune-card-bg: rgba(40, 44, 52, 0.8);
    --fortune-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Reset pour la page de la roue */
.fortune-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--fortune-bg);
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
}

/* ========================================
   STYLES DISCORD AUTHENTICATION
======================================== */

.discord-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-login-content {
    background: linear-gradient(135deg, #7289da, #5865f2);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    color: white;
    box-shadow: 0 0 50px rgba(114, 137, 218, 0.5);
}

.discord-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.discord-title {
    font-size: 2rem;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 1rem;
}

.discord-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.discord-btn {
    background: white;
    color: #5865f2;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.discord-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.user-info {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 15px;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFD700;
}

.user-name {
    font-weight: bold;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #c0392b;
}

/* ========================================
   FORTUNE WHEEL MAIN STYLES
======================================== */

/* Container principal */
.fortune-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Effets de lumière de foire */
.fortune-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 69, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 70%, rgba(138, 43, 226, 0.1) 0%, transparent 50%);
    animation: fairyLights 4s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes fairyLights {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

/* Header d'anniversaire */
.anniversary-banner {
    text-align: center;
    margin-bottom: 2rem;
    z-index: 10;
    position: relative;
    width: 100%;
    max-width: 800px;
}

.anniversary-banner h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--fortune-primary);
    font-family: 'Orbitron', sans-serif;
    text-shadow: 
        0 0 10px var(--fortune-primary),
        0 0 20px var(--fortune-primary),
        0 0 30px var(--fortune-primary);
    margin-bottom: 1rem;
    animation: glow 2s ease-in-out infinite alternate;
    line-height: 1.1;
}

@keyframes glow {
    from { 
        text-shadow: 
            0 0 10px var(--fortune-primary),
            0 0 20px var(--fortune-primary),
            0 0 30px var(--fortune-primary);
    }
    to { 
        text-shadow: 
            0 0 15px var(--fortune-primary),
            0 0 25px var(--fortune-primary),
            0 0 35px var(--fortune-primary),
            0 0 40px var(--fortune-primary);
    }
}

.anniversary-banner p {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #FFF;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.anniversary-banner p:last-child {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--fortune-primary);
    margin-bottom: 0;
}

/* Section de la roue */
.wheel-section {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Container de la roue */
.wheel-container {
    position: relative;
    width: min(400px, 80vw);
    height: min(400px, 80vw);
    margin: 0 auto 2rem;
    max-width: 400px;
    max-height: 400px;
}

/* La roue elle-même */
.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 0 8px #8B4513,
        0 0 0 12px #654321,
        0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.wheel.spinning {
    animation: wheelSpin 4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes wheelSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}

/* Segments de la roue */
.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    overflow: visible;
}

.wheel-text {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

.wheel-text span {
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    text-align: center;
    display: block;
}

/* Centre de la roue */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--fortune-primary), #FFA500);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    border: 4px solid #8B4513;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #8B4513;
}

/* Pointeur de la roue */
.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid #DC143C;
    transform: translateX(-50%);
    z-index: 25;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Bouton de rotation */
.spin-button {
    background: linear-gradient(45deg, var(--fortune-secondary), #F7931E);
    border: none;
    color: white;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: bold;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 5px 15px rgba(255, 107, 53, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: buttonPulse 2s infinite;
    margin-bottom: 1rem;
    z-index: 10;
    position: relative;
}

@keyframes buttonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.spin-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 
        0 8px 25px rgba(255, 107, 53, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.spin-button:disabled {
    background: #666;
    cursor: not-allowed;
    animation: none;
    transform: scale(1);
    opacity: 0.7;
}

/* Informations de timing */
.timer-info {
    text-align: center;
    margin-top: 1rem;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: var(--fortune-primary);
    z-index: 10;
    position: relative;
}

/* Bouton retour à l'accueil */
.back-home {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--fortune-primary);
    color: var(--fortune-primary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.back-home:hover {
    background: var(--fortune-primary);
    color: #000;
    transform: translateX(-5px);
}

/* Contrôles audio */
.audio-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.audio-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--fortune-primary);
    color: var(--fortune-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.audio-btn:hover {
    background: var(--fortune-primary);
    color: #000;
    transform: scale(1.1);
}

.audio-btn.muted {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Modal pour les résultats */
.result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.result-modal.show {
    display: flex;
}

.result-content {
    background: linear-gradient(135deg, #2e3b4e, #1a2531);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 3px solid #FFD700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    animation: modalAppear 0.5s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.winner .result-icon {
    color: #FFD700;
    animation: celebration 1s ease-in-out infinite alternate;
}

.loser .result-icon {
    color: #ff6b6b;
}

@keyframes celebration {
    from { transform: scale(1); }
    to { transform: scale(1.2); }
}

.result-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-family: 'Orbitron', sans-serif;
    color: white;
}

.winner .result-title {
    color: #FFD700;
}

.loser .result-title {
    color: #ff6b6b;
}

.result-prize {
    font-size: 1.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 2px dashed #FFD700;
    color: white;
}

.result-code {
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ff88;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    letter-spacing: 2px;
}

.close-modal {
    background: var(--fortune-primary);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-top: 1rem;
    font-weight: bold;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #FFD700;
    animation: confetti-fall 3s linear infinite;
    z-index: 999;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Animations supplémentaires pour l'ambiance foire */
@keyframes carnival-lights {
    0%, 100% { 
        box-shadow: 
            0 0 5px var(--fortune-primary),
            0 0 10px var(--fortune-primary),
            0 0 15px var(--fortune-primary);
    }
    25% { 
        box-shadow: 
            0 0 5px #FF69B4,
            0 0 10px #FF69B4,
            0 0 15px #FF69B4;
    }
    50% { 
        box-shadow: 
            0 0 5px #00BFFF,
            0 0 10px #00BFFF,
            0 0 15px #00BFFF;
    }
    75% { 
        box-shadow: 
            0 0 5px #32CD32,
            0 0 10px #32CD32,
            0 0 15px #32CD32;
    }
}

.wheel:not(.spinning) {
    animation: carnival-lights 3s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 768px) {
    .user-info {
        top: 70px;
        right: 10px;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }

    .discord-login-content {
        padding: 2rem 1rem;
    }

    .discord-title {
        font-size: 1.5rem;
    }

    .fortune-container {
        padding: 0.5rem;
        min-height: 100vh;
    }

    .anniversary-banner {
        margin-bottom: 1rem;
        padding: 0 1rem;
    }

    .anniversary-banner h1 {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    .anniversary-banner p {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
        margin-bottom: 0.3rem;
    }

    .wheel-container {
        width: min(280px, 85vw);
        height: min(280px, 85vw);
        margin-bottom: 1rem;
    }

    .wheel-center {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .wheel-pointer {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 25px solid #DC143C;
        top: -12px;
    }

    .spin-button {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .timer-info {
        font-size: 0.9rem;
        padding: 0 1rem;
        text-align: center;
    }

    .back-home {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        top: 5px;
        left: 5px;
    }

    .audio-controls {
        top: 10px;
        right: 10px;
        gap: 5px;
    }

    .audio-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .result-content {
        padding: 1.5rem 1rem;
        margin: 1rem;
        max-width: 90vw;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .result-prize {
        font-size: 1.2rem;
        padding: 0.8rem;
    }

    .result-code {
        font-size: 1.4rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .fortune-container {
        padding: 0.3rem;
    }

    .anniversary-banner h1 {
        font-size: clamp(1.2rem, 10vw, 2rem);
    }

    .wheel-container {
        width: min(250px, 90vw);
        height: min(250px, 90vw);
    }

    .wheel-center {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .spin-button {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .audio-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .result-content {
        padding: 1rem;
    }
}

@media (max-width: 360px) {
    .wheel-container {
        width: min(220px, 95vw);
        height: min(220px, 95vw);
    }

    .anniversary-banner h1 {
        font-size: 1.3rem;
    }

    .anniversary-banner p {
        font-size: 0.85rem;
    }
}