/* Spellbook™ Frontend Styles */
/* Enhanced with Game Goblin 144 Questions System, DreamForge, Batch Processing, and Controller Button Mapper */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Screen management */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: block;
}

/* Background gradient */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #1a0033 0%, 
        #2d1b69 25%, 
        #4c1d95 50%, 
        #7c3aed 75%, 
        #a855f7 100%);
    z-index: -1;
}

.background-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%);
    animation: gradientShift 10s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* Main screen styles */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.floating-title h1 {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, #a855f7, #06b6d4);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
    margin-bottom: 1rem;
}

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

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
}

.button-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* Main buttons */
.manifest-btn, .dreamforge-btn, .translator-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.manifest-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.dreamforge-btn {
    background: linear-gradient(135deg, #3a67ed, #2c4cdb);
    color: white;
}

.translator-btn {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}

.manifest-btn:hover, .dreamforge-btn:hover, .translator-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.translator-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.translator-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Pulse animation for completed game */
.translator-btn.pulse-animation {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
        transform: scale(1.05);
    }
}

.button-context {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Settings */
.settings-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.settings-panel {
    position: fixed;
    top: 80px;
    right: 1rem;
    width: 300px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 999;
    backdrop-filter: blur(10px);
}

.settings-panel.hidden {
    display: none;
}

.usage-stats {
    margin: 1rem 0;
}

.usage-item {
    margin-bottom: 1rem;
}

.usage-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    height: 8px;
    position: relative;
    margin: 0.5rem 0;
}

.usage-fill {
    background: linear-gradient(90deg, #10b981, #3b82f6);
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.ai-info {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Game Goblin Screen Styles */
.game-goblin-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* This is the new medium teal background */
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%);
}

.game-goblin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.game-goblin-title h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* Adds a nice space between the goblin and the text */
}

.game-goblin-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.status-indicator.online {
    animation: pulse 2s infinite;
}

.status-indicator.processing {
    background: #f59e0b;
    animation: pulse 1s infinite;
}

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

/* Welcome Section - Enhanced for questionnaire */
.welcome-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.goblin-avatar {
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.welcome-text h3 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.welcome-text p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.welcome-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    line-height: 1.5;
}

/* Questionnaire-specific styles */
.questionnaire-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* This will center the progress bar and bubble */
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto; /* This centers the whole container */
}

/* Batch Info Section */
.batch-info {
    width: 100%;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
}

.batch-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.batch-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.batch-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #7c3aed);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#batchText {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(168, 85, 247, 0.9);
}

.progress-section {
    width: 100%;
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6, #a855f7);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.goblin-message {
    background: rgba(9, 59, 56, 0.927);
    border: 1px solid rgba(33, 125, 95, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0; /* Use margin 0 on left/right for centering */
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 650px; /* Set a max-width for the bubble itself */
    width: 100%; 
    text-align: left; /* Keep text inside the bubble left-aligned */
    white-space: pre-wrap; /* ✅ This makes paragraphs work */
}

.question-context {
    background: rgba(12, 65, 64, 0.956);
    border: 1px solid rgba(26, 117, 114, 0.67);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 231, 20, 0.9);
}

.retry-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Batch Notification */
.batch-notification {
    animation: slideIn 0.3s ease-out;
}

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

/* Chat Input Area - Enhanced for questionnaire */
.chat-input-area {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

#goblinChatInput, #questionAnswerInput {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    min-height: 28px;
    max-height: 120px;
    outline: none;
    line-height: 1.5;
}

#goblinChatInput::placeholder, #questionAnswerInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.attachment-btn, .image-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.attachment-btn:hover, .image-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.send-arrow {
    font-weight: bold;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0 0.5rem;
}

.char-counter {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.ai-selector, .question-info {
    display: flex;
    align-items: center;
}

.ai-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: rgba(16, 185, 129, 0.9);
    font-weight: 500;
}

.question-info span {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: rgba(59, 130, 246, 0.9);
    font-weight: 500;
}

/* DreamForge Screen Styles */
.dreamforge-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a0033 0%, #2d1b69 50%, #4c1d95 100%);
}

.dreamforge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dreamforge-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.dreamforge-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.dreamforge-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.dreamforge-container {
    width: 100%;
    max-width: 900px;
}

