:root {
    --bg-color: #1e1e24;
    --board-color: #e6b36f;
    /* Wood color */
    --board-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --line-color: #5c4033;
    --text-color: #f0f0f0;
    --accent-color: #4cc9f0;
    --primary-btn-bg: #4361ee;
    --secondary-btn-bg: #3f37c9;
    --font-main: 'Outfit', sans-serif;
    --font-serif: 'Noto Serif SC', serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #2b2d42, #1e1e24);
}

.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.game-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
    margin-top: 1rem;
}

.side-panel {
    flex: 1;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.center-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.player-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.player-card.active {
    background: rgba(67, 97, 238, 0.15);
    border-color: rgba(67, 97, 238, 0.5);
    box-shadow: 0 0 30px rgba(67, 97, 238, 0.2);
    transform: scale(1.02);
}

.player-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.player-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #f72585, #4361ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(67, 97, 238, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: #8d99ae;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stone-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.stone-icon.black {
    background: radial-gradient(circle at 30% 30%, #666, #000);
}

.stone-icon.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
}

.board-container {
    position: relative;
    padding: 10px;
    background: #6d4c41;
    border-radius: 8px;
    box-shadow: var(--board-shadow);
}

canvas {
    background-color: var(--board-color);
    cursor: pointer;
    border-radius: 4px;
    display: block;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

#winner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
    z-index: 10;
}

.hidden {
    display: none !important;
}

.winner-card {
    background: white;
    padding: 2rem 3rem;
    border-radius: 20px;
    text-align: center;
    color: #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    to {
        transform: scale(1);
    }
}

.winner-card h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2b2d42;
}

button {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.primary-btn {
    background: var(--primary-btn-bg);
    color: white;
}

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

#restart-btn {
    background: linear-gradient(45deg, #4361ee, #3a0ca3);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

footer {
    margin-top: auto;
    padding: 2rem;
    font-size: 0.8rem;
    color: #8d99ae;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }

    .side-panel {
        width: 100%;
        max-width: 600px;
        flex-direction: row;
    }

    .player-card {
        flex: 1;
    }
}