/* CSS Reset & Variables */
:root {
    --bg-dark: #0b0813;
    --panel-bg: rgba(22, 16, 38, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #b5a9cc;
    
    /* Brand Colors */
    --pink: #ff2a85;
    --pink-glow: rgba(255, 42, 133, 0.4);
    --purple: #8f2de2;
    --purple-glow: rgba(143, 45, 226, 0.4);
    
    /* Interactive States */
    --hover-bg: rgba(255, 255, 255, 0.05);
    --danger: #ff4a5a;
    --danger-glow: rgba(255, 74, 90, 0.3);
    --success: #00e676;
    
    /* Fonts */
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Glowing Decorators */
.glow-radial {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

.glow-radial.pink {
    background: var(--pink);
    top: -10%;
    left: -10%;
}

.glow-radial.purple {
    background: var(--purple);
    bottom: -10%;
    right: -10%;
}

/* Tiny star overlay for depth */
.stars-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
                      radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
                      radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
}

/* App Container Layout */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
}

/* Header Styling */
.header-container {
    text-align: center;
    margin-bottom: 0.5rem;
}

.main-title {
    font-family: var(--font-title);
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ff2a85 0%, #d82ae2 50%, #8f2de2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(255, 42, 133, 0.25));
    text-transform: uppercase;
    animation: pulseGlow 4s ease-in-out infinite;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-top: 0.5rem;
}

/* Main Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .main-title {
        font-size: 2.5rem;
    }
}

/* Wheel Container Section */
.wheel-section {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.wheel-outer-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    max-width: 90vw;
    max-height: 90vw;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-glow-effect {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%, var(--pink), var(--purple), var(--pink));
    filter: blur(20px);
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.wheel-outer-wrapper.spinning .wheel-glow-effect {
    opacity: 0.35;
    animation: rotateOuterGlow 3s linear infinite;
}

#rouletteWheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 
                inset 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Wheel Pointer */
.wheel-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #ffffff;
    filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 5px rgba(255, 42, 133, 0.8));
    pointer-events: none;
}

.pointer-arrow {
    font-size: 3rem;
    display: block;
    transform-origin: 50% 10%;
    transition: transform 0.1s ease;
}

.wheel-pointer.wiggle {
    animation: arrowWiggle 0.15s ease-in-out infinite alternate;
}

/* Center Spin Button */
.spin-btn-center {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1b1333 0%, #110924 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 
                0 0 20px rgba(143, 45, 226, 0.4),
                inset 0 0 8px rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spin-btn-center span {
    background: linear-gradient(135deg, #ffffff 0%, #e0c8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spin-btn-center::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    animation: rotateOuterRim 12s linear infinite;
    pointer-events: none;
}

.spin-btn-center:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 
                0 0 30px var(--pink-glow),
                inset 0 0 12px rgba(255, 255, 255, 0.3);
    border-color: var(--pink);
}

.spin-btn-center:active {
    transform: scale(0.95);
}

.spin-btn-center:disabled {
    cursor: not-allowed;
    opacity: 0.8;
    filter: grayscale(0.5);
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Glass Panel Styles */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 560px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 1rem;
}

.panel-header h2 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
}

.panel-header h2 i {
    color: var(--pink);
}

.badge {
    background: rgba(143, 45, 226, 0.2);
    border: 1px solid var(--purple);
    color: #e0c8ff;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Quick Action Row */
.quick-actions {
    display: flex;
    gap: 1rem;
}

/* Dynamic Inputs Area */
.inputs-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 280px;
}

/* Custom Scrollbar */
.inputs-container::-webkit-scrollbar {
    width: 6px;
}

.inputs-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.inputs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.inputs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Input Row Styles */
.option-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    transform: translateY(15px);
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.option-row.removing {
    animation: slideOut 0.25s ease forwards;
}

.row-index {
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 20px;
    text-align: right;
    font-weight: 500;
}

.input-glow-wrapper {
    position: relative;
    flex-grow: 1;
}

.option-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.option-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--purple);
    box-shadow: 0 0 12px rgba(143, 45, 226, 0.25);
}

.option-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 42, 133, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 42, 133, 0.5);
    filter: brightness(1.1);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn-danger-text:hover {
    color: var(--danger);
    background: rgba(255, 74, 90, 0.08);
}

.btn-delete {
    background: rgba(255, 74, 90, 0.08);
    color: var(--danger);
    border: 1px solid rgba(255, 74, 90, 0.15);
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    flex-shrink: 0;
}

.btn-delete:hover {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 0 12px var(--danger-glow);
    transform: scale(1.05);
}

.btn-delete:active {
    transform: scale(0.95);
}

.btn-add {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Modals & Popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 3, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 90%;
    max-width: 460px;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(143, 45, 226, 0.25);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-icon-glow {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    color: #ffffff;
    box-shadow: 0 0 30px rgba(255, 42, 133, 0.4);
    margin-bottom: 0.5rem;
}

.modal-card h3 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e0c8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.winner-text {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    margin: 1rem 0;
    text-shadow: 0 0 15px var(--pink-glow), 0 0 30px var(--purple-glow);
    animation: textCelebrate 0.8s ease infinite alternate;
    word-break: break-word;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

.modal-buttons .btn {
    flex: 1;
}

/* Confetti Overlay */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99;
}

/* Keyframes Animations */
@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 42, 133, 0.2);
    }
    50% {
        text-shadow: 0 0 45px rgba(255, 42, 133, 0.5), 0 0 10px rgba(143, 45, 226, 0.3);
    }
}

@keyframes rotateOuterRim {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateOuterGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes arrowWiggle {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(-12deg); }
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
}

@keyframes bounceAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes textCelebrate {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.06);
    }
}
.bounce-animation {
    animation: bounceAnimation 2s ease infinite;
}
