/* ========================================
   FONTS & GLOBAL STYLES
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Courier Prime', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.game-container {
    width: 100%;
    max-width: 1200px;
    background: #5a7d9c;
    border: 4px solid #2c3e50;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* ========================================
   WINDOW HEADER
   ======================================== */
.window-header {
    background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #1a252f;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
}

.window-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #27ae60;
    border: 2px solid #1a7e3a;
    margin-right: 5px;
}

.window-title {
    flex: 1;
}

.status-indicator {
    background: #27ae60;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    border: 1px solid #1a7e3a;
}

.settings-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.settings-btn:hover {
    transform: rotate(20deg);
    color: #3498db;
}

/* ========================================
   GAME BOARD (Main Content Area)
   ======================================== */
.game-board {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    padding: 30px;
    background: #4a6b87;
    min-height: 500px;
}

@media (max-width: 768px) {
    .game-board {
        grid-template-columns: 1fr;
        padding: 20px;
        min-height: auto;
    }
}

/* ========================================
   LEFT PANEL (Character + Dialog)
   ======================================== */
.left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Character Container */
.character-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 200px;
    margin-bottom: 20px;
}

.character {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.character-head {
    width: 100px;
    height: 100px;
    background: #d4a574;
    border: 4px solid #2c3e50;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.character-eye {
    width: 16px;
    height: 20px;
    background: white;
    border: 3px solid #2c3e50;
    position: relative;
}

.character-eye::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 12px;
    background: #2c3e50;
    top: 4px;
    left: 2px;
}

.character-mouth {
    position: absolute;
    bottom: 15px;
    width: 30px;
    height: 15px;
    border: 3px solid #2c3e50;
    border-top: none;
    border-radius: 0 0 15px 15px;
}

.character-body {
    width: 120px;
    height: 80px;
    background: #8b4513;
    border: 4px solid #2c3e50;
    position: relative;
}

/* Speech Bubble */
.speech-bubble {
    background: #f5deb3;
    border: 4px solid #8b4513;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 0 solid transparent;
    border-top: 15px solid #8b4513;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 23px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 0 solid transparent;
    border-top: 10px solid #f5deb3;
}

.bubble-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: #8b4513;
    border-bottom: 2px solid #8b4513;
    padding-bottom: 5px;
}

.speech-bubble p {
    font-size: 13px;
    line-height: 1.5;
    color: #2c3e50;
}

/* Status Box */
.status-box {
    background: #2c3e50;
    border: 3px solid #1a252f;
    padding: 12px;
    width: 100%;
    text-align: center;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.status-box p {
    color: #ecf0f1;
    font-size: 12px;
    letter-spacing: 1px;
}

/* ========================================
   RIGHT PANEL (Input Form)
   ======================================== */
.right-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.input-panel {
    background: #3d5a73;
    border: 4px solid #2c3e50;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

.input-label {
    display: block;
    font-weight: bold;
    font-size: 12px;
    color: #ecf0f1;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #2c3e50;
    background: #ecf0f1;
    color: #2c3e50;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
    background: #fff;
}

.textarea-input {
    resize: vertical;
    min-height: 120px;
}

/* Button Row */
.button-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: 3px solid #2c3e50;
    background: #34495e;
    color: #ecf0f1;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    font-size: 14px;
}

.btn-primary {
    background: #27ae60;
    border-color: #1a7e3a;
}

.btn-primary:hover:not(:disabled) {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: #e74c3c;
    border-color: #c0392b;
}

.btn-secondary:hover:not(:disabled) {
    background: #ec7063;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

/* Error Message */
.error-message {
    margin-top: 12px;
    padding: 10px;
    background: #c0392b;
    color: #ecf0f1;
    border: 2px solid #922b21;
    border-radius: 3px;
    font-size: 12px;
    display: block;
}

.error-message.hidden {
    display: none;
}

/* ========================================
   OUTPUT AREA
   ======================================== */
.output-area {
    background: #3d5a73;
    border-top: 4px solid #2c3e50;
    padding: 20px 30px;
    max-height: 400px;
    overflow-y: auto;
}

.output-header {
    font-weight: bold;
    font-size: 14px;
    color: #3498db;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 8px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.placeholder-text {
    color: #bdc3c7;
    font-style: italic;
    text-align: center;
    padding: 30px 20px;
    font-size: 12px;
}

.question-item {
    background: #2c3e50;
    border-left: 4px solid #3498db;
    padding: 12px 15px;
    border-radius: 3px;
    color: #ecf0f1;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.question-item strong {
    color: #3498db;
    display: block;
    margin-bottom: 5px;
}

/* ========================================
   FOOTER
   ======================================== */
.window-footer {
    background: #2c3e50;
    border-top: 2px solid #1a252f;
    padding: 10px 12px;
    text-align: center;
    color: #bdc3c7;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.tip-text {
    display: block;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
.output-area::-webkit-scrollbar {
    width: 8px;
}

.output-area::-webkit-scrollbar-track {
    background: #2c3e50;
}

.output-area::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 4px;
}

.output-area::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

/* ========================================
   LOADING STATE
   ======================================== */
.loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ecf0f1;
    border-radius: 50%;
    animation: blink 0.6s infinite;
    margin-left: 5px;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}
