* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 20px;
}

.game-container {
    max-width: 1300px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
}

.player {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
}

.player-color.blue {
    background-color: #4A90E2;
}

.player-color.red {
    background-color: #E74C3C;
}

.current-player {
    font-size: 1.1em;
    font-weight: bold;
    color: #2c3e50;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(16, 40px);
    grid-template-rows: repeat(16, 40px);
    gap: 1px;
    margin: 20px 0;
    background: #8B4513;
    padding: 10px;
    border-radius: 8px;
    width: fit-content;
    margin: 20px auto;
}

/* Player Areas */
.area {
    position: relative;
    border: 3px solid #000;
}

.player1-start {
    background: #F4E4BC;
}

.player2-home {
    background: #E8D5B7;
}

/* Water Areas */
.water {
    background: #B0C4DE;
    border: 3px solid #4682B4;
    position: relative;
}

/* Water direction arrows */
.cell[data-water-direction]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: bold;
    color: rgba(70, 130, 180, 0.6);
    z-index: 1;
    pointer-events: none;
}

.cell[data-water-direction="up"]::before {
    content: '↑';
}

.cell[data-water-direction="down"]::before {
    content: '↓';
}

.cell[data-water-direction="left"]::before {
    content: '←';
}

.cell[data-water-direction="right"]::before {
    content: '→';
}

/* Steps */
.step {
    background: #DDD;
    border: 3px solid #999;
    position: relative;
}

/* Causeway Areas */
.causeway {
    background: #F5DEB3;
    border: 3px solid #D2B48C;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 1px;
    padding: 2px;
}

.strip {
    background: #F5DEB3;
    border: 1px solid #D2B48C;
    position: relative;
    min-height: 100%;
}

.strip[data-player="1"] {
    border-bottom: 2px solid #333;
}

.strip[data-player="2"] {
    border-top: 2px solid #333;
}

.game-piece {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    position: absolute;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.game-piece.blue {
    background-color: #4A90E2;
}

.game-piece.red {
    background-color: #E74C3C;
}

.game-piece.selected {
    border-color: #FFD700;
    border-width: 3px;
    box-shadow: 0 0 12px #FFD700;
    transform: scale(1.3);
    z-index: 100;
}

.game-piece.swimmer {
    border-style: dashed;
}

.game-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin: 10px 0;
}

.dice-section, .movement-dice {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.dice-section h3, .movement-dice h3 {
    margin-bottom: 10px;
    color: #495057;
}

.initial-dice, #movement-dice-container {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
}

.dice {
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.dice.used {
    background: #e0e0e0;
    color: #999;
    border-color: #999;
    opacity: 0.6;
}

.dice-info {
    margin: 10px 0;
    font-size: 0.9em;
}

.dice-info p {
    margin: 5px 0;
}

.actions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn.primary {
    background-color: #007bff;
    color: white;
}

.btn.primary:hover {
    background-color: #0056b3;
}

.btn.secondary {
    background-color: #6c757d;
    color: white;
}

.btn.secondary:hover {
    background-color: #545b62;
}

.btn.warning {
    background-color: #ffc107;
    color: #212529;
}

.btn.warning:hover {
    background-color: #e0a800;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-log {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.game-log h3 {
    margin-bottom: 10px;
    color: #495057;
}

#log-content {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
    border-bottom: 1px solid #f0f0f0;
}

.log-entry:last-child {
    border-bottom: none;
}

.highlight {
    background-color: #fff3cd !important;
    border: 3px solid #ffc107 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    cursor: pointer;
    z-index: 50;
}

.barrier {
    background-color: #ffebee !important;
    border: 2px solid #f44336 !important;
}

@media (max-width: 768px) {
    .game-board {
        grid-template-columns: 80px 120px 30px 80px 240px 80px 30px 120px 80px;
        grid-template-rows: 80px 60px 30px 80px;
    }

    .game-controls {
        grid-template-columns: 1fr;
    }

    .game-piece {
        width: 12px;
        height: 12px;
    }
}

/* Landscape tablet/mobile - reduce spacing */
@media (max-width: 1024px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .game-container {
        padding: 5px;
        max-width: 100%;
    }

    .game-board {
        margin: 0 !important;
    }

    .board-controls-container {
        justify-content: center;
        padding: 0 10px;
    }
}