/* WP Gacha Simulator - Professional Premium Design */

/* CSS Variables for Premium Theme */
:root {
    --wgs-primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 50%, #45B7D1 100%);
    --wgs-button-gradient: linear-gradient(135deg, #FF8E53 0%, #FE6B8B 30%, #FF6EC7 100%);
    --wgs-gold-gradient: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    --wgs-ur-gradient: linear-gradient(135deg, #FF00FF 0%, #00FFFF 25%, #FFD700 50%, #FF1493 75%, #00FF00 100%);
    --wgs-ssr-gradient: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --wgs-sr-gradient: linear-gradient(135deg, #C0C0C0 0%, #B8B8B8 100%);
    --wgs-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --wgs-shadow-2xl: 0 30px 60px rgba(0, 0, 0, 0.25);
    --wgs-shadow-glow: 0 0 60px rgba(255, 107, 107, 0.5);
    --wgs-animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --wgs-animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
.wgs-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    box-sizing: border-box;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,107,107,0.03) 100%);
    border-radius: 30px;
}

.wgs-container * {
    box-sizing: border-box;
}

/* Premium Header Design */
.wgs-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    animation: fadeInDown 0.8s ease-out;
}

.wgs-title {
    font-size: 3em;
    font-weight: 900;
    background: var(--wgs-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
    animation: titlePulse 3s ease-in-out infinite;
}

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

.wgs-icon {
    font-size: 1.2em;
    animation: iconRotate 4s linear infinite;
}

@keyframes iconRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Preset Selector - Premium Card Design */
.wgs-preset-selector {
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out;
}

.wgs-preset-selector h3 {
    text-align: center;
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.wgs-preset-selector h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--wgs-primary-gradient);
    border-radius: 2px;
}

.wgs-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

/* Premium Card Style Buttons */
.wgs-preset-btn {
    padding: 25px 15px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 10px 10px 20px rgba(0,0,0,0.08), -5px -5px 15px rgba(255,255,255,0.9);
    cursor: pointer;
    transition: all 0.4s var(--wgs-animation-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.wgs-preset-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--wgs-primary-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    transform: rotate(45deg);
}

.wgs-preset-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 40px rgba(255,107,107,0.25), 0 0 0 3px rgba(255,107,107,0.2);
}

.wgs-preset-btn:hover::before {
    opacity: 0.1;
}

.wgs-preset-btn:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}

.wgs-preset-icon {
    display: block;
    font-size: 3em;
    margin-bottom: 12px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
    animation: iconBounce 2s ease-in-out infinite;
}

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

.wgs-preset-name {
    font-size: 1em;
    font-weight: 700;
    color: #333;
    text-align: center;
}

/* Main Gacha Area - Premium Gaming Style */
.wgs-container .wgs-gacha-area {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #fda085 100%);
    border-radius: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--wgs-shadow-2xl);
}

.wgs-gacha-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wgs-current-gacha {
    color: white;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.custom-gacha-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.custom-label {
    font-size: 0.6em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.custom-name {
    font-size: 1.2em;
    font-weight: 900;
}

.custom-gacha-icon {
    font-size: 1.5em;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

/* The Main Event - Premium Gacha Button */
.wgs-gacha-button {
    background: linear-gradient(135deg, #FF6EC7 0%, #FF8E53 50%, #FE6B8B 100%);
    color: white;
    border: none;
    padding: 30px 60px;
    font-size: 1.8em;
    font-weight: 900;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--wgs-animation-smooth);
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 15px 35px rgba(255,110,199,0.4), inset 0 2px 10px rgba(255,255,255,0.3);
    animation: buttonPulse 2s ease-in-out infinite;
    overflow: hidden;
}

@keyframes buttonPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 15px 35px rgba(255,110,199,0.4), inset 0 2px 10px rgba(255,255,255,0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 20px 45px rgba(255,110,199,0.5), inset 0 2px 10px rgba(255,255,255,0.4);
    }
}

.wgs-gacha-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wgs-gacha-button:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 25px 50px rgba(255,110,199,0.6), inset 0 2px 15px rgba(255,255,255,0.4);
    filter: brightness(1.1);
}

.wgs-gacha-button:hover::before {
    width: 400px;
    height: 400px;
}

.wgs-gacha-button:active {
    transform: scale(0.95);
    box-shadow: 0 10px 25px rgba(255,110,199,0.4), inset 0 2px 5px rgba(0,0,0,0.2);
}

.wgs-gacha-button.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    animation: none;
}

