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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #e0e0e0;
    overflow: hidden;
}

#app-container {
    display: grid;
    grid-template-areas: 
        "header header header"
        "left-sidebar scene right-sidebar"
        "bottom-controls bottom-controls bottom-controls"
        "footer footer footer";
    grid-template-rows: 120px 1fr 70px 50px;
    grid-template-columns: 350px 1fr 350px;
    height: 100vh;
    gap: 12px;
    padding: 12px;
}

/* Enhanced Header */
.header {
    grid-area: header;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 20px;
    padding: 20px 25px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 212, 255, 0.1), rgba(255, 107, 53, 0.1));
    z-index: -1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.app-title {
    font-size: 2.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #00d4ff, #ff6b35, #00d4ff);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.version-badge {
    position: absolute;
    top: 15px;
    left: 25px;
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
}

.version-badge.glowing {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.generation-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.seed-container {
    display: flex;
    gap: 5px;
    align-items: center;
}

.seed-input {
    width: 80px !important;
}

.dice-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 8px;
    padding: 8px;
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.dice-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: rotate(180deg);
}

.control-input {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 10px;
    padding: 10px 14px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.control-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.generate-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.regen-textures-btn, .smart-fix-btn {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.smart-fix-btn {
    background: linear-gradient(135deg, #9d4edd, #7209b7);
}

.regen-textures-btn:hover, .smart-fix-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.smart-fix-btn:hover {
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.4);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid transparent;
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced Sidebars */
.left-sidebar, .right-sidebar {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 25px;
    overflow-y: auto;
    position: relative;
}

.left-sidebar {
    grid-area: left-sidebar;
}

.right-sidebar {
    grid-area: right-sidebar;
}

.left-sidebar::before, .right-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.05), rgba(255, 107, 53, 0.05));
    z-index: -1;
    border-radius: 18px;
}

