/**
 * Spin the Wheel Challenge - ENHANCED GOTHIC FRONTEND STYLES
 */

.stwc-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle at center, #2c2c2c 0%, #1a1a1a 70%, #000000 100%);
    border-radius: 15px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(255, 0, 0, 0.3);
    border: 2px solid rgba(255, 0, 0, 0.5);
}

/* Controls - Enhanced Gothic Style */
.stwc-controls {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: end;
    padding: 20px;
    background: rgba(139, 0, 0, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 0, 0.3);
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.1);
}

.stwc-control-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 150px;
}

.stwc-control-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #ff6666;
    font-size: 14px;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 102, 102, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stwc-control-group select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 0, 0, 0.5);
    border-radius: 6px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    transition: all 0.3s ease;
    min-height: 40px;
    backdrop-filter: blur(5px);
    box-shadow: 
        0 0 10px rgba(255, 0, 0, 0.3),
        inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.stwc-control-group select:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 
        0 0 0 3px rgba(255, 0, 0, 0.5),
        0 0 20px rgba(255, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.9);
}

.stwc-control-group select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 8px;
}

/* ENHANCED WHEEL CONTAINER - DRAMATIC GOTHIC STYLE */
.stwc-wheel-container {
    background: radial-gradient(circle at center, #2a0a0a 0%, #1a0505 40%, #000000 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.9),
        inset 0 0 30px rgba(255, 0, 0, 0.1),
        0 0 80px rgba(255, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border: 3px solid #8b0000;
}

/* DRAMATIC ANIMATED BACKGROUND */
.stwc-wheel-container::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(
        from 0deg,
        rgba(255, 0, 0, 0.1),
        rgba(139, 0, 0, 0.2),
        rgba(255, 0, 0, 0.1),
        rgba(139, 0, 0, 0.2),
        rgba(255, 0, 0, 0.1)
    );
    animation: stwc-spiral-rotate 20s linear infinite;
    z-index: 1;
}

/* PULSING RED GLOW EFFECT */
.stwc-wheel-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 0, 0, 0.3) 0%, transparent 70%);
    animation: stwc-pulse-glow 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes stwc-spiral-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes stwc-pulse-glow {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ENHANCED WHEEL WITH SKULL CENTER */
#stwc-wheel {
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    box-shadow: 
        0 0 0 8px #8b0000,
        0 0 0 16px #ff0000,
        0 0 0 24px #8b0000,
        0 0 60px rgba(255, 0, 0, 0.8),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    background: #ffffff;
    animation: stwc-wheel-glow 2s ease-in-out infinite;
}

@keyframes stwc-wheel-glow {
    0%, 100% {
        box-shadow: 
            0 0 0 8px #8b0000,
            0 0 0 16px #ff0000,
            0 0 0 24px #8b0000,
            0 0 60px rgba(255, 0, 0, 0.8),
            inset 0 0 30px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 
            0 0 0 8px #ff0000,
            0 0 0 16px #ff3333,
            0 0 0 24px #ff0000,
            0 0 80px rgba(255, 0, 0, 1),
            inset 0 0 30px rgba(0, 0, 0, 0.5);
    }
}

/* SKULL OVERLAY FOR CENTER */
#stwc-wheel::after {
    content: '💀';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    z-index: 10;
    text-shadow: 
        0 0 10px rgba(255, 0, 0, 0.8),
        0 0 20px rgba(255, 0, 0, 0.6),
        0 0 30px rgba(255, 0, 0, 0.4);
    animation: stwc-skull-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes stwc-skull-pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 
            0 0 10px rgba(255, 0, 0, 0.8),
            0 0 20px rgba(255, 0, 0, 0.6),
            0 0 30px rgba(255, 0, 0, 0.4);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        text-shadow: 
            0 0 15px rgba(255, 0, 0, 1),
            0 0 30px rgba(255, 0, 0, 0.8),
            0 0 45px rgba(255, 0, 0, 0.6);
    }
}

.stwc-spin-controls {
    margin-top: 30px;
    position: relative;
    z-index: 3;
}