.wgs-btn-text {
    position: relative;
    z-index: 1;
}

.wgs-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animation Container */
.wgs-animation-container {
    min-height: 350px;
    position: relative;
    margin: 40px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Result Area - Premium Display */
.wgs-result-area {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    padding: 40px;
    border-radius: 25px;
    margin-top: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
    position: relative;
    overflow: hidden;
}

.wgs-result-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--wgs-primary-gradient);
}

/* Rarity Styles - Premium Effects */
.wgs-result-rarity {
    font-size: 3em;
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    display: inline-block;
}

.wgs-result-rarity.rarity-UR {
    background: var(--wgs-ur-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: urShine 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.8));
}

@keyframes urShine {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255,215,0,0.8)); }
    50% { filter: drop-shadow(0 0 40px rgba(255,215,0,1)); }
}

.wgs-result-rarity.rarity-SSR {
    background: var(--wgs-ssr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(255,215,0,0.6));
}

.wgs-result-rarity.rarity-SR {
    background: var(--wgs-sr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(192,192,192,0.5));
}

.wgs-result-rarity.rarity-R {
    color: #4169E1;
    text-shadow: 2px 2px 4px rgba(65,105,225,0.3);
}

.wgs-result-rarity.rarity-N {
    color: #808080;
    text-shadow: 1px 1px 2px rgba(128,128,128,0.3);
}

.wgs-result-text {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
    animation: resultBounce 0.6s var(--wgs-animation-bounce);
}

@keyframes resultBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Share Buttons - Premium Style */
.wgs-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.wgs-share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.3s var(--wgs-animation-smooth);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.wgs-share-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wgs-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.wgs-share-btn:hover::before {
    width: 300px;
    height: 300px;
}

