/* Cincy Tycoon — Cincinnati red/orange theme */
:root {
    --game-primary: #c41e3a;
    --ct-primary: #c41e3a;
    --ct-primary-light: #e8344f;
    --ct-secondary: #fb4f14;
    --ct-board-bg: #c8e6c0;
    --ct-card-bg: #1a1a2e;
}

/* Override common.css accent colors */
h1, h2 { color: var(--ct-primary); }

input[type="text"], input[type="number"] {
    border-color: var(--ct-primary);
}

#join-btn, #start-btn, #playagain-btn {
    background: var(--ct-primary);
    color: #fff;
}

.join-room-code {
    color: var(--ct-primary);
}

.room-code-display {
    color: var(--ct-primary);
}

.room-code-lobby {
    text-align: center;
    font-size: 1.3rem;
    color: #aaa;
    margin-bottom: 20px;
}

.room-code-lobby span {
    color: var(--ct-primary);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.15em;
}

/* --- Piece Selector (join screen) --- */
.piece-selector {
    margin: 16px 0;
}

.piece-selector-label {
    display: block;
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 8px;
    text-align: center;
}

.piece-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.piece-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    background: #16213e;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.piece-option:hover {
    background: #1a2744;
}

.piece-option.selected {
    border-color: var(--ct-primary);
    background: #1a2744;
}

.piece-label {
    font-size: 0.7rem;
    color: #aaa;
}

.piece-option.selected .piece-label {
    color: #fff;
}

/* --- Player Mode --- */
.player-mode #app {
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

/* Game layout: actions left, board right in landscape */
.game-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.game-actions {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.game-board-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.game-board-container .board-grid {
    width: 100%;
    aspect-ratio: 1 / 1;
}

@media (min-width: 700px), (orientation: landscape) {
    .player-mode #app {
        max-width: none;
        padding: 12px;
    }

    /* Keep join/lobby screens constrained */
    .player-mode #join-screen,
    .player-mode #lobby-screen {
        max-width: 600px;
        margin: 0 auto;
    }

    .player-mode .game-layout {
        flex-direction: row;
        height: 100dvh;
        overflow: hidden;
        gap: 12px;
    }

    .player-mode .game-actions {
        flex: 1;
        overflow-y: auto;
        min-width: 200px;
        max-width: 400px;
    }

    .player-mode .game-board-container {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .player-mode .game-board-container .board-grid {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 280px);
        width: auto;
        aspect-ratio: 1 / 1;
    }
}

/* Player info bar */
.player-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #16213e;
    border: 2px solid var(--ct-primary);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-cash {
    color: #2ecc71;
}

.info-props {
    color: #aaa;
}

/* Game panels */
.game-panel {
    text-align: center;
    padding: 16px 0;
}

.game-panel h2 {
    margin-bottom: 16px;
}

/* Action buttons */
.action-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--ct-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 10px;
}

.action-btn:active {
    transform: scale(0.97);
}

.action-btn-secondary {
    background: transparent;
    border: 2px solid var(--ct-primary);
    color: var(--ct-primary);
}

/* Dice display */
.dice-display {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

.die {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #fff;
    color: #1a1a2e;
    border-radius: 10px;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Action panel info */
#action-info p {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #eee;
}

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

/* Jail panel */
#jail-panel .action-btn {
    margin-bottom: 10px;
}

/* Build panel */
.build-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #16213e;
    font-size: 1rem;
}

.build-prop-name {
    flex: 1;
    text-align: left;
}

.build-prop-info {
    color: #aaa;
    margin-right: 12px;
}

.build-btn-small {
    width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Card display */
.card-display {
    background: var(--ct-card-bg);
    border: 2px solid var(--ct-secondary);
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
    text-align: center;
}

.card-display h3 {
    color: var(--ct-secondary);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.card-display p {
    font-size: 1.15rem;
    line-height: 1.5;
    color: #eee;
}

/* Auction screen */
.auction-item-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ct-primary);
    margin-bottom: 8px;
}

.auction-bid-info {
    font-size: 1.2rem;
    color: #2ecc71;
    font-weight: 600;
    margin: 12px 0;
    text-align: center;
}

.auction-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.auction-controls input[type="number"] {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    border: 2px solid var(--ct-primary);
    border-radius: 8px;
    background: #16213e;
    color: #eee;
    outline: none;
}

/* Trade panels */
#trade-propose-panel,
#trade-review-panel {
    text-align: left;
}

#trade-propose-panel h2,
#trade-review-panel h2 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

#trade-info {
    padding: 12px;
    margin-bottom: 12px;
    background: #16213e;
    border-radius: 8px;
    font-size: 0.95rem;
}

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

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

.trade-section {
    margin-bottom: 12px;
}

.trade-section label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #aaa;
}

.trade-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--ct-primary);
    background: #16213e;
    color: #eee;
    font-size: 1rem;
}

.trade-columns {
    display: flex;
    gap: 12px;
}

.trade-col {
    flex: 1;
    background: #16213e;
    border-radius: 8px;
    padding: 12px;
}

.trade-col h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--ct-primary-light);
}

.trade-cash-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.trade-cash-row input {
    width: 80px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #0f0f23;
    color: #eee;
    font-size: 0.9rem;
}

.trade-prop-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-prop-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 4px 0;
    cursor: pointer;
}

.trade-prop-item input[type="checkbox"] {
    accent-color: var(--ct-primary);
}

