/* Next UI inspired styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}
h3{
    margin-bottom: 10px;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 1400px;
    margin: 0 auto;
    height:100vh;
    background-color: #fff;
    display: flex;
    flex-wrap: nowrap;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* 游戏容器 */
.game-container {
    flex: 3;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
}

.left-section {
    width: 75%;
}

.right-section {
    width: 25%;
}

/* 信息容器 */
.info-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 玩家头像区域 */
.player-avatars {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.avatar-container {
    text-align: center;
}

.avatar {
    width: 60px;
    height: 60px;
    background-color: #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px;
    font-size: 12px;
}

/* 本轮信息区域 */
.round-info {
    flex-grow: 1;

}

/* 聊天区域 */
.chat-box {
    height:200px;
    display: flex;
    flex-direction: column;
}

.chat-content {
    background-color: white;
    border-radius: 5px;
    padding: 10px;
    min-height: 150px;
    flex-grow: 1;
    border: 1px solid #e0e0e0;
}

.game-setup {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.target-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.target-btn {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.target-btn:hover {
    background-color: #e9ecef;
}

.target-btn.selected {
    background-color: #0070f3 !important;
    border-color: #0070f3 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 112, 243, 0.4) !important;
}

/* 分数区域 */
.score-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.player-scores {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.player-score, .target-score {
    text-align: center;
    padding: 10px;
}

.player-label, .target-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.score-value, .target-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.player1.active .score-value {
    color: #0070f3;
}

.player2.active .score-value {
    color: #0070f3;
}

.current-round-info {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.turn-score-container, .round-score-container {
    text-align: center;
}

.turn-label, .round-label {
    font-size: 14px;
    color: #666;
}

.turn-value, .round-value {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.hidden {
    display: none;
}

.game-board {
    animation: fadeIn 0.5s ease;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 骰子区域 */
.dice-container {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    min-height: 550px;
}

#dice-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* 游戏控制区域 */
.game-controls {
    margin-bottom: 20px;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.control-btn {
    position: relative;
    padding: 12px 25px;
    min-width: 120px;
}

.btn-text {
    display: block;
    margin-bottom: 5px;
}

.shortcut-key {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
}

#round-history {
    overflow-y: auto;
    max-height:400px;
}

.round-item {
    background-color: #f0f8ff;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.round-header {
    font-size: 14px;
    font-weight: normal;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.round-score {
    font-weight: bold;
    color: #2c3e50;
}

.round-dice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.round-dice .die{
    width: 40px;
    height: 40px;
}
.round-dice .die .dot{
    width: 8px;
    height: 8px;
}
.die {
    width: 70px;
    height: 70px;
    background-color: white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    border: 2px solid #ddd;
}

.die:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.die.selected {
    transform: translateY(-10px);
    border: 2px solid #2196f3;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* All dice are white now, no special styling for scoring/non-scoring */

.die.scoring {
    cursor: pointer;
}

/* 骰子点数样式 */
.die-dots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 80%;
    height: 80%;
}

.dot {
    width: 14px;
    height: 14px;
    background-color: #333;
    border-radius: 50%;
    margin: auto;
    display: none; /* 默认隐藏所有点 */
}

/* 骰子点数位置和显示 */
.die-1 .dot:nth-child(5) { grid-area: 2 / 2; display: block; }

.die-2 .dot:nth-child(1) { grid-area: 1 / 1; display: block; }
.die-2 .dot:nth-child(9) { grid-area: 3 / 3; display: block; }

.die-3 .dot:nth-child(1) { grid-area: 1 / 1; display: block; }
.die-3 .dot:nth-child(5) { grid-area: 2 / 2; display: block; }
.die-3 .dot:nth-child(9) { grid-area: 3 / 3; display: block; }

.die-4 .dot:nth-child(1) { grid-area: 1 / 1; display: block; }
.die-4 .dot:nth-child(3) { grid-area: 1 / 3; display: block; }
.die-4 .dot:nth-child(7) { grid-area: 3 / 1; display: block; }
.die-4 .dot:nth-child(9) { grid-area: 3 / 3; display: block; }

.die-5 .dot:nth-child(1) { grid-area: 1 / 1; display: block; }
.die-5 .dot:nth-child(3) { grid-area: 1 / 3; display: block; }
.die-5 .dot:nth-child(5) { grid-area: 2 / 2; display: block; }
.die-5 .dot:nth-child(7) { grid-area: 3 / 1; display: block; }
.die-5 .dot:nth-child(9) { grid-area: 3 / 3; display: block; }

.die-6 .dot:nth-child(1) { grid-area: 1 / 1; display: block; }
.die-6 .dot:nth-child(3) { grid-area: 1 / 3; display: block; }
.die-6 .dot:nth-child(4) { grid-area: 2 / 1; display: block; }
.die-6 .dot:nth-child(6) { grid-area: 2 / 3; display: block; }
.die-6 .dot:nth-child(7) { grid-area: 3 / 1; display: block; }
.die-6 .dot:nth-child(9) { grid-area: 3 / 3; display: block; }

/* 已替换为 .control-buttons */

.nextui-button {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nextui-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nextui-button:active {
    transform: translateY(0);
}

.nextui-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.nextui-button.primary {
    background-color: #0070f3;
}

.nextui-button.primary:hover {
    background-color: #0060df;
}

.nextui-button.success {
    background-color: #17c964;
}

.nextui-button.success:hover {
    background-color: #13a452;
}

.nextui-button.secondary {
    background-color: #7828c8;
}

.nextui-button.secondary:hover {
    background-color: #6622aa;
}

.nextui-button.flat {
    background-color: #f5f5f5;
    color: #333;
}

.nextui-button.flat:hover {
    background-color: #e0e0e0;
}



.success {
    background-color: #d4edda;
    color: #155724;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
}

.danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* 规则弹窗 - 使用标准dialog */
.rules-dialog {
    padding: 0;
    border: none;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.rules-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.dialog-content {
    background-color: white;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dialog-header {
    padding: 20px 20px 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.dialog-header h2 {
    margin: 0;
}

.rules-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.dialog-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin: 0;
}

.close-btn:hover {
    color: #333;
}

.rules-content {
    margin-top: 20px;
}

.rules-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
}

.rules-content ul, .rules-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-content li {
    margin-bottom: 5px;
}

/* 已不需要，使用.hidden来控制显示/隐藏 */

/* Dice animation */
@keyframes roll {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.rolling {
    animation: roll 0.5s ease;
}

/* Farkle notification */
.farkle-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.3);
    z-index: 1000;
    text-align: center;
    width: 80%;
    max-width: 500px;
    border: 2px solid #e74c3c;
    animation: fadeIn 0.3s ease;
}

.farkle-notification h2 {
    color: #e74c3c;
    font-size: 32px;
    margin-bottom: 10px;
}

.farkle-notification p {
    margin-bottom: 20px;
    font-size: 18px;
}

.farkle-dice {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.countdown-container {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 20px;
}

.countdown-bar {
    height: 100%;
    background-color: #e74c3c;
    width: 100%;
    transition: width 3s linear;
}

.countdown-active .countdown-bar {
    width: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .game-container {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .die {
        width: 60px;
        height: 60px;
    }
    
    .player-scores {
        flex-direction: column;
        gap: 15px;
    }
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .die {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}
