/* =============================================
   ROLETA DE PRÊMIOS - PREMIUM DESIGN
   ============================================= */

:root {
    --gold-light: #F5D67B;
    --gold: #E0AA40;
    --gold-dark: #B8862D;
    --bg-dark: #0a0e1a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a8c0;
    --accent: #E0AA40;
    --danger: #ff4757;
    --success: #2ed573;
    --radius: 14px;
    --shadow-gold: 0 0 30px rgba(224, 170, 64, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(224, 170, 64, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(224, 170, 64, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(10, 14, 26, 1) 0%, rgba(10, 14, 26, 1) 100%);
    z-index: 0;
}

/* Background particles */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-particles .particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 8s infinite ease-in-out;
}

@keyframes floatParticle {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.6; transform: translateY(-80px) scale(1); }
}

/* ===================== APP CONTAINER ===================== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* ===================== TITLE ===================== */
.main-title {
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(224, 170, 64, 0.3));
    letter-spacing: 1px;
}

.title-icon {
    display: inline-block;
    -webkit-text-fill-color: initial;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ===================== PRIZE PANEL ===================== */
.prize-panel {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(224, 170, 64, 0.15);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.prize-panel:hover {
    border-color: rgba(224, 170, 64, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.toggle-panel-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    padding: 4px;
    transition: transform 0.3s ease;
}

.toggle-panel-btn.collapsed {
    transform: rotate(-90deg);
}

.panel-body {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.panel-body.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Add prize form */
.add-prize-form {
    display: flex;
    gap: 10px;
}

.add-prize-form input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.add-prize-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(224, 170, 64, 0.15);
}

.add-prize-form input::placeholder {
    color: var(--text-secondary);
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.add-btn:active {
    transform: translateY(0);
}

/* Prize list */
.prize-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.prize-list::-webkit-scrollbar {
    width: 4px;
}

.prize-list::-webkit-scrollbar-track {
    background: transparent;
}

.prize-list::-webkit-scrollbar-thumb {
    background: rgba(224, 170, 64, 0.3);
    border-radius: 4px;
}

.prize-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(224, 170, 64, 0.1);
    border: 1px solid rgba(224, 170, 64, 0.2);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-light);
    animation: tagAppear 0.3s ease;
}

@keyframes tagAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.prize-tag .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 71, 87, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--danger);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.prize-tag .remove-btn:hover {
    background: var(--danger);
    color: #fff;
    transform: scale(1.1);
}

/* ===================== WHEEL AREA ===================== */
.wheel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 520px;
    height: 520px;
}

/* Pointer */
.wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    transition: transform 0.1s ease;
}

.wheel-pointer.tick {
    animation: pointerTick 0.1s ease;
}

@keyframes pointerTick {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

/* Outer ring / lights */
.wheel-outer-ring {
    position: absolute;
    width: 510px;
    height: 510px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--gold-dark) 0deg,
        var(--gold-light) 10deg,
        var(--gold-dark) 20deg
    );
    z-index: 1;
    box-shadow: 
        0 0 60px rgba(224, 170, 64, 0.3),
        inset 0 0 30px rgba(0,0,0,0.3);
}

.wheel-outer-ring::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--bg-dark);
}

/* Light dots on outer ring */
.light-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 8px var(--gold), 0 0 20px rgba(224, 170, 64, 0.4);
    z-index: 2;
}

.light-dot.off {
    background: rgba(224, 170, 64, 0.2);
    box-shadow: none;
}

/* Canvas */
#wheelCanvas {
    position: absolute;
    z-index: 5;
    border-radius: 50%;
    filter: drop-shadow(0 8px 30px rgba(0,0,0,0.4));
}

/* Center spin button */
.center-btn {
    position: absolute;
    z-index: 10;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(145deg, var(--gold-light), var(--gold-dark));
    box-shadow: 
        0 4px 20px rgba(224, 170, 64, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    padding: 0;
}

.center-btn:hover {
    transform: scale(1.08);
    box-shadow: 
        0 6px 30px rgba(224, 170, 64, 0.6),
        inset 0 2px 4px rgba(255,255,255,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2);
}

.center-btn:active {
    transform: scale(0.95);
}

.center-btn.spinning {
    pointer-events: none;
    opacity: 0.7;
}

.center-btn-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.4) 0%, transparent 60%);
}

.spin-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: #1a1a2e;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===================== RESULT DISPLAY ===================== */
.result-display {
    width: 100%;
    max-width: 500px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(224, 170, 64, 0.1), rgba(224, 170, 64, 0.05));
    border: 1px solid rgba(224, 170, 64, 0.25);
    border-radius: var(--radius);
    text-align: center;
    animation: resultAppear 0.5s ease;
}

@keyframes resultAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-display.hidden {
    display: none;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.result-prize {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    position: relative;
    background: linear-gradient(145deg, #1a1f35, #0d1020);
    border: 1px solid rgba(224, 170, 64, 0.3);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 10px;
}

.modal-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
}

.modal-prize {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    padding: 15px;
    border: 2px solid rgba(224, 170, 64, 0.2);
    border-radius: 16px;
    background-color: rgba(224, 170, 64, 0.05);
    /* Need both background properties for the text effect */
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
}

.modal-close-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: 12px;
    color: #1a1a2e;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
    animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
    0% { 
        opacity: 1; 
        transform: translateY(0) rotate(0deg) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(500px) rotate(720deg) scale(0.5); 
    }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 560px) {
    .app-container {
        padding: 20px 15px 40px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .wheel-wrapper {
        width: 340px;
        height: 340px;
    }

    #wheelCanvas {
        width: 320px !important;
        height: 320px !important;
    }

    .wheel-outer-ring {
        width: 340px;
        height: 340px;
    }

    .center-btn {
        width: 70px;
        height: 70px;
    }

    .spin-text {
        font-size: 0.75rem;
    }

    .wheel-pointer svg {
        width: 35px;
        height: 50px;
    }

    .add-prize-form {
        flex-direction: column;
    }

    .modal {
        padding: 35px 25px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-prize {
        font-size: 1.6rem;
    }
}
