:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.8);
    --text-light: #f8fafc;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --board-bg: #cbd5e1;

    /* Board colors */
    --c-brown: #8b4513;
    --c-lightblue: #87ceeb;
    --c-pink: #ff69b4;
    --c-orange: #ffa500;
    --c-red: #ff0000;
    --c-yellow: #ffd700;
    --c-green: #008000;
    --c-darkblue: #00008b;
    --c-special: #475569;
}

/* ===== Auth Screen ===== */
.auth-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.auth-screen.hidden { display: none; }

.auth-container {
    width: 100%;
    max-width: 420px;
    animation: authFadeIn 0.5s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 5px;
    animation: authBounce 2s infinite;
}

@keyframes authBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-logo h1 {
    font-size: 2.8rem;
    color: var(--c-yellow);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    margin: 0;
}

.auth-logo p {
    color: #94a3b8;
    font-size: 1rem;
    margin-top: 5px;
}

.auth-form {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-form.hidden { display: none; }

.auth-input-group {
    margin-bottom: 16px;
}

.auth-input-group label {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 6px;
    font-weight: bold;
}

.auth-input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    direction: ltr;
    text-align: left;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--c-yellow);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.auth-input-group input::placeholder {
    color: #64748b;
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
    animation: authShake 0.4s ease;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    margin-bottom: 12px;
}

.auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.auth-btn-guest {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
}

.auth-btn-guest:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    gap: 15px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    color: #64748b;
    font-size: 0.85rem;
}

.auth-switch {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--c-yellow);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.auth-switch a:hover {
    color: #facc15;
    text-decoration: underline;
}

/* User Info Bar in Setup */
.user-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 8px 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.user-info-bar.hidden { display: none; }

#user-display-name {
    color: #c4b5fd;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.user-logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
}

.user-logout-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.hidden {
    display: none !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    /* Ù…Ù†Ø¹ ØªØ­Ø¯ÙŠØ¯ Ø§Ù„Ù†ØµÙˆØµ Ø¨Ø§Ù„Ø®Ø·Ø£ Ø£Ø«Ù†Ø§Ø¡ Ø§Ù„Ù„Ø¹Ø¨ */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at top right, #1e293b, #0f172a);
    overflow-x: hidden;
    overflow-y: auto;
    cursor: default;
}

