/* Monopol Styles */
:root {
    --monopol-bg: #1c1c1f;
    --monopol-text: #fff;
    --accent: #2ecc71;
    --accent-glow: rgba(46, 204, 113, 0.4);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --board-bg: #e1e7e4;
    --square-bg: rgba(255, 255, 255, 0.82);
    --glass-modal-bg: rgba(255, 255, 255, 0.94);
    --select-glow: 0 0 10px rgba(46, 204, 113, 0.3);
}

body.dark-theme.monopol-body,
body.dark-theme .monopol-body {
    --monopol-bg: #1c1c1f;
    --monopol-text: #fff;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --board-bg: #2d3436;
    --square-bg: #353b48;
    --glass-modal-bg: rgba(30, 30, 35, 0.96);
    --select-glow: 0 0 15px rgba(46, 204, 113, 0.5);
}

body.monopol-body {
    background-color: var(--monopol-bg);
    background-image: radial-gradient(circle at 50% 10%, #2c3e50 0%, #1c1c1f 100%);
    color: var(--monopol-text);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Reducem padding-ul de sus/jos pentru a lăsa loc tablei */
.monopol-wrapper {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.fw-800 {
    font-weight: 800;
}

.fw-600 {
    font-weight: 600;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-group .btn-outline-light.active {
    background-color: #fff !important;
    color: #000 !important;
    font-weight: 800;
}

#end-turn:not(:disabled),
.btn-end-turn-floating:not(:disabled) {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: white !important;
    box-shadow: 0 0 15px var(--accent-glow);
    font-weight: 800;
}


/* Map Cards */
.map-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-align: left;
}

.map-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.map-preview {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.map-ro {
    background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1543165796-5426273eaab3?auto=format&fit=crop&q=80&w=800');
}

.map-eu {
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1467269204594-9661b134dd2b?auto=format&fit=crop&q=80&w=800');
}

.map-us {
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1496442226666-8d4d0e62e6e9?auto=format&fit=crop&q=80&w=800');
}

.map-info {
    padding: 20px;
}

.map-info h3 {
    font-weight: 700;
    margin-bottom: 8px;
}

.map-info p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.monopol-board {
    display: grid;
    grid-template-columns: 1.5fr repeat(9, 1fr) 1.5fr;
    grid-template-rows: 1.5fr repeat(9, 1fr) 1.5fr;
    width: 100%;
    max-width: 88vh;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background: #2d3436;
    border: 5px solid #333;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.square {
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--square-bg);
    color: var(--monopol-text);
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.square-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

.square-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
    padding: 2px;
}

.square-bar {
    height: 18px;
    width: 100%;
    margin: 0;
    flex-shrink: 0;
}

.bar-brown {
    background: #955436;
}

.bar-lightblue {
    background: #aae0fa;
}

.bar-pink {
    background: #d93a96;
}

.bar-orange {
    background: #f7941d;
}

.bar-red {
    background: #ed1c24;
}

.bar-yellow {
    background: #fef200;
}

.bar-green {
    background: #1fb25a;
}

.bar-darkblue {
    background: #0072bb;
}

.square-name {
    padding: 2px;
    line-height: 1;
    margin-top: 2px;
}

.square-price {
    margin-bottom: 2px;
    font-size: 0.55rem;
}

.square-icon {
    font-size: 1.2rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tokens */
.square-tokens {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.player-token {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    margin: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tile Orientations */
.tile-1,
.tile-2,
.tile-3,
.tile-4,
.tile-5,
.tile-6,
.tile-7,
.tile-8,
.tile-9 {
    flex-direction: column;
}

.tile-11,
.tile-12,
.tile-13,
.tile-14,
.tile-15,
.tile-16,
.tile-17,
.tile-18,
.tile-19 {
    flex-direction: row-reverse;
}

.tile-11 .square-container,
.tile-12 .square-container,
.tile-13 .square-container,
.tile-14 .square-container,
.tile-15 .square-container,
.tile-16 .square-container,
.tile-17 .square-container,
.tile-18 .square-container,
.tile-19 .square-container {
    flex-direction: row-reverse;
}

.tile-11 .square-bar,
.tile-12 .square-bar,
.tile-13 .square-bar,
.tile-14 .square-bar,
.tile-15 .square-bar,
.tile-16 .square-bar,
.tile-17 .square-bar,
.tile-18 .square-bar,
.tile-19 .square-bar {
    height: 100% !important;
    width: 15px !important;
    border-left: 2px solid rgba(0, 0, 0, 0.2) !important;
}

.tile-21,
.tile-22,
.tile-23,
.tile-24,
.tile-25,
.tile-26,
.tile-27,
.tile-28,
.tile-29 {
    flex-direction: column-reverse;
}

.tile-21 .square-container,
.tile-22 .square-container,
.tile-23 .square-container,
.tile-24 .square-container,
.tile-25 .square-container,
.tile-26 .square-container,
.tile-27 .square-container,
.tile-28 .square-container,
.tile-29 .square-container {
    flex-direction: column-reverse;
}

.tile-21 .square-bar,
.tile-22 .square-bar,
.tile-23 .square-bar,
.tile-24 .square-bar,
.tile-25 .square-bar,
.tile-26 .square-bar,
.tile-27 .square-bar,
.tile-28 .square-bar,
.tile-29 .square-bar {
    border-top: 2px solid rgba(0, 0, 0, 0.2) !important;
}

.tile-31,
.tile-32 .tile-33,
.tile-34,
.tile-35,
.tile-36,
.tile-37,
.tile-38,
.tile-39 {
    flex-direction: row;
}

.tile-31 .square-container,
.tile-32 .square-container,
.tile-33 .square-container,
.tile-34 .square-container,
.tile-35 .square-container,
.tile-36 .square-container,
.tile-37 .square-container,
.tile-38 .square-container,
.tile-39 .square-container {
    flex-direction: row;
}

.tile-31 .square-bar,
.tile-32 .square-bar,
.tile-33 .square-bar,
.tile-34 .square-bar,
.tile-35 .square-bar,
.tile-36 .square-bar,
.tile-37 .square-bar,
.tile-38 .square-bar,
.tile-39 .square-bar {
    height: 100% !important;
    width: 15px !important;
    border-right: 2px solid rgba(0, 0, 0, 0.2) !important;
}

/* Corner Squares */
.special {
    background: var(--square-bg) !important;
    color: var(--monopol-text);
}

.tile-0 {
    background: #ff7675 !important;
    /* START - Bright Red */
    color: #fff !important;
    font-size: 1rem;
}

/* VISITĂ */
.tile-10 {
    background: #fab1a0 !important;
    color: #2d3436 !important;
}

/* FREE */
.tile-20 {
    background: #dfe6e9 !important;
    color: #2d3436 !important;
}

/* POLIȚIE */
.tile-30 {
    background: #0984e3 !important;
    color: #fff !important;
}

.square-tokens {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Go to Jail */

.owner-tag {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 40;
    transition: all 0.3s ease;
}

.ownership-bar {
    position: absolute;
    z-index: 30;
    pointer-events: none;
}

/* Positioning for ownership bars based on tile orientation */
.tile-bottom .ownership-bar {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.tile-left .ownership-bar {
    top: 0;
    right: 0;
    height: 100%;
    width: 5px;
}

.tile-top .ownership-bar {
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.tile-right .ownership-bar {
    top: 0;
    left: 0;
    height: 100%;
    width: 5px;
}


.dice-result {
    font-size: 2.5rem;
    font-weight: 800;
    color: #333;
    animation: dicePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@keyframes dicePop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.lobby-player-icon {
    transition: transform 0.3s ease;
}

.lobby-player-icon:hover {
    transform: scale(1.1);
}

.board-center {
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    background: var(--monopol-bg);
    background-image: url('https://www.transparenttextures.com/patterns/brushed-alum.png');
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid #ccc;
    z-index: 10;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95%;
    height: 100%;
    justify-content: space-between;
    padding-top: 10px;
}


.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 700;
}

.btn-accent:hover {
    background: #27ae60;
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.shadow-glow {
    box-shadow: 0 0 15px var(--accent-glow);
}

.glass-modal {
    background: var(--glass-modal-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    color: var(--monopol-text);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.glowing-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--monopol-text) !important;
    border-radius: 12px !important;
    padding: 10px 15px !important;
    box-shadow: var(--select-glow);
    transition: all 0.3s ease;
}

.glowing-select:focus {
    box-shadow: 0 0 20px var(--accent-glow) !important;
    border-color: var(--accent) !important;
}

.modal-header {
    border-bottom: 1px solid var(--glass-border) !important;
}

.glass-modal .btn-outline-light {
    border-color: var(--glass-border) !important;
}

.glass-modal .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

body:not(.dark-theme) .glass-modal .btn-outline-light:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-close-white {
    filter: invert(var(--theme-invert, 0)) grayscale(100%);
}

body:not(.dark-theme) {
    --theme-invert: 1;
}

/* ===== LIGHT THEME FIXES ===== */
body.monopol-body:not(.dark-theme) {
    --monopol-text: #222;
    --monopol-bg: #f0f2f5;
    --glass: rgba(0, 0, 0, 0.04);
    --glass-border: rgba(0, 0, 0, 0.12);
    --glass-modal-bg: rgba(255, 255, 255, 0.97);
    background-color: #f0f2f5;
    background-image: radial-gradient(circle at 50% 10%, #e8ecf1 0%, #f0f2f5 100%);
    color: #222;
}

/* Setup screen labels */
.setup-label {
    color: var(--monopol-text);
    opacity: 0.8;
}

/* Broad contrast fix for light theme */
body.monopol-body:not(.dark-theme) .text-white-50,
body.monopol-body:not(.dark-theme) .text-muted {
    color: #333 !important;
    opacity: 1 !important;
}

/* Fix for outlined buttons in setup screen */
body.monopol-body:not(.dark-theme) .btn-outline-light {
    color: #333 !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
    background-color: rgba(0, 0, 0, 0.02) !important;
}

body.monopol-body:not(.dark-theme) .btn-outline-light:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    color: #000 !important;
}

/* Keep active button as high-contrast (dark in light theme) */
body.monopol-body:not(.dark-theme) .btn-group .btn-outline-light.active {
    background-color: #1c1c1f !important;
    color: #fff !important;
    border-color: #1c1c1f !important;
}

/* Fix for dropdowns and inputs in setup screen */
body.monopol-body:not(.dark-theme) select.bg-dark,
body.monopol-body:not(.dark-theme) input.bg-dark {
    background-color: #ffffff !important;
    color: #222 !important;
    border-color: #ced4da !important;
}

body.monopol-body:not(.dark-theme) select.bg-dark option {
    background-color: #ffffff !important;
    color: #222 !important;
}

/* Glass modal text in light theme */
body:not(.dark-theme) .glass-modal {
    color: #222;
}

body:not(.dark-theme) .glass-modal h3,
body:not(.dark-theme) .glass-modal h5,
body:not(.dark-theme) .glass-modal p,
body:not(.dark-theme) .glass-modal label,
body:not(.dark-theme) .glass-modal span,
body:not(.dark-theme) .glass-modal div {
    color: #222;
}

/* Modal title & message */
body:not(.dark-theme) #modal-title,
body:not(.dark-theme) #modal-message {
    color: #222 !important;
}

/* Trade modal text */
body:not(.dark-theme) .trade-side {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body:not(.dark-theme) .trade-item {
    color: #333;
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body:not(.dark-theme) .trade-item:hover {
    background: rgba(0, 0, 0, 0.07);
}

/* Property info card in modal */
body:not(.dark-theme) .property-info-content {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #222;
}

/* Board center */
body:not(.dark-theme) .board-center {
    background: #f5f6f8;
    color: #222;
}

/* Game panels */
body:not(.dark-theme) #game-area .glass-panel {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    color: #222;
}

body:not(.dark-theme) #game-area .glass-panel h4,
body:not(.dark-theme) #game-area .glass-panel h5,
body:not(.dark-theme) #game-area .glass-panel p {
    color: #222;
}

/* Game log */
body:not(.dark-theme) #game-log {
    color: #333;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Glowing select in light theme */
body:not(.dark-theme) .glowing-select {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #222 !important;
}

/* Setup screen text */
body.monopol-body:not(.dark-theme) .text-gradient {
    background: linear-gradient(135deg, #222 0%, #555 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scrollbar for light theme */
body:not(.dark-theme) .property-scroll::-webkit-scrollbar-thumb,
body:not(.dark-theme) #player-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* Mortgage sign still needs contrast */
body:not(.dark-theme) .mortgage-sign {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

/* Ajustăm înălțimea log-ului să fie mai mică pe desktop pentru a economisi spațiu */
#game-log {
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.8rem;
}

#game-log::-webkit-scrollbar {
    width: 4px;
}

#game-log::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* --- 3D DICE STYLES (Realistic) --- */
:root {
    --dice-size: 50px;
}

.dice-platform {
    display: flex;
    gap: 30px;
    transform-style: preserve-3d;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    padding: 20px;
}

.dice-platform.rollable {
    cursor: pointer;
    filter: drop-shadow(0 0 15px rgba(46, 204, 113, 0.6));
    animation: diceGlowPulse 2s infinite;
}

@keyframes diceGlowPulse {
    0% {
        filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.4));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(46, 204, 113, 0.8));
        transform: scale(1.02);
    }

    100% {
        filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.4));
        transform: scale(1);
    }
}

.die {
    width: 50px;
    height: 50px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.15, 0.45, 0.15, 1.15);
}

.die-face,
.die-face-core {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.die-face {
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border: 1px solid #ccc;
    border-radius: 8px;
    display: grid;
    grid-template: repeat(3, 1fr) / repeat(3, 1fr);
    padding: 6px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
    z-index: 2;
}

.die-face-core {
    background-color: #d0d0d0;
    width: 96%;
    height: 96%;
    left: 2%;
    top: 2%;
    border-radius: 6px;
    backface-visibility: visible;
    z-index: 1;
    box-shadow: 0 0 2px 1px #d0d0d0;
}

body.dark-theme .die-face {
    background: linear-gradient(145deg, #4b6584, #34495e);
    border-color: #2c3e50;
}

body.dark-theme .die-face-core {
    background-color: #2c3e50;
    box-shadow: 0 0 2px 1px #2c3e50;
}

.dot {
    background-color: #333;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    align-self: center;
    justify-self: center;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-theme .dot {
    background-color: #ecf0f1;
}

/* Grid Positioning for Dots */
.face-1 .dot:nth-child(1) {
    grid-area: 2 / 2;
}

.face-2 .dot:nth-child(1) {
    grid-area: 1 / 3;
}

.face-2 .dot:nth-child(2) {
    grid-area: 3 / 1;
}

.face-3 .dot:nth-child(1) {
    grid-area: 1 / 3;
}

.face-3 .dot:nth-child(2) {
    grid-area: 2 / 2;
}

.face-3 .dot:nth-child(3) {
    grid-area: 3 / 1;
}

.face-4 .dot:nth-child(1) {
    grid-area: 1 / 1;
}

.face-4 .dot:nth-child(2) {
    grid-area: 1 / 3;
}

.face-4 .dot:nth-child(3) {
    grid-area: 3 / 1;
}

.face-4 .dot:nth-child(4) {
    grid-area: 3 / 3;
}

.face-5 .dot:nth-child(1) {
    grid-area: 1 / 1;
}

.face-5 .dot:nth-child(2) {
    grid-area: 1 / 3;
}

.face-5 .dot:nth-child(3) {
    grid-area: 2 / 2;
}

.face-5 .dot:nth-child(4) {
    grid-area: 3 / 1;
}

.face-5 .dot:nth-child(5) {
    grid-area: 3 / 3;
}

.face-6 .dot:nth-child(1) {
    grid-area: 1 / 1;
}

.face-6 .dot:nth-child(2) {
    grid-area: 1 / 3;
}

.face-6 .dot:nth-child(3) {
    grid-area: 2 / 1;
}

.face-6 .dot:nth-child(4) {
    grid-area: 2 / 3;
}

.face-6 .dot:nth-child(5) {
    grid-area: 3 / 1;
}

.face-6 .dot:nth-child(6) {
    grid-area: 3 / 3;
}

/* Face Transforms */
.face-1 {
    transform: translateZ(25px);
}

.face-6 {
    transform: rotateY(180deg) translateZ(25px);
}

.face-2 {
    transform: rotateY(90deg) translateZ(25px);
}

.face-5 {
    transform: rotateY(-90deg) translateZ(25px);
}

.face-3 {
    transform: rotateX(90deg) translateZ(25px);
}

.face-4 {
    transform: rotateX(-90deg) translateZ(25px);
}

.core-face-1 {
    transform: translateZ(23px);
}

.core-face-6 {
    transform: rotateY(180deg) translateZ(23px);
}

.core-face-2 {
    transform: rotateY(90deg) translateZ(23px);
}

.core-face-5 {
    transform: rotateY(-90deg) translateZ(23px);
}

.core-face-3 {
    transform: rotateX(90deg) translateZ(23px);
}

.core-face-4 {
    transform: rotateX(-90deg) translateZ(23px);
}

.dice-result {
    font-size: 2rem;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color, #333);
    pointer-events: none;
    z-index: 100;
}

.centered-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Trading UI */
.trade-side {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 250px;
    overflow-y: auto;
}

.trade-item {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.trade-item.selected {
    background: rgba(46, 204, 113, 0.25) !important;
    border-color: var(--accent) !important;
    color: white;
    box-shadow: 0 0 10px var(--accent-glow);
}

.center-content {
    justify-content: flex-start !important;
    padding-top: 20px;
}

/* Movement Hints */
.hint-pulse {
    animation: hintPulse 1.5s infinite;
    position: relative;
    z-index: 50;
    box-shadow: inset 0 0 20px #f1c40f !important;
}

@keyframes hintPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.player-token.pending-jump {
    width: 35px !important;
    height: 35px !important;
    border: 3px solid #fff !important;
    box-shadow: 0 0 20px #fff, 0 0 40px rgba(255, 255, 255, 0.5) !important;
    animation: tokenJump 0.6s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

@keyframes tokenJump {
    0% {
        transform: scale(1) translateY(0);
    }

    100% {
        transform: scale(1.2) translateY(-10px);
    }
}

@keyframes tokenWiggle {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(10deg);
    }

    50% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(-10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Property Info Card */
.property-info-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.property-header {
    height: 40px;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Board Center HUD */
#board-center-hud {
    margin-top: -10px;
    margin-bottom: 25px !important;
    gap: 12px !important;
    /* Spațiu mai mare între jucători */
}

#board-center-hud .badge {
    padding: 8px 15px !important;
    border-radius: 12px;
    min-width: 110px;
    /* Asigură o lățime minimă pentru vizibilitate */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#board-center-hud .badge.btn-accent {
    transform: scale(1.15);
    /* Jucătorul activ este și mai mare */
    box-shadow: 0 0 20px var(--accent-glow);
    z-index: 5;
}

/* Building Indicators */
.building-container {
    pointer-events: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    padding: 2px;
    gap: 1.5px;
    max-width: 85%;
}

.building i {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
    font-size: 0.75rem;
}

.building.hotel i {
    font-size: 1rem;
    color: #f1c40f !important;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.building.house i {
    color: #2ecc71 !important;
}

@media (max-width: 991px) {
    .building i {
        font-size: 0.55rem;
    }

    .building.hotel i {
        font-size: 0.7rem;
    }

    .ownership-bar {
        height: 3px !important;
        width: 3px !important;
    }

    .tile-bottom .ownership-bar,
    .tile-top .ownership-bar {
        height: 3px !important;
        width: 100% !important;
    }

    .tile-left .ownership-bar,
    .tile-right .ownership-bar {
        width: 3px !important;
        height: 100% !important;
    }
}

@keyframes HUDfadeIn {

    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.selected-asset {
    background: rgba(46, 204, 113, 0.3) !important;
    transform: scale(0.98);
}

.mortgage-sign {
    background: rgba(0, 0, 0, 0.7);
    padding: 0 4px;
    border-radius: 3px;
    pointer-events: none;
}


/* Floating Buttons for Mobile - HIDDEN on desktop */
.btn-end-turn-floating,
.btn-floating-left {
    display: none !important;
}


/* Player Stats HUD reposition */
#board-center-hud {
    margin-top: -15px;
    margin-bottom: 20px !important;
}

@keyframes interactionPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
        border-color: #2ecc71;
    }

    70% {
        box-shadow: 0 0 0 15px rgba(46, 204, 113, 0);
        border-color: #fff;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
        border-color: #2ecc71;
    }
}

@keyframes endTurnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
        border-color: #e74c3c;
    }

    70% {
        box-shadow: 0 0 0 20px rgba(231, 76, 60, 0);
        border-color: #fff;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
        border-color: #e74c3c;
    }
}

.landing-glow {
    animation: interactionPulse 1.5s infinite !important;
    z-index: 100 !important;
    border: 3px solid #2ecc71 !important;
    transform: scale(1.02);
    cursor: pointer !important;
}

.end-turn-glow {
    animation: endTurnPulse 1.2s infinite !important;
    z-index: 101 !important;
    border: 3px solid #e74c3c !important;
    cursor: pointer !important;
    position: relative;
}

.end-turn-glow::after {
    content: 'ÎNCHEIE RÂNDUL';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 102;
    pointer-events: none;
}

@media (max-width: 991px) {
    body.monopol-body {
        padding-top: 80px !important;
    }

    .container-fluid.monopol-wrapper {
        padding-left: 5px !important;
        padding-right: 5px !important;
        padding-top: 5px !important;
        width: 100% !important;
        overflow-x: hidden !important;
        display: block !important;
    }

    .monopol-board {
        grid-template-columns: 1.8fr repeat(9, 1fr) 1.8fr;
        grid-template-rows: 1.8fr repeat(9, 1fr) 1.8fr;
        max-width: 98%;
        width: 100%;
        aspect-ratio: 1 / 1;
        border-width: 3px;
        margin: 0 auto;
        box-sizing: border-box !important;
    }

    .square {
        font-size: 0.5rem;
    }

    .square-bar {
        height: 12px;
    }

    .square-price {
        font-size: 0.45rem;
    }

    .square-name {
        font-size: 0.48rem;
        line-height: 1;
        margin-top: 1px;
    }

    .square-icon {
        font-size: 0.8rem;
    }

    .dice-platform {
        transform: scale(0.65);
        gap: 10px !important;
    }

    .scene-container-mini {
        height: 80px !important;
    }

    .dice-result {
        font-size: 1.2rem;
        padding: 8px 15px;
    }
}

@media (max-width: 576px) {
    #setup-screen {
        margin: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }

    /* Fixed: Ensure board doesn't overflow on narrow screens (e.g. < 371px) */
    .monopol-board {
        display: grid !important;
        grid-template-columns: 1.8fr repeat(9, 1fr) 1.8fr !important;
        grid-template-rows: 1.8fr repeat(9, 1fr) 1.8fr !important;
        max-width: 95% !important;
        /* Changed from vw to % for better container fit */
        width: 95% !important;
        height: auto !important;
        /* height auto with aspect-ratio is safer */
        aspect-ratio: 1/1 !important;
        margin: 5px auto !important;
        border-width: 2px !important;
        border-radius: 8px !important;
        /* Slight radius for better look */
    }

    .square {
        font-size: 0.42rem !important;
    }

    .square-bar {
        height: 10px !important;
    }

    .square-name {
        font-size: 0.4rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .square-price {
        font-size: 0.38rem !important;
        margin-bottom: 0 !important;
    }

    .square-icon {
        font-size: 0.7rem !important;
    }

    /* Reposition Dice & HUD for mobile - Make it more prominent and 'above' list */
    .board-center {
        background: rgba(var(--monopol-bg-rgb, 20, 20, 25), 0.95) !important;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 50 !important;
    }

    .center-content {
        padding-top: 10px !important;
        justify-content: center !important;
    }

    /* Scale dice even smaller to fit the center better on mobile */
    .dice-platform {
        transform: scale(0.5) !important;
        gap: 5px !important;
    }

    .scene-container-mini {
        height: 60px !important;
    }

    #board-center-hud {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px !important;
        /* ELIMINĂ scale(0.6) și înlocuiește cu ceva mai mare */
        transform: scale(0.9) !important;
        margin-top: 5px !important;
        margin-bottom: 10px !important;
    }

    #board-center-hud .badge {
        padding: 3px 6px !important;
        font-size: 0.55rem !important;
    }

    #game-log {
        display: none;
        /* Hide log in the center on mobile to save space */
    }

    /* UI Improvements for buttons on mobile */
    .btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.85rem !important;
        border-radius: 12px !important;
    }

    .btn-lg {
        padding: 0.6rem 1.2rem !important;
        font-size: 1rem !important;
    }

    /* Floating Buttons for Mobile - RESTORE on mobile */
    .btn-end-turn-floating {
        display: block !important;
        position: absolute;
        bottom: 10px;
        right: 10px;
        z-index: 1000;
        padding: 12px 20px;
        border-radius: 15px;
    }

    .btn-floating-left {
        display: block !important;
        position: absolute;
        bottom: 10px;
        left: 10px;
        z-index: 1000;
        padding: 10px 15px;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(5px);
    }

    /* Stack reordering: Board first, then Controls */
    .order-1 {
        order: 2 !important;
    }

    .order-2 {
        order: 1 !important;
    }

    .order-3 {
        order: 3 !important;
    }

    /* Add a floating/lower prominent dice result if needed */
    .dice-result {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 200;
        background: var(--accent);
        color: white;
        box-shadow: 0 0 20px var(--accent-glow);
        border: none;
    }
}

@media (max-width: 390px) {
    .monopol-board {
        grid-template-columns: 2.5fr repeat(9, minmax(0, 1fr)) 2.5fr !important;
        grid-template-rows: 2.5fr repeat(9, minmax(0, 1fr)) 2.5fr !important;
        border-width: 1px !important;
    }

    #board-center-hud {
        transform: scale(0.8) !important;
        gap: 4px !important;
    }

    #board-center-hud .badge {
        min-width: 80px;
    }

    /* Banii pe mobil să fie totuși mari */
    .hud-player-money {
        font-size: 1rem !important;
    }

    .center-content {
        justify-content: center !important;
        padding: 2px !important;
        min-width: 0 !important;
    }

    .square {
        min-width: 0 !important;
        min-height: 0 !important;
    }

    .dice-platform {
        transform: scale(0.3) !important;
        gap: 2px !important;
    }

    .scene-container-mini {
        height: 30px !important;
        width: 100% !important;
    }
}

