/**
 * 阿鹿小站 v2.0 - 單機圍棋專屬樣式表 (game/go/go_local.css)
 */

/* 頁面背景與主容器 */
.go-page-container {
    background: radial-gradient(circle at top, #1e272e, #0f141c);
    color: #f1f2f6;
    padding: 40px 20px;
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', 'Inter', 'SF Pro TC', sans-serif;
}

/* 雙欄主外殼 */
.go-layout-wrapper {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1100px;
    align-items: flex-start;
}

/* 棋盤區域佔比 */
.go-board-section {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* 棋盤精緻卡片 */
.go-board-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 棋盤頂部狀態 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.board-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.status-badge {
    background: linear-gradient(135deg, #f53b57, #dd2644);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(245, 59, 87, 0.4);
    transition: all 0.3s ease;
}

.status-badge.white-turn {
    background: linear-gradient(135deg, #ffffff, #dcdde1);
    color: #1e272e;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.ko-badge {
    background: #ffc048;
    color: #1e272e;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

/* Canvas 棋盤容器與 aspect-ratio 強制方形 */
.canvas-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 10px 25px rgba(0,0,0,0.3);
}

#go-canvas {
    width: 100%;
    height: 100%;
    background: #e5c07b; /* 經典榧木木質黃色 */
    display: block;
    cursor: crosshair;
    border-radius: 12px;
}

/* 控制側邊欄 */
.go-control-sidebar {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 玻璃擬態資訊卡片 */
.control-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.control-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
    padding-left: 10px;
    color: #dcdde1;
}

/* 玩家 VS 狀態區 */
.player-vs-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.player-info {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    padding: 15px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.player-info.active {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
}

.player-info.black.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

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

.stone-icon.black {
    background: radial-gradient(circle at 30% 30%, #4b5563, #111827);
    border: 1px solid #1f2937;
}

.stone-icon.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #d1d5db);
    border: 1px solid #9ca3af;
}

.player-info .name {
    font-size: 0.9rem;
    font-weight: 500;
}

.player-info .captures {
    font-size: 0.8rem;
    color: #a4b0be;
}

.vs-divider {
    font-size: 0.8rem;
    font-weight: 700;
    color: #747d8c;
}

/* 遊戲設定表單項目 */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-size: 0.85rem;
    color: #a4b0be;
    margin-bottom: 8px;
    font-weight: 500;
}

/* 按鈕群組 */
.btn-group {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,0.05);
}

.btn-option {
    flex: 1;
    background: transparent;
    border: none;
    color: #a4b0be;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-option:hover {
    color: #ffffff;
}

.btn-option.active {
    background: #3498db;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

/* 下拉選單 */
.select-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

/* 行動按鈕 */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn-action {
    flex: 1;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action.btn-danger {
    background: #ff4757;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.25);
}

.btn-action.btn-danger:hover {
    background: #ff6b81;
    transform: translateY(-1px);
}

.btn-action.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-action.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 規則說明列表 */
.rules-list {
    padding-left: 18px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.82rem;
    color: #a4b0be;
    line-height: 1.5;
}

.rules-list li strong {
    color: #ffffff;
}

/* 手機版落子放大鏡/準星 */
.go-magnifier {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #3498db;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    background: #e5c07b;
    pointer-events: none; /* 避免擋住點擊事件 */
    z-index: 100;
    overflow: hidden;
}

#magnifier-canvas {
    width: 100%;
    height: 100%;
}

/* ------------------------------------------- */
/* 📱 響應式佈局 (RWD) Media Queries */
/* ------------------------------------------- */
@media (max-width: 900px) {
    .go-layout-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .go-board-section {
        width: 100%;
    }

    .go-control-sidebar {
        width: 100%;
        max-width: 620px;
    }
    
    .go-page-container {
        padding: 20px 10px;
    }
}

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

/* =========================================================
   📊 即時勝率分析條樣式
   ========================================================= */
.winrate-bar-container {
    width: 100%;
    height: 12px; /* 變細一些，更顯精緻現代 */
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(90deg, #f8fafc, #cbd5e1); /* 預設白色底色 (白棋勝率) */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    position: relative;
    box-sizing: border-box;
}

.winrate-progress {
    height: 100%;
    background: linear-gradient(90deg, #1e293b, #0f172a); /* 黑色進度條 (黑棋勝率) */
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-right: 2px solid #3498db; /* 科技藍分割線 */
    box-sizing: border-box;
}

.winrate-header-box {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

/* 複盤控制卡片微調 */
.review-card .btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    padding: 10px 0;
}

.review-card .btn-danger:hover {
    background: #ff6b81 !important;
    transform: translateY(-1px);
}
