* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 1rem;
    margin: 0;
}

.container {
    max-width: min(800px, 90vw);
    width: 100%;
    background: var(--container-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--container-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: min(1.5rem, 3vw);
    text-align: center;
    border: 2px solid transparent;
    max-height: 98vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

header p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.theme-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.theme-selector label {
    font-weight: 500;
    color: var(--text-primary);
}

.theme-selector select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--text-secondary);
    border-radius: 8px;
    background: var(--container-bg);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.theme-selector select:focus {
    outline: none;
    border-color: var(--text-primary);
}

.spinner-container {
    position: relative;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.wheel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-wheel {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(#ff6b6b 0deg 60deg,
            #4ecdc4 60deg 120deg,
            #45b7d1 120deg 180deg,
            #96ceb4 180deg 240deg,
            #feca57 240deg 300deg,
            #ff9ff3 300deg 360deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 3s cubic-bezier(0.23, 1, 0.32, 1);
    border: var(--wheel-border);
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(60px, 20%);
    height: min(60px, 20%);
    background: var(--wheel-center-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.fixed-pointer {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 25px solid var(--pointer-color);
    z-index: 15;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.controls {
    margin-top: 1.5rem;
}

.spin-btn {
    background: var(--spin-btn-bg);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--spin-btn-shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto 1.5rem;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px var(--spin-btn-shadow);
}

.spin-btn:active {
    transform: translateY(0);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.team-management {
    background: var(--team-management-bg);
    border-radius: 15px;
    padding: 1.2rem;
    padding-bottom: 1.5rem;
    margin-top: 1.5rem;
    flex-shrink: 0;
}

.team-management h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.add-member {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.add-member input {
    flex: 1;
    max-width: 250px;
    padding: 0.75rem;
    border: 2px solid var(--text-secondary);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--container-bg);
    color: var(--text-primary);
}

.add-member input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.add-member button {
    background: var(--text-primary);
    color: var(--container-bg);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-member button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.members-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.member-tag {
    background: var(--member-tag-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.remove-member {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.remove-member:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.winner-announcement {
    background: var(--modal-bg);
    color: white;
    padding: 3rem 4rem;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
    animation: modalSlideIn 0.5s ease-out;
    font-family: var(--font-family);
}

.winner-announcement h2 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.winner-announcement p {
    font-size: 1.5rem;
    margin: 1rem 0 2rem;
    opacity: 0.9;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Firework Animation */
.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1.5s ease-out forwards;
}

.firework-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    animation: particleMove 2s ease-out forwards;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .spinner-wheel {
        width: 250px;
        height: 250px;
    }

    .add-member {
        flex-direction: column;
    }

    .add-member input {
        max-width: none;
    }

    .winner-announcement {
        padding: 2rem;
        margin: 1rem;
    }

    .winner-announcement h2 {
        font-size: 2rem;
    }

    .winner-announcement p {
        font-size: 1.2rem;
    }
}

/* Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fireworkExplode {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes particleMove {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* Theme
-specific animations */

/* Asteroid animations for arcade80s theme */
@keyframes asteroidBlast {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

@keyframes asteroidFragmentFly {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(720deg);
        opacity: 0;
    }
}

@keyframes asteroidHit {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Matrix rain animations for cyberpunk theme */
@keyframes matrixColumnFall {
    0% {
        transform: translateY(-100vh);
    }

    100% {
        transform: translateY(100vh);
    }
}

@keyframes digitalGlitch {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    50% {
        opacity: 0.7;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Smiley face animations for retro70s theme */
@keyframes smileyFloat {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Modern theme firework animations */
@keyframes fireworkFlash {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

@keyframes fireworkParticle {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0);
        opacity: 0;
    }
}