body {
    background-color: #f7f9fc;
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
}

/* Overlays & Menus */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.menu-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    width: 350px;
}

.menu-box h1 {
    color: #e51937;
    margin-top: 0;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.menu-group {
    margin: 20px 0;
    text-align: left;
}

.menu-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.menu-group input, .trade-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Player Names Inputs */
#player-names-container {
    max-height: 150px;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 20px;
}
.player-name-input {
    margin-bottom: 10px;
}
.player-name-input label {
    font-size: 0.9em;
}

/* Buttons */
.primary-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    font-weight: bold;
}
.primary-btn:hover { background-color: #218838; }
.primary-btn:disabled { background-color: #888; cursor: not-allowed; }

.secondary-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}
.secondary-btn:hover { background-color: #c82333; }

.pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* Trade Specific */
.trade-box { width: 400px; }
.input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-symbol span {
    position: absolute;
    left: 10px;
    font-weight: bold;
}
.input-with-symbol input {
    padding-left: 25px;
}

/* Layout */
.game-container {
    display: flex;
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    align-items: flex-start;
}

.board-wrapper {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
}

/* Board */
.board {
    display: grid;
    grid-template-columns: 100px repeat(9, 65px) 100px;
    grid-template-rows: 100px repeat(9, 65px) 100px;
    background-color: #d8e8d8;
    border: 2px solid #222;
    width: 785px;
    height: 785px;
}

.center {
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #e6f0e6;
    border: 1px solid #ccc;
}

.logo {
    font-size: 60px;
    font-weight: bold;
    color: white;
    background-color: #e51937;
    padding: 10px 40px;
    border: 3px solid black;
    transform: rotate(-45deg) translateY(-40px);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    letter-spacing: 2px;
}

/* Spaces */
.space {
    border: 1px solid #555;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 11px;
    position: relative;
    background-color: white;
    cursor: pointer; /* make spaces clickable */
    transition: background-color 0.2s;
}

.space:hover {
    background-color: #f0f0f0;
}

.corner { width: 100px; height: 100px; background-color: #f0f8ff; }
.corner-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 14px;
}
.corner-content strong { font-size: 18px; }

.bottom, .top { width: 65px; height: 100px; }
.left, .right { width: 100px; height: 65px; flex-direction: row; }

/* Ownership Indicators */
.property {
    position: relative;
}
.owner-indicator {
    position: absolute;
    width: 100%;
    height: 6px;
    bottom: 0;
    left: 0;
    opacity: 0.8;
}
.left .owner-indicator, .right .owner-indicator {
    width: 6px;
    height: 100%;
    bottom: auto;
}
.left .owner-indicator { right: 0; left: auto; }

/* Color Bars */
.color-bar { border-bottom: 2px solid #333; }
.bottom .color-bar, .top .color-bar { height: 22%; width: 100%; }
.left .color-bar, .right .color-bar { height: 100%; width: 22%; border-bottom: none; border-right: 2px solid #333; }
.right { flex-direction: row-reverse; }
.right .color-bar { border-right: none; border-left: 2px solid #333; }
.top { flex-direction: column-reverse; }
.top .color-bar { border-bottom: none; border-top: 2px solid #333; }

.content {
    flex-grow: 1;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-weight: 500;
}

.train-icon { font-size: 12px; }

/* Colors */
.brown { background-color: #8b4513; }
.lightblue { background-color: #87ceeb; }
.pink { background-color: #ff1493; }
.orange { background-color: #ffa500; }
.red { background-color: #ed1c24; }
.yellow { background-color: #fef200; }
.green { background-color: #1fb25a; }
.blue { background-color: #0072bb; }

/* Property Card Modal */
.property-card-box {
    padding: 0;
    width: 280px;
    overflow: hidden;
    border: 2px solid black;
    border-radius: 8px;
}

.property-color-header {
    height: 60px;
    border-bottom: 2px solid black;
}

.property-title {
    margin: 10px 0;
    font-size: 1.5em;
    padding: 0 10px;
}

.property-stats {
    padding: 10px 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
}
.property-stats p {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.property-stats p span:last-child {
    text-align: right;
    max-width: 68%;
}


/* Event Card Modal */
.event-card-box {
    background: #fff9e6; /* slight yellow tint */
    border: 3px solid #f39c12;
}

.alert-box {
    border-color: #e51937;
    background: #fff3f5;
}

#alert-title {
    color: #e51937;
    margin-top: 0;
}

#alert-message {
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

/* UI Panel */
.ui-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ui-panel h2, .ui-panel h3 {
    margin: 0;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.player-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-stat {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 6px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-stat.active-turn {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #f8ffff;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 18px;
}

.player-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
}

.prop-list {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    line-height: 1.3;
}

.log-container {
    height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.log-container p {
    margin: 4px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}
.log-container p:last-child { border-bottom: none; }

/* Dice */
#dice-container {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}
.die {
    width: 50px;
    height: 50px;
    background-color: white;
    border: 2px solid #333;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 2px 2px 5px rgba(0,0,0,0.2);
}

/* Player Tokens */
.player-token {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    position: absolute;
    transition: all 0.4s ease-in-out;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Ripple effect for the active player's token - two expanding rings */
.player-token.ripple::before,
.player-token.ripple::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(40,167,69,0.65); /* greenish ripple */
    opacity: 0.9;
    pointer-events: none;
    z-index: 5; /* behind token so token stays visible */
    animation: ripple 1.8s infinite ease-out;
}
.player-token.ripple::after {
    animation-delay: 0.9s;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0.9;
    }
    60% {
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.6);
        opacity: 0;
    }
}

/* Houses & Hotels */
.houses-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 0 2px;
    box-sizing: border-box;
}

.left .houses-container, .right .houses-container {
    flex-direction: column;
    top: auto;
    left: 0;
    width: 22%;
    height: 100%;
}
.right .houses-container {
    left: auto;
    right: 0;
}

.house {
    width: 10px;
    height: 10px;
    background-color: #28a745;
    border: 1px solid #218838;
}

.hotel {
    width: 20px;
    height: 12px;
    background-color: #dc3545;
    border: 1px solid #c82333;
}

/* Purchase Prompt */
.purchase-box {
    margin-bottom: 20px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    border: 2px solid #333;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
    border-radius: 12px 12px 0 0;
}
.purchase-box h2 {
    margin-top: 0;
    color: #e51937;
}
