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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
}

.controls {
    text-align: center;
    margin-bottom: 40px;
}

.refresh-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    font-family: 'Poppins', sans-serif;
}

.refresh-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
    background: linear-gradient(45deg, #764ba2, #667eea);
}

.refresh-btn:active {
    transform: translateY(-1px);
}

.clear-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.character-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.character-card:hover::before {
    left: 100%;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.character-card.flipped {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.character-card.flipped .character-image,
.character-card.flipped .character-category {
    display: none;
}

.character-card.flipped .character-name {
    font-size: 1.2rem;
    margin: 0;
    padding: 20px 0;
}

.character-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.character-card:hover .character-image {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.character-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.character-category {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

footer {
    text-align: center;
    padding: 30px 0;
    opacity: 0.8;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .characters-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .characters-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .character-card {
        padding: 15px;
    }
    
    .character-image {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .character-name {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .refresh-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .clear-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        margin-left: 8px;
    }
    
    .copy-btn, .exit-btn {
        padding: 12px 18px;
        font-size: 0.9rem;
        margin: 8px;
    }
    
    .share-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-header {
        padding: 20px 15px;
    }
    
    .character-card {
        padding: 15px 10px;
        min-height: 140px;
    }
    
    .character-image {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .character-name {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .character-category {
        font-size: 0.8rem;
    }
    
    .character-emoji {
        font-size: 2.5rem;
    }
}

/* Touch optimizations for mobile */
@media (hover: none) and (pointer: coarse) {
    .character-card:hover {
        transform: none;
    }
    
    .character-card:active {
        transform: scale(0.95);
    }
    
    .refresh-btn:hover, .clear-btn:hover, .copy-btn:hover, .exit-btn:hover {
        transform: none;
    }
    
    .refresh-btn:active, .clear-btn:active, .copy-btn:active, .exit-btn:active {
        transform: scale(0.95);
    }
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .character-card {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
} 
.character-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.character-emoji {
    font-size: 3rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.exit-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    margin: 10px;
    transition: all 0.3s ease;
}

.exit-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Secret Character Section - Clean Modern Design */
.secret-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    color: white;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.secret-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.02) 50%, transparent 70%);
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.secret-character h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.secret-character-card {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 15px;
    margin: 10px auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-block;
    min-width: 200px;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.secret-character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.15);
}

.secret-character-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.secret-character-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.secret-character-card h4 {
    font-size: 1.1rem;
    margin: 8px 0 4px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.secret-character-card p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

.secret-hint {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 12px;
    font-style: italic;
    position: relative;
    z-index: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Mobile optimizations for secret section */
@media (max-width: 768px) {
    .secret-section {
        padding: 18px 15px;
        margin: 15px 0;
    }
    
    .secret-character h3 {
        font-size: 1.2rem;
    }
    
    .secret-character-card {
        padding: 12px;
        min-width: 180px;
    }
    
    .secret-character-image {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    .secret-character-card h4 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .secret-section {
        padding: 15px 12px;
    }
    
    .secret-character h3 {
        font-size: 1.1rem;
    }
    
    .secret-character-card {
        padding: 10px;
        min-width: 160px;
    }
    
    .secret-character-image {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .secret-character-card h4 {
        font-size: 0.9rem;
    }
    
    .secret-hint {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}
