/* ============================================
   MONOPOLY - Animated & Responsive
   ============================================ */

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

:root {
    --brown: #8B4513;
    --lightblue: #87CEEB;
    --pink: #D81B60;
    --orange: #FF8F00;
    --red: #D32F2F;
    --yellow: #FDD835;
    --green: #2E7D32;
    --darkblue: #1565C0;
    --board-bg: #C8E6C9;
    --board-border: #333;
    --p0-color: #E53935;
    --p1-color: #1E88E5;
    --p2-color: #43A047;
    --p3-color: #FB8C00;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    overflow-x: hidden;
}

.screen { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.hidden { display: none !important; }

/* ============================================
   JOIN SCREEN
   ============================================ */
.join-box {
    background: #16213e;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    min-width: 320px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.join-box h1 {
    font-size: 3rem;
    letter-spacing: 0.4em;
    color: #E53935;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 0.25rem;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 2px 2px 0 #000, 0 0 10px rgba(229,57,53,0.3); }
    50% { text-shadow: 2px 2px 0 #000, 0 0 25px rgba(229,57,53,0.6); }
}

.subtitle { color: #aaa; margin-bottom: 1rem; font-size: 1.1rem; }

#player-name {
    width: 100%;
    padding: 12px 16px;
    font-size: 1.1rem;
    border: 2px solid #333;
    border-radius: 8px;
    background: #0f3460;
    color: #fff;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#player-name:focus {
    border-color: #E53935;
    box-shadow: 0 0 12px rgba(229,57,53,0.3);
}

/* Room selection */
.room-select-box { min-width: 380px; max-width: 480px; }
.rooms-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 8px; }

.room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f3460;
    border-radius: 8px;
    padding: 12px 14px;
    border: 2px solid transparent;
    transition: all 0.25s;
    cursor: default;
}
.room-card:hover { border-color: rgba(229,57,53,0.3); }

