body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f8f9fa;
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Board Styles */
.board-preview-grid {
    display: grid;
    gap: 2px;
    background-color: #f0f0f0;
    border: 2px solid #333;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    margin: 0 auto;
}

.board-cell {
    position: relative;
    background-color: white;
    padding: 4px;
    font-size: 0.7em;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.board-cell:hover {
    border-color: #0d6efd;
    box-shadow: inset 0 0 5px rgba(13, 110, 253, 0.5);
}

.board-cell .name-wrapper {
    position: relative;
    z-index: 2;
    padding: 2px;
}

.board-cell .name {
    font-weight: bold;
    word-break: break-word;
    text-align: center;
}

.board-cell-corner .name {
    font-size: 1.1em;
}

.board-cell-corner {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.board-cell-center {
    grid-column-start: 2;
    grid-row-start: 2;
    background-color: #c9e2b3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Georgia', serif;
    font-size: 2vw;
    font-weight: bold;
    color: #3e5e2a;
    text-shadow: 1px 1px 2px white;
}

.player-tokens-container {
    position: absolute;
    bottom: 2px;
    right: 2px;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap-reverse;
    gap: 2px;
    z-index: 5;
    pointer-events: none;
}

.player-token {
    font-size: 1.5em;
    line-height: 1;
    text-shadow: 0 0 2px black, 0 0 4px white;
}

.jail-visiting-area, .jail-in-jail-area {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}

.jail-visiting-area {
    top: 2px;
    left: 0;
    right: 0;
    padding: 2px;
    justify-content: center;
}

.jail-in-jail-area {
    bottom: 5px;
    left: 5px;
    right: 5px;
    justify-content: center;
    padding: 4px;
    background: rgba(255, 165, 0, 0.5);
    border-radius: 4px;
    border: 1px dashed rgba(0,0,0,0.4);
}

.building-icons {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    justify-content: center;
    align-items: center;
    align-content: center;
    z-index: 3;
}

.building-icons i {
    font-size: 1.1em;
    flex-basis: 45%;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.7), 0 0 3px rgba(255, 255, 255, 0.7);
    text-align: center;
    color: #E63946;
}

/* Game UI Styles */
.game-setup, .game-play {
    display: none;
}

.game-setup.active, .game-play.active {
    display: block;
}

.player-setup {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
}

.player-info-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.current-player {
    border-left: 4px solid #007bff;
    background: #f8f9ff;
}

.game-controls {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.game-controls .btn-icon {
    width: 42px; /* Set a fixed width for alignment */
    height: 38px;
    font-size: 1.2em;
}

.dice-result {
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff;
    margin: 0;
}

.property-list {
    max-height: 200px;
    overflow-y: auto;
}

.property-item {
    padding: 5px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 0.9em;
}

.property-popover-info {
    font-size: 0.9em;
}

.property-popover-info ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.event-card {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.trade-modal .form-check {
    margin: 5px 0;
}

.trade-offer {
    background: #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

/* Game Log Styles */
#game-log {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(5px);
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1060; /* Above modals */
    transition: height 0.3s ease-in-out;
}

#game-log.collapsed {
    height: 30px;
}

#game-log.expanded {
    height: 25vh;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 30px;
    font-size: 0.9em;
    font-family: monospace, sans-serif;
    color: #333;
    cursor: pointer;
}

.log-header i {
    transition: transform 0.3s ease-in-out;
}

#game-log.expanded .log-header i {
    transform: rotate(180deg);
}

#latest-log-entry {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    padding-right: 10px;
}

.log-content {
    height: calc(100% - 30px);
    overflow-y: auto;
    padding: 5px 15px;
    font-size: 0.85em;
    font-family: monospace, sans-serif;
}

#game-log.collapsed .log-content {
    display: none;
}

#log-content-area {
    width: 100%;
    height: 100%;
    padding: 5px 15px;
    font-size: 0.85em;
    font-family: monospace, sans-serif;
    background-color: transparent;
    border: none;
    resize: none;
}
#log-content-area:focus {
    outline: none;
    box-shadow: none;
}

.log-entry {
    padding: 3px 0;
}

.log-entry:first-child {
    font-weight: bold;
}

@media (max-width: 768px) {
    .board-preview-grid {
        max-width: 90vw;
    }
    
    .board-cell {
        font-size: 0.6em;
    }

    .game-container {
        padding: 10px;
    }
}