/* public/style.css */
:root {
    --bg-color: #F0FBF6; /* 非常浅的绿色背景 */
    --text-color: #333333; /* 深灰色文字，对比更柔和 */
    --primary-color: #2ECC71; /* 清新、明亮的绿色，用于主要按钮和高亮 */
    --primary-hover-color: #27AE60; /* 按钮悬停时的深绿色 */
    --secondary-color: #95A5A6; /* 次要按钮和文字的灰色 */
    --panel-bg: #FFFFFF; /* 面板使用白色，更显清新 */
    --board-bg: #E3B778; /* 棋盘保持木色质感 */
    --line-color: #6A4F2A;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 0;
    font-weight: 600;
}

.subtitle {
    color: var(--secondary-color);
    margin-top: 5px;
    font-size: 1.2em;
}

/* 全局关于按钮 */
#global-about-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    font-weight: bold;
    padding: 0;
    line-height: 50px;
    box-shadow: 0 2px 10px var(--shadow-color);
    cursor: pointer;
    transition: all 0.3s ease;
}
#global-about-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}


/* 视图切换 */
.view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.view.active {
    display: flex;
}
.hidden {
    display: none !important;
}


/* 菜单 */
.menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    max-width: 300px;
}

button {
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2);
}
button:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.3);
}

button.back-to-home, .modal-buttons button#cancel-settings-btn, #close-about-modal-btn {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.2);
}
button.back-to-home:hover, .modal-buttons button#cancel-settings-btn:hover, #close-about-modal-btn:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.3);
}

/* AI 状态面板 */
#ai-status-panel {
    background-color: var(--panel-bg);
    border-radius: 8px;
    padding: 10px 20px;
    margin: 15px 0;
    border: 1px solid #eee;
    box-shadow: 0 5px 25px var(--shadow-color);
}
#ai-status-panel .menu {
    flex-direction: row;
    justify-content: center;
    margin-top: 10px;
    gap: 10px;
}
#ai-status-panel .menu button {
    font-size: 1em;
    padding: 10px 20px;
}


/* 游戏区域 */
.game-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
}

#gobang-board, #replay-board {
    background-color: var(--board-bg);
    border-radius: 8px;
    box-shadow: 0 5px 25px var(--shadow-color);
}

.game-info-panel {
    flex-grow: 1;
    min-width: 300px;
    max-width: 400px;
    background-color: var(--panel-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 5px 25px var(--shadow-color);
}

#move-list, #replay-move-list {
    list-style-type: none;
    padding: 0;
    height: 400px;
    overflow-y: auto;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9em;
    border: 1px solid #eee;
}
#move-list li, #replay-move-list li {
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
}

.game-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#replay-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}
#replay-controls button, #replay-controls select {
    font-size: 1em;
    padding: 10px;
    width: 100%;
    border-radius: 5px;
}
#replay-controls select {
    border: 1px solid #ccc;
    background-color: white;
}


.real-time-clock {
    font-size: 1em;
    color: var(--secondary-color);
    margin: 10px 0;
}

/* 回放界面特定样式 */
#replay-meta-info {
    text-align: left;
    width: 100%;
    max-width: 930px; /* Aligns with game-area width */
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 0 5px 25px var(--shadow-color);
}
#replay-meta-info p {
    margin: 8px 0;
}
#replay-meta-info strong {
    color: var(--primary-color);
}


/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-content h2 {
    text-align: center;
    margin-top: 0;
    color: var(--primary-color);
}

.modal-content fieldset {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 10px 15px;
}

.modal-content legend {
    color: var(--primary-color);
    padding: 0 10px;
    font-weight: bold;
}

.modal-content label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons button {
    font-size: 1em;
    padding: 10px 25px;
}

/* 关于弹窗特定样式 */
#about-modal .modal-content {
    text-align: center;
}
#about-modal-content {
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 15px;
    line-height: 1.6;
}

#about-modal-content h2, #about-modal-content h3 {
    color: var(--primary-color);
}