.game-container {
    display: flex;
    flex-direction: row;
    direction: ltr;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #1e293b, #0f172a);
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* === ØªØ®Ø·ÙŠØ· Ø§Ù„Ù…ÙˆØ¨Ø§ÙŠÙ„ Ø§Ù„Ø±Ø¦ÙŠØ³ÙŠ === */
@media (max-width: 768px) {
    body {
        align-items: flex-start !important;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden !important;
    }

    .game-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 100vw !important;
        overflow: hidden !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    /* Ø§Ù„Ù‡ÙŠØ¯Ø± - Ù…ØµØºØ± Ø¹Ù„Ù‰ Ø§Ù„Ù…ÙˆØ¨Ø§ÙŠÙ„ */
    .sidebar .header {
        padding: 6px 10px !important;
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        border-bottom: 1px solid rgba(255, 215, 0, 0.3) !important;
    }

    .sidebar .header h1 {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }

    .sidebar .header p {
        display: none !important;
    }

    #account-coins-panel {
        margin-top: 0 !important;
        padding: 3px 10px !important;
        font-size: 0.8rem !important;
    }

    /* Ø§Ù„Ø³Ø§ÙŠØ¯Ø¨Ø§Ø± Ø§Ù„Ø£ÙŠÙ…Ù† - ØµÙ Ø£ÙÙ‚ÙŠ ÙÙŠ Ø§Ù„Ø£Ø¹Ù„Ù‰ */
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        flex-shrink: 0 !important;
        order: 1 !important;
        padding: 0 !important;
        gap: 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    /* Ù…Ø¹Ù„ÙˆÙ…Ø§Øª Ø§Ù„Ù„Ø§Ø¹Ø¨ÙŠÙ† - ØµÙ Ø£ÙÙ‚ÙŠ Ù…Ø¶ØºÙˆØ· */
    .players-info {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        padding: 6px 8px !important;
        border-radius: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        background: rgba(30, 41, 59, 0.9) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .player-card {
        min-width: 130px !important;
        max-width: 160px !important;
        padding: 6px 8px !important;
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }

    .player-name {
        font-size: 0.85rem !important;
    }

    .player-money {
        font-size: 1rem !important;
    }

    /* Ù„ÙˆØ­Ø© Ø§Ù„Ø¨ÙˆØ±Ø¯ - ØªÙ…Ù„Ø£ Ø§Ù„Ù…Ø³Ø§Ø­Ø© Ø§Ù„Ù…ØªØ§Ø­Ø© ÙˆÙ…ØªÙˆØ³Ø·Ø© */
    .board-container {
        flex: 1 !important;
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 4px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
        direction: ltr !important;
    }

    .board {
        width: min(98vw, calc(100dvh - 200px)) !important;
        height: min(98vw, calc(100dvh - 200px)) !important;
        max-width: none !important;
        max-height: none !important;
    }

    .square {
        font-size: 0.45rem !important;
        padding: 0px !important;
    }

    .square .name {
        font-size: 0.4rem !important;
        line-height: 1 !important;
    }

    .square .price {
        font-size: 0.4rem !important;
    }

    .sq-icon {
        font-size: 0.7rem !important;
        margin: 0 !important;
    }

    .corner .name {
        font-size: 0.55rem !important;
    }

    .logo {
        font-size: 2rem !important;
    }

    .card-area-chance,
    .card-area-community {
        width: 80px !important;
        height: 50px !important;
        font-size: 0.5rem !important;
        padding: 4px !important;
    }

    .token {
        width: 10px !important;
        height: 10px !important;
        border-width: 1px !important;
    }

    .buildings-container {
        font-size: 0.5rem !important;
    }

    /* === Ø§Ù„Ø³Ø§ÙŠØ¯Ø¨Ø§Ø± Ø§Ù„Ø£ÙŠØ³Ø± - overlay ÙƒØ§Ù…Ù„ Ø§Ù„Ø´Ø§Ø´Ø© === */
    .left-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        order: 3 !important;
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 60px !important;
        z-index: 1500 !important;
        background: rgba(15, 23, 42, 0.97) !important;
        backdrop-filter: blur(10px) !important;
        overflow-y: auto !important;
        padding: 15px 10px !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .left-sidebar.mobile-visible {
        display: flex !important;
    }

    /* === ÙˆØ¶Ø¹ Ø§Ù„ÙƒØ§Ø±Øª ÙÙ‚Ø· (Ø¥Ø®ÙØ§Ø¡ Ø§Ù„Ø³Ø¬Ù„) === */
    .left-sidebar.card-only-mode .header {
        display: none !important;
    }

    .left-sidebar.card-only-mode #mobile-log-close {
        display: none !important;
    }

    /* Ø³Ø¬Ù„ Ø§Ù„Ø£Ø­Ø¯Ø§Ø« Ø¹Ù„Ù‰ Ø§Ù„Ù…ÙˆØ¨Ø§ÙŠÙ„ */
    .left-sidebar .header {
        width: 100% !important;
        max-width: 400px !important;
        flex-shrink: 0 !important;
    }

    .left-sidebar #game-log {
        height: 200px !important;
    }

    /* === ÙƒØ§Ø±Øª Ø§Ù„ØªÙØ§ØµÙŠÙ„ - ØªØµÙ…ÙŠÙ… ÙƒÙ„Ø§Ø³ÙŠÙƒÙŠ ÙˆØ§Ø¶Ø­ === */
    .left-sidebar .arab-card {
        width: 100% !important;
        max-width: 340px !important;
        margin: 5px auto !important;
        border-width: 4px !important;
        border-color: #555 !important;
        border-radius: 4px !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.5) !important;
        flex-shrink: 0 !important;
    }

    .left-sidebar .arab-card-header {
        padding: 10px 15px !important;
        position: relative !important;
    }

    .left-sidebar .arab-card-header h2 {
        font-size: 1.4rem !important;
        margin-bottom: 2px !important;
    }

    .left-sidebar .arab-card-header h3 {
        font-size: 0.95rem !important;
    }

    .left-sidebar .arab-card-body {
        padding: 12px 15px !important;
    }

    .left-sidebar .arab-card-table td,
    .left-sidebar .arab-card-table th,
    .left-sidebar .arab-card-costs td {
        font-size: 0.9rem !important;
        padding: 4px 0 !important;
    }

    .left-sidebar .arab-card-table th {
        padding-bottom: 6px !important;
    }

    .left-sidebar .arab-divider {
        margin: 10px 0 !important;
    }

    .left-sidebar #hc-extra {
        margin: 12px 0 !important;
        font-size: 1.05rem !important;
        line-height: 1.4 !important;
    }

    /* Ø²Ø± Ø¥ØºÙ„Ø§Ù‚ Ø§Ù„ÙƒØ§Ø±Øª - ÙˆØ§Ø¶Ø­ ÙˆÙƒØ¨ÙŠØ± */
    #close-hc-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.3rem !important;
        background: rgba(239, 68, 68, 0.9) !important;
        border: 2px solid #fff !important;
        border-radius: 50% !important;
        color: #fff !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 20 !important;
        left: 8px !important;
        top: 8px !important;
    }

    /* Ù„ÙˆØ­Ø© Ø§Ù„ØªØ­ÙƒÙ… Ø§Ù„Ø¹Ø§Ø¦Ù…Ø© */
    .action-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: rgba(15, 23, 42, 0.97) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 2px solid var(--c-yellow) !important;
        padding: 8px 12px !important;
        z-index: 1000 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5) !important;
        order: 4 !important;
    }

    .dice-container {
        margin-bottom: 0 !important;
        gap: 4px !important;
    }

    .dice {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.3rem !important;
        border-radius: 8px !important;
    }

    .action-panel .btn {
        margin-bottom: 0 !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        width: auto !important;
        white-space: nowrap !important;
    }

    .action-panel #turn-status {
        display: none !important;
    }

    .action-panel #system-message {
        display: none !important;
    }

    /* Ù†ÙˆØ§ÙØ° Ø§Ù„Ø³Ø¬Ù† ÙˆØ§Ù„Ø´Ø±Ø§Ø¡ ÙˆØ§Ù„Ø¥Ø¯Ø§Ø±Ø© - ØªØ¸Ù‡Ø± ÙÙˆÙ‚ Ø´Ø±ÙŠØ· Ø§Ù„ØªØ­ÙƒÙ… */
    .action-panel #jail-controls,
    .action-panel #action-buttons-container,
    .action-panel #property-mgmt-panel {
        position: absolute !important;
        bottom: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(15, 23, 42, 0.98) !important;
        padding: 12px !important;
        border-radius: 12px 12px 0 0 !important;
        margin: 0 !important;
        border-top: 1px solid var(--c-yellow) !important;
        flex-direction: column !important;
    }

    /* Ø²Ø± ØªØ¨Ø¯ÙŠÙ„ Ø³Ø¬Ù„ Ø§Ù„Ø£Ø­Ø¯Ø§Ø« */
    #mobile-log-toggle {
        position: fixed;
        top: 8px;
        left: 8px;
        z-index: 2000;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(15, 23, 42, 0.9);
        border: 1.5px solid var(--c-yellow);
        color: var(--c-yellow);
        font-size: 1.1rem;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.4);
        backdrop-filter: blur(5px);
    }

    #mobile-log-toggle:active {
        transform: scale(0.9);
    }

    /* Ø²Ø± Ø¥ØºÙ„Ø§Ù‚ Ø§Ù„Ø³Ø¬Ù„ */
    #mobile-log-close {
        display: block !important;
        position: sticky;
        top: 0;
        z-index: 10;
        width: 100%;
        max-width: 400px;
        padding: 10px;
        background: rgba(239, 68, 68, 0.15);
        border: 1.5px solid #ef4444;
        border-radius: 10px;
        color: #ef4444;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        margin-bottom: 10px;
        text-align: center;
        flex-shrink: 0;
    }

    /* Ù…ÙˆØ¯Ø§Ù„Ø² Ø¹Ù„Ù‰ Ø§Ù„Ù…ÙˆØ¨Ø§ÙŠÙ„ */
    .modal-box {
        width: 92vw !important;
        max-width: 400px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding: 15px !important;
    }

    .auction-classic-container {
        flex-direction: column !important;
    }

    .auction-classic-card-side {
        border-left: none !important;
        border-bottom: 2px solid #166534 !important;
        padding: 10px !important;
    }

    .auction-classic-title {
        font-size: 3rem !important;
    }

    .auction-count-display {
        font-size: 5rem !important;
    }

    .auction-classic-panel {
        padding: 15px !important;
    }
}

