@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;900&display=swap');


/* -----------------------------------------------------------------------
   IMPERIUM CSS - Table of Contents
--------------------------------------------------------------------------
   1. Variables & Resets
   2. Home Screen
   3. Game Screen
   4. Board
   5. Player Panel
   6. Panel Actions (Dice & Buttons)
   7. Modals & Overlays
   8. Property Info Card
   9. Toast Notifications
   10. Responsive Queries
   11. Board Tokens
   12. Trading UI
--------------------------------------------------------------------------- */


:root {
    --board-bg: #cde6d0;
    --tile-bg: #fcfcfc;
    --line-color: #2c3e50;
    --accent: #e74c3c;
    --accent-dark: #c0392b;
    --round-color: #fbbf24;
    --bg-deep: #0d1117;
    --bg-panel: #161b22;
    --bg-card: #1c2333;
    --bg-card-hover: #21293a;
    --text-primary: #e6edf3;
    --text-dim: #8b949e;
    --text-bright: #fcfcfc;
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-active: rgba(255, 255, 255, 0.18);
    --panel-width: 320px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    overflow: hidden;
}

body {
    background-color: var(--bg-deep);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* ====== HOME SCREEN ====== */
.home-screen,
.game-screen,
.board-background {
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('./assets/Monopolybackground.svg');
    background-size: cover;
    background-position: center;
    background-color: var(--bg-deep);
}

.home-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.6s var(--ease-out);
    transition: background-color 0.4s var(--ease-out);
}

.home-screen.dark-overlay {
    background-color: rgba(0, 0, 0, 0.85);
    background-blend-mode: multiply;
}


@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.home-card {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    max-width: 500px;
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(28px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.home-logo {
    text-align: center;
}

.home-logo-badge {
    display: inline-block;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    color: #fff;
    background: var(--accent-dark);
    padding: 8px 24px;
    border-radius: var(--radius-sm);
}

.home-logo-sub {
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-bright);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

.player-count-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.count-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid var(--border-active);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.count-btn:hover {
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.count-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px) scale(1.05);
}

.home-selected-label {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-bright);
    min-height: 1.2em;
}

.home-names {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.home-player-setup {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
}

.home-player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

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

.home-player-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-bright);
}

.home-name-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 8px;
}

.home-name-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.home-name-input::placeholder {
    color: var(--text-bright);
}




/* Icon picker grid */
.icon-picker-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-subtle);
    background: var(--bg-card);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    border-color: var(--accent);
    transform: scale(1.15);
}

.icon-btn.selected {
    border-color: var(--accent);
    background: rgba(231, 76, 60, 0.2);
    transform: scale(1.1);
}

.icon-btn.taken {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    filter: grayscale(100%);
}

.home-start-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.home-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.55);
}

.home-start-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.home-money-hint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-bright);
}

.home-money-hint strong {
    color: #2ecc71;
}




/* Game Screen */
.game-screen {
    display: flex;
    align-items: stretch;
    height: 100vh;
    overflow: hidden;
    animation: fadeIn 0.5s var(--ease-out);
}

.board-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-width: 0;
}

/* Board */
.board {
    width: min(88vmin, 100%);
    aspect-ratio: 1/1;
    max-width: 840px;
    max-height: 840px;
    background-color: var(--line-color);
    border: 6px solid var(--line-color);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: grid;
    grid-template-columns: 1.5fr repeat(6, 1fr) 1.5fr;
    grid-template-rows: 1.5fr repeat(6, 1fr) 1.5fr;
    gap: 2px;
    overflow: hidden;
}

.tile {
    background-color: var(--tile-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s var(--ease-out);
}

.interactable-tile {
    cursor: pointer;
}

.interactable-tile:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
}

/* Player tokens on tiles */
.tile-tokens {
    position: absolute;
    bottom: 2px;
    left: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    pointer-events: none;
    z-index: 5;
}

