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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

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

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

header h1 {
    font-size: 2.5rem;
    color: #ff9933;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    color: #138808;
    font-size: 1.1rem;
}

.screen {
    display: block;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.start-box {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 100px auto;
}

.start-box h2 {
    margin-bottom: 20px;
    color: #ff9933;
}

.player-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 30px;
}

/* Mode Select */
.mode-select {
    max-width: 600px !important;
}

.mode-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.mode-btn {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,153,51,0.3);
    border-radius: 16px;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    width: 160px;
    text-align: center;
}

.mode-btn:hover {
    background: rgba(255,153,51,0.15);
    border-color: #ff9933;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255,153,51,0.3);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.mode-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ff9933;
    margin-bottom: 6px;
}

.mode-desc {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.3;
}

/* Online Setup */
.online-tabs {
    margin-top: 20px;
}

.tab-section {
    padding: 16px 0;
}

.tab-section h3 {
    color: #ff9933;
    margin-bottom: 10px;
    font-size: 1rem;
}

.tab-divider {
    text-align: center;
    position: relative;
    margin: 10px 0;
    color: #666;
}

.tab-divider::before,
.tab-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255,255,255,0.15);
}

.tab-divider::before { left: 0; }
.tab-divider::after { right: 0; }

.tab-divider span {
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.room-code-field {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 10px;
}

.room-code-field::placeholder {
    color: #666;
    letter-spacing: 1px;
    text-transform: none;
}

.room-code-field:focus {
    outline: none;
    border-color: #ff9933;
}

.name-field {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    margin-top: 10px;
}

.name-field::placeholder {
    color: #666;
}

.name-field:focus {
    outline: none;
    border-color: #ff9933;
}

/* Lobby */
.room-code-big {
    font-size: 3rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #ff9933;
    letter-spacing: 8px;
    background: rgba(255,153,51,0.1);
    border: 3px dashed rgba(255,153,51,0.4);
    border-radius: 12px;
    padding: 16px 24px;
    margin: 20px auto;
    display: inline-block;
    user-select: all;
}

.share-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px auto 0;
    max-width: 400px;
}

.share-link-field {
    flex: 1;
    background: #2c3e50;
    color: #aaa;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: monospace;
    user-select: all;
}

.btn-copy {
    background: #ff9933;
    color: #1a1a2e;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #ffad5c;
}

.lobby-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 8px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 1rem;
}

.lobby-player.joined {
    color: #4caf50;
}

.lobby-player.waiting {
    color: #666;
    font-style: italic;
}

.lobby-player-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lobby-waiting {
    color: #aaa;
    font-size: 0.9rem;
    animation: lobbyPulse 1.5s ease-in-out infinite;
}

@keyframes lobbyPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Mixed mode dropdown */
.mode-select-dropdown {
    background: #2c3e50;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 1rem;
    margin-left: 8px;
}

.board-mode-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.board-mode-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: #2c3e50;
    color: #aaa;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.board-mode-btn.active {
    background: #ff9933;
    color: #1a1a2e;
}

.board-mode-btn:hover:not(.active) {
    background: #34495e;
    color: #fff;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #ff9933, #ff6600);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255,153,51,0.4);
}