.room-info { flex: 1; text-align: left; }
.room-info .room-name { font-weight: bold; font-size: 1rem; color: #eee; }
.room-info .room-status { font-size: 0.8rem; color: #888; margin-top: 2px; }
.room-info .room-players-list { font-size: 0.75rem; color: #666; margin-top: 2px; }

.room-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; margin-right: 6px;
}
.room-dot.open { background: #4CAF50; box-shadow: 0 0 6px rgba(76,175,80,0.5); }
.room-dot.playing { background: #FF9800; box-shadow: 0 0 6px rgba(255,152,0,0.5); }
.room-dot.full { background: #f44336; }
.room-dot.ended { background: #666; }

.room-join-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    background: linear-gradient(135deg, #E53935, #C62828);
    color: #fff;
    flex-shrink: 0;
}
.room-join-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(229,57,53,0.4); }
.room-join-btn:disabled { background: #444; color: #888; cursor: not-allowed; transform: none; box-shadow: none; }

/* Lobby */
.btn-leave {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid #f44336;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    background: transparent;
    color: #f44336;
}
.btn-leave:hover { background: #f44336; color: #fff; }

#lobby-buttons { flex-wrap: wrap; }
#lobby-buttons #btn-start { flex: 1; }
#lobby-buttons .btn-leave { flex: 1; min-width: 120px; }

.lobby-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lobby-kick-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 1px solid #f44336;
    border-radius: 4px;
    background: transparent;
    color: #f44336;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.lobby-kick-btn:hover { background: #f44336; color: #fff; }

/* In-game kick and quit */
.kick-btn {
    margin-left: auto;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: bold;
    border: 1px solid #f44336;
    border-radius: 3px;
    background: transparent;
    color: #f44336;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.kick-btn:hover { background: #f44336; color: #fff; }

.btn-quit-game {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid #f44336;
    border-radius: 6px;
    background: transparent;
    color: #f44336;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.btn-quit-game:hover { background: #f44336; color: #fff; }

#btn-join, #btn-start {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#btn-join { background: #E53935; color: #fff; }
#btn-join:hover { background: #C62828; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(229,57,53,0.4); }
#btn-join:active { transform: translateY(0); }
#btn-join:disabled { background: #555; cursor: not-allowed; transform: none; box-shadow: none; }

#btn-start { background: #43A047; color: #fff; margin-top: 1rem; }
#btn-start:hover { background: #2E7D32; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(67,160,71,0.4); }

#lobby-info { margin-top: 1.5rem; color: #aaa; min-height: 80px; }
.lobby-player { padding: 6px 0; font-size: 1rem; animation: fadeSlideIn 0.3s ease-out; }
.lobby-player .dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 0 0 4px rgba(255,255,255,0); }
}

@keyframes fadeSlideIn {
    from { transform: translateX(-10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.error-msg { color: #ff5252; margin-top: 0.5rem; font-size: 0.9rem; min-height: 1.2em; }

/* ============================================
   GAME LAYOUT
   ============================================ */
#game-screen {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
    min-height: 100vh;
}

.game-layout {
    display: flex;
    gap: 12px;
    max-width: 1600px;
    width: 100%;
    align-items: flex-start;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   PLAYER PANELS
   ============================================ */
.players-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 200px;
    flex-shrink: 0;
}

.player-card {
    background: #16213e;
    border-radius: 10px;
    padding: 10px 12px;
    border-left: 4px solid #555;
    transition: all 0.4s ease;
}
.player-card.active {
    box-shadow: 0 0 16px rgba(255,255,255,0.15);
    background: #1a2744;
    animation: activeGlow 2s ease-in-out infinite;
}

@keyframes activeGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(255,255,255,0.1); }
    50% { box-shadow: 0 0 22px rgba(255,255,255,0.25); }
}

.player-card.p0 { border-left-color: var(--p0-color); }
.player-card.p1 { border-left-color: var(--p1-color); }
.player-card.p2 { border-left-color: var(--p2-color); }
.player-card.p3 { border-left-color: var(--p3-color); }
.player-card.bankrupt { opacity: 0.35; filter: grayscale(0.8); }

.player-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.player-token {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.player-token svg { width: 100%; height: 100%; }
.t0 svg { color: var(--p0-color); }
.t1 svg { color: var(--p1-color); }
.t2 svg { color: var(--p2-color); }
.t3 svg { color: var(--p3-color); }

.player-name-display {
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-money {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4CAF50;
    margin: 4px 0;
    transition: color 0.3s;
}
.player-money.flash-up {
    animation: moneyUp 0.6s ease-out;
}
.player-money.flash-down {
    animation: moneyDown 0.6s ease-out;
}

@keyframes moneyUp {
    0% { color: #4CAF50; }
    30% { color: #69F0AE; transform: scale(1.15); }
    100% { color: #4CAF50; transform: scale(1); }
}

@keyframes moneyDown {
    0% { color: #4CAF50; }
    30% { color: #ff5252; transform: scale(1.15); }
    100% { color: #4CAF50; transform: scale(1); }
}

.player-props {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}
.mini-prop {
    width: 14px; height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mini-prop:hover { transform: scale(1.4); box-shadow: 0 0 6px rgba(255,255,255,0.3); }
.mini-prop.mortgaged { opacity: 0.3; }
.player-status {
    font-size: 0.75rem;
    color: #ff9800;
    margin-top: 4px;
}

/* ============================================
   BOARD
   ============================================ */
.board-container {
    position: relative;
    flex-shrink: 0;
}

.board {
    display: grid;
    grid-template-columns: 1.4fr repeat(9, 1fr) 1.4fr;
    grid-template-rows: 1.4fr repeat(9, 1fr) 1.4fr;
    width: min(72vmin, 680px);
    height: min(72vmin, 680px);
    background: var(--board-bg);
    border: 3px solid var(--board-border);
    border-radius: 4px;
    gap: 0;
}

.space {
    border: 1px solid rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #dcedc8;
    transition: filter 0.2s, box-shadow 0.2s;
}
.space:hover {
    filter: brightness(0.9);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.15);
    z-index: 1;
}

/* Highlight space when player lands */
.space.highlight {
    animation: spaceHighlight 1s ease-out;
}

@keyframes spaceHighlight {
    0% { box-shadow: inset 0 0 0 3px rgba(255,215,0,0.9); }
    100% { box-shadow: inset 0 0 0 0 rgba(255,215,0,0); }
}

/* Color bars */
.space .color-bar { position: absolute; background: #ccc; }
.space.side-bottom .color-bar { top: 0; left: 0; right: 0; height: 20%; }
.space.side-top .color-bar { bottom: 0; left: 0; right: 0; height: 20%; }
.space.side-left .color-bar { top: 0; right: 0; bottom: 0; width: 20%; }
.space.side-right .color-bar { top: 0; left: 0; bottom: 0; width: 20%; }

.space .space-name {
    font-size: clamp(0.35rem, 0.9vmin, 0.6rem);
    text-align: center;
    color: #333;
    font-weight: 600;
    line-height: 1.1;
    padding: 1px 2px;
    z-index: 1;
    word-break: break-word;
}

.space .space-price {
    font-size: clamp(0.3rem, 0.7vmin, 0.5rem);
    color: #555;
    z-index: 1;
}

.space.corner { background: #dcedc8; font-weight: bold; }
.space.corner .space-name { font-size: clamp(0.4rem, 1vmin, 0.65rem); }
.space.tax { background: #fff9c4; }
.space.chance { background: #fff3e0; }
.space.community { background: #e3f2fd; }

/* Houses */
.houses-display {
    display: flex;
    gap: 1px;
    position: absolute;
    z-index: 2;
}
.space.side-bottom .houses-display { top: 1px; left: 50%; transform: translateX(-50%); }
.space.side-top .houses-display { bottom: 1px; left: 50%; transform: translateX(-50%); }
.space.side-left .houses-display { right: 1px; top: 50%; transform: translateY(-50%); flex-direction: column; }
.space.side-right .houses-display { left: 1px; top: 50%; transform: translateY(-50%); flex-direction: column; }

.house-icon {
    width: clamp(4px, 0.7vmin, 7px);
    height: clamp(4px, 0.7vmin, 7px);
    background: #2E7D32;
    border-radius: 1px;
    animation: housePop 0.3s ease-out;
}
.hotel-icon {
    width: clamp(6px, 1vmin, 10px);
    height: clamp(6px, 1vmin, 10px);
    background: #C62828;
    border-radius: 1px;
    animation: housePop 0.3s ease-out;
}

@keyframes housePop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Owner indicator */
.owner-indicator {
    position: absolute;
    bottom: 1px; right: 1px;
    width: clamp(5px, 0.8vmin, 8px);
    height: clamp(5px, 0.8vmin, 8px);
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
    z-index: 2;
    transition: background 0.3s;
}
.space.side-top .owner-indicator { bottom: auto; top: 1px; }

/* ============================================
   TOKENS OVERLAY (pieces animate here)
   ============================================ */
.tokens-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
}

.game-piece {
    position: absolute;
    width: clamp(22px, 3.5vmin, 32px);
    height: clamp(22px, 3.5vmin, 32px);
    pointer-events: auto;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.5));
    transition: filter 0.2s;
    z-index: 5;
    /* Default: no transition so initial placement is instant */
}

.game-piece.animate {
    transition: left 0.14s ease-in-out, top 0.14s ease-in-out, filter 0.2s;
}

.game-piece:hover {
    filter: drop-shadow(1px 2px 4px rgba(0,0,0,0.7)) brightness(1.2);
    z-index: 10;
}

.game-piece svg {
    width: 100%; height: 100%;
    display: block;
}

/* Landing bounce */
.game-piece.landing {
    animation: pieceBounce 0.4s ease-out;
}

@keyframes pieceBounce {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.3) translateY(-8px); }
    50% { transform: scale(1) translateY(0); }
    70% { transform: scale(1.1) translateY(-3px); }
    100% { transform: scale(1) translateY(0); }
}

/* Jail wobble */
.game-piece.in-jail {
    animation: jailWobble 2s ease-in-out infinite;
}

@keyframes jailWobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* ============================================
   BOARD CENTER
   ============================================ */
.board-center {
    position: absolute;
    top: 12.7%; left: 12.7%;
    width: 74.6%; height: 74.6%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.dice-area {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    pointer-events: auto;
}

.dice {
    width: clamp(36px, 5.5vmin, 56px);
    height: clamp(36px, 5.5vmin, 56px);
    background: linear-gradient(145deg, #fff, #e8e8e8);
    border-radius: 8px;
    border: 2px solid #555;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 5px;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.dice.rolling {
    animation: diceRoll 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes diceRoll {
    0%   { transform: rotate(0deg) scale(1); }
    15%  { transform: rotate(20deg) scale(1.15); }
    30%  { transform: rotate(-15deg) scale(1.1); }
    45%  { transform: rotate(12deg) scale(1.12); }
    60%  { transform: rotate(-8deg) scale(1.05); }
    75%  { transform: rotate(4deg) scale(1.08); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Dice "just rolled" bounce */
.dice.landed {
    animation: diceLand 0.3s ease-out;
}

@keyframes diceLand {
    0% { transform: scale(1.1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.dot {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: transparent;
    transition: background 0.15s;
}
.dot.filled {
    background: radial-gradient(circle at 35% 35%, #444, #111);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.center-info {
    text-align: center;
    color: #333;
    pointer-events: auto;
}
.monopoly-title {
    font-size: clamp(1rem, 3vmin, 2rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    color: #C62828;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    margin-bottom: 8px;
}
#turn-info {
    font-size: clamp(0.6rem, 1.3vmin, 0.9rem);
    font-weight: bold;
    margin-bottom: 4px;
    transition: color 0.3s;
}
#free-parking-info {
    font-size: clamp(0.5rem, 1vmin, 0.75rem);
    color: #555;
}
#free-parking-info:not(:empty) {
    animation: fpFloat 3s ease-in-out infinite;
}

@keyframes fpFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ============================================
   SIDE PANEL
   ============================================ */
.side-panel {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.actions-panel, .trade-panel {
    background: #16213e;
    border-radius: 10px;
    padding: 12px;
}
.actions-panel h3, .trade-panel h3, .log-panel h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #aaa;
    margin-bottom: 8px;
}

#action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#action-buttons button {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

/* Button ripple effect */
#action-buttons button::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: width 0.4s, height 0.4s, top 0.4s, left 0.4s;
}
#action-buttons button:active::after {
    width: 200px; height: 200px;
    top: calc(50% - 100px);
    left: calc(50% - 100px);
}

.btn-roll { background: linear-gradient(135deg, #E53935, #C62828); color: #fff; }
.btn-roll:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(229,57,53,0.4); }
.btn-buy { background: linear-gradient(135deg, #43A047, #2E7D32); color: #fff; }
.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(67,160,71,0.4); }
.btn-pass { background: linear-gradient(135deg, #757575, #616161); color: #fff; }
.btn-pass:hover { transform: translateY(-1px); }
.btn-end { background: linear-gradient(135deg, #FF8F00, #E65100); color: #fff; }
.btn-end:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,143,0,0.4); }
.btn-build { background: linear-gradient(135deg, #1565C0, #0D47A1); color: #fff; }
.btn-build:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(21,101,192,0.4); }
.btn-trade { background: linear-gradient(135deg, #7B1FA2, #6A1B9A); color: #fff; }
.btn-trade:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(123,31,162,0.4); }
.btn-jail { background: linear-gradient(135deg, #00897B, #00695C); color: #fff; }
.btn-jail:hover { transform: translateY(-2px); }
.btn-mortgage { background: linear-gradient(135deg, #5D4037, #4E342E); color: #fff; }
.btn-mortgage:hover { transform: translateY(-1px); }
.btn-secondary { background: #555; color: #fff; }
.btn-secondary:hover { background: #444; transform: translateY(-1px); }

.log-panel {
    background: #16213e;
    border-radius: 10px;
    padding: 12px;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#game-log {
    overflow-y: auto;
    font-size: 0.75rem;
    color: #bbb;
    flex: 1;
    max-height: 250px;
}
#game-log .log-entry {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: logSlide 0.3s ease-out;
}

@keyframes logSlide {
    from { transform: translateX(-8px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   POPUPS
   ============================================ */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: overlayIn 0.25s ease-out;
    backdrop-filter: blur(2px);
}

@keyframes overlayIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(2px); }
}

.popup {
    background: linear-gradient(180deg, #1a2744, #16213e);
    border-radius: 14px;
    padding: 24px;
    min-width: 300px;
    max-width: 450px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
    animation: popBounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popBounce {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.popup-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
}
.popup-body {
    margin-bottom: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
    color: #ccc;
    text-align: center;
}
.popup-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.popup-actions button {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    min-width: 100px;
}
.popup-actions button:hover { transform: translateY(-2px); }
.popup-actions button:active { transform: translateY(0); }

/* Trade modal */
.trade-popup { max-width: 550px; }
.trade-row { display: flex; gap: 16px; margin-bottom: 12px; }
.trade-col { flex: 1; }
.trade-col h4 { margin-bottom: 6px; color: #eee; }
.trade-col label { display: block; font-size: 0.9rem; margin-bottom: 8px; }
.trade-col input[type="number"] {
    width: 80px; padding: 4px 8px;
    border: 1px solid #444; border-radius: 4px;
    background: #0f3460; color: #fff; font-size: 0.9rem;
}
.trade-props-list { max-height: 120px; overflow-y: auto; }
.trade-prop-item {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 0; font-size: 0.85rem; cursor: pointer;
}
.trade-prop-item input { cursor: pointer; }
.trade-target { margin-top: 8px; }
.trade-target select {
    padding: 6px 10px; border-radius: 4px;
    background: #0f3460; color: #fff;
    border: 1px solid #444; font-size: 0.9rem;
}

/* Property info */
.property-popup { min-width: 280px; }
.prop-card {
    text-align: center; padding: 12px;
    border-radius: 8px; background: #0f3460;
    margin-bottom: 8px;
}
.prop-card .prop-color-bar {
    height: 24px; border-radius: 4px 4px 0 0;
    margin: -12px -12px 8px -12px;
}
.prop-card .prop-name { font-size: 1rem; font-weight: bold; margin-bottom: 4px; }
.prop-card .prop-detail { font-size: 0.8rem; color: #aaa; margin: 2px 0; }

/* Game over */
.winner-banner {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    background: rgba(0,0,0,0.85);
    animation: fadeIn 0.5s;
    backdrop-filter: blur(4px);
}
.winner-content {
    text-align: center;
    animation: winnerPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.winner-content h1 {
    font-size: 3rem;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000, 0 0 30px rgba(255,215,0,0.4);
    margin-bottom: 1rem;
    animation: winnerGlow 1.5s ease-in-out infinite;
}
.winner-content p { font-size: 1.5rem; color: #eee; }

@keyframes winnerPop {
    from { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes winnerGlow {
    0%, 100% { text-shadow: 2px 2px 0 #000, 0 0 20px rgba(255,215,0,0.3); }
    50% { text-shadow: 2px 2px 0 #000, 0 0 40px rgba(255,215,0,0.6); }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #C62828;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    z-index: 300;
    font-weight: bold;
    animation: toastIn 0.3s ease-out forwards;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .game-layout { flex-direction: column; align-items: center; }
    .players-panel { flex-direction: row; flex-wrap: wrap; width: 100%; justify-content: center; }
    .player-card { min-width: 150px; flex: 1; }
    .side-panel { width: 100%; max-width: 100%; flex-direction: row; flex-wrap: wrap; }
    .actions-panel, .log-panel, .trade-panel { flex: 1; min-width: 200px; }
}

@media (max-width: 600px) {
    .board { width: 96vmin; height: 96vmin; }
    .players-panel { gap: 4px; }
    .player-card { padding: 6px 8px; min-width: 120px; }
    .popup { min-width: 260px; padding: 16px; }
    .trade-row { flex-direction: column; }
}