.tile-token {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.top-edge {
    align-items: flex-end;
    padding-bottom: 10px;
}

.bottom-edge {
    align-items: flex-start;
    padding-top: 10px;
}

.left-edge {
    justify-content: flex-end;
    padding-right: 10px;
}

.right-edge {
    justify-content: flex-start;
    padding-left: 10px;
}

/* Scrolls and certificate upgrade icons */
.tile-upgrade-indicator {
    position: absolute;
    display: flex;
    gap: 2px;
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
}

/* Tiles 2-7 (bottom-edge) */
.bottom-edge .tile-upgrade-indicator {
    top: 4px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Tiles 9-14 (left-edge) */
.left-edge .tile-upgrade-indicator {
    right: 4px;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) rotate(270deg);
}

/* Tiles 16-21 (top-edge) */
.top-edge .tile-upgrade-indicator {
    top: 4px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%)
}

/* Tiles 23-28 (right-edge)*/
.right-edge .tile-upgrade-indicator {
    left: 4px;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) rotate(90deg);
}

/* ====== TRADING UI ====== */
.trade-property-btn {
    display: block;
    cursor: pointer;
    margin-bottom: 8px;
    user-select: none;
}

.trade-property-btn-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.trade-property-btn:hover .trade-property-btn-content {
    background: rgba(255, 255, 255, 0.2);
}

.trade-property-btn input[type="checkbox"]:checked~.trade-property-btn-content {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px rgba(74, 144, 226, 0.4);
}


/* ====== BOARD CENTER ====== */
.center {
    grid-row: 2/8;
    grid-column: 2/8;
    background-color: var(--board-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 16px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.1);
}

.center h1 {
    font-size: clamp(1rem, 3.5vmin, 3rem);
    font-weight: 900;
    letter-spacing: 0.5rem;
    color: #fff;
    text-transform: uppercase;
    background: var(--accent-dark);
    padding: 0.5em 1em;
    border: 5px solid #fff;
    transform: rotate(-45deg);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.15);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
}

/* ====== PLAYER PANEL ====== */
.player-panel {
    width: var(--panel-width);
    flex-shrink: 0;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-bright);
}

.panel-round {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--round-color);
    background: rgba(251, 191, 36, 0.12);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.panel-players {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-active) transparent;
}

/* Player card */
.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    cursor: default;
}

.player-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--player-colour);
    border-radius: 4px 0 0 4px;
    transition: width 0.25s;
}

.player-card.active {
    border-color: var(--player-colour);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 1px var(--player-colour), 0 6px 20px rgba(0, 0, 0, 0.3);
}

.player-card.active::before {
    width: 6px;
}

.pc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--player-colour);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.pc-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-turn-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--player-colour);
    color: #fff;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s, transform 0.25s;
}

.player-card.active .pc-turn-badge {
    opacity: 1;
    transform: scale(1);
}

.pc-money {
    font-size: 1rem;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.pc-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 0;
}

.pc-props-title {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-bright);
    margin-bottom: 5px;
}

.pc-props-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 18px;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-active) transparent;
}

.pc-props-empty {
    font-size: 0.72rem;
    color: var(--text-bright);
    font-style: italic;
}

.prop-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.65rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.2s;
}

.prop-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
}

.prop-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.prop-chip-level {
    font-size: 0.5rem;
    font-weight: 800;
    background: var(--accent);
    color: white;
    padding: 1px 4px;
    border-radius: 4px;
    margin-left: 4px;
}

.player-card.bankrupt {
    opacity: 0.4;
    pointer-events: none;
}

.player-card.bankrupt .pc-name::after {
    content: ' – Bankrupt';
    color: var(--accent);
    font-weight: 400;
}