/* Tablet Layout */
@media (min-width: 769px) and (max-width: 1250px) {
    .game-container {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        padding: 10px !important;
        padding-bottom: 100px !important;
        gap: 15px !important;
    }

    .sidebar, .left-sidebar, .board-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        padding: 10px !important;
        margin: 0 auto !important;
        overflow: visible !important;
        position: relative !important;
    }

    .board-container { order: 1 !important; }
    .sidebar { order: 2 !important; }
    .left-sidebar { order: 3 !important; }

    .board {
        width: min(90vw, 600px) !important;
        height: min(90vw, 600px) !important;
        max-width: 600px !important;
        max-height: 600px !important;
    }

    .square {
        font-size: 0.55rem !important;
        padding: 1px !important;
    }

    .logo {
        font-size: 2.5rem !important;
    }

    /* Ù„ÙˆØ­Ø© Ø§Ù„ØªØ­ÙƒÙ… Ø§Ù„Ø¹Ø§Ø¦Ù…Ø© Ù„Ù„ØªØ§Ø¨Ù„Øª */
    .action-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 2px solid var(--c-yellow) !important;
        padding: 10px 20px !important;
        z-index: 1000 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-around !important;
        gap: 10px !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5) !important;
    }

    .dice-container {
        margin-bottom: 0 !important;
        gap: 5px !important;
    }

    .dice {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.5rem !important;
    }

    .action-panel .btn {
        margin-bottom: 0 !important;
        padding: 8px 15px !important;
        font-size: 0.9rem !important;
        width: auto !important;
    }

    .action-panel #turn-status {
        display: none !important;
    }

    .action-panel #jail-controls,
    .action-panel #action-buttons-container,
    .action-panel #property-mgmt-panel {
        position: absolute !important;
        bottom: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(15, 23, 42, 0.98) !important;
        padding: 15px !important;
        border-radius: 15px 15px 0 0 !important;
        margin: 0 !important;
        border-top: 1px solid var(--c-yellow) !important;
    }
}

