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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

.search-section {
    margin-bottom: 40px;
}

.search-container {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    flex-direction: column;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.search-btn {
    padding: 15px 30px;
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(255,107,107,0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255,107,107,0.4);
}

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

.search-icon {
    font-size: 1.2rem;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.wiki-entry {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out;
}

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

.wiki-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

.wiki-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.wiki-image {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiki-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wiki-content h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.description-section {
    margin-bottom: 30px;
}

.wiki-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

.stats-section {
    margin-bottom: 30px;
}

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

.stat-item {
    background: rgba(255,255,255,0.7);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-label {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.stat-bar {
    position: relative;
    background: #ecf0f1;
    height: 25px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.stat-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1s ease-out;
    position: relative;
}

.stat-fill.hp { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.stat-fill.atk { background: linear-gradient(90deg, #f39c12, #e67e22); }
.stat-fill.def { background: linear-gradient(90deg, #3498db, #2980b9); }
.stat-fill.pwr { background: linear-gradient(90deg, #9b59b6, #8e44ad); }

.stat-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-size: 0.9rem;
}

.abilities-section {
    margin-bottom: 30px;
}

.abilities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ability-tag {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
    transition: transform 0.2s ease;
}

.ability-tag:hover {
    transform: translateY(-2px);
}

.generate-new-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102,126,234,0.3);
}

.generate-new-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102,126,234,0.4);
}

.history-section {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    color: white;
}

.history-section h3 {
    margin-bottom: 15px;
    color: white;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.history-item:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .wiki-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .wiki-image {
        margin: 0 auto;
        width: 150px;
        height: 150px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .wiki-entry {
        padding: 20px;
    }
}