.btn-action {
    background: linear-gradient(135deg, #138808, #0d5c06);
    color: white;
    width: 100%;
    margin-top: 15px;
}

.btn-action:hover {
    background: linear-gradient(135deg, #1aa00a, #138808);
}

.btn-buy {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-buy:hover {
    background: linear-gradient(135deg, #5dade2, #3498db);
}

.btn-skip {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-skip:hover {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.btn-jail-pay {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-jail-pay:hover {
    background: linear-gradient(135deg, #ec7063, #e74c3c);
}

.btn-jail-roll {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-jail-roll:hover {
    background: linear-gradient(135deg, #af7ac5, #9b59b6);
}

.btn-trade {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-trade:hover {
    background: linear-gradient(135deg, #48c9b0, #1abc9c);
}

.btn-build {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-build:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.btn-sell {
    background: linear-gradient(135deg, #c0392b, #a93226);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-sell:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-resign {
    background: transparent;
    color: #e57373;
    border: 1px solid #e57373;
    width: 100%;
    margin-top: 18px;
    font-size: 0.85rem;
    opacity: 0.75;
}

.btn-resign:hover {
    background: rgba(229, 115, 115, 0.12);
    opacity: 1;
}

/* Post-roll countdown indicator */
.post-roll-countdown {
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(255, 153, 51, 0.15);
    border: 1px solid #ff9933;
    border-radius: 4px;
    color: #ff9933;
    font-size: 0.78rem;
    text-align: center;
    font-family: monospace;
    letter-spacing: 0.03em;
}

/* Trade Modal */
.trade-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-modal.hidden {
    display: none;
}

.trade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.trade-content {
    position: relative;
    background: #1e2a3a;
    border-radius: 12px;
    padding: 24px;
    min-width: 380px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2001;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.trade-content h3 {
    text-align: center;
    margin-bottom: 16px;
    color: #1abc9c;
    font-size: 1.3rem;
}

.trade-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.trade-section h4 {
    margin-bottom: 8px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.trade-section select {
    background: #2c3e50;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 4px 8px;
    margin-left: 4px;
}

.trade-section input[type="number"] {
    background: #2c3e50;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 4px 8px;
}

.trade-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.trade-card-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.trade-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #b8c4d6;
}

.trade-card-option:hover {
    background: rgba(255,255,255,0.1);
}

.trade-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.trade-buttons .btn {
    flex: 1;
}

/* Game Layout */
.game-layout {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 20px;
    align-items: start;
}

.left-sidebar {
    display: flex;
    flex-direction: column;
    align-self: start;
}

/* Board */
.board-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.board {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    width: 735px;
    height: 735px;
    background: #c8e6c9;
    /*border: 4px solid #2e7d32;*/
    border-radius: 10px;
    position: relative;
}

.cell {
    border: 1px solid #696969;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2px;
    font-size: 0.6rem;
    text-align: center;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.cell:hover {
    transform: scale(1.08);
    z-index: 20;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.cell-color {
    width: 100%;
    height: 12px;
    position: absolute;
    top: 0;
    left: 0;
}

.cell-name {
    margin-top: 14px;
    font-weight: bold;
    color: #333;
    font-size: 0.55rem;
    line-height: 1.1;
}

.cell-price {
    font-size: 0.5rem;
    color: #666;
    margin-top: 2px;
}

/* Corner cells */
.corner {
    background: #e8f5e9;
}

/* Special cells */
.cell-go { background: linear-gradient(135deg, #fff9c4, #fff59d); }
.cell-jail { background: linear-gradient(135deg, #ffccbc, #ffab91); }
.cell-parking { background: linear-gradient(135deg, #c8e6c9, #a5d6a7); }
.cell-club { background: linear-gradient(135deg, #ce93d8, #ab47bc); }
.cell-chance { background: linear-gradient(135deg, #ffe0b2, #ffcc80); }
.cell-community { background: linear-gradient(135deg, #b3e5fc, #81d4fa); }
.cell-tax { background: linear-gradient(135deg, #d1c4e9, #b39ddb); }
.cell-travel { background: linear-gradient(135deg, #cfd8dc, #b0bec5); }

/* Property colors */
.color-brown { background: #8B4513; }
.color-lightblue { background: #87CEEB; }
.color-pink { background: #FF69B4; }
.color-orange { background: #FFA500; }
.color-red { background: #FF0000; }
.color-yellow { background: #FFD700; }
.color-green { background: #228B22; }
.color-darkblue { background: #00008B; }

/* Player tokens */
.players-on-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    justify-content: center;
}

.player-token {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Ownership indicator - triangular nib at bottom center */
.owned-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid;
    filter: drop-shadow(0 0 3px currentColor);
}

/* Houses */
.houses-container {
    display: flex;
    gap: 1px;
    position: absolute;
    top: 14px;
    left: 2px;
}

.house {
    width: 6px;
    height: 6px;
    border: 1px solid rgba(0,0,0,0.3);
}

.hotel {
    width: 10px;
    height: 8px;
    border: 1px solid rgba(0,0,0,0.3);
}

/* Center quadrants */
.board-quadrant {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px;
    border: 1px solid #a5d6a7;
    text-align: center;
    overflow-y: auto;
}

.board-quadrant:hover {
    transform: none;
    box-shadow: none;
}

.board-quadrant h3 {
    font-size: 0.75rem;
    margin-bottom: 4px;
    color: #333;
}

.board-quadrant ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.board-quadrant li {
    font-size: 0.55rem;
    color: #444;
    padding: 1px 0;
    border-bottom: 1px dotted #ccc;
    line-height: 1.2;
}

.board-quadrant li:last-child {
    border-bottom: none;
}

/* Quadrant colors */
.quadrant-chance {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
}

.quadrant-community {
    background: linear-gradient(135deg, #e1f5fe, #b3e5fc);
}

.quadrant-rules {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
}

.board-center-divider {
    background: #c8e6c9;
}


/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
}

.panel h3 {
    color: #ff9933;
    margin-bottom: 10px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,153,51,0.3);
    padding-bottom: 5px;
}

/* Current Turn */
.current-player {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.dice {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    color: #333;
}

/* Message Box */
.message-box {
    max-height: 120px;
    overflow-y: auto;
}

.message {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Players Panel */
.player-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border-left: 4px solid;
}

.player-card.active {
    background: rgba(255,255,255,0.15);
}

.player-card.bankrupt {
    opacity: 0.5;
    text-decoration: line-through;
}

.player-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.player-details {
    flex: 1;
}

.player-name {
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-edit-name {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-edit-name:hover {
    opacity: 1;
}

.inline-name-input {
    background: #1a1a2e;
    border: 1px solid #ff9933;
    border-radius: 4px;
    color: #fff;
    font-size: inherit;
    font-family: inherit;
    padding: 2px 6px;
    width: 120px;
    outline: none;
}

.inline-name-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 153, 51, 0.3);
}

.lobby-player .inline-name-input {
    width: 140px;
    font-size: 0.95rem;
    padding: 3px 8px;
}

.player-money {
    font-size: 0.8rem;
    color: #4caf50;
}

.player-props {
    font-size: 0.7rem;
    color: #aaa;
}

/* Property Panel */
.property-info {
    font-size: 0.9rem;
}

.property-info .muted {
    color: #888;
    font-style: italic;
}

.property-detail {
    margin: 5px 0;
}

.property-detail label {
    color: #aaa;
}

/* Game Over board-view bar */
#gameover-board-bar {
    display: flex;
    justify-content: center;
    padding: 10px 0 14px;
}

#gameover-board-bar .btn {
    width: auto;
}

/* Game Over */
.gameover-box {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px;
    text-align: center;
    max-width: 500px;
    margin: 100px auto;
}

.gameover-box h2 {
    color: #ff9933;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.gameover-box p {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,153,51,0.5);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 1400px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .board {
        width: 600px;
        height: 600px;
    }

    .sidebar, .left-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .panel {
        flex: 1;
        min-width: 200px;
    }
}

/* ========================================
   MOBILE — phones up to 768px
   ======================================== */
@media (max-width: 768px) {

    /* --- Layout containers --- */
    .game-container {
        padding: 8px;
    }

    /* --- Setup screens --- */
    .start-box {
        margin: 16px auto;
        padding: 20px 16px;
    }

    .gameover-box {
        margin: 20px auto;
        padding: 30px 20px;
    }

    .gameover-box h2 { font-size: 1.8rem; }
    .gameover-box p  { font-size: 1.1rem; }

    /* Lobby room code: smaller so it fits on narrow screens */
    .room-code-big {
        font-size: 1.6rem;
        letter-spacing: 4px;
        padding: 10px 14px;
    }

    /* Mode buttons: single column on mobile */
    .mode-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-btn {
        width: 100%;
        padding: 16px 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .mode-icon {
        font-size: 2rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    /* Player count buttons: stack vertically */
    .player-select {
        flex-direction: column;
        align-items: stretch;
    }

    .player-select .btn {
        width: 100%;
    }

    /* Share link: stack on narrow screens */
    .share-link-container {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }

    /* --- Game layout: Board → Actions → Players (mobile only) ---*/
    .game-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* 1. Board at the very top */
    .board-container {
        order: 1;
    }

    /* 2. Sidebar (actions + players) below the board */
    .sidebar {
        order: 2;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    /* Hide property info panel and online room info entirely on mobile */
    .left-sidebar {
        display: none;
    }

    /* Hide the game log on mobile */
    .message-box {
        display: none;
    }

    /* Panels: full-width, reduce padding */
    .panel {
        flex: none;
        min-width: unset;
        width: 100%;
        padding: 10px 12px;
    }

    /* --- Board --- */
    .board {
        width: 96vw;
        height: 96vw;
    }

    /* Hide center quadrant text — only the border cells matter on mobile */
    .board-quadrant h3,
    .board-quadrant ul {
        display: none;
    }

    /* Cell text */
    .cell-name  { font-size: 0.4rem; }
    .cell-price { font-size: 0.35rem; }

    /* --- Turn controls --- */
    .dice-container {
        gap: 10px;
    }

    .dice {
        width: 46px;
        height: 46px;
        font-size: 1.8rem;
    }

    /* Compact action buttons — still 44px tall for touch */
    .btn {
        padding: 12px 16px;
        min-height: 44px;
        font-size: 0.95rem;
    }

    /* --- Modals: full-width on narrow screens --- */
    .trade-content {
        min-width: unset;
        width: 92vw;
        max-width: 92vw;
        padding: 16px;
        max-height: 85vh;
    }

    .card-content {
        width: 88vw;
        padding: 20px 16px;
    }

    .card-content p {
        font-size: 1rem;
    }
}

/* ========================================
   ANIMATIONS - Phase 1: Keyframes
   ======================================== */

/* 1.1 Token Movement Animations */
@keyframes tokenHop {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.1); }
}

@keyframes tokenBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 1.2 Dice Roll Animations */
@keyframes diceShake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    10% { transform: rotate(-15deg) scale(1.1); }
    20% { transform: rotate(15deg) scale(1.1); }
    30% { transform: rotate(-10deg) scale(1.05); }
    40% { transform: rotate(10deg) scale(1.05); }
    50% { transform: rotate(-5deg) scale(1); }
    60% { transform: rotate(5deg) scale(1); }
    70% { transform: rotate(-3deg); }
    80% { transform: rotate(3deg); }
    90% { transform: rotate(-1deg); }
}

@keyframes diceBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 1.3 Property Purchase Animations */
@keyframes purchaseGlow {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { box-shadow: 0 0 20px 10px rgba(76, 175, 80, 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes confettiPop {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--x, 0), var(--y, -60px)) scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* 1.4 Money Change Animations */
@keyframes moneyFloat {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-10px) scale(1); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-50px) scale(1); opacity: 0; }
}

@keyframes moneyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); color: #4caf50; }
}

/* 1.5 Card Flip Animation */
@keyframes cardFlipIn {
    0% { transform: perspective(800px) rotateY(-90deg) scale(0.8); opacity: 0; }
    50% { transform: perspective(800px) rotateY(10deg) scale(1.05); }
    100% { transform: perspective(800px) rotateY(0deg) scale(1); opacity: 1; }
}

@keyframes cardFadeOut {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0; }
}

/* 1.6 Turn Indicator Animation */
@keyframes turnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 153, 51, 0.7); }
    50% { box-shadow: 0 0 15px 5px rgba(255, 153, 51, 0.4); }
}

@keyframes activePlayerGlow {
    0%, 100% { border-color: rgba(255, 255, 255, 0.5); }
    50% { border-color: rgba(255, 153, 51, 1); }
}

/* 1.7 House/Hotel Animations */
@keyframes housePop {
    0% { transform: scale(0) rotate(-45deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    75% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes hotelShine {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.5); }
    50% { box-shadow: 0 0 10px 3px rgba(244, 67, 54, 0.8); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.5); }
}

/* ========================================
   ANIMATION UTILITY CLASSES
   ======================================== */

/* Token animation classes */
.token-hopping {
    animation: tokenHop 0.3s ease-in-out;
}

.token-landing {
    animation: tokenBounce 0.4s ease-out;
}

/* Dice animation classes */
.dice-shaking {
    animation: diceShake 0.8s ease-in-out;
}

.dice-landed {
    animation: diceBounce 0.3s ease-out;
}

/* Build mode highlight */
.cell-buildable {
    animation: buildable-pulse 1s infinite;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

@keyframes buildable-pulse {
    0%, 100% { box-shadow: 0 0 8px 2px rgba(255, 153, 0, 0.6); }
    50% { box-shadow: 0 0 16px 6px rgba(255, 153, 0, 0.9); }
}

/* Sell mode highlight */
.cell-sellable {
    animation: sellable-pulse 1s infinite;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

@keyframes sellable-pulse {
    0%, 100% { box-shadow: 0 0 8px 2px rgba(231, 76, 60, 0.6); }
    50% { box-shadow: 0 0 16px 6px rgba(231, 76, 60, 0.9); }
}

/* Property animation classes */
.cell-purchased {
    animation: purchaseGlow 0.8s ease-out;
}

/* Turn indicator classes */
.player-icon.active-turn {
    animation: turnPulse 1.5s ease-in-out infinite;
}

.player-card.active {
    animation: activePlayerGlow 1.5s ease-in-out infinite;
    border-left-width: 6px;
}

/* House animation classes */
.house-new {
    animation: housePop 0.4s ease-out;
}

.hotel-new {
    animation: housePop 0.4s ease-out, hotelShine 1s ease-in-out 0.4s;
}

/* ========================================
   CARD MODAL STYLES
   ======================================== */

.card-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: auto;
}

.card-modal.hidden {
    display: none !important;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.card-content {
    position: relative;
    width: 320px;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    animation: cardFlipIn 0.5s ease-out;
}

.card-content.card-dismiss {
    animation: cardFadeOut 0.3s ease-in forwards;
}

.card-content.chance-card {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    border: 4px solid #ff9800;
}

.card-content.community-card {
    background: linear-gradient(135deg, #e1f5fe 0%, #81d4fa 100%);
    border: 4px solid #03a9f4;
}

.card-content.go-card {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border: 4px solid #ff9933;
}

.card-content.go-card h3 {
    color: #ff6600;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-content.chance-card h3 {
    color: #e65100;
}

.card-content.community-card h3 {
    color: #01579b;
}

.card-content p {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.card-content .card-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.card-content .card-hint {
    font-size: 0.75rem;
    color: #666;
    margin-top: 20px;
    opacity: 0.7;
}

/* ========================================
   MONEY ANIMATION CONTAINER
   ======================================== */

.money-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.money-float {
    position: absolute;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: moneyFloat 1.5s ease-out forwards;
    white-space: nowrap;
}

.money-float.money-gain {
    color: #4caf50;
}

.money-float.money-loss {
    color: #f44336;
}

.money-pulse {
    animation: moneyPulse 0.5s ease-out;
}

/* ========================================
   CONFETTI PARTICLES
   ======================================== */

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiPop 1s ease-out forwards;
}

.confetti-1 { background: #ff9933; border-radius: 50%; }
.confetti-2 { background: #138808; transform: rotate(45deg); }
.confetti-3 { background: #000080; border-radius: 2px; }
.confetti-4 { background: #ff6600; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.confetti-5 { background: #4caf50; border-radius: 50%; }
.confetti-6 { background: #2196f3; transform: rotate(30deg); }

/* ========================================
   ENHANCED HOVER EFFECTS
   ======================================== */

.cell:hover .cell-name {
    color: #ff9933;
}

.btn:disabled {
    background: #555 !important;
    color: #999 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.dice {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dice:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.player-card {
    transition: all 0.2s ease;
}

.player-card:hover:not(.bankrupt) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* AI Badge */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #fff;
    font-size: 0.55rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    margin-left: 2px;
}

/* AI Thinking Animation */
.ai-thinking {
    display: inline-block;
    animation: aiDots 1.4s infinite steps(4, end);
    width: 1.5em;
    text-align: left;
    overflow: hidden;
    vertical-align: bottom;
}

@keyframes aiDots {
    0% { content: ''; width: 0; }
    25% { width: 0.5em; }
    50% { width: 1em; }
    75% { width: 1.5em; }
    100% { width: 0; }
}

/* Online game turn indicator */
#online-turn-status {
    font-weight: bold;
    padding: 6px 0;
    transition: color 0.3s ease;
}

#online-room-info {
    margin-bottom: 12px;
}