/* ENHANCED DRAMATIC SPIN BUTTON */
.stwc-spin-button {
    background: linear-gradient(135deg, #8b0000 0%, #ff0000 50%, #8b0000 100%);
    border: 4px solid #ffffff;
    color: white;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        0 0 40px rgba(255, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 255, 255, 0.5);
}

/* ENHANCED BUTTON HOVER EFFECT */
.stwc-spin-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.5s;
}

.stwc-spin-button:hover:not(:disabled)::before {
    left: 100%;
}

.stwc-spin-button:hover:not(:disabled) {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.9),
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 0 60px rgba(255, 0, 0, 0.9);
    background: linear-gradient(135deg, #ff0000 0%, #ff3333 50%, #ff0000 100%);
    border-color: #ffcccc;
}

.stwc-spin-button:active:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
}

.stwc-spin-button:disabled {
    background: linear-gradient(135deg, #333 0%, #666 50%, #333 100%);
    cursor: not-allowed;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(100, 100, 100, 0.3);
    transform: none;
    border-color: #999;
}

/* ENHANCED LOADING ANIMATION */
.stwc-loading {
    text-align: center;
    padding: 40px 20px;
    color: #ff6666;
}

.stwc-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 0, 0, 0.3);
    border-top: 6px solid #ff0000;
    border-radius: 50%;
    animation: stwc-spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.8),
        inset 0 0 20px rgba(255, 0, 0, 0.2);
}

@keyframes stwc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ENHANCED GOTHIC MODAL */
.stwc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(15px);
}

.stwc-modal-content {
    background: linear-gradient(135deg, #1a0505 0%, #2d1010 50%, #1a0505 100%);
    border: 5px solid #8b0000;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.9),
        inset 0 0 0 2px #ff0000,
        0 0 80px rgba(255, 0, 0, 0.6);
    animation: stwc-modal-appear 0.5s ease-out;
    color: #ffffff;
}

@keyframes stwc-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px) rotateX(20deg);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

.stwc-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #ff6666;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.stwc-close:hover {
    color: #ff0000;
    transform: scale(1.3) rotate(180deg);
    text-shadow: 
        0 0 20px rgba(255, 0, 0, 1),
        0 0 40px rgba(255, 0, 0, 0.8);
}

/* ENHANCED RESULT DISPLAY */
.stwc-result {
    text-align: center;
}

.stwc-emoji {
    font-size: 100px;
    margin-bottom: 20px;
    display: block;
    line-height: 1;
    animation: stwc-emoji-dramatic 2s ease-in-out infinite;
    text-shadow: 
        0 0 20px rgba(255, 0, 0, 0.8),
        0 0 40px rgba(255, 0, 0, 0.6);
}

