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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #ffffff;
    min-height: 100vh;
}

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

header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #00ff88;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.tagline {
    font-size: 1.2em;
    color: #aaaaaa;
    font-style: italic;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.canvas-area {
    position: relative;
}

#canvas {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 3px solid #00ff88;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.4);
    background: #000;
    display: block;
    transition: opacity 0.3s;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5em;
    color: #00ff88;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 10px;
    display: none;
    animation: pulse 1.5s infinite;
}

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

.control-panel {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #00ff88;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
}

.btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
}

.btn-lucky {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.btn-lucky:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

.btn-lucky:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(135deg, #9370db 0%, #6a5acd 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.5);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(147, 112, 219, 0.8);
}

.trait-display {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #00ff88;
}

.trait-display h3 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.trait {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
}

.trait-label {
    color: #00ccff;
    font-weight: bold;
}

.rarity-badge {
    text-align: center;
    margin-top: 15px;
}

.rarity-tier {
    display: inline-block;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.3em;
    margin-bottom: 10px;
    text-transform: uppercase;
    box-shadow: 0 0 20px currentColor;
}

.rarity-chance {
    font-size: 0.9em;
    color: #aaaaaa;
    font-family: 'Courier New', monospace;
}

.stats {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid #00ff88;
}

.stat {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
}

.stat-label {
    color: #00ccff;
    margin-right: 10px;
}

#counter {
    color: #00ff88;
    font-weight: bold;
    font-size: 1.5em;
}

.gallery {
    margin-top: 20px;
}

.gallery h4 {
    color: #00ff88;
    margin-bottom: 10px;
}

.gallery-thumb {
    width: calc(33.333% - 7px);
    margin: 3.5px;
    border-radius: 8px;
    border: 2px solid #00ff88;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    border-top: 2px solid #00ff88;
    color: #aaaaaa;
}

footer a {
    color: #00ff88;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #00ccff;
}

.disclaimer {
    font-size: 0.9em;
    font-style: italic;
    margin-top: 10px;
}

.credit {
    margin-top: 10px;
    font-size: 0.9em;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #canvas {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5em;
    }
    
    .tagline {
        font-size: 1em;
    }
    
    .btn {
        font-size: 1em;
        padding: 12px 20px;
    }
}