* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #1b2838;
    color: #eee;
}

/* ---------- Лобі ---------- */
.lobby-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.lobby-wrap { text-align: center; max-width: 700px; padding: 20px; }
.lobby-wrap h1 { font-size: 2.2em; margin-bottom: 0; }
.subtitle { color: #9fb3c8; margin-top: 4px; }
.lobby-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.lobby-card {
    background: #223649;
    border-radius: 12px;
    padding: 20px;
    width: 260px;
    text-align: left;
}
.lobby-card h2 { margin-top: 0; font-size: 1.2em; }
.lobby-card label { display: block; margin: 10px 0 4px; font-size: 0.9em; color: #9fb3c8; }
.lobby-card input[type=text] {
    width: 100%; padding: 8px; border-radius: 6px; border: 1px solid #3a5068;
    background: #182534; color: #fff; font-size: 1em;
}
.lobby-card input[type=color] { width: 100%; height: 36px; border: none; border-radius: 6px; }
.lobby-card button {
    margin-top: 16px; width: 100%; padding: 10px; border: none; border-radius: 6px;
    background: #2ecc71; color: #0b1e14; font-weight: bold; font-size: 1em; cursor: pointer;
}
.lobby-card button:hover { background: #27ae60; }
.error { color: #e74c3c; margin-top: 8px; font-size: 0.9em; min-height: 1.2em; }

/* ---------- Гра ---------- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: #223649; padding: 10px 20px; flex-wrap: wrap; gap: 10px;
}
.turn-info { font-weight: bold; font-size: 1.1em; }
.game-layout { display: flex; gap: 16px; padding: 16px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }

.board {
    display: grid;
    grid-template-columns: repeat(11, minmax(60px, 90px));
    grid-template-rows: repeat(11, minmax(60px, 90px));
    gap: 2px;
    background: #0f1a24;
    padding: 4px;
    border-radius: 8px;
}
.tile {
    background: #2c4258;
    border-radius: 4px;
    padding: 4px;
    font-size: 0.65em;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tile-name { font-weight: bold; line-height: 1.1; }
.tile-price { color: #9fb3c8; margin-top: 2px; }
.tile-owner { height: 5px; border-radius: 2px; margin-top: 2px; }
.tile-tokens { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
.token-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; flex-shrink: 0; }

.tile-start { background: #1e5631; }
.tile-tax { background: #5c3a21; }
.tile-chance { background: #5c4a21; }
.tile-jail { background: #333; }
.tile-go_to_jail { background: #5c2121; }
.tile-free_parking { background: #21375c; }
.tile-gas, .tile-service { background: #3a3a3a; }
.tile.current-tile { outline: 2px solid #f1c40f; }

.board-center {
    grid-row: 2 / 11; grid-column: 2 / 11;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #16222e; border-radius: 8px; gap: 16px; padding: 10px;
    position: relative;
}
.dice-area { display: flex; gap: 12px; }
.dice {
    width: 50px; height: 50px; background: #fff; color: #222; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 1.6em; font-weight: bold;
}
.action-buttons { display: flex; flex-direction: column; gap: 8px; width: 200px; }
.action-buttons button {
    padding: 10px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 0.95em;
}
.btn-roll { background: #2ecc71; color: #0b1e14; }
.btn-buy { background: #f1c40f; color: #3a2f00; }
.btn-end { background: #3498db; color: #06202f; }
.btn-jail { background: #e67e22; color: #2f1900; }

.waiting-lobby { text-align: center; }
.waiting-lobby button { margin-top: 12px; padding: 10px 20px; background: #2ecc71; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }

.game-over-banner { text-align: center; font-size: 1.3em; font-weight: bold; color: #f1c40f; }

.sidebar { width: 280px; }
.sidebar h3 { margin-bottom: 6px; }
#playersList { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.player-card { background: #223649; border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.player-card.current { outline: 2px solid #f1c40f; }
.player-color { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.player-name { font-weight: bold; flex: 1; }
.player-money { color: #2ecc71; font-size: 0.9em; }
.player-bankrupt { opacity: 0.4; text-decoration: line-through; }
.player-jail { font-size: 0.75em; color: #e67e22; }

.event-log { background: #182534; border-radius: 8px; padding: 8px; height: 220px; overflow-y: auto; font-size: 0.85em; }
.event-log div { padding: 3px 0; border-bottom: 1px solid #223649; }

.my-properties { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 220px; overflow-y: auto; }
.my-prop-card { background: #223649; border-radius: 6px; padding: 6px 8px; font-size: 0.8em; }
.my-prop-card .prop-title { font-weight: bold; margin-bottom: 4px; }
.my-prop-card .prop-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.my-prop-card button { font-size: 0.78em; padding: 4px 6px; border: none; border-radius: 4px; cursor: pointer; background: #3a5068; color: #fff; }
.my-prop-card button:hover { background: #4a6478; }
.my-prop-card .mortgaged-tag { color: #e67e22; font-size: 0.85em; }

.trades-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.trade-card { background: #223649; border-radius: 6px; padding: 8px; font-size: 0.82em; }
.trade-card .trade-buttons { display: flex; gap: 6px; margin-top: 6px; }
.trade-card button { padding: 4px 8px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85em; }
.btn-accept { background: #2ecc71; color: #0b1e14; }
.btn-decline { background: #e74c3c; color: #2b0a06; }
.btn-cancel-trade { background: #7f8c8d; color: #111; }

.btn-trade-open { width: 100%; padding: 8px; background: #3498db; color: #06202f; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; margin-bottom: 8px; }
.trade-form { background: #182534; border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.trade-form label { display: block; margin: 6px 0 3px; font-size: 0.8em; color: #9fb3c8; }
.trade-form select, .trade-form input[type=number] { width: 100%; padding: 6px; border-radius: 4px; border: 1px solid #3a5068; background: #223649; color: #fff; }
.trade-columns { display: flex; gap: 10px; margin-top: 4px; }
.trade-columns > div { flex: 1; }
.trade-tiles { max-height: 120px; overflow-y: auto; background: #223649; border-radius: 4px; padding: 4px; font-size: 0.78em; }
.trade-tiles label { display: block; font-size: 0.9em; color: #eee; margin: 2px 0; font-weight: normal; }
.btn-trade-send { width: 100%; padding: 8px; background: #2ecc71; color: #0b1e14; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; margin-top: 10px; }
.btn-trade-close { width: 100%; padding: 6px; background: transparent; color: #9fb3c8; border: 1px solid #3a5068; border-radius: 6px; cursor: pointer; margin-top: 6px; }

@media (max-width: 900px) {
    .board { grid-template-columns: repeat(11, minmax(30px, 45px)); grid-template-rows: repeat(11, minmax(30px, 45px)); }
    .tile { font-size: 0.5em; padding: 2px; }
    .sidebar { width: 100%; }
}
