* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

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

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

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.generate-btn {
    width: 100%;
    padding: 18px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-bottom: 30px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.build-container {
    animation: slideIn 0.5s ease-out;
}

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

.build-container h2 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.8em;
}

.build-info {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95em;
}

.spells-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 30px;
    justify-items: center;
}

.spell-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 120px;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.spell-card.card-drawn {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: cardDraw 0.5s ease-out;
}

@keyframes cardDraw {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8) rotateY(-90deg);
    }
    50% {
        transform: translateY(-5px) scale(1.05) rotateY(0deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateY(0deg);
    }
}

.spell-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
}

.spell-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.spell-card.offensive {
    border-color: #e74c3c;
    color: #e74c3c;
}

.spell-card.defensive {
    border-color: #3498db;
    color: #3498db;
}

.spell-card.utility {
    border-color: #2ecc71;
    color: #2ecc71;
}

.spell-card.area {
    border-color: #f39c12;
    color: #f39c12;
}

.spell-card.travel {
    border-color: #9b59b6;
    color: #9b59b6;
}

.spell-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin: 6px auto;
    display: block;
    image-rendering: crisp-edges;
}

.spell-number {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.spell-name {
    font-size: 1.1em;
    font-weight: bold;
    margin: 8px 0 6px 0;
    color: #333;
}

.spell-type {
    font-size: 0.85em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.build-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.welcome-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .spells-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .spell-card {
        padding: 15px;
        max-width: 100%;
    }
    
    .spell-icon {
        width: 56px;
        height: 56px;
    }
    
    .spell-name {
        font-size: 1.1em;
        margin: 8px 0 6px 0;
    }
    
    .spell-type {
        font-size: 0.85em;
    }
    
    .build-stats {
        gap: 20px;
    }
}