@media (max-width: 300px) {
    .monopol-board {
        grid-template-columns: 3.5fr repeat(9, minmax(0, 1fr)) 3.5fr !important;
        grid-template-rows: 3.5fr repeat(9, minmax(0, 1fr)) 3.5fr !important;
    }

    #board-center-hud {
        transform: scale(0.45);
        margin-top: -15px !important;
    }

    #board-center-hud .badge {
        font-size: 0.28rem !important;
        padding: 1px 2px !important;
    }

    .dice-platform {
        transform: scale(0.2) !important;
        gap: 1px !important;
    }

    .scene-container-mini {
        height: 20px !important;
    }

    .square-name {
        font-size: 0.25rem !important;
    }

    .square-price,
    .square-icon {
        display: none !important;
    }
}

.property-scroll {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.property-scroll::-webkit-scrollbar {
    width: 4px;
}

.property-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.inventory-item:active {
    transform: scale(0.98);
}

#game-area .glass-panel {
    display: flex;
    flex-direction: column;
    padding: 15px !important;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

/* Zonele de scroll din interiorul panourilor */


/* Scrollbar personalizat pentru panouri */
.property-scroll::-webkit-scrollbar,
#player-list::-webkit-scrollbar {
    width: 5px;
}

.property-scroll::-webkit-scrollbar-thumb,
#player-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Ajustare HUD Centru (Banii să fie vizibili pe tabla mare) */
#board-center-hud {
    margin-bottom: 10px !important;
}

#board-center-hud .badge {
    min-width: 120px;
    padding: 10px !important;
}

.hud-player-money {
    font-size: 1.3rem !important;
    /* Banii mult mai mari */
    font-weight: 800;
}

/* Pătrățelele de pe tablă se ajustează automat la mărime */
.square {
    font-size: 0.7rem;
    /* Puțin mai mare pentru text pe tablă mare */
}

/* Pionii pe tabla mare */
.player-token {
    width: 18px;
    /* Mărim și pionii */
    height: 18px;
    border: 2px solid #fff;
}

/* --- FIX PENTRU MOBIL --- */
@media (max-width: 991px) {
    .monopol-board {
        max-width: 98vw;
        max-height: 98vw;
    }

    #game-area .glass-panel {
        height: auto;
        /* Pe mobil revine la înălțime naturală */
        max-height: 500px;
        margin-bottom: 15px;
    }

    /* Pe mobil micșorăm HUD-ul ca să nu acopere tabla */
    #board-center-hud {
        transform: scale(0.8);
    }
}

/* Fix pentru Setup Screen (să nu aibă scroll la început) */
#setup-screen {
    max-width: 1000px;
    margin: 20px auto !important;
    padding: 30px !important;
}

.map-preview {
    height: 150px;
}