body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #1a2634;
    color: #ecf0f1;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #243447;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.board-container {
    width: 100%;
    overflow-x: auto;
    margin: 12px 0;
    padding: 15px 0;
    background-color: #2d3436;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.board {
    display: flex;
    align-items: center;
    min-width: min-content;
    padding: 20px;
    min-height: 100px;
    transition: all 0.3s ease;
    background-color: #34495e;
    margin: 0 10px;
    border-radius: 6px;
}

.player-hands {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.player-hand {
    background-color: #2d3436;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 1px solid #3d4246;
    margin-bottom: 15px;
}

.player-hand h3 {
    color: #e74c3c;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.score-card {
    background-color: #2d3436;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 1px solid #3d4246;
}

.score-card h3 {
    color: #e74c3c;
    margin-bottom: 8px;
}

.score-card p {
    color: #ecf0f1;
    font-size: 1.8rem;
    font-weight: 600;
}

.game-log {
    width: 98%;
    height: 150px;
    overflow-y: auto;
    background-color: #1a2634; 
    border: 1px solid #34495e;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-family: monospace;
    color: #ecf0f1;
}

#continue-button, #newgame-button, .menu-button, #startgame-button {
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 4px;
}

#continue-button:hover, #newgame-button:hover, .menu-button:hover {
    background-color: #9b2c22;
}

h1, h2, h3 {
    color: #c0392b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.player-hand {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.player-hand img {
    transition: transform 0.2s ease;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding: 10px;
    }

    .player-hands {
        grid-template-columns: 1fr;
    }

    .scores {
        grid-template-columns: 1fr;
    }
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.menu-item {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background-color: #34495e;
}

.menu-button {
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logo {
    width: 300px;
}

@media (max-width: 768px) {
    .logo {
        width: 100px;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    .menu {
        display: none;
    }
}

.board-container {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    padding: 10px 0;
    background-color: #e8f5e9;
    border-radius: 4px;
    scroll-behavior: smooth;
}

.board img {
    transition: transform 0.3s ease;
}

#continue-button, #newgame-button {
    display: none;
}

#round {
    text-align: center;
    font-weight: bold;
}

.player-hand-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background-color: #34495e;
    border-radius: 6px;
}

.domino-image {
    cursor: pointer;
    rotate: 90deg;
    height: 18px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.domino-image-board {
    height: 20px;
    margin: 0 2px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

#game-board {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 20px;
}

.modal {
    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: 1000;
}

.modal-content {
    background-color: #243447;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #34495e;
}

.modal-header h2 {
    margin: 0;
    color: #ecf0f1;
}

.close-button {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}

.close-button:hover {
    color: #c0392b;
}

.modal-body {
    padding: 20px;
    color: #ecf0f1;
    line-height: 1.6;
}

.modal-body h3 {
    color: #c0392b;
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #34495e;
    text-align: right;
}

.modal-button {
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-button:hover {
    background-color: #9b2c22;
}

.modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-family: 'Poppins', sans-serif;
    color: #ecf0f1;
}

#history-table th,
#history-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #34495e;
}

#history-table th {
    background-color: #2c3e50;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

#history-table tbody tr:hover {
    background-color: #2c3e50;
}

#history-table tfoot {
    font-weight: 600;
}

#history-table tfoot tr {
    background-color: #2c3e50;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}