/* ====== PANEL ACTIONS (dice + buttons) ====== */
.panel-actions {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.dice-display {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.die {
    width: 56px;
    height: 56px;
    background: #fff;
    color: #1a1a2e;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.die.rolling {
    animation: diceRoll 0.6s ease-out;
}

@keyframes diceRoll {
    0% {
        transform: rotateX(0) rotateZ(0) scale(1);
    }

    25% {
        transform: rotateX(180deg) rotateZ(90deg) scale(1.1);
    }

    50% {
        transform: rotateX(360deg) rotateZ(180deg) scale(0.95);
    }

    75% {
        transform: rotateX(540deg) rotateZ(270deg) scale(1.05);
    }

    100% {
        transform: rotateX(720deg) rotateZ(360deg) scale(1);
    }
}

.action-btn {
    padding: 14px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-align: center;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.action-btn--roll {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.action-btn--buy {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-btn--buy:hover:not(:disabled) {
    box-shadow: 0 5px 10px rgba(46, 204, 113, 0.65);
    transform: translateY(-2px);
}

.action-btn--end {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #fff;
}

.action-btn--jail {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    box-shadow: 0 4px 16px rgba(230, 126, 34, 0.4);
}

.action-btn--upgrade {
    background-color: #2ecc71;
    color: #fff;
}

.action-btn--downgrade {
    background-color: #e74c3c;
    color: #fff;
}

/*  --------------------7. MODALS & OVERLAYS ------------------------*/
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 450px;
    width: 92vw;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    overflow-x: auto;
}

.modal-content--transparent {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.modal-content--large {
    max-width: 800px;
}

/* ------- PROPERTY INFO CARD (modal) ------- */
.prop-card-image-container {
    text-align: center;
    margin: 1rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.prop-card-img {
    width: 100%;
    height: auto;
    max-height: 50vh;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.prop-card-fallback {
    padding: 40px;
    background: #eee;
    font-weight: bold;
    color: #555;
    text-align: center;
    width: 100%;
}


/* Event card inside modal */

.event-card-top {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 24px;
    text-align: center;
    border-bottom: 3px dashed rgba(255, 255, 255, 0.3);
}

.event-card-top h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 4px;
}

.event-card-top .event-card-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
}

.event-card-body {
    padding: 24px;
    text-align: center;
}

.event-card-body p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.event-card-effect {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.event-card-effect.gain {
    color: #2ecc71;
}

.event-card-effect.lose {
    color: var(--accent);
}

.event-card-body .action-btn {
    width: 100%;
}

/* Jail modal */
.jail-card-top {
    background: linear-gradient(135deg, #e67e22, #d35400);
    padding: 24px;
    text-align: center;
}

.jail-card-top h3 {
    font-size: 1.2rem;
    color: #fff;
}

/* ------- TOAST NOTIFICATIONS ------- */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.4s var(--ease-out), toastOut 0.4s 2.6s var(--ease-out) forwards;
    white-space: nowrap;
}

.toast.toast-gain {
    border-left: 4px solid #2ecc71;
}

.toast.toast-lose {
    border-left: 4px solid var(--accent);
}

.toast.toast-info {
    border-left: 4px solid #3498db;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-10px)
    }
}

/* ------- RESPONSIVE ------- */
@media (max-width: 780px) {
    :root {
        --panel-width: 240px;
    }
}

@media (max-width: 560px) {
    .game-screen {
        flex-direction: column;
    }

    .player-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        max-height: 40vh;
    }
}

/* ------- TOKENS ------- */
.tile-tokens {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    pointer-events: none;
    z-index: 5;
    justify-content: center;
    align-items: center;
}

.tile-token {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tile-tokens--visiting {
    bottom: 4px;
    left: 4px;
    right: auto;
    top: auto;
    transform: none;
}

/* ------- OWNER ICON ON TILES ------- */
.tile-owner-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.left-edge .tile-owner-icon {
    left: 2px;
    right: auto;
}



/* board Background*/
.board-wrapper {
    position: relative;
}

.board-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 12px;
}

.board {
    position: relative;
    z-index: 1;
}



/* negative money */
.pc-money--negative {
    color: var(--accent);
}

/* Bankrupt Button */
.action-btn--bankrupt {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
    width: 100%;
    margin-top: 8px;
    animation: pulse-bankrupt 1.5s infinite;
}

@keyframes pulse-bankrupt {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
    }

    50% {
        box-shadow: 0 4px 24px rgba(231, 76, 60, 0.7);
    }
}


.player-card.bankrupt {
    opacity: 0.4;
    pointer-events: auto;
}

.player-card.bankrupt .pc-name::after {
    content: ' – Bankrupt';
    color: var(--accent);
    font-weight: 400;
}

/* Win Screen */
.win-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.6s var(--ease-out);
}

.win-card {
    background: var(--bg-card);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.2), 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.55s var(--ease-out);
    max-width: 420px;
    width: 90vw;
}

.win-emoji {
    font-size: 5rem;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.win-name {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.win-money {
    font-size: 1.1rem;
    color: #2ecc71;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Trading Screen */
.trade-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.trade-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.trade-input option {
    background: var(--bg-card);
    color: var(--text-primary);
}
