:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --board-color: #8B4513;
    --grid-color: #654321;
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --win-color: #FF5252;
    --highlight-color: rgba(255, 215, 0, 0.7);
    --info-bg: rgba(0, 0, 0, 0.5);
    --timer-color: #FFD700;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --board-color: #8B4513;
    --grid-color: #654321;
}

body {
    font-family: 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    color: var(--text-color);
    transition: all 0.3s ease;
    min-height: 100vh;
    overflow: hidden;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    height: 100vh;
    justify-content: center;
}

.top-section {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.title-container {
    text-align: center;
    flex: 1;
}

.title-container h1 {
    margin: 0;
    font-size: 36px;
    font-weight: bold;
}

.furigana {
    font-size: 16px;
    color: #666;
    margin-top: -5px;
}

.game-area {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 180px;
    align-items: flex-start;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 180px;
    align-items: flex-end;
}

#board-container {
    position: relative;
    width: 600px;
    height: 600px;
}

#board {
    width: 600px;
    height: 600px;
    background-color: var(--board-color);
    border: 4px solid var(--grid-color);
    position: relative;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    touch-action: none;
    box-sizing: border-box;
}

.status-box {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    background-color: var(--info-bg);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    min-width: 150px;
    text-align: center;
    border: 2px solid var(--grid-color);
    backdrop-filter: blur(5px);
    margin-top: -10px;
<<<<<<< HEAD
    width: 100%;
    max-width: 566.6px;
=======
    width: 600px;
    max-width: 600px;
    box-sizing: border-box;
>>>>>>> 259fb8b8bb8077af83d621c485ec909db2f158a2
}

.win-message {
    color: var(--win-color);
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

.timer-box {
    background-color: var(--info-bg);
    color: var(--timer-color);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border: 2px solid var(--grid-color);
<<<<<<< HEAD
    min-width: 155px;
=======
    min-width: 180px;
>>>>>>> 259fb8b8bb8077af83d621c485ec909db2f158a2
    backdrop-filter: blur(5px);
}

.timer-label {
    font-size: 12px;
    color: var(--text-color);
    margin-bottom: 5px;
    display: block;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    align-items: center;
}

.control-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 16px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    min-width: 180px;
    min-height: 50px;
}

#reset-btn {
    background-color: var(--primary-color);
    color: white;
}

#reset-btn:hover {
    background-color: var(--primary-hover);
}

#mode-toggle {
    background-color: #5D4037;
    color: white;
}

#mode-toggle:hover {
    background-color: #4E342E;
}

#ai-toggle {
    background-color: #1976D2;
    color: white;
}

#ai-toggle:hover {
    background-color: #1565C0;
}

select {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #5D4037;
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    min-width: 180px;
    min-height: 50px;
}

.select-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
}

.opponent-info {
    background-color: var(--info-bg);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border: 2px solid var(--grid-color);
    backdrop-filter: blur(5px);
    min-width: 180px;
}

.settings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-direction: column;
}

.settings label {
    font-weight: bold;
    font-size: 14px;
}

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

.highlight-piece {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--highlight-color);
    pointer-events: none;
    z-index: 10;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
}

@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }

    .left-panel, .right-panel {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        align-items: center;
        flex-wrap: wrap;
    }

    #board-container {
        width: 100%;
        max-width: 500px;
        height: 500px;
        margin-bottom: 20px;
    }

    .btn, select {
        padding: 12px 18px;
        font-size: 14px;
        min-width: 120px;
        min-height: 40px;
    }

    .status-box {
        position: static;
        margin-top: 15px;
        bottom: auto;
        max-width: 155px;
    }
}