.panel {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.panel h3 {
    color: #00d4ff;
    margin-bottom: 18px;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.panel h4 {
    color: #ff6b35;
    margin: 18px 0 12px 0;
    font-size: 1rem;
    font-weight: bold;
}

.panel label {
    display: block;
    margin: 12px 0 6px 0;
    font-size: 14px;
    color: #cccccc;
    font-weight: 500;
}

.quality-preview {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.quality-indicator {
    color: #00d4ff;
    font-size: 12px;
    font-weight: bold;
}

/* Enhanced Texture Studio */
.texture-studio {
    border: 2px solid rgba(255, 107, 53, 0.3);
    background: rgba(255, 107, 53, 0.05);
}

.texture-studio h3 {
    color: #ff6b35;
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.collapsible-header:hover {
    color: #ff8855;
    transform: translateX(5px);
}

.collapse-indicator {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.collapsible-content {
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
}

.template-section {
    margin-bottom: 20px;
}

.template-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    min-height: 60px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.template-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.8);
}

.template-variables {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.variable-grid {
    display: grid;
    gap: 8px;
}

.variable-item {
    font-size: 12px;
    line-height: 1.3;
    color: #cccccc;
}

.variable-item strong {
    color: #00d4ff;
}

.custom-prompt-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(157, 78, 221, 0.1);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 10px;
}

.prompt-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

#charCounter {
    font-size: 11px;
    color: #999;
}

#charCounter.warning {
    color: #ff6b35;
    font-weight: bold;
}

.template-presets {
    margin: 20px 0;
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.preset-btn {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    color: #00d4ff;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    text-align: left;
}

.preset-btn:hover {
    background: rgba(0, 212, 255, 0.25);
    transform: translateY(-1px);
}

.preset-controls, .template-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.small-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 6px;
    padding: 6px 12px;
    color: #00d4ff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.small-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

.small-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.advanced-controls {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.slider:hover {
    background: rgba(255, 255, 255, 0.3);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

/* Enhanced Scene Container */
.scene-container {
    grid-area: scene;
    position: relative;
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(circle, rgba(26, 26, 46, 0.8) 0%, rgba(10, 10, 10, 0.9) 100%);
}

.scene-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Enhanced Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 30px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(0, 212, 255, 0.3);
    border-top: 6px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

.progress-bar {
    width: 400px;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin: 25px auto;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #0099cc, #ff6b35);
    border-radius: 6px;
    transition: width 0.4s ease;
    width: 0%;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.texture-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.texture-preview {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.preview-loading {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #00d4ff, #ff6b35);
    border-radius: 4px;
    margin: 0 auto 5px;
    animation: pulse 1.5s ease-in-out infinite;
}

.texture-preview p {
    font-size: 10px;
    color: #ccc;
}

/* Performance and Debug Overlays */
.fps-counter, .performance-stats {
    position: absolute;
    top: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #00d4ff;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    z-index: 100;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.fps-counter {
    left: 15px;
}

.performance-stats {
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fps-good { color: #00ff88; }
.fps-medium { color: #ffaa00; }
.fps-poor { color: #ff3333; }

.texture-debug-overlay, .seam-debug-overlay {
    position: absolute;
    top: 60px;
    right: 15px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 10px;
    padding: 15px;
    max-width: 350px;
    z-index: 100;
    font-size: 12px;
}

.texture-debug-overlay h4 {
    color: #00d4ff;
    margin-bottom: 10px;
}

.texture-debug-overlay p {
    margin: 6px 0;
    color: #cccccc;
}

.seam-debug-overlay {
    top: 15px;
    background: rgba(255, 107, 53, 0.9);
    border-color: rgba(255, 107, 53, 0.8);
}

/* Enhanced Texture Inspector */
.texture-inspector {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(0, 212, 255, 0.6);
    border-radius: 15px;
    padding: 25px;
    max-width: 450px;
    z-index: 1001;
    backdrop-filter: blur(15px);
}

.inspector-content {
    text-align: center;
}

.inspector-content h4 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.inspector-image {
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.inspector-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.no-texture {
    padding: 40px;
    color: #666;
    font-style: italic;
}

.inspector-info {
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
}

.inspector-info p {
    margin: 8px 0;
    color: #cccccc;
}

.inspector-info strong {
    color: #00d4ff;
}

.inspector-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

/* Bottom Controls */
.bottom-controls {
    grid-area: bottom-controls;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.view-controls, .export-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 10px;
    padding: 10px 16px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.control-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* Enhanced Texture Gallery */
.texture-gallery-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.texture-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.texture-thumbnail {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.texture-thumbnail:hover {
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.texture-thumbnail.success {
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.05);
}

.texture-thumbnail.failed {
    border-color: rgba(255, 107, 53, 0.6);
    background: rgba(255, 107, 53, 0.1);
}

.thumbnail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.surface-type {
    font-size: 14px;
}

.texture-thumbnail img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.failed-texture {
    width: 100%;
    height: 60px;
    background: rgba(255, 107, 53, 0.2);
    border: 2px dashed rgba(255, 107, 53, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b35;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 8px;
}

.texture-info {
    font-size: 11px;
    line-height: 1.3;
}

.texture-info p {
    color: #aaa;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quality-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 6px;
    margin: 6px 0;
    position: relative;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff3333, #ffaa00, #00ff88);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.quality-text {
    position: absolute;
    right: 4px;
    top: -18px;
    font-size: 9px;
    color: #ccc;
}

.texture-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.regen-btn, .select-btn {
    background: rgba(255, 107, 53, 0.3);
    border: 1px solid #ff6b35;
    border-radius: 4px;
    color: #ff6b35;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
}

.select-btn {
    background: rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
    color: #00d4ff;
}

.regen-btn:hover, .select-btn:hover {
    background: rgba(255, 107, 53, 0.5);
    transform: scale(1.1);
}

.select-btn:hover {
    background: rgba(0, 212, 255, 0.5);
}

.texture-history {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* City Statistics */
.city-stats {
    display: grid;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 13px;
}

.stat-label {
    color: #ccc;
}

.stat-value {
    color: #00d4ff;
    font-weight: bold;
}

.stat-item.success-rate .stat-value {
    color: #00ff88;
}

.stat-item.environmental .stat-value {
    color: #4ade80;
}

/* AI Assistant */
.ai-assistant {
    border: 2px solid rgba(157, 78, 221, 0.3);
    background: rgba(157, 78, 221, 0.05);
}

.ai-assistant h3 {
    color: #9d4edd;
}

.assistant-suggestions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggestion-item, .consistency-check, .performance-advice {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 12px;
}

.suggestion-item p:first-child {
    color: #9d4edd;
    font-weight: bold;
    margin-bottom: 4px;
}

.consistency-check.success { border-left: 3px solid #00ff88; }
.consistency-check.warning { border-left: 3px solid #ffaa00; }
.consistency-check.error { border-left: 3px solid #ff3333; }

/* Generation Log */
.generation-log {
    max-height: 180px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.generation-log p {
    margin-bottom: 6px;
    padding: 2px 0;
}

.generation-log p.error {
    color: #ff6b35;
}

.generation-log p.warning {
    color: #ffaa00;
}

.generation-log p.success {
    color: #00ff88;
}

.timestamp {
    color: #666;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
}

/* Footer */
.footer {
    grid-area: footer;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 12px 25px;
    text-align: center;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Achievement System */
.achievement-notification {
    position: fixed;
    top: 50px;
    right: 50px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    padding: 20px 25px;
    border-radius: 15px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    animation: slideInRight 0.5s ease-out;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-content h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.achievement-content p {
    font-size: 14px;
    line-height: 1.3;
}

/* Easter Eggs */
.easter-egg-container {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

.easter-egg {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
    font-size: 14px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Enhanced Scrollbars */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0099cc, #007acc);
}

/* Mobile Responsiveness */
@media (max-width: 1600px) {
    #app-container {
        grid-template-columns: 320px 1fr 320px;
    }
}

@media (max-width: 1400px) {
    #app-container {
        grid-template-columns: 300px 1fr 300px;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 1200px) {
    #app-container {
        grid-template-areas: 
            "header"
            "scene"
            "bottom-controls"
            "footer";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
    }
    
    .left-sidebar, .right-sidebar {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .generation-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .control-input {
        min-width: 100px;
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .app-title {
        font-size: 1.6rem;
    }
    
    .version-badge {
        position: static;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    #app-container {
        padding: 8px;
        gap: 8px;
    }
    
    .header {
        padding: 15px;
        border-radius: 15px;
    }
    
    .bottom-controls {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .view-controls, .export-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .control-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .app-title {
        font-size: 1.4rem;
    }
    
    .generation-controls {
        width: 100%;
    }
    
    .control-input {
        min-width: 80px;
        font-size: 11px;
    }
    
    .achievement-notification {
        right: 20px;
        top: 20px;
        max-width: 250px;
    }
    
    .easter-egg-container {
        bottom: 20px;
    }
}

/* Enhanced animations for better UX */
@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); 
    }
    50% { 
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6), 0 0 30px rgba(0, 212, 255, 0.4); 
    }
}

.texture-thumbnail.success {
    animation: glow 2s ease-in-out;
}

/* Focus accessibility improvements */
.control-input:focus,
.template-input:focus,
.small-btn:focus,
.control-btn:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .panel {
        border-color: #ffffff;
    }
    
    .control-input {
        border-color: #ffffff;
    }
    
    .app-title {
        -webkit-text-fill-color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}