.wgs-share-btn[data-platform="x"] {
    background: linear-gradient(135deg, #000000, #333333);
    color: white;
}

.wgs-share-btn[data-platform="facebook"] {
    background: linear-gradient(135deg, #1877f2, #0c63d4);
    color: white;
}

.wgs-share-btn[data-platform="line"] {
    background: linear-gradient(135deg, #00B900, #00A000);
    color: white;
}

.wgs-share-btn[data-platform="instagram"] {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.wgs-share-btn[data-platform="threads"] {
    background: linear-gradient(135deg, #000000, #444444);
    color: white;
}

.wgs-share-btn[data-platform="bluesky"] {
    background: linear-gradient(135deg, #00A8E8, #0084b4);
    color: white;
}

/* Custom Create Area - Premium Design */
.wgs-custom-create-area {
    text-align: center;
    margin: 50px 0;
    padding: 40px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 25px;
    position: relative;
}

.wgs-custom-create-area h3 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 25px;
    background: var(--wgs-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wgs-custom-create-btn {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s var(--wgs-animation-smooth);
    box-shadow: 0 10px 25px rgba(78,205,196,0.3);
}

.wgs-custom-create-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(78,205,196,0.4);
    filter: brightness(1.1);
}

/* Modal - Premium Overlay */
.wgs-custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wgs-modal-content {
    background: white;
    padding: 40px;
    border-radius: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.4s var(--wgs-animation-bounce);
}

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

.wgs-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.5em;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wgs-modal-close:hover {
    color: #333;
    background: rgba(0,0,0,0.05);
    transform: rotate(90deg);
}

/* Custom Form - Premium Inputs */
.wgs-custom-form label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #333;
    font-size: 1.1em;
}

.wgs-custom-form input[type="text"],
.wgs-custom-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fafafa;
}

.wgs-custom-form input[type="text"]:focus,
.wgs-custom-form textarea:focus {
    outline: none;
    border-color: #4ECDC4;
    background: white;
    box-shadow: 0 0 0 4px rgba(78,205,196,0.1);
}

.wgs-rarity-section {
    margin: 25px 0;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    transition: all 0.3s ease;
}

.wgs-rarity-section:hover {
    border-color: #e0e0e0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.wgs-rarity-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: 700;
}

.wgs-rarity-section[data-rarity="UR"] h4 {
    background: var(--wgs-ur-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wgs-rarity-section[data-rarity="SSR"] h4 {
    background: var(--wgs-ssr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wgs-rarity-section[data-rarity="SR"] h4 {
    background: var(--wgs-sr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wgs-item-input {
    margin-bottom: 12px;
}

.wgs-primary-btn {
    margin-top: 30px;
    padding: 20px 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--wgs-animation-smooth);
    box-shadow: 0 10px 30px rgba(118,75,162,0.3);
    width: 100%;
}

.wgs-primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(118,75,162,0.4);
    filter: brightness(1.1);
}

/* Statistics Area - Premium Dashboard */
.wgs-stats-area {
    margin-top: 50px;
    padding: 40px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.wgs-stats-area h3 {
    text-align: center;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 30px;
    background: var(--wgs-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wgs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.wgs-stat-item {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.05), -5px -5px 15px rgba(255,255,255,0.9);
    transition: all 0.3s ease;
}

.wgs-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 10px 10px 25px rgba(0,0,0,0.08), -5px -5px 15px rgba(255,255,255,0.9);
}

.wgs-stat-label {
    display: block;
    font-size: 0.95em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wgs-stat-value {
    display: block;
    font-size: 2em;
    font-weight: 900;
    background: var(--wgs-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wgs-luck-stars {
    color: #FFD700;
    font-size: 1.5em;
    filter: drop-shadow(0 0 5px rgba(255,215,0,0.5));
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive - Premium Mobile Experience */
@media (max-width: 768px) {
    .wgs-container {
        padding: 30px 15px;
    }
    
    .wgs-title {
        font-size: 2.2em;
    }
    
    .wgs-preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .wgs-preset-btn {
        min-height: 130px;
        padding: 20px 10px;
    }
    
    .wgs-preset-icon {
        font-size: 2.5em;
    }
    
    .wgs-gacha-button {
        padding: 25px 40px;
        font-size: 1.4em;
        width: 100%;
        max-width: 350px;
    }
    
    .wgs-container .wgs-gacha-area {
        padding: 35px 20px;
        border-radius: 25px;
    }
    
    .wgs-result-rarity {
        font-size: 2.5em;
    }
    
    .wgs-result-text {
        font-size: 1.6em;
    }
    
    .wgs-share-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .wgs-share-btn {
        min-width: 100px;
        padding: 10px 20px;
    }
    
    .wgs-modal-content {
        padding: 30px 20px;
        width: 95%;
        border-radius: 20px;
    }
    
    .wgs-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wgs-title {
        font-size: 1.8em;
    }
    
    .wgs-preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .wgs-gacha-button {
        font-size: 1.2em;
        padding: 20px 30px;
    }
    
    .wgs-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .wgs-stat-item {
        padding: 20px;
    }
}

/* Utility Classes */
.wgs-hidden {
    display: none !important;
}

.wgs-visible {
    display: block !important;
}

/* Premium Loading State */
.wgs-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.wgs-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(118,75,162,0.2);
    border-top-color: #764ba2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Print Styles */
@media print {
    .wgs-gacha-button,
    .wgs-share-buttons,
    .wgs-custom-create-area {
        display: none;
    }
}