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

body {
    font-family: 'Space Mono', monospace;
    background: linear-gradient(135deg, #0a0a0a, #1a0a1a);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #64ffda, #ff6b9d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
}

header p {
    font-size: 1.1rem;
    color: #888;
    max-width: 600px;
    margin: 0 auto;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.input-controls {
    display: flex;
    gap: 1rem;
}

#promptInput {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    color: #fff;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

#promptInput:focus {
    outline: none;
    border-color: #555;
}

#promptInput::placeholder {
    color: #666;
}

#generateBtn {
    background: linear-gradient(45deg, #333, #555);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#generateBtn:hover {
    background: linear-gradient(45deg, #444, #666);
    transform: translateY(-2px);
}

#generateBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#randomBtn {
    background: linear-gradient(45deg, #ff6b9d, #ff8e6b);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
}

#randomBtn:hover {
    background: linear-gradient(45deg, #ff8e9d, #ffa06b);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.3);
}

.content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    align-items: start;
}

.canvas-container {
    position: relative;
    background: linear-gradient(135deg, #111, #1a1a2e);
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/9;
    border: 2px solid #333;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#planetCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(5px);
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-progress {
    margin-top: 1rem;
    width: 300px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #64ffda, #ff6b9d);
    width: 0%;
    transition: width 0.3s ease;
}

#loadingText {
    font-size: 0.9rem;
    color: #ccc;
}

.planet-info {
    background: linear-gradient(135deg, #111, #1a1a2e);
    border-radius: 20px;
    padding: 2rem;
    border: 2px solid #333;
    height: fit-content;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#planetName {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
}

#planetDescription {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.controls {
    border-top: 1px solid #333;
    padding-top: 2rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.canvas-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.canvas-controls button {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.5rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.canvas-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
    transform: translateY(-2px);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
}

.action-buttons button {
    flex: 1;
    background: linear-gradient(45deg, #333, #555);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-buttons button:hover {
    background: linear-gradient(45deg, #444, #666);
    transform: translateY(-2px);
}

#shareBtn {
    background: linear-gradient(45deg, #ff6b9d, #ff8e6b);
}

#shareBtn:hover {
    background: linear-gradient(45deg, #ff8e9d, #ffa06b);
}

.planet-header {
    margin-bottom: 1.5rem;
}

.planet-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.planet-stats span {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.planet-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #333;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item .label {
    color: #888;
    font-size: 0.9rem;
}

.detail-item span:last-child {
    color: #64ffda;
    font-weight: bold;
}

@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .canvas-container {
        aspect-ratio: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .input-section {
        gap: 0.75rem;
    }
    
    #promptInput {
        padding: 1rem;
        min-height: 80px;
    }
    
    .planet-info {
        padding: 1.5rem;
    }
    
    .input-controls {
        flex-direction: column;
    }
    
    .planet-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .canvas-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .canvas-controls button {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
}