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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 1s ease-out;
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.emoji {
    font-size: 2.5rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.subtitle {
    font-size: 1.2rem;
    color: #a0a0a0;
}

main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

.controls {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ffffff;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffffff;
}

.emotion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.emotion-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.emotion-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.emotion-btn.active {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.emotion-icon {
    font-size: 2rem;
}

.emotion-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.intensity-control {
    margin-bottom: 30px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    margin: 15px 0;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.3s;
}

.slider::-webkit-slider-thumb:hover {
    background: #764ba2;
}

#intensity-value {
    display: inline-block;
    margin-left: 10px;
    font-size: 1.2rem;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.primary-btn, .secondary-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.canvas-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
}

#crystal-canvas {
    max-width: 100%;
    border-radius: 10px;
}

.emotion-label {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.emotion-label.visible {
    opacity: 1;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #666;
}

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

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        margin-bottom: 20px;
    }
    
    .emotion-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .emotion-btn {
        padding: 10px;
    }
    
    .emotion-icon {
        font-size: 1.5rem;
    }
}