.rune-frame {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(10px);
}

.rune {
    position: absolute;
    font-size: 2rem;
    color: rgba(168, 85, 247, 0.6);
    animation: runeGlow 4s ease-in-out infinite alternate;
}

.rune.top-left { top: -10px; left: -10px; }
.rune.top-right { top: -10px; right: -10px; }
.rune.bottom-left { bottom: -10px; left: -10px; }
.rune.bottom-right { bottom: -10px; right: -10px; }

@keyframes runeGlow {
    0% { opacity: 0.4; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.1); }
}

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

.dreamforge-welcome {
    margin-bottom: 3rem;
}

.dreamforge-welcome h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #a855f7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dreamforge-welcome p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    padding: 2rem;
    background: rgba(168, 85, 247, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.upload-area:hover {
    border-color: rgba(168, 85, 247, 0.6);
    background: rgba(168, 85, 247, 0.1);
}

.upload-area.dragover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: rgba(168, 85, 247, 0.7);
}

.upload-area h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.upload-area p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.file-types {
    font-size: 0.875rem;
    color: rgba(168, 85, 247, 0.8);
    margin-bottom: 1rem;
}

.browse-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.upload-status {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

.upload-status.hidden {
    display: none;
}

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 1.5rem;
    color: #10b981;
}

.file-info {
    flex: 1;
    text-align: left;
}

.file-name {
    display: block;
    font-weight: 600;
    color: #ffffff;
}

.file-size {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.remove-file {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: rgba(239, 68, 68, 0.3);
}

.text-input-section {
    margin-bottom: 2rem;
}

.text-input-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.story-input-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

#storyInput {
    width: 100%;
    min-height: 200px;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

#storyInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.char-count {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.clear-btn {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.action-section {
    margin-top: 2rem;
}

.feed-goblin-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.feed-goblin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.feed-goblin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.25rem;
}

/* Story Preview Modal */
.story-preview-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.close-modal-btn {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.story-game-preview {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.preview-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 4px solid #a855f7;
}

.preview-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #a855f7;
}

.editable-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    min-height: 100px;
    color: white;
    line-height: 1.6;
    outline: none;
}

.editable-content:focus {
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.08);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.edit-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #60a5fa;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.manifest-btn {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: white;
}

