/* --- 基本重置与全局 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; overflow: hidden; }
body {
    background-color: #3A7D3A; /* 浅绿色背景 */
    color: #fff;
}

#game-table {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 10px;
    gap: 10px;
}

.piles-row, .cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

#opponent-piles-display-area {
    min-height: 80px;
    padding-bottom: 5px;
}
.opponent-pile-slot {
    width: 70px; height: 90px;
    background-color: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    display: flex; justify-content: center; align-items: center;
}
.opponent-pile-slot .slot-label { font-size: 0.7em; color: rgba(255,255,255,0.5); }

#center-table-graphic-area { /* This was from V4, we removed it for V5 classic layout */
    /* display: none; */ /* Or completely remove from HTML if not used */
}

#player-arrangement-and-analysis-zone {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    padding: 5px 0;
}
#my-player-piles { /* Container for the three player piles */
    /* .piles-row class is applied */
}
.hand-pile-dropzone.player-self-pile {
    width: 90px; height: 65px;
    background-color: rgba(0,0,0,0.25);
    border: 2px dashed rgba(150, 200, 150, 0.6);
    padding: 4px; border-radius: 5px;
    display: flex; flex-direction: column; align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative; /* For the zone-label */
}
.player-self-pile .pile-label, .hand-zone-label { /* General label style for zones */
    font-size: 0.65em; color: #c0e0c0; margin-bottom: 2px;
    /* position: absolute; top: 2px; left: 4px; background: rgba(0,0,0,0.4); padding: 1px 3px; border-radius: 2px; */
    /* Simpler: just text at the top */
    width: 100%; text-align: center;
}
.player-self-pile .cards-wrapper { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; width: 100%; height: 100%; }
.player-self-pile.drag-over, #player-hand-cards-center-display.drag-over {
    background-color: rgba(80, 150, 80, 0.3) !important;
    border-color: #a0ffa0 !important;
    border-style: solid !important;
}

#hand-analysis-display {
    width: 150px; padding: 6px;
    background-color: rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; font-size: 0.6em; color: #c0d0c0;
    align-self: center; min-height: 65px;
}
#hand-analysis-display h4 { font-size: 1.1em; color: #e0f0e0; margin:0 0 4px 0; border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 2px;}
#hand-analysis-display p { margin-bottom: 2px; line-height: 1.2; }
#hand-analysis-display strong { color: #ffffbb; }
#hand-analysis-display em { font-style: normal; color: #b0b0b0; }

#player-hand-cards-center-display {
    min-height: 90px; max-height: 110px; /* Adjusted height */
    padding: 10px; padding-top: 20px; /* Space for label */
    background-color: rgba(139, 0, 0, 0.4);
    border-radius: 8px; overflow-x: auto; overflow-y: hidden;
    width: 95%; max-width: 800px; margin: 10px auto;
    flex-grow: 1; /* Allow it to take space */
    position: relative; /* For the zone-label */
}
#player-hand-cards-center-display .card {
    position: relative; transform: none !important;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
#player-hand-cards-center-display .card:hover {
    transform: translateY(-4px) scale(1.06) !important; z-index: 100;
}
#player-hand-cards-center-display .hand-zone-label { /* Specific styling for this label */
    position: absolute; top: 3px; left: 8px;
    background-color: rgba(0,0,0,0.5); padding: 2px 4px; border-radius: 3px;
    font-size: 0.6em; color: #ddd;
}


.card {
    width: 50px; height: 70px;
    background-color: #fff; border: 1px solid #777; border-radius: 4px;
    display: flex; flex-direction: column; justify-content: space-around; align-items: center;
    padding: 3px; font-weight: bold; box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    cursor: grab; user-select: none;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.card:hover { transform: translateY(-3px) scale(1.05); box-shadow: 2px 2px 6px rgba(0,0,0,0.3); z-index: 50; }
.card.dragging { opacity: 0.7; transform: rotate(2deg) scale(1.05) !important; cursor: grabbing; z-index: 1000;}
.card .rank { font-size: 1.2em; }
.card .suit { font-size: 1em; }
.card.hearts, .card.diamonds { color: #D32F2F; }
.card.spades, .card.clubs { color: #212121; }

.cards-wrapper .card {
    width: 38px; height: 52px; cursor: default; box-shadow: 0px 1px 1px rgba(0,0,0,0.1);
}
.cards-wrapper .card .rank { font-size: 0.9em; }
.cards-wrapper .card .suit { font-size: 0.75em; }
.cards-wrapper .card:hover { transform: translateY(-1px); }

#controls-panel {
    height: 50px; background-color: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.1); padding: 0 10px;
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto;
}
.player-info { display: flex; align-items: center; gap: 12px; font-size: 0.75em; color: #e0f0e0;}
.player-info #player-name-display { font-weight: bold; }
#ai-托管-info { font-size: 0.85em; color: #ffdd77; font-style: italic; }

.action-buttons { display: flex; gap: 6px; }
.game-btn {
    padding: 5px 9px; font-size: 0.7em; color: #fff;
    background-color: #2E7D32; border: 1px solid #1B5E20;
    border-radius: 12px; cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.game-btn:hover { background-color: #388E3C; transform: translateY(-1px); }
.game-btn:active { background-color: #1B5E20; transform: translateY(0); }
.game-btn:disabled { background-color: #444; color: #888; cursor: not-allowed; }
.game-btn.submit { background-color: #c0392b; border-color: #a03020; }
.game-btn.submit:hover { background-color: #e74c3c; }
#ai-托管-btn { background-color: #8e44ad; border-color: #703080; }
#ai-suggest-btn { background-color: #f39c12; border-color: #d08000; }

#game-message-popup {
    position: fixed; bottom: 55px; left: 50%; transform: translateX(-50%);
    background-color: rgba(10, 30, 10, 0.9); color: #d0e0d0;
    padding: 8px 15px; border-radius: 5px; box-shadow: 0 -1px 5px rgba(0,0,0,0.2);
    font-size: 0.85em; z-index: 1500; opacity: 0; transition: opacity 0.3s, bottom 0.3s;
    display: none;
}
#game-message-popup.visible { opacity: 1; bottom: 65px; }
#game-message-popup.error { background-color: rgba(180,0,0,0.9); color: #ffdada; }
#game-message-popup.success { background-color: rgba(0,80,0,0.9); color: #d2ffd2; }

.modal-overlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background-color: rgba(0,0,0,0.7); display:flex; justify-content:center; align-items:center;
    z-index: 2000;
}
.modal-content {
    background-color: #2c3e50; padding: 20px 25px; border-radius: 8px;
    border: 1px solid #34495e; text-align: center; box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.modal-content h4 { margin-bottom: 18px; font-size: 1.1em; color: #ecf0f1; }
.modal-content .game-btn { display: block; width: 100%; margin-bottom: 8px; }
.modal-content .game-btn.cancel { background-color: #7f8c8d; border-color: #607070;}
.modal-content .game-btn.cancel:hover { background-color: #95a5a6;}