@keyframes stwc-emoji-dramatic {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        text-shadow: 
            0 0 20px rgba(255, 0, 0, 0.8),
            0 0 40px rgba(255, 0, 0, 0.6);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    50% { 
        transform: scale(1.15) rotate(0deg);
        text-shadow: 
            0 0 30px rgba(255, 0, 0, 1),
            0 0 60px rgba(255, 0, 0, 0.8);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.stwc-title {
    font-size: 32px;
    font-weight: bold;
    color: #ff6666;
    margin: 0 0 20px 0;
    line-height: 1.3;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 102, 102, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stwc-description {
    font-size: 18px;
    line-height: 1.6;
    color: #ffcccc;
    margin-bottom: 30px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.stwc-description h1,
.stwc-description h2,
.stwc-description h3,
.stwc-description h4,
.stwc-description h5,
.stwc-description h6 {
    margin: 20px 0 10px 0;
    color: #ff6666;
    text-shadow: 0 0 10px rgba(255, 102, 102, 0.6);
}

.stwc-description p {
    margin: 10px 0;
}

.stwc-description ul,
.stwc-description ol {
    text-align: left;
    margin: 10px 0;
    padding-left: 20px;
}

.stwc-description a {
    color: #ff9999;
    text-decoration: none;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(255, 153, 153, 0.6);
}

.stwc-description a:hover {
    text-decoration: underline;
    color: #ffcccc;
}

.stwc-description .button,
.stwc-description button {
    background: linear-gradient(135deg, #8b0000, #ff0000);
    color: white;
    padding: 12px 24px;
    border: 2px solid #ff6666;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.stwc-description .button:hover,
.stwc-description button:hover {
    background: linear-gradient(135deg, #ff0000, #ff3333);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
}

#stwc-spin-again {
    background: linear-gradient(135deg, #8b0000 0%, #ff0000 100%);
    border: 3px solid #ff6666;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(255, 0, 0, 0.5);
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

#stwc-spin-again:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 0, 0, 0.8);
    background: linear-gradient(135deg, #ff0000 0%, #ff3333 100%);
    border-color: #ffcccc;
}

/* ENHANCED ERROR MESSAGE */
.stwc-error-message {
    text-align: center;
    padding: 40px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.9), rgba(220, 50, 50, 0.9));
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid #ff0000;
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.stwc-error-message h3 {
    color: #ffcccc;
    margin-bottom: 15px;
    font-size: 28px;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
}

.stwc-error-message p {
    margin-bottom: 20px;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Responsive Design - Enhanced */
@media (max-width: 768px) {
    .stwc-container {
        padding: 15px;
        margin: 10px;
    }
    
    .stwc-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
    }
    
    .stwc-control-group {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
    
    .stwc-control-group select {
        width: 100%;
    }
    
    .stwc-wheel-container {
        padding: 25px;
        border-radius: 15px;
    }
    
    #stwc-wheel {
        width: 300px !important;
        height: 300px !important;
    }
    
    #stwc-wheel::after {
        font-size: 30px;
    }
    
    .stwc-spin-button {
        padding: 15px 30px;
        font-size: 18px;
    }
    
    .stwc-modal-content {
        padding: 30px 20px;
        margin: 0 10px;
    }
    
    .stwc-emoji {
        font-size: 80px;
    }
    
    .stwc-title {
        font-size: 26px;
    }
    
    .stwc-description {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #stwc-wheel {
        width: 250px !important;
        height: 250px !important;
    }
    
    #stwc-wheel::after {
        font-size: 25px;
    }
    
    .stwc-emoji {
        font-size: 60px;
    }
    
    .stwc-title {
        font-size: 22px;
    }
    
    .stwc-spin-button {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .stwc-control-group label {
        font-size: 13px;
    }
    
    .stwc-wheel-container {
        padding: 20px;
    }
}

/* Browser-specific dropdown fixes - Enhanced */
.stwc-control-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff0000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Accessibility - Enhanced */
.stwc-spin-button:focus,
.stwc-control-group select:focus {
    outline: 3px solid #ff6666;
    outline-offset: 3px;
}

.stwc-modal-content:focus {
    outline: none;
}

/* High Contrast Mode - Enhanced */
@media (prefers-contrast: high) {
    .stwc-control-group select {
        border-width: 4px;
        border-color: #ff0000;
        color: #ffffff;
        background: #000000;
    }
    
    .stwc-spin-button {
        border: 4px solid #ff0000;
    }
    
    .stwc-modal-content {
        border: 6px solid #ff0000;
    }
    
    .stwc-control-group label {
        color: #ff6666;
        font-weight: bold;
    }
}

/* Reduced Motion - Enhanced */
@media (prefers-reduced-motion: reduce) {
    .stwc-spin-button,
    .stwc-modal-content,
    #stwc-spin-again,
    .stwc-emoji,
    #stwc-wheel::after {
        transition: none;
        animation: none;
    }
    
    .stwc-spinner {
        animation: none;
        border-top-color: transparent;
    }
    
    .stwc-wheel-container::before,
    .stwc-wheel-container::after {
        animation: none;
    }
    
    #stwc-wheel {
        animation: none;
    }
    
    @keyframes stwc-modal-appear {
        from, to {
            opacity: 1;
            transform: scale(1) translateY(0) rotateX(0deg);
        }
    }
}