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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

header {
    text-align: center;
    color: white;
    padding: 10px 0;
    flex-shrink: 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.version {
    font-size: 0.85rem;
    opacity: 0.9;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(255,255,255,0.95);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.info-item {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
}

.info-item .label {
    font-weight: 600;
    color: #667eea;
}

.info-item .value {
    color: #333;
}

.game-container {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.left-panel {
    width: 600px;
    min-width: 600px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.right-panel {
    width: 500px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow-y: auto;
    flex-shrink: 0;
}

.terminal {
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
}

.welcome-message {
    color: #d4d4d4;
}

.terminal-line {
    margin: 5px 0;
}

.terminal-prompt {
    color: #569cd6;
}

.terminal-output {
    color: #d4d4d4;
}

.terminal-success {
    color: #4ec9b0;
}

.terminal-error {
    color: #f48771;
}

.terminal-move {
    color: #dcdcaa;
}

.terminal-computer {
    color: #c586c0;
}

.board-header {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.chessboard {
    display: grid;
    grid-template-columns: 20px repeat(8, 50px);
    grid-template-rows: repeat(8, 50px) 20px;
    gap: 0;
    margin: 0 auto;
    width: fit-content;
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    border: 3px solid #333;
}

.rank-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.square.light {
    background: #f0d9b5;
}

.square.dark {
    background: #b58863;
}

.piece {
    font-size: 2rem;
    user-select: none;
}

.piece.white {
    color: #ffffff;
    text-shadow: 0 0 3px #000, 0 0 5px #000;
}

.piece.black {
    color: #000000;
    text-shadow: 0 0 2px #fff;
}

.input-container {
    display: flex;
    align-items: center;
    background: #1e1e1e;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    flex-shrink: 0;
    width: 100%;
}

.prompt {
    color: #569cd6;
    font-family: 'Courier New', monospace;
    margin-right: 10px;
    white-space: nowrap;
}

#moveInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    outline: none;
}

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

.quick-commands {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    width: 100%;
}

.quick-commands button {
    background: white;
    color: #667eea;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.quick-commands button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.quick-commands button:active {
    transform: translateY(0);
}

/* Scrollbar styling for terminal */
.terminal::-webkit-scrollbar {
    width: 10px;
}

.terminal::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.terminal::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

.terminal::-webkit-scrollbar-thumb:hover {
    background: #777;
}

@media (max-width: 1200px) {
    .game-container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .right-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }

    .game-container {
        flex-direction: column;
    }

    .right-panel {
        width: 100%;
    }

    .chessboard {
        grid-template-columns: 20px repeat(8, 40px);
        grid-template-rows: repeat(8, 40px) 20px;
    }

    .square {
        width: 40px;
        height: 40px;
    }

    .piece {
        font-size: 1.8rem;
    }

    .quick-commands {
        flex-direction: column;
    }

    .quick-commands button {
        width: 100%;
    }
}

/* Loading indicator */
.loading {
    color: #c586c0;
    animation: pulse 1.5s ease-in-out infinite;
}

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