.trade-from {
    font-weight: bold;
    margin-bottom: 12px;
}

/* Bankrupt panel */
#bankrupt-panel {
    text-align: center;
    padding: 24px;
}

#bankrupt-panel h2 {
    color: #e74c3c;
}

/* Final scores — preserve green money color */
.final-score-row .player-score { color: #2ecc71; }

/* TV mode link */
.tv-mode-link {
    display: none;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 16px;
    text-decoration: none;
}
.tv-mode-link:hover {
    color: var(--ct-primary);
    text-decoration: underline;
}
@media (min-width: 768px) {
    .tv-mode-link { display: block; }
}


/* =========================================================
   DISPLAY MODE — Board + Players
   ========================================================= */

.display-mode #app {
    width: 100%;
    max-width: 100vw;
    padding: 10px;
}

/* Board layout wrapper */
.board-layout {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* The 11x11 CSS Grid board */
.board-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(9, 1fr) 1.5fr;
    grid-template-rows: 1.5fr repeat(9, 1fr) 1.5fr;
    gap: 1px;
    background: #333;
    border: 2px solid #555;
    border-radius: 4px;
    width: 100%;
    aspect-ratio: 1 / 1;
}

/* Individual board space */
.board-space {
    background: var(--ct-board-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2px;
    min-width: 0;
    min-height: 0;
}

/* Corner spaces */
.corner-space {
    background: #b8d8b0;
}

/* Color bands for properties */
.color-band {
    position: absolute;
    width: 100%;
    height: 20%;
}

/* Bottom row: color band on top */
.bottom-row .color-band {
    top: 0;
    left: 0;
}

/* Top row: color band on bottom */
.top-row .color-band {
    bottom: 0;
    left: 0;
}

/* Left column: color band on right */
.left-col .color-band {
    top: 0;
    right: 0;
    width: 20%;
    height: 100%;
}

/* Right column: color band on left */
.right-col .color-band {
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
}

/* Property group colors */
.color-brown { background-color: #8B4513; }
.color-light_blue { background-color: #87CEEB; }
.color-pink { background-color: #FF69B4; }
.color-orange { background-color: #FFA500; }
.color-red { background-color: #FF0000; }
.color-yellow { background-color: #FFD700; }
.color-green { background-color: #008000; }
.color-dark_blue { background-color: #00008B; }

/* Space text */
.space-name {
    font-size: 0.5vw;
    font-weight: 600;
    color: #222;
    text-align: center;
    line-height: 1.1;
    z-index: 1;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
}

.space-price {
    font-size: 0.45vw;
    color: #555;
    z-index: 1;
}

.corner-space .space-name {
    font-size: 0.65vw;
    font-weight: 700;
}

/* Building indicators */
.space-buildings {
    display: flex;
    gap: 1px;
    z-index: 2;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.building {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 1px;
}

.building.house {
    background: #2ecc71;
}

.building.hotel {
    background: #e74c3c;
    width: 10px;
    height: 8px;
    font-size: 6px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Player tokens on board */
.space-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    z-index: 3;
    position: absolute;
    top: 2px;
    right: 2px;
}

.player-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    filter: drop-shadow(0 0 1px rgba(0,0,0,.6));
}

.player-token.current-turn {
    filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 1px rgba(0,0,0,.6));
}

/* Owned property indicator */
.board-space.owned {
    box-shadow: inset 0 0 0 2px var(--owner-color, #888);
}

.board-space.mortgaged {
    opacity: 0.5;
}

/* Center panel (inside the board) */
.center-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    text-align: center;
    background: rgba(26, 26, 46, 0.92);
    border-radius: 12px;
    padding: 16px;
    z-index: 10;
    pointer-events: none;
}

.center-panel h2 {
    color: var(--ct-primary);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.center-turn {
    font-size: 1.1rem;
    color: #eee;
    font-weight: 600;
}

.center-phase {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 4px;
}

.center-panel .dice-display {
    justify-content: center;
    margin: 12px 0;
}

.center-panel .die {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
}

.center-panel .card-display {
    background: transparent;
    border: 1px solid var(--ct-secondary);
    padding: 12px;
    margin: 8px 0;
}

.center-panel .card-display h3 {
    font-size: 0.9rem;
}

.center-panel .card-display p {
    font-size: 0.85rem;
}

/* =========================================================
   Responsive
   ========================================================= */

/* Make board text bigger on larger screens */
@media (min-width: 900px) {
    .space-name { font-size: 0.55vw; }
    .space-price { font-size: 0.5vw; }
    .corner-space .space-name { font-size: 0.7vw; }
}

@media (min-width: 1200px) {
    .space-name { font-size: 7px; }
    .space-price { font-size: 6px; }
    .corner-space .space-name { font-size: 9px; }
    .board-grid {
        max-width: 800px;
    }
}

/* Smaller screens: tighter board */
@media (max-width: 600px) {
    .space-name { font-size: 5px; }
    .space-price { font-size: 4px; }
    .corner-space .space-name { font-size: 6px; }
    .player-token svg { width: 10px; height: 10px; }
    .building { width: 4px; height: 4px; }
    .building.hotel { width: 7px; height: 5px; font-size: 4px; }
    .center-panel { padding: 8px; width: 60%; }
    .center-panel h2 { font-size: 1rem; }
    .center-turn { font-size: 0.85rem; }
    .center-phase { font-size: 0.75rem; }
    .center-panel .die { width: 28px; height: 28px; font-size: 1rem; }
}