.manifest-btn img {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  margin-right: 0.5rem;
  filter: drop-shadow(1px 1px 0 #000) drop-shadow(1px 1px 0 #000);
}
 

/* Game Window Modal Styles */
.game-window-content {
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.game-canvas-container {
    margin-bottom: 2rem;
}

.game-canvas {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.game-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

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

/* Game Scene Styles */
.game-scene {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    overflow: hidden;
}

.game-character {
    position: absolute;
    bottom: 20%;
    left: 20%;
    font-size: 3rem;
    z-index: 10;
}

.game-environment {
    position: absolute;
    width: 100%;
    height: 100%;
}

.game-tree {
    position: absolute;
    bottom: 15%;
    right: 30%;
    font-size: 4rem;
}

.game-castle {
    position: absolute;
    bottom: 10%;
    right: 10%;
    font-size: 5rem;
}

.game-gem {
    position: absolute;
    top: 30%;
    left: 60%;
    font-size: 2rem;
    animation: sparkle 2s ease-in-out infinite;
}

.game-ui {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-bar {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.health-fill {
    width: 100px;
    height: 8px;
    background: linear-gradient(90deg, #ef4444, #10b981);
    border-radius: 4px;
}

.score {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 600;
}

@keyframes gameplayMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.play-game-btn, .pause-game-btn, .restart-game-btn, .fullscreen-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.play-game-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.pause-game-btn {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}

.restart-game-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
}

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

.play-game-btn:hover:not(:disabled), .pause-game-btn:hover:not(:disabled), 
.restart-game-btn:hover:not(:disabled), .fullscreen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.play-game-btn:disabled, .pause-game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-section {
    margin-bottom: 2rem;
}

.download-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.download-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

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

.download-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.download-title {
    font-weight: 600;
    font-size: 1rem;
}

.download-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.game-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    font-weight: 600;
    color: #a855f7;
}

/* Controller Button Mapper Screen Styles */
.controller-mapper-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

.controller-mapper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mapper-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.mapper-title p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.processing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(245, 158, 11, 0.9);
}

.mapper-main {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-height: calc(100vh - 300px);
    overflow: hidden;
}

.controller-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.mapping-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.controller-selector h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.controller-dropdown, .action-dropdown {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.controller-dropdown:focus, .action-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
}

.controller-display {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Controller SVG Styles */
.controller-svg {
    max-width: 100%;
    max-height: 300px;
}

.keyboard-controller {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.keyboard-layout {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.key-row {
    display: flex;
    gap: 0.25rem;
}

.key {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    min-width: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.key.wide {
    min-width: 60px;
}

.key:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #3b82f6;
}

.mouse-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mouse {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mouse-button, .mouse-wheel {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    min-width: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mouse-button:hover, .mouse-wheel:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #3b82f6;
}

.playstation-controller, .xbox-controller, .switch-controller, .steamdeck-controller {
    position: relative;
    width: 300px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controller-body {
    position: relative;
    width: 100%;
    height: 100%;
}

.dpad {
    position: absolute;
    top: 50%;
    left: 20%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
}

.dpad-button {
    width: 25px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dpad-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #3b82f6;
}

.face-buttons {
    position: absolute;
    top: 50%;
    right: 20%;
    transform: translate(50%, -50%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
}

.face-button {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.face-button.triangle, .face-button.y { background: rgba(34, 197, 94, 0.3); }
.face-button.square, .face-button.x { background: rgba(59, 130, 246, 0.3); }
.face-button.circle, .face-button.b { background: rgba(239, 68, 68, 0.3); }
.face-button.cross, .face-button.a { background: rgba(245, 158, 11, 0.3); }

.face-button:hover {
    transform: scale(1.1);
    border-color: #3b82f6;
}

.shoulder-buttons {
    position: absolute;
    top: 10%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10%;
}

.shoulder-button {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shoulder-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #3b82f6;
}

.analog-sticks {
    position: absolute;
    bottom: 20%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 25%;
}

.analog-stick {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analog-stick:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #3b82f6;
}

.trackpads {
    position: absolute;
    bottom: 30%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15%;
}

.trackpad {
    width: 40px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trackpad:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #3b82f6;
}

.mobile-controller {
    width: 300px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.virtual-dpad, .virtual-buttons, .touch-gestures {
    display: flex;
    gap: 0.5rem;
}

.virtual-button, .gesture {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.virtual-button:hover, .gesture:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #3b82f6;
}

.button-mappings h4 {
    font-size: 1.1rem;
    margin: 2rem 0 1rem;
    color: #ffffff;
}

.mapping-list {
    max-height: 200px;
    overflow-y: auto;
}

.mapping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.mapping-action {
    font-weight: 600;
    color: #ffffff;
}

.mapping-combo {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.remove-mapping-btn {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-mapping-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.no-mappings {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
    font-style: italic;
}

.mapping-config h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.action-selector {
    margin-bottom: 2rem;
}

.action-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.combo-builder h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.combo-display {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.combo-slot {
    width: 60px;
    height: 60px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.combo-slot.filled {
    border-style: solid;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #ffffff;
    font-weight: 600;
}

.combo-slot.empty {
    border-color: rgba(255, 255, 255, 0.2);
}

.available-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.available-button {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.available-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.combo-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.clear-combo-btn, .save-combo-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-combo-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.clear-combo-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.save-combo-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.save-combo-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.save-combo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preset-configs {
    margin-top: 2rem;
}

.preset-configs h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.75rem;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: #a855f7;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
}

.processing-panel {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.processing-info {
    flex: 1;
}

.processing-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.processing-steps {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.step.active {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: rgba(16, 185, 129, 0.9);
}

.step-icon {
    font-size: 1.1rem;
}

.step-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.step-status {
    font-size: 0.8rem;
}

.processing-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.processing-progress .progress-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.processing-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6, #a855f7);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.processing-progress .progress-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.finish-mapping-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.finish-mapping-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
}

.finish-mapping-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Translator screen */
.translator-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.translator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.translator-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.translator-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.translator-container {
    display: flex;
    flex: 1;
    gap: 2rem;
    padding: 2rem;
}

.translator-input-section, .translator-output-section {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.input-header h3, .output-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.quick-examples {
    margin: 1.5rem 0;
}

.example-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.example-btn {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.translator-input-wrapper {
    margin-top: 1rem;
}

.translator-input-wrapper textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.translator-input-wrapper textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.translate-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.translate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.translate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.output-controls {
    display: flex;
    gap: 0.5rem;
}

.copy-btn, .download-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover:not(:disabled), .download-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn:disabled, .download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.code-output-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    min-height: 200px;
    position: relative;
}

.code-output {
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.placeholder-subtitle {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.code-explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.code-explanation.hidden {
    display: none;
}

.translation-history {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 2rem 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.clear-history-btn {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.history-list {
    max-height: 150px;
    overflow-y: auto;
}

.history-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-text {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.history-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.history-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
}

/* Processing screen */
.split-layout {
    display: flex;
    min-height: 100vh;
}

.left-panel, .right-panel {
    flex: 1;
    padding: 2rem;
}

.left-panel {
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.character-view {
    text-align: center;
    margin-bottom: 2rem;
}

.mute-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.character-container {
    margin: 2rem 0;
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dancing-character {
    font-size: 4rem;
    animation: dance 2s ease-in-out infinite;
    position: relative;
}

@keyframes dance {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(-5deg); }
}

.magic-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    animation: sparkle 3s ease-in-out infinite;
}

.sparkle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 30%; right: 20%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { bottom: 30%; left: 30%; animation-delay: 1s; }
.sparkle:nth-child(4) { bottom: 20%; right: 30%; animation-delay: 1.5s; }

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

.flavor-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #a855f7;
    margin: 1rem 0;
    min-height: 2rem;
}

.progress-container {
    margin-top: 2rem;
}

.next-steps h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.step-list {
    margin: 1.5rem 0;
}

.step {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #3b82f6;
}

.next-step-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.next-step-list li {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.download-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a0033, #2d1b69);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.completion-features {
    margin: 1.5rem 0;
}

.feature {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #10b981;
}

.generated-output {
    margin: 1.5rem 0;
}

.code-preview {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.code-preview pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
}

.close-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Demo note */
.demo-note {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.demo-note p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

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

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

/* Responsive design */
@media (max-width: 768px) {
    .floating-title h1 {
        font-size: 2.5rem;
    }
    
    .button-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .translator-container, .mapper-main {
        flex-direction: column;
    }
    
    .split-layout {
        flex-direction: column;
    }
    
    .example-buttons {
        grid-template-columns: 1fr;
    }
    
    .welcome-section {
        padding: 2rem 1rem 1rem;
    }
    
    .chat-input-area {
        padding: 1rem;
    }
    
    .welcome-text h3 {
        font-size: 2rem;
    }
    
    .welcome-text p {
        font-size: 1.25rem;
    }
    
    .goblin-avatar {
        font-size: 4rem;
    }
    
    .dreamforge-main {
        padding: 1rem;
    }
    
    .rune-frame {
        padding: 2rem 1rem;
    }
    
    .dreamforge-welcome h3 {
        font-size: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .controller-display {
        min-height: 200px;
    }
    
    .processing-steps {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .processing-panel {
        flex-direction: column;
        gap: 1rem;
    }
    
    .available-buttons {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    
    .combo-actions {
        flex-direction: column;
    }
    
    .download-options {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }
    
    .floating-title h1 {
        font-size: 2rem;
    }
    
    .translator-header, .dreamforge-header, .game-goblin-header, .controller-mapper-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 1rem;
    }
    
    .welcome-text h3 {
        font-size: 1.75rem;
    }
    
    .welcome-text p {
        font-size: 1.1rem;
    }
    
    .goblin-avatar {
        font-size: 3.5rem;
    }
    
    .rune {
        font-size: 1.5rem;
    }
    
    .controller-svg {
        max-height: 200px;
    }
    
    .key, .mouse-button {
        min-width: 25px;
        padding: 0.25rem;
        font-size: 0.7rem;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .game-canvas {
        height: 300px;
    }
    
    .game-controls {
        grid-template-columns: 1fr;
    }
}

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

/* Focus styles for keyboard navigation */
button:focus,
textarea:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .background-gradient {
        background: #000000;
    }
    
    .modal-content {
        background: #000000;
        border: 2px solid #ffffff;
    }
}
