/* Dress Up Flop - Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Bubbles Animation */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 35%;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 30px;
    height: 30px;
    left: 70%;
    animation-delay: 6s;
}

.bubble:nth-child(5) {
    width: 50px;
    height: 50px;
    left: 85%;
    animation-delay: 8s;
}

@keyframes float {
    0% {
        opacity: 1;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(0);
    }
}

/* Main Container */
.dress-up-container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.game-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.title-section h1 {
    font-size: 2.5rem;
    color: #2D3748;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-section p {
    color: #4A5568;
    font-size: 1.1rem;
    font-weight: 500;
}

.navigation {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Main Game Area - Horizontal Layout */
.game-area {
    display: flex;
    gap: 2rem;
    min-height: 600px;
    align-items: flex-start;
}

/* Swimming Pool - Takes more space */
.swimming-pool {
    flex: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: fit-content;
}

/* Customization Panel - Sidebar */
.customization-panel {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: fit-content;
}

.customization-panel h2 {
    color: #2D3748;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    text-align: center;
    font-weight: 600;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 0.8rem 1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    color: #667eea;
    font-size: 0.9rem;
    flex: 1;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Customization Options */
.customization-options {
    min-height: 300px;
    margin-bottom: 2rem;
}

.option-category {
    display: none;
}

.option-category.active {
    display: block;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.option-item {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fredoka', sans-serif;
}

.option-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.option-item.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.item-preview {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Option Grid - Smaller for Better Fit */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.8rem;
}

.option-item {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Fredoka', sans-serif;
    min-height: 70px;
}

.option-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.option-item.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.item-preview {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.item-name {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
}

/* Color Grid */
/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.8rem;
}

.color-option {
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1.5rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    min-height: 70px;
}

.color-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: white;
}

.color-option.selected {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: white;
    border-width: 4px;
}

.color-name {
    font-size: 0.75rem;
    text-align: center;
    font-weight: 600;
}

.color-name {
    font-size: 0.9rem;
    text-align: center;
    font-weight: 600;
}

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

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
}

.screenshot-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

#screenshotCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.share-caption {
    margin-bottom: 1.5rem;
}

#shareCaption {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.9);
}

#shareCaption:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.social-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.social-btn.twitter {
    background: linear-gradient(135deg, #1DA1F2, #0D8BD9);
}

.social-btn.facebook {
    background: linear-gradient(135deg, #4267B2, #365899);
}

.social-btn.instagram {
    background: linear-gradient(135deg, #E4405F, #C13584);
}

.social-btn.download {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Action Buttons - More Visible */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.action-btn {
    background: linear-gradient(135deg, #FF6B6B, #E74C3C);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: white;
    flex: 1;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.action-btn#randomizeBtn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.action-btn#randomizeBtn:hover {
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

/* Swimming Pool Header */
.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.pool-header h2 {
    color: #2D3748;
    font-size: 1.8rem;
    font-weight: 600;
}

.pool-controls {
    display: flex;
    gap: 0.5rem;
}

.pool-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    color: #667eea;
    font-size: 0.9rem;
}

.pool-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

.pool-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* Canvas Styling */
#swimCanvas {
    width: 100%;
    height: 400px;
    background: linear-gradient(180deg, #87CEEB 0%, #4682B4 50%, #191970 100%);
    border-radius: 15px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    margin-bottom: 1rem;
    cursor: move;
}

/* Pool Info */
.pool-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
}

.happiness-bar {
    width: 120px;
    height: 8px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.happiness-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
    border-radius: 4px;
    width: 80%;
    transition: width 0.3s ease;
}

/* Footer */
.game-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-footer p {
    color: #718096;
    font-weight: 500;
}

.social-share {
    display: flex;
    gap: 1rem;
}

.share-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    color: #667eea;
}

.share-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-area {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .swimming-pool {
        order: 1;
        flex: none;
    }
    
    .customization-panel {
        order: 2;
        flex: none;
        min-width: auto;
        max-width: none;
    }
    
    .option-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .dress-up-container {
        padding: 0.5rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }
    
    .title-section h1 {
        font-size: 2rem;
    }
    
    .title-section p {
        font-size: 1rem;
    }
    
    .category-tabs {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        flex: 1;
        min-width: 0;
    }
    
    .option-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .color-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .pool-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pool-controls {
        justify-content: center;
    }
    
    .game-footer {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .customization-panel, .swimming-pool {
        padding: 1.5rem;
    }
    
    #swimCanvas {
        height: 300px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .title-section h1 {
        font-size: 1.8rem;
    }
    
    .category-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        flex: none;
        width: 100%;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .color-grid {
        grid-template-columns: 1fr;
    }
    
    .customization-panel, .swimming-pool {
        padding: 1rem;
    }
    
    .item-preview {
        font-size: 2rem;
    }
    
    .item-name {
        font-size: 0.8rem;
    }
    
    .pool-controls {
        flex-wrap: wrap;
    }
    
    .pool-btn {
        flex: 1;
        min-width: 80px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .option-item, .color-option, .tab-btn, .action-btn, .pool-btn {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .option-item:hover, .color-option:hover, .tab-btn:hover:not(.active) {
        transform: none;
        box-shadow: none;
    }
    
    .option-item:active, .color-option:active {
        transform: scale(0.98);
    }
}