.sidebar,
.left-sidebar {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    padding: 10px;
    z-index: 100;
    direction: rtl !important;
    background: rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

/* ØªØ®ØµÙŠØµ Ø§Ù„Ø³ÙƒØ±ÙˆÙ„ Ø¨Ø§Ø± Ù„Ù„Ù‚ÙˆØ§Ø¦Ù… Ø§Ù„Ø¬Ø§Ù†Ø¨ÙŠØ© */
.sidebar::-webkit-scrollbar,
.left-sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb,
.left-sidebar::-webkit-scrollbar-thumb {
    background: rgba(250, 204, 21, 0.3);
    border-radius: 10px;
}

.board-container {
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-width: 0;
    direction: rtl !important;
}



.header,
.players-info,
.action-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.header h1 {
    font-size: 2.5rem;
    color: var(--c-yellow);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 5px;
    text-align: center;
}

.header p {
    text-align: center;
    color: #94a3b8;
}

.player-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-right: 4px solid var(--accent);
    transition: transform 0.3s;
}

.player-card.active {
    transform: scale(1.02);
    border-color: var(--c-yellow);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.player-name {
    font-weight: bold;
    font-size: 1.2rem;
}

.player-money {
    color: var(--success);
    font-weight: 900;
    font-size: 1.4rem;
}

/* Actions */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dice {
    font-size: 3rem;
    width: 60px;
    height: 60px;
    background: white;
    color: black;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s;
}

.dice.rolling {
    animation: roll 0.5s infinite linear;
}

@keyframes roll {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    margin-bottom: 10px;
}

.primary-btn {
    background: var(--accent);
}

.primary-btn:hover {
    background: var(--accent-hover);
}

.success-btn {
    background: var(--success);
}

.success-btn:hover {
    background: #059669;
}

.danger-btn {
    background: var(--danger);
}

.danger-btn:hover {
    background: #dc2626;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.turn-status {
    text-align: center;
    font-size: 1.1rem;
    margin-top: 10px;
    color: var(--c-yellow);
}

.hidden {
    display: none !important;
}

/* Board */
.board-container {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 10px;
}

.board {
    width: 100%;
    height: 100%;
    max-width: min(85vh, 100%, 800px);
    max-height: min(85vh, 100%, 800px);
    aspect-ratio: 1 / 1;
    background: #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 8px #1e293b, 0 0 0 12px #cbd5e1;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(9, minmax(0, 1fr)) minmax(0, 1.5fr);
    grid-template-rows: minmax(0, 1.5fr) repeat(9, minmax(0, 1fr)) minmax(0, 1.5fr);
    gap: 1px;
    background-color: #334155;
    border: 2px solid #0f172a;
    position: relative;
    overflow: hidden;
}



.board-center {
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    background: radial-gradient(circle, #f8fafc, #cbd5e1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 5rem;
    font-weight: 900;
    color: #b91c1c;
    text-shadow: 3px 3px 0px #fff, 5px 5px 10px rgba(0, 0, 0, 0.3);
    transform: rotate(-45deg);
    letter-spacing: -2px;
    z-index: 1;
}



.card-area-chance,
.card-area-community {
    position: absolute;
    width: 150px;
    height: 90px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #333;
    font-size: 0.8rem;
    padding: 10px;
    text-align: center;
    box-shadow:
        2px 2px 0 #fff,
        3px 3px 0 rgba(0, 0, 0, 0.1),
        5px 5px 0 #fff,
        6px 6px 0 rgba(0, 0, 0, 0.1);
}

.card-area-chance {
    top: 20%;
    left: 20%;
    transform: rotate(45deg);
    background: #ffedd5;
    border: 2px solid #f97316;
}

.card-area-community {
    bottom: 20%;
    right: 20%;
    transform: rotate(45deg);
    background: #dbeafe;
    border: 2px solid #2563eb;
}

.card-label {
    text-transform: uppercase;
}

.square {
    background: #f8fafc;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    font-size: 0.7rem;
    position: relative;
    cursor: pointer;
    transition: filter 0.2s ease-in-out;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.square.mortgaged {
    opacity: 0.6;
}

.square.mortgaged::after {
    content: "Ù…ÙŽØ±Ù’Ù‡ÙˆÙ†";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: rgba(185, 28, 28, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 10;
}

/* Trade Modal */
.trade-modal-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: right;
}

.trade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
}

.trade-select {
    background: #1e293b;
    color: white;
    border: 1px solid #334155;
    padding: 5px;
    border-radius: 4px;
    width: 60%;
}

.trade-input {
    background: #1e293b;
    color: white;
    border: 1px solid #334155;
    padding: 5px;
    border-radius: 4px;
    width: 40%;
}

/* Debt Manager Modal */
.debt-manager {
    border: 3px solid #ef4444 !important;
}

/* Tooltip styles */
.square .tooltip {
    visibility: hidden;
    background-color: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: all 0.2s ease-in-out;
    width: 140px;
    font-size: 0.85rem;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent);
}

.square:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.tooltip strong {
    color: var(--c-yellow);
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
}

.square .color-bar {
    height: 20%;
    width: 100%;
}

.square .name {
    font-weight: bold;
    padding: 1px;
    line-height: 1;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.square .price {
    font-weight: bold;
    color: #475569;
    padding-bottom: 2px;
}

.corner {
    background: #e2e8f0;
    justify-content: center;
}

.corner .name {
    font-size: 1rem;
    font-weight: 900;
}

.sq-icon {
    font-size: 1.5rem;
    margin: 2px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tokens */
.tokens-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    gap: 2px;
    padding: 5px;
}

.token {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    transition: all 0.4s ease-in-out;
}

/* Specific sides rotation */
.row-top {
    flex-direction: column-reverse;
}

.row-top .color-bar {
    height: 20%;
    border-bottom: 1px solid #ccc;
}

.row-bottom {
    flex-direction: column;
}

.row-bottom .color-bar {
    height: 20%;
    border-bottom: 1px solid #ccc;
}

.col-left {
    flex-direction: row-reverse;
}

.col-left .color-bar {
    width: 20%;
    height: 100%;
    border-left: 1px solid #ccc;
}

.col-left .name,
.col-left .price {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.col-right {
    flex-direction: row;
}

.col-right .color-bar {
    width: 20%;
    height: 100%;
    border-right: 1px solid #ccc;
}

.col-right .name,
.col-right .price {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Modals Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-box {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 20px;
    width: 320px;
    max-width: 95vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Arab Card Styles (Classic Bank El Haz) */
.arab-card {
    background-color: #f8fafc;
    border: 4px solid #ccc;
    padding: 0;
    width: 100%;
    max-width: 320px;
    color: #000;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}



.arab-card-header {
    background-color: #0000cc;
    color: #ffff00;
    padding: 8px 12px;
    border-bottom: 2px solid #000;
}

.arab-card-header h2 {
    margin: 0;
    font-size: 1.8rem;
    text-shadow: 1px 1px 2px #000;
}

.arab-card-header h3 {
    margin: 5px 0 0 0;
    font-size: 1.2rem;
    color: #fff;
}

.arab-card-body {
    padding: 15px;
}

.arab-card-table,
.arab-card-costs {
    width: 100%;
    text-align: right;
    border-collapse: collapse;
}

.arab-card-table td,
.arab-card-table th,
.arab-card-costs td {
    padding: 4px 0;
    font-weight: bold;
    font-size: 1rem;
}

.arab-card-table th {
    color: #0000cc;
    border-bottom: 2px solid #0000cc;
    padding-bottom: 5px;
}

.arab-card-table td:first-child,
.arab-card-costs td:first-child {
    color: #cc0000;
    text-align: left;
}

.arab-divider {
    border: 0;
    border-top: 2px solid #000;
    margin: 15px 0;
}


/* Action Card (Chance/Community) */
.action-card {
    background: #fff9c4;
    color: #b71c1c;
    border: 4px solid #f57f17;
}

.action-card h2 {
    margin-bottom: 15px;
    font-size: 2rem;
    color: #f57f17;
}

.action-card-desc {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: bold;
    color: #333;
}

/* Auction Classic Design */
.auction-classic-modal {
    width: 800px !important;
    max-width: 95vw !important;
    padding: 0 !important;
    overflow-y: auto;
    max-height: 90vh;
    background: #d9f99d !important;
    border: 3px solid #166534 !important;
}

.auction-classic-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
}

/* Buildings on Board */
.buildings-container {
    position: absolute;
    top: 2px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 2px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 10;
}

.house {
    color: #16a34a;
    text-shadow: 0 0 2px #fff;
}

.hotel {
    color: #dc2626;
    font-size: 1rem;
    text-shadow: 0 0 2px #fff;
}

/* Confetti & Win Screen */
.win-screen {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 3px solid var(--c-yellow);
    box-shadow: 0 0 50px rgba(250, 204, 21, 0.3);
    z-index: 1000;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 999;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(105vh) rotate(360deg);
    }
}

/* Management Panel Styling */
.mgmt-panel .btn {
    font-size: 0.9rem;
    padding: 8px;
    transition: all 0.2s;
}

.mgmt-panel .btn:hover:not(:disabled) {
    transform: translateX(-5px);
}

.auction-classic-card-side {
    flex: 1;
    background: #fdfdfd;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-left: 2px solid #166534;
}

.auction-classic-panel {
    flex: 1.2;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    color: #166534;
}

.auction-classic-title {
    font-size: 5rem;
    color: #b91c1c;
    font-weight: 900;
    margin-bottom: 10px;
}

.auction-classic-timer-box {
    margin: 20px 0;
}

.auction-classic-timer-box p {
    font-size: 1.5rem;
    font-weight: bold;
}

.auction-count-display {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    margin: 10px 0;
    color: #000;
}

.auction-classic-footer {
    color: #b91c1c;
    font-weight: bold;
    font-size: 1.1rem;
}

.auction-classic-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.classic-bid-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #166534;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.classic-bid-button:active {
    transform: scale(0.9);
}

.inner-green {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, #22c55e, #166534);
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.5);
}

.auction-classic-info {
    margin-top: 20px;
    font-size: 1.4rem;
    font-weight: bold;
    width: 100%;
}

.bid-val {
    color: #b91c1c;
    font-size: 1.8rem;
}

.bidder-val {
    font-size: 1.8rem;
    color: #000;
}
