:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --danger: #ef4444;
    --board-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

.container {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--board-shadow);
    max-width: 1100px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

h1 {
    text-align: center;
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-container {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

#board {
    width: 450px !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.info-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-container, .history-container {
    background: rgba(15, 23, 42, 0.6);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

#status {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}

#move-history {
    height: 250px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    align-content: start;
}

#move-history div {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    color: var(--text-primary);
}

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

button {
    flex: 1;
    padding: 1rem 1.5rem;
    background-color: var(--accent);
    color: #0f172a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

button:active {
    transform: translateY(0);
}

#reset-btn {
    background-color: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
}

#reset-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
    box-shadow: none;
}

/* Custom scrollbar */
#move-history::-webkit-scrollbar {
    width: 6px;
}

#move-history::-webkit-scrollbar-track {
    background: transparent;
}

#move-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 1000px) {
    .container {
        padding: 1.5rem;
    }
    
    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    #board {
        width: 100%;
        max-width: 500px;
    }

    .info-panel {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 500px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .status-container, .history-container {
        padding: 1rem;
    }

    #status {
        font-size: 1.1rem;
    }

    #move-history {
        height: 180px;
        grid-template-columns: 1fr;
    }
}
