/*
 * The Mels Live - Authentic High-Fidelity UI Styling
 * Clean, modern Sims 4 glassmorphic aesthetic:
 * - Oceanic blues, fresh greens, glowing Plumbobs, and crisp white typography
 */

:root {
    --sims-blue-dark: #0f2438;
    --sims-blue-panel: rgba(18, 44, 70, 0.88);
    --sims-blue-card: rgba(25, 60, 95, 0.75);
    --sims-border: rgba(120, 180, 240, 0.35);
    --sims-plumbob-green: #2ecc71;
    --sims-simoleon-gold: #f39c12;
    --sims-white: #ffffff;
    --sims-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--sims-blue-dark);
    font-family: var(--sims-font);
    color: var(--sims-white);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#canvasContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    touch-action: none;
}

/* ==========================================================================
/* ==========================================================================
   TOP CONTROLS & CAMERA TOOLBAR
   ========================================================================== */

/* Current Lot HUD Banner */
/* ==========================================================================
   TOP HEADER & TOOLBAR LAYOUT (NO-OVERLAP GUARANTEE)
   ========================================================================== */
.game-header {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    z-index: 20;
    pointer-events: none;
}

.current-lot-hud {
    position: relative;
    top: 0;
    left: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sims-blue-panel);
    border: 1.5px solid var(--sims-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 6px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    color: #fff;
    pointer-events: auto;
}

.lot-pin-icon {
    font-size: 1.2rem;
}

.lot-hud-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lot-hud-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lot-hud-name {
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--sims-white);
    white-space: nowrap;
}

.lot-hud-owner {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--sims-text-muted);
    white-space: nowrap;
}

.lot-hud-details-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.lot-hud-separator {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.72rem;
}

.tso-simtime-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 10px;
    padding: 1px 7px;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.tso-phase-icon {
    font-size: 0.82rem;
    filter: drop-shadow(0 0 4px rgba(255, 200, 50, 0.5));
}

.tso-time-text {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
}

.tso-day-pill {
    color: #7dd3fc;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
}

.top-toolbar {
    position: relative;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    pointer-events: auto;
    max-width: calc(100% - 350px);
}

.top-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    max-width: 100%;
}

.top-toolbar-row.utility-row {
    gap: 8px;
}

.top-toolbar-row.modes-row {
    gap: 4px;
    position: relative;
}

.primary-modes-dock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(12, 24, 42, 0.75);
    border: 1.5px solid rgba(80, 160, 220, 0.3);
    border-radius: 20px;
    padding: 3px 6px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.primary-modes-dock .sims-btn.active-mode {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.hud-more-btn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    color: #e2e8f0 !important;
}

.hud-more-btn:hover,
.hud-more-btn.active {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: #38bdf8 !important;
}

.hud-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 250;
    display: grid;
    grid-template-columns: repeat(3, 140px);
    gap: 6px;
    background: rgba(10, 22, 40, 0.95);
    border: 1.5px solid rgba(80, 160, 220, 0.4);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 180, 216, 0.2);
    backdrop-filter: blur(16px);
    animation: fadeInSlideDown 0.18s ease-out;
}

@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Suppress duplicate dynamically injected toolbar items since they are already integrated into More menu */
#topToolbarUtilityRow .pet-group,
#topToolbarUtilityRow .fishing-group,
#topToolbarUtilityRow .relationships-group,
#topToolbarModesRow > #shopBusinessBtn {
    display: none !important;
}

.toolbar-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#topToolbar .sims-btn {
    padding: 5px 9px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 14px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    line-height: 1.2;
    transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

#topToolbar .sims-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

#topToolbar .sims-btn:active {
    transform: translateY(1px);
}

@media (max-width: 900px) {
    .game-header {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .current-lot-hud {
        align-self: flex-start;
    }
    .top-toolbar {
        max-width: 100%;
        align-items: flex-start;
    }
    .top-toolbar-row {
        justify-content: flex-start;
    }
}

.camera-group {
    background: rgba(15, 30, 48, 0.65);
    border: 1px solid rgba(80, 160, 220, 0.25);
    border-radius: 20px;
    padding: 2px 4px;
    backdrop-filter: blur(8px);
}

.cam-ctrl-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.15s ease;
}

.cam-ctrl-btn:hover {
    background: rgba(46, 204, 113, 0.3) !important;
    color: var(--sims-plumbob-green) !important;
    transform: scale(1.1);
}

.sims-btn {
    background: var(--sims-blue-panel);
    border: 1.5px solid var(--sims-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--sims-white);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.sims-btn:hover {
    background: rgba(35, 85, 135, 0.95);
    border-color: var(--sims-plumbob-green);
    transform: translateY(-1px);
}

/* ==========================================================================
   BOTTOM MASTER HUD (Sims 4 Style)
   ========================================================================== */
#bottomHUD {
    position: absolute;
    bottom: 14px;
    left: 18px;
    right: 18px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

body.build-mode-active #bottomHUD {
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px);
}

/* Left Cluster: Side-by-side Profile Card & Action Queue (No vertical overlap) */
/* The cluster and stack are mostly empty space over the world: let clicks through to Sims and
   furniture, and only catch them on the visible cards (#86: a 640x355 box swallowed world clicks) */
.sim-hud-left-cluster {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100vw - 340px);
}

.sim-profile-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.hud-whims-container,
.hud-moodlets-tray,
.action-queue-bar {
    pointer-events: none;
}

.hud-whims-container > *,
.hud-moodlets-tray > *,
.action-queue-bar > * {
    pointer-events: auto;
}

/* Active Sim Portrait Card (Bottom-Left) */
.sim-profile-card {
    pointer-events: auto;
    background: var(--sims-blue-panel);
    border: 2px solid var(--sims-border);
    backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 10px 18px 10px 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.sim-portrait-wrap {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid var(--sims-plumbob-green);
    background: radial-gradient(circle, #256598 0%, #102d45 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.45);
    transition: transform 0.2s;
}

.sim-portrait-wrap:hover {
    transform: scale(1.08);
}

.plumbob-icon-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    font-size: 1.1rem;
    filter: drop-shadow(0 0 4px #2ecc71);
}

.sim-info-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}

.sim-info-col .hud-career-chip,
.sim-info-col .sim-diamonds-badge,
.sim-info-col .hud-phone-btn {
    display: inline-flex !important;
    width: fit-content !important;
    max-width: 150px;
    padding: 2px 8px !important;
    font-size: 0.7rem !important;
    border-radius: 12px !important;
    margin: 1px 0 !important;
}

.sim-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.sim-emotion-badge {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--sims-plumbob-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sim-wallet {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sims-simoleon-gold);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   ACTIVE ACTIVITY CARD & ACTION QUEUE BAR (THE SIMS STYLE)
   ========================================================================== */
.action-queue-bar {
    pointer-events: none; /* its cards catch clicks; the empty bar doesn't */
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    min-height: 46px;
}

.active-activity-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(16, 44, 74, 0.95), rgba(8, 22, 38, 0.95));
    border: 2px solid var(--sims-plumbob-green);
    box-shadow: 0 4px 18px rgba(46, 204, 113, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 5px 12px 5px 6px;
    animation: pulseActiveActivity 2s infinite ease-in-out;
}

@keyframes pulseActiveActivity {
    0%, 100% { box-shadow: 0 4px 18px rgba(46, 204, 113, 0.35); }
    50% { box-shadow: 0 4px 24px rgba(46, 204, 113, 0.7); }
}

.active-activity-icon-slot {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.activity-spinner-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--sims-plumbob-green);
    border-right-color: rgba(85, 239, 196, 0.65);
    animation: spinRing 1.5s linear infinite;
}

@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.active-activity-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 100px;
    max-width: 160px;
}

.activity-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.activity-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.activity-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #55efc4);
    border-radius: 3px;
    transition: width 0.12s ease-out;
}

.activity-cancel-btn {
    background: rgba(231, 76, 60, 0.25);
    border: 1px solid rgba(231, 76, 60, 0.6);
    color: #ff7675;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s;
    margin-left: 2px;
}

.activity-cancel-btn:hover {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.15);
}

.action-slot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(18, 44, 70, 0.9);
    border: 2px solid var(--sims-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: transform 0.2s;
}

.action-slot.queued {
    border-color: rgba(255, 255, 255, 0.35);
}

.action-slot.queued:hover {
    transform: scale(1.1);
    border-color: #f39c12;
}

.action-slot.queued:hover::after {
    content: "✕";
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Needs Motives Panel (Bottom-Right) */
.needs-panel {
    pointer-events: auto;
    background: var(--sims-blue-panel);
    border: 2px solid var(--sims-border);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 12px 18px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 280px;
}

.needs-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #a4c8e8;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 4px;
}

.need-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    padding: 3px 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.need-row:hover {
    background: rgba(46, 204, 113, 0.18);
    transform: translateX(3px);
}

.need-row:hover .need-label {
    color: #2ecc71;
    font-weight: 700;
}

.need-row:active {
    transform: scale(0.97);
}

.need-label {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 80px;
}

.need-track {
    flex: 1;
    height: 9px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.need-fill {
    height: 100%;
    width: 80%;
    background-color: var(--sims-plumbob-green);
    border-radius: 5px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

/* ==========================================================================
   CIRCULAR FLOATING PIE MENU
   ========================================================================== */
#pieMenuContainer {
    display: none;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    z-index: 50;
    pointer-events: auto;
}

#pieMenuContainer.active {
    display: block;
    animation: popIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popIn {
    from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.pie-center-disc {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88px;
    height: 88px;
    background: var(--sims-blue-panel);
    border: 2px solid var(--sims-plumbob-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 0 16px rgba(46, 204, 113, 0.4);
    z-index: 2;
}

.pie-slice-btn {
    position: absolute;
    width: 90px;
    height: 44px;
    background: var(--sims-blue-card);
    border: 1.5px solid var(--sims-border);
    backdrop-filter: blur(8px);
    border-radius: 22px;
    color: var(--sims-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
    z-index: 3;
}

.pie-slice-btn small {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.pie-slice-btn:hover {
    background: #1d70b8;
    border-color: var(--sims-plumbob-green);
    transform: scale(1.1);
}

/* ==========================================================================
   MULTIPLAYER CHAT & SYSTEM LOG BOX (TABBED & COLLAPSIBLE)
   ========================================================================== */
/* ==========================================================================
   MULTIPLAYER CHAT & SYSTEM LOG BOX (DRAGGABLE & RESIZABLE)
   ========================================================================== */
#chatContainer {
    position: absolute;
    bottom: 135px; /* Sits cleanly above the profile card while leaving clear headroom for directive HUD */
    left: 18px;
    width: 340px;
    height: 190px;
    min-width: 260px;
    max-width: min(800px, 95vw);
    min-height: 130px;
    max-height: min(650px, 85vh);
    background: rgba(14, 34, 54, 0.94);
    border: 1.5px solid var(--sims-border);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 8px 10px 10px;
    z-index: 55; /* Higher than #bottomHUD (20) to guarantee it never goes underneath */
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    pointer-events: auto;
    user-select: text;
}

#chatContainer.dragging {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 16px rgba(9, 132, 227, 0.6);
    border-color: #74b9ff;
    transition: none !important;
}

#chatContainer.collapsed {
    height: 38px !important;
    min-height: 38px !important;
    overflow: hidden;
    padding-bottom: 4px;
    background: rgba(14, 34, 54, 0.85);
}

#chatContainer.collapsed .chat-body,
#chatContainer.collapsed .chat-resize-handle {
    display: none !important;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.chat-header:active,
.chat-header.dragging {
    cursor: grabbing;
}

.chat-drag-handle {
    font-size: 1.1rem;
    color: #7f8c8d;
    padding: 0 4px 0 0;
    cursor: grab;
    user-select: none;
    transition: color 0.15s;
}

.chat-header:hover .chat-drag-handle {
    color: #55efc4;
}

.chat-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
}

.chat-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a4b0be;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.chat-tab-btn.active {
    color: #fff;
    background: rgba(9, 132, 227, 0.35);
    border-color: rgba(116, 185, 255, 0.5);
    box-shadow: 0 0 8px rgba(9, 132, 227, 0.4);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-ctrl-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    color: #dfe6e9;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.chat-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    transform: scale(1.1);
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 6px;
}

#chatMessages {
    flex: 1;
    min-height: 60px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.78rem;
    padding-right: 4px;
}

#chatMessages::-webkit-scrollbar {
    width: 4px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.chat-entry {
    line-height: 1.35;
    word-break: break-word;
    display: flex;
    gap: 5px;
}

.chat-entry strong {
    color: #5dade2;
    flex-shrink: 0;
}

.chat-entry.msg-system strong {
    color: #f1c40f;
}

.chat-entry.msg-system span {
    color: #dfe6e9;
}

.chat-entry.msg-chat strong {
    color: #2ecc71;
}

#chatForm {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--sims-border);
    color: #fff;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.2s;
}

#chatInput:focus {
    border-color: var(--sims-plumbob-green);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

.chat-send-btn {
    padding: 4px 12px !important;
    font-size: 0.75rem !important;
    background: linear-gradient(135deg, #0984e3, #00cec9) !important;
    border-color: #55efc4 !important;
}

.chat-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    user-select: none;
    text-align: center;
    line-height: 14px;
    touch-action: none;
    transition: color 0.15s;
}

.chat-resize-handle:hover {
    color: #55efc4;
}

/* ==========================================================================
   CHARACTER CUSTOMIZER MODAL
   ========================================================================== */
.sims-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 15, 25, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sims-modal.active {
    display: flex !important;
    z-index: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--sims-blue-panel);
    border: 2px solid var(--sims-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 10px;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sims-plumbob-green);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    color: #a4c8e8;
}

.form-group input, .form-group select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--sims-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    outline: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* ==========================================================================
   TITLE SCREEN OVERLAY & AUTHENTICATION STYLING
   ========================================================================== */
.title-screen {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 40%, rgba(20, 55, 90, 0.85) 0%, rgba(6, 18, 32, 0.97) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.title-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.title-content-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 520px;
    width: 90%;
    padding: 40px 30px;
    border-radius: 28px;
    background: rgba(18, 44, 75, 0.7);
    border: 1.5px solid rgba(130, 200, 255, 0.35);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(46, 204, 113, 0.15);
    animation: titleCardPop 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes titleCardPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Iconic Animated 3D-styled Plumbob */
.title-plumbob-container {
    position: relative;
    width: 60px;
    height: 90px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-plumbob-gem {
    width: 44px;
    height: 74px;
    background: linear-gradient(135deg, #a8ff78 0%, #2ecc71 45%, #15803d 100%);
    clip-path: polygon(50% 0%, 100% 35%, 50% 100%, 0% 35%);
    filter: drop-shadow(0 0 16px rgba(46, 204, 113, 0.85));
    animation: plumbobFloat 2.8s ease-in-out infinite;
}

@keyframes plumbobFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 16px rgba(46, 204, 113, 0.75));
    }
    50% {
        transform: translateY(-12px) rotate(4deg) scale(1.05);
        filter: drop-shadow(0 0 26px rgba(46, 204, 113, 0.95));
    }
}

.title-plumbob-shadow {
    width: 32px;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    margin-top: 6px;
    animation: plumbobShadow 2.8s ease-in-out infinite;
}

@keyframes plumbobShadow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(0.7); opacity: 0.3; }
}

.title-game-logo {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-live-badge {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 1.5px;
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.6);
}

.title-tagline {
    font-size: 0.88rem;
    color: #b0d4f1;
    margin-bottom: 22px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.title-account-status {
    background: rgba(10, 30, 50, 0.6);
    border: 1px solid rgba(130, 200, 255, 0.25);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cde4f7;
    margin-bottom: 24px;
}

.title-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 26px;
}

.sims-title-btn {
    width: 100%;
    padding: 13px 20px;
    background: rgba(22, 55, 90, 0.9);
    border: 1.5px solid var(--sims-border);
    border-radius: 24px;
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transition: all 0.22s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.sims-title-btn:hover {
    background: rgba(35, 90, 145, 0.95);
    border-color: var(--sims-plumbob-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(46, 204, 113, 0.25);
}

.sims-title-btn.primary-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: #55efc4;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.45);
}

.sims-title-btn.primary-btn:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #55efc4 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px rgba(46, 204, 113, 0.6);
}

.title-footer-notes {
    font-size: 0.72rem;
    color: #7da5c9;
}

/* Authentication Modal Upgrades */
.auth-modal-card {
    max-width: 440px;
}

.auth-tabs-header {
    display: flex;
    gap: 12px;
}

.auth-tab-btn {
    background: transparent;
    border: none;
    color: #92b8dc;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    color: var(--sims-plumbob-green);
    border-bottom-color: var(--sims-plumbob-green);
}

.auth-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 14px;
    text-align: center;
}

.auth-link-btn {
    align-self: center;
    background: none;
    border: none;
    color: var(--sims-plumbob-green);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 6px;
}

.auth-link-btn:hover {
    filter: brightness(1.2);
}

.auth-view-title {
    margin: 0;
    font-size: 1.05rem;
}

.auth-view-hint {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
    line-height: 1.4;
}

.optional-label {
    font-weight: normal;
    opacity: 0.7;
    font-size: 0.75rem;
}

.auth-alert.info {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.55);
    color: #bfe3ff;
}

.auth-alert.error {
    background: rgba(231, 76, 60, 0.25);
    border: 1px solid rgba(231, 76, 60, 0.6);
    color: #ff9999;
}

.auth-alert.success {
    background: rgba(46, 204, 113, 0.25);
    border: 1px solid rgba(46, 204, 113, 0.6);
    color: #abffcb;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.primary-submit-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--sims-plumbob-green);
    border-color: #27ae60;
    font-size: 0.95rem;
    font-weight: 700;
    justify-content: center;
    border-radius: 14px;
}

.primary-submit-btn:hover:not(:disabled) {
    background: #27ae60;
    border-color: #55efc4;
}

.primary-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==========================================================================
   NEIGHBORHOOD WORLD MAP & ONBOARDING STYLING
   ========================================================================== */
.neighborhood-overlay {
    position: fixed;
    inset: 0;
    z-index: 350;
    background: radial-gradient(circle at 50% 15%, #18426d 0%, #07192d 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.neighborhood-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none !important;
}

.neighborhood-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 20px 30px;
    box-sizing: border-box;
}

.neighborhood-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1.5px solid rgba(130, 200, 255, 0.25);
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.neighborhood-title-group h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.neighborhood-subtitle {
    font-size: 0.82rem;
    color: #a0cbf1;
}

.neighborhood-funds-chip {
    background: rgba(10, 30, 50, 0.85);
    border: 1.5px solid #f39c12;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(243, 156, 18, 0.25);
}

.neighborhood-funds-chip strong {
    color: #f39c12;
    font-size: 1.05rem;
}

/* Onboarding Guide Banner */
.onboarding-guide-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.35) 0%, rgba(41, 128, 185, 0.35) 100%);
    border: 1.5px solid rgba(46, 204, 113, 0.6);
    padding: 12px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    animation: bannerPulse 3s ease-in-out infinite alternate;
}

@keyframes bannerPulse {
    from { border-color: rgba(46, 204, 113, 0.4); }
    to { border-color: rgba(85, 239, 196, 0.9); }
}

.onboarding-icon {
    font-size: 1.8rem;
}

.onboarding-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.88rem;
    color: #e2f1fd;
}

/* District Filter Tabs */
.district-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
    min-height: 38px;
}

.district-tab {
    background: rgba(15, 38, 65, 0.8);
    border: 1px solid var(--sims-border);
    color: #b0d4f5;
    padding: 7px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.district-tab:hover {
    background: rgba(30, 75, 125, 0.9);
    color: #ffffff;
    border-color: #55efc4;
}

.district-tab.active {
    background: var(--sims-plumbob-green);
    border-color: #55efc4;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

/* 20-Lot Grid Container */
.neighborhood-grid-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.neighborhood-lots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding-bottom: 24px;
}

/* Individual Lot Card */
.lot-card {
    background: rgba(18, 44, 75, 0.75);
    border: 1.5px solid rgba(130, 200, 255, 0.25);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lot-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--sims-plumbob-green);
    box-shadow: 0 12px 30px rgba(46, 204, 113, 0.25);
}

.lot-card.owned-by-me {
    border-color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
}

.lot-card.affordable {
    border-color: rgba(46, 204, 113, 0.5);
}

.lot-card.expensive {
    opacity: 0.85;
}

.lot-card-hero {
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 12px;
    position: relative;
}

.district-outskirts {
    background: linear-gradient(135deg, #795548 0%, #2e7d32 100%);
}

.district-suburbs {
    background: linear-gradient(135deg, #27ae60 0%, #2980b9 100%);
}

.district-hilltop {
    background: linear-gradient(135deg, #8e44ad 0%, #2c3e50 100%);
}

.district-civic {
    background: linear-gradient(135deg, #2c3e50 0%, #d35400 100%);
}

.lot-card-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.lot-card-badge.for-sale-affordable {
    background: rgba(46, 204, 113, 0.9);
    color: #ffffff;
}

.lot-card-badge.for-sale-expensive {
    background: rgba(52, 73, 94, 0.85);
    color: #bdc3c7;
}

.lot-card-badge.my-home {
    background: #2ecc71;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.8);
}

.lot-card-badge.community {
    background: #2980b9;
    color: #ffffff;
}

.lot-card-badge.resident {
    background: #e67e22;
    color: #ffffff;
}

.lot-district-chip {
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    color: #e2f1fd;
}

.lot-card-content {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.lot-card-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
}

.lot-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
}

.lot-card-desc {
    font-size: 0.76rem;
    color: #9ac2e6;
    line-height: 1.35;
    flex: 1;
    margin: 4px 0;
}

.lot-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    margin-top: 4px;
}

.lot-card-footer strong {
    color: #f39c12;
    font-size: 0.92rem;
}

/* Inspector Modal Styling */
.lot-modal-card {
    max-width: 480px;
}

.lot-hero-graphic {
    height: 110px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 12px;
}

.lot-badge-pill {
    background: rgba(0, 0, 0, 0.55);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    color: #fff;
}

.lot-graphic-center-emblem {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.lot-graphic-big-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.lot-graphic-size-pill {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #f1f5f9;
}

.lot-description-text {
    font-size: 0.86rem;
    color: #b8d6f2;
    line-height: 1.4;
    margin-bottom: 14px;
}

.lot-financial-box {
    background: rgba(10, 25, 45, 0.8);
    border: 1px solid var(--sims-border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.fin-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    color: #c7e0f8;
}

.fin-row.total-row {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 6px;
    font-weight: 700;
}

.lot-ownership-info {
    font-size: 0.84rem;
    color: #92b8dc;
    margin-bottom: 14px;
}

.lot-action-buttons {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   ONBOARDING DIRECTIVE HUD & QUEST PROGRESSION
   ========================================================================== */
#onboardingDirectiveHUD {
    position: fixed;
    top: 76px;
    left: 20px;
    right: auto;
    bottom: auto;
    margin: 0;
    transform: none !important;
    z-index: 260; /* Higher than #neighborhoodOverlay (z-index 250) */
    pointer-events: auto;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    max-width: 380px;
    width: calc(100vw - 40px);
    box-sizing: border-box;
}

.directive-card {
    background: rgba(14, 34, 61, 0.92);
    border: 1.5px solid rgba(85, 239, 196, 0.55);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(46, 204, 113, 0.25);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #ffffff;
    box-sizing: border-box;
    animation: directiveFadeIn 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    max-height: 250px;
    overflow-y: auto;
}

@keyframes directiveFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 500px) {
    #onboardingDirectiveHUD {
        left: 12px;
        top: 70px;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}

.directive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.directive-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.65);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #55efc4;
}

.directive-pulse-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ecc71;
    animation: directivePulse 1.8s infinite;
}

@keyframes directivePulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 12px #55efc4; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.directive-header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.directive-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8d6f2;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.directive-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.directive-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.directive-title-row {
    display: flex;
    flex-direction: column;
}

.directive-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.directive-subtitle {
    font-size: 0.76rem;
    font-weight: 700;
    color: #82c8ff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.directive-desc {
    font-size: 0.84rem;
    color: #d2e4f7;
    line-height: 1.4;
    margin: 2px 0 4px;
}

.directive-hint-box {
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid #f39c12;
    padding: 6px 10px;
    border-radius: 4px 8px 8px 4px;
    font-size: 0.76rem;
    color: #ffd166;
    display: flex;
    gap: 6px;
    align-items: center;
}

.directive-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

.directive-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.22) 0%, rgba(230, 126, 34, 0.22) 100%);
    border: 1px solid rgba(243, 156, 18, 0.55);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #f1c40f;
    align-self: flex-start;
}

.directive-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.directive-progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 180, 216, 0.22);
    border: 1px solid rgba(0, 180, 216, 0.55);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #48cae4;
    align-self: flex-start;
}

.directive-action-btn {
    width: 100%;
    padding: 9px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(46, 204, 113, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.directive-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.65);
}

.directive-card.minimized {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: 20px;
}

.directive-card.minimized .directive-step-pill {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #55efc4;
}

.directive-card.minimized .minimized-title {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 700;
}

.directive-card.completed {
    background: rgba(22, 60, 40, 0.92);
    border-color: #2ecc71;
}

.directive-completed-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.directive-completed-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.directive-completed-text strong {
    font-size: 0.95rem;
    color: #55efc4;
}

.directive-completed-text small {
    font-size: 0.74rem;
    color: #a8e6cf;
}

/* Starter recommended pulse in Neighborhood grid */
.lot-card.starter-recommended {
    border: 2px solid #2ecc71;
    box-shadow: 0 0 16px rgba(46, 204, 113, 0.45);
    animation: starterPulse 2s infinite ease-in-out;
}

@keyframes starterPulse {
    0% { box-shadow: 0 0 12px rgba(46, 204, 113, 0.35); }
    50% { box-shadow: 0 0 24px rgba(46, 204, 113, 0.75); border-color: #55efc4; }
    100% { box-shadow: 0 0 12px rgba(46, 204, 113, 0.35); }
}

/* ==========================================================================
   BUILD & BUY MODE STYLING
   ========================================================================== */
.buy-modal-card {
    max-width: 860px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.buy-header-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.buy-header-subtitle {
    font-size: 0.78rem;
    color: #9ac2e6;
}

.buy-funds-badge {
    background: rgba(14, 34, 61, 0.85);
    border: 1px solid #f39c12;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    display: flex;
    gap: 6px;
    align-items: center;
}

.buy-funds-badge strong {
    color: #f39c12;
    font-size: 0.95rem;
}

.buy-category-tabs {
    display: flex;
    gap: 8px;
    margin: 14px 0;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
    min-height: 38px;
}

.buy-tab {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #d2e4f7;
    padding: 6px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.buy-tab:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.buy-tab.active {
    background: linear-gradient(135deg, #e67e22, #d35400);
    border-color: #f39c12;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.buy-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: minmax(290px, auto);
    align-content: start;
    gap: 16px;
    overflow-y: auto;
    max-height: 58vh;
    padding-right: 8px;
    flex: 1;
    min-height: 240px;
}

.buy-item-card {
    background: rgba(14, 34, 61, 0.85);
    border: 1.5px solid rgba(130, 200, 255, 0.25);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 290px;
    height: 100%;
    transition: all 0.22s;
}

.buy-item-card:hover {
    transform: translateY(-3px);
    border-color: #55efc4;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.25);
}

.buy-item-card.unaffordable {
    opacity: 0.75;
}

.buy-card-icon-hero {
    height: 80px;
    min-height: 80px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(20, 50, 85, 0.85), rgba(10, 30, 55, 0.95));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.buy-item-icon {
    font-size: 2.2rem;
}

.buy-price-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 800;
}

.buy-price-tag.green {
    background: rgba(46, 204, 113, 0.25);
    border: 1px solid #2ecc71;
    color: #55efc4;
}

.buy-price-tag.red {
    background: rgba(231, 76, 60, 0.25);
    border: 1px solid #e74c3c;
    color: #ff7675;
}

.buy-card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 0 auto;
}

.buy-card-title {
    font-size: 0.92rem;
    color: #ffffff;
    font-weight: 700;
}

.buy-card-motive {
    font-size: 0.74rem;
    font-weight: 700;
    color: #55efc4;
}

.buy-card-desc {
    font-size: 0.74rem;
    color: #b8d6f2;
    line-height: 1.35;
    flex: 1;
    margin: 2px 0 6px;
}

.buy-select-btn {
    margin-top: auto;
    width: 100%;
    padding: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 10px;
    justify-content: center;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #55efc4;
}

.buy-select-btn:disabled {
    background: rgba(52, 73, 94, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    color: #95a5a6;
    cursor: not-allowed;
}

.buy-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    margin-top: 10px;
}

.buy-hint {
    font-size: 0.76rem;
    color: #ffd166;
}

/* Placement Mode Floating HUD */
.placement-controls-hud {
    position: fixed;
    top: 72px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.placement-hud-card {
    background: rgba(14, 34, 61, 0.94);
    border: 2px solid #55efc4;
    border-radius: 20px;
    padding: 10px 20px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(46, 204, 113, 0.4);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    animation: popUpHUD 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popUpHUD {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.placement-hud-icon {
    font-size: 2rem;
}

.placement-hud-text {
    display: flex;
    flex-direction: column;
}

.placement-hud-text strong {
    font-size: 0.95rem;
    color: #ffffff;
}

.placement-hud-text small {
    font-size: 0.75rem;
    color: #a8e6cf;
}

/* ==========================================================================
   CAREERS & EMPLOYMENT AGENCY STYLING
   ========================================================================== */
.career-modal-card {
    max-width: 820px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.career-header-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.career-header-subtitle {
    font-size: 0.78rem;
    color: #9ac2e6;
}

/* Active Career Hero */
.active-career-hero {
    background: linear-gradient(135deg, rgba(41, 128, 185, 0.35) 0%, rgba(39, 174, 96, 0.35) 100%);
    border: 1.5px solid #55efc4;
    border-radius: 16px;
    padding: 14px 18px;
    margin: 12px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.active-career-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.active-career-icon {
    font-size: 2.4rem;
}

.active-career-badge {
    background: rgba(46, 204, 113, 0.25);
    border: 1px solid #2ecc71;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #55efc4;
    text-transform: uppercase;
    display: inline-block;
}

.active-career-details h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin: 2px 0;
}

.active-career-wage {
    font-size: 0.8rem;
    color: #ffd166;
}

.active-career-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.career-perf-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.career-perf-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #d2e4f7;
}

.career-perf-label strong {
    color: #55efc4;
}

.career-perf-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
}

.career-perf-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #2ecc71);
    border-radius: 4px;
    transition: width 0.3s;
}

.active-career-actions {
    display: flex;
    gap: 8px;
}

.career-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 52vh;
    padding-right: 6px;
}

.career-card {
    background: rgba(14, 34, 61, 0.75);
    border: 1.5px solid rgba(130, 200, 255, 0.2);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.career-card:hover {
    border-color: #82c8ff;
    background: rgba(18, 44, 75, 0.85);
}

.career-card.employed {
    border-color: #2ecc71;
    background: rgba(22, 60, 40, 0.7);
}

.career-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.career-card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.career-icon {
    font-size: 1.8rem;
}

.career-card-title-group h4 {
    font-size: 1.02rem;
    color: #ffffff;
    margin: 0;
}

.career-venue {
    font-size: 0.72rem;
    color: #82c8ff;
}

.career-desc {
    font-size: 0.78rem;
    color: #b8d6f2;
    line-height: 1.35;
    margin: 0;
}

.career-tiers-roadmap {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.tier-pill {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tier-pill.active-tier {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.15);
}

.tier-level {
    font-size: 0.65rem;
    font-weight: 800;
    color: #82c8ff;
    text-transform: uppercase;
}

.tier-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #ffffff;
}

.tier-wage {
    font-size: 0.72rem;
    color: #f39c12;
    font-weight: 700;
}

/* HUD Career Chip */
.hud-career-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 2px;
    width: fit-content;
}

.hud-career-chip.active {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.6);
    color: #55efc4;
}

.hud-career-chip.unemployed {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #bdc3c7;
}

.hud-career-chip:hover {
    transform: scale(1.04);
}

/* Shift Progress Overlay */
.shift-progress-overlay {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 260;
    pointer-events: auto;
}

.shift-card {
    background: rgba(14, 34, 61, 0.94);
    border: 1.5px solid #f39c12;
    border-radius: 18px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    color: #fff;
    min-width: 280px;
    animation: popUpHUD 0.3s ease;
}

.shift-icon {
    font-size: 1.8rem;
}

.shift-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.shift-info strong {
    font-size: 0.88rem;
    color: #ffffff;
}

.shift-info small {
    font-size: 0.72rem;
    color: #ffd166;
}

.shift-bar-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.shift-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #2ecc71);
    border-radius: 3px;
    transition: width 0.5s linear;
}

/* ==========================================================================
   SIMS TRAVEL & MOVE-IN LOADING SCREEN
   ========================================================================== */
.travel-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b3a5b 0%, #081524 85%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.travel-loading-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.travel-loading-backdrop {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="%232ecc71" fill-opacity="0.04"><path d="M20 5 L28 20 L20 35 L12 20 Z"/></g></svg>');
    opacity: 0.8;
}

.travel-loading-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 480px;
    padding: 30px 40px;
    background: rgba(14, 34, 61, 0.9);
    border: 2px solid var(--sims-plumbob-green);
    border-radius: 28px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7), 0 0 40px rgba(46, 204, 113, 0.3);
    backdrop-filter: blur(16px);
}

.travel-plumbob-spinner {
    position: relative;
    width: 60px;
    height: 90px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-gem {
    width: 36px;
    height: 72px;
    background: linear-gradient(135deg, #a8ff78 0%, #2ecc71 40%, #16a085 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    filter: drop-shadow(0 0 16px rgba(46, 204, 113, 0.85));
    animation: rotatePlumbobSpinner 2.2s infinite ease-in-out;
}

@keyframes rotatePlumbobSpinner {
    0% { transform: scale(1) rotateY(0deg); }
    50% { transform: scale(1.12) rotateY(180deg); }
    100% { transform: scale(1) rotateY(360deg); }
}

.spinner-halo {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.45) 0%, transparent 70%);
    animation: pulseHalo 1.8s infinite ease-in-out;
}

@keyframes pulseHalo {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.9; }
}

.travel-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.travel-district-pill {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.15);
    border: 1px solid rgba(255, 209, 102, 0.4);
    border-radius: 14px;
    padding: 3px 12px;
    margin-bottom: 14px;
}

.travel-spline-text {
    font-size: 0.88rem;
    color: #a0c4e2;
    font-style: italic;
    min-height: 22px;
    margin: 0 0 18px 0;
}

.travel-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.travel-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2ecc71, #55efc4);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.8);
    transition: width 0.12s linear;
}

.travel-pct-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #55efc4;
    margin-top: 8px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.7);
}

/* ==========================================================================
   SIMS VISUAL OVERHEAD CITY MAP
   ========================================================================== */
.map-view-toggle {
    display: flex;
    gap: 6px;
    background: rgba(8, 22, 38, 0.8);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--sims-border);
}

.map-view-toggle .toggle-btn {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 700;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #a0c4e2;
}

.map-view-toggle .toggle-btn.active {
    background: var(--sims-plumbob-green);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.4);
}

.city-map-container {
    position: relative;
    width: 100%;
    height: 560px;
    min-height: 560px;
    border-radius: 22px;
    overflow: hidden;
    border: 2px solid var(--sims-border);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6), 0 12px 36px rgba(0, 0, 0, 0.5);
    background: #14283f;
    user-select: none;
    margin-bottom: 20px;
}

/* 4 Regional Terrain Belts */
.city-terrain-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.city-biome-band {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    padding-left: 24px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.1);
}

.city-biome-band:last-child {
    border-bottom: none;
}

.biome-outskirts {
    background: linear-gradient(180deg, #c29567 0%, #aa7c4d 100%);
}

.biome-suburbs {
    background: linear-gradient(180deg, #437a3f 0%, #366633 100%);
}

.biome-hilltop {
    background: linear-gradient(180deg, #3d3b59 0%, #29283f 100%);
}

.biome-civic {
    background: linear-gradient(180deg, #24415c 0%, #182e44 100%);
}

.biome-watermark {
    position: absolute;
    right: 24px;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.12);
    text-transform: uppercase;
    pointer-events: none;
}

.biome-label-badge {
    position: absolute;
    left: 18px;
    top: 12px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 3px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Road Network */
.city-roads-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Interactive 3D-styled City Lot Pins */
.city-lot-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 5;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28), filter 0.2s ease;
}

.city-lot-pin:hover {
    transform: translate(-50%, -50%) scale(1.22);
    z-index: 20;
}

.pin-icon-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(14, 34, 61, 0.92);
    border: 2px solid var(--sims-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.city-lot-pin:hover .pin-icon-wrap {
    border-color: var(--sims-plumbob-green);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.7);
}

.city-lot-pin.is-my-home .pin-icon-wrap {
    border-color: #2ecc71;
    box-shadow: 0 0 22px rgba(46, 204, 113, 0.9);
    animation: homePulse 1.8s infinite;
}

@keyframes homePulse {
    0%, 100% { box-shadow: 0 0 14px rgba(46, 204, 113, 0.6); }
    50% { box-shadow: 0 0 28px rgba(46, 204, 113, 1); }
}

.pin-plumbob-crown {
    position: absolute;
    top: -24px;
    font-size: 1.3rem;
    animation: spinFloatCrown 2s infinite ease-in-out;
}

@keyframes spinFloatCrown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.pin-badge-chip {
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 12px;
    padding: 2px 8px;
    background: rgba(10, 24, 44, 0.9);
    border: 1px solid var(--sims-border);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.city-lot-pin.for-sale-affordable .pin-badge-chip {
    background: rgba(46, 204, 113, 0.9);
    border-color: #55efc4;
    color: #ffffff;
    animation: pulseStarter 1.8s infinite;
}

@keyframes pulseStarter {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.city-lot-pin.for-sale-expensive .pin-badge-chip {
    background: rgba(231, 76, 60, 0.85);
    border-color: #e74c3c;
}

.city-lot-pin.community-venue .pin-badge-chip {
    background: rgba(41, 128, 185, 0.9);
    border-color: #5dade2;
}

.city-lot-pin.resident-occupied .pin-badge-chip {
    background: rgba(243, 156, 18, 0.9);
    border-color: #f39c12;
}

/* Tooltip on pin hover */
.pin-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 45, 0.95);
    border: 1.5px solid var(--sims-plumbob-green);
    border-radius: 12px;
    padding: 6px 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.city-lot-pin:hover .pin-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.pin-tooltip-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffffff;
}

.pin-tooltip-sub {
    font-size: 0.68rem;
    color: #ffd166;
}

/* =========================================================================
   ARCHITECTURAL BUILD MODE DRAWER & CONTROLS
   ========================================================================= */
.build-mode-drawer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(105%);
    width: min(960px, 96vw);
    max-height: min(270px, 36vh);
    background: linear-gradient(180deg, rgba(14, 30, 52, 0.96) 0%, rgba(8, 18, 34, 0.98) 100%);
    border: 2px solid var(--sims-border);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(46, 204, 113, 0.2);
    backdrop-filter: blur(16px);
    z-index: 450;
    display: flex;
    flex-direction: column;
    transition: transform 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.2), visibility 0.32s;
    padding: 12px 18px;
    box-sizing: border-box;
    pointer-events: none;
    visibility: hidden;
}

.build-mode-drawer.active {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.build-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.build-drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.build-header-icon {
    font-size: 24px;
    background: rgba(46, 204, 113, 0.2);
    border-radius: 8px;
    padding: 4px;
}

.build-drawer-title strong {
    font-size: 1.05rem;
    display: block;
}

.build-drawer-title small {
    font-size: 0.75rem;
    color: #ffd166;
}

.cutaway-controls-group {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 3px;
}

.cutaway-btn {
    background: transparent;
    border: none;
    color: #bdc3c7;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cutaway-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.cutaway-btn.active {
    background: #27ae60;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.6);
}

.build-close-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.build-close-btn:hover {
    background: #e74c3c;
    color: #ffffff;
}

.build-category-tabs {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-shrink: 0;
    min-height: 38px;
}

.build-tab-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.build-tab-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--sims-plumbob-green);
}

.build-tab-btn.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
}

.build-tab-btn.danger-tab.active {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border-color: #e74c3c;
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.5);
}

.build-palette-content {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 4px 10px 4px;
}

.build-style-card {
    min-width: 140px;
    max-width: 155px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.2);
}

.build-style-card:hover {
    transform: translateY(-4px);
    border-color: var(--sims-plumbob-green);
    background: rgba(255, 255, 255, 0.1);
}

.build-style-card.selected {
    border-color: var(--sims-plumbob-green);
    background: rgba(46, 204, 113, 0.15);
    box-shadow: 0 0 16px rgba(46, 204, 113, 0.4);
}

.build-style-card.danger-card.selected {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    box-shadow: 0 0 16px rgba(231, 76, 60, 0.4);
}

.build-card-swatch {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.build-card-info strong {
    font-size: 0.78rem;
    color: #ffffff;
    display: block;
    line-height: 1.2;
}

.build-card-price {
    font-size: 0.74rem;
    font-weight: 800;
    color: #ffd166;
    margin-top: 3px;
    display: block;
}

.roof-apply-btn {
    margin-top: 4px;
    font-size: 0.72rem;
    padding: 3px 8px;
}

/* ==========================================================================
   TOWNIE SOCIAL PIE MENU & FREE WILL AUTONOMY STYLING
   ========================================================================== */
.pie-slice-btn.social-slice-btn {
    background: linear-gradient(135deg, rgba(28, 40, 56, 0.95), rgba(41, 57, 78, 0.95));
    border-color: #f39c12;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.pie-slice-btn.social-slice-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    border-color: #f1c40f;
    box-shadow: 0 0 14px rgba(243, 156, 18, 0.6);
    transform: scale(1.08);
}

#freeWillToggleBtn.free-will-on {
    background: linear-gradient(135deg, #16a085, #1abc9c) !important;
    border-color: #2ecc71 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
}

#freeWillToggleBtn.free-will-off {
    background: linear-gradient(135deg, #5f6368, #3c4043) !important;
    border-color: #70757a !important;
    color: #dadce0 !important;
    opacity: 0.85;
}

.auto-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(46, 204, 113, 0.25);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 8px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-badge-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.7rem;
    line-height: 1;
}

/* Comfort Rating Tags in Buy Mode */
.buy-card-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 4px 0 6px;
}

.buy-comfort-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(230, 126, 34, 0.22);
    border: 1px solid rgba(243, 156, 18, 0.6);
    color: #ffd166;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

/* =========================================================================
   THE SIMS ONLINE (TSO) SKILL SYSTEM & PROGRESSION STYLES
   ========================================================================= */

.floating-skill-xp {
    position: fixed;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(22, 160, 133, 0.95), rgba(46, 204, 113, 0.95));
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.5), 0 0 15px rgba(255, 255, 255, 0.6);
    pointer-events: none;
    z-index: 10000;
    animation: floatUpSkill 2.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    border: 1.5px solid #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes floatUpSkill {
    0% { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
    15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -100%) scale(1.0); }
    100% { opacity: 0; transform: translate(-50%, -140%) scale(0.85); }
}

.skill-levelup-banner {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #16a085, #2ecc71);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 16px;
    border: 2px solid #a8ffb2;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(46, 204, 113, 0.7);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10000;
    animation: bounceInDown 0.5s ease-out;
}

.skill-levelup-banner.fade-out {
    animation: fadeOutUp 0.5s ease-in forwards;
}

.banner-icon {
    font-size: 2.4rem;
    background: rgba(255, 255, 255, 0.2);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-body h3 {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    color: #d1ffd6;
}

.banner-body p {
    margin: 3px 0 0;
    font-size: 1.15rem;
}

.banner-reward {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #fff9d2;
    font-weight: 600;
}

/* Skills Modal Card */
.skills-modal-card {
    max-width: 680px;
    width: 95%;
    background: linear-gradient(165deg, #0e1e30, #0a1524);
    border: 1.5px solid rgba(85, 239, 196, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}

.skills-overview-banner {
    display: flex;
    justify-content: space-around;
    background: rgba(16, 38, 62, 0.75);
    border: 1px solid rgba(85, 239, 196, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.overview-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.overview-stat .stat-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: #55efc4;
}

.overview-stat .stat-label {
    font-size: 0.72rem;
    color: #a0c4e2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skills-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.skill-card-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(22, 48, 76, 0.6);
    border: 1px solid rgba(130, 200, 255, 0.18);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.skill-card-row:hover {
    background: rgba(28, 62, 98, 0.85);
    border-color: rgba(85, 239, 196, 0.5);
    transform: translateY(-1px);
}

.skill-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(14, 30, 48, 0.8);
    border: 1px solid rgba(85, 239, 196, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.skill-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
}

.skill-card-level {
    font-weight: 700;
    font-size: 0.85rem;
    color: #55efc4;
}

.skill-pips-container {
    display: flex;
    gap: 4px;
    margin: 3px 0;
}

.skill-pip {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.skill-pip.filled {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #55efc4;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.5);
}

.skill-xp-bar-wrap {
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    overflow: hidden;
}

.skill-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #55efc4);
    transition: width 0.3s ease;
}

.skill-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #8bb6db;
}

.skills-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 14px;
}

/* =========================================================================
   COMMERCIAL ECONOMY, VIP DIAMOND STORE & WATCH AD STYLES
   ========================================================================= */

.sim-diamonds-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(142, 68, 173, 0.35);
    border: 1px solid rgba(187, 143, 206, 0.7);
    color: #f5b7b1;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.sim-diamonds-badge:hover {
    background: rgba(142, 68, 173, 0.65);
    border-color: #ffd700;
    transform: scale(1.04);
}

.vip-modal-card {
    max-width: 860px;
    width: 95%;
    background: linear-gradient(165deg, #1b112c, #0d0817);
    border: 1.5px solid rgba(187, 143, 206, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(142, 68, 173, 0.3);
}

.vip-header {
    border-bottom: 1.5px solid rgba(187, 143, 206, 0.25);
    padding-bottom: 12px;
}

.diamond-sparkle {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(187, 143, 206, 0.8));
}

.header-diamond-pill {
    background: rgba(142, 68, 173, 0.25);
    border: 1px solid rgba(187, 143, 206, 0.5);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 18px;
}

/* Sponsor Ad Banner */
.sponsor-ad-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.2), rgba(243, 156, 18, 0.15));
    border: 1.5px solid rgba(243, 156, 18, 0.5);
    border-radius: 14px;
    padding: 12px 18px;
    margin-top: 14px;
}

.sponsor-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tv-broadcast-icon {
    font-size: 2.2rem;
}

.sponsor-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffd700;
}

.sponsor-desc {
    font-size: 0.78rem;
    color: #ffffff;
    margin-top: 2px;
}

.sponsor-watch-btn {
    background: linear-gradient(135deg, #e67e22, #d35400);
    border-color: #f39c12;
    padding: 8px 18px;
    font-weight: 800;
    white-space: nowrap;
}

/* 7-Day Streak Calendar */
.streak-cards-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 760px) {
    .streak-cards-row {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

.streak-card {
    background: rgba(35, 24, 55, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.streak-card.current {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
    background: rgba(55, 38, 88, 0.9);
}

.streak-card.claimed {
    opacity: 0.6;
    border-color: #2ecc71;
}

.streak-day-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #a894cc;
}

.streak-icon {
    font-size: 1.4rem;
}

.streak-reward-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffffff;
}

.claim-streak-btn {
    padding: 3px 8px;
    font-size: 0.68rem;
    background: #27ae60;
    border-color: #2ecc71;
    margin-top: 2px;
}

.claimed-check {
    color: #2ecc71;
    font-weight: 800;
}

/* VIP Catalog */
.vip-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 8px;
    padding-right: 4px;
}

.vip-store-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 20, 50, 0.7);
    border: 1px solid rgba(187, 143, 206, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
}

.vip-card-icon {
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vip-card-info {
    flex: 1;
}

.vip-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
}

.vip-card-type {
    font-size: 0.68rem;
    color: #ffd700;
}

.vip-card-desc {
    font-size: 0.66rem;
    color: #d1b8ff;
}

.vip-purchase-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #8e44ad, #6c3483);
    border-color: #bb8fce;
    white-space: nowrap;
}

/* Sponsor Ad Player Modal */
.ad-player-box {
    position: relative;
    max-width: 480px;
    width: 90%;
    background: #0d0a17;
    border: 2px solid #e67e22;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(230, 126, 34, 0.5);
    overflow: hidden;
    z-index: 10001;
    animation: bounceInDown 0.4s ease;
}

.ad-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #191228;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 1px;
}

.ad-timer {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e67e22;
}

.ad-player-screen {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(180deg, #1b122e, #0e0a1a);
}

.ad-brand-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: pulseGlow 1.5s infinite alternate;
}

.ad-brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}

.ad-brand-tagline {
    font-size: 0.85rem;
    color: #f1c40f;
    font-style: italic;
    margin: 8px auto 20px;
    max-width: 380px;
}

.ad-progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto;
}

.ad-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e67e22, #f1c40f);
    transition: width 1s linear;
}

.ad-player-footer {
    padding: 14px 18px;
    background: #140e21;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ad-reward-preview {
    font-size: 0.78rem;
    color: #55efc4;
    font-weight: 700;
}

/* =========================================================================
   SOCIAL MMO & LOT PRESTIGE STYLES
   ========================================================================= */

.lot-prestige-btn {
    background: rgba(241, 196, 15, 0.25);
    border: 1px solid rgba(241, 196, 15, 0.6);
    color: #fff2a3;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lot-prestige-btn:hover {
    background: rgba(241, 196, 15, 0.5);
    border-color: #ffd700;
    transform: scale(1.04);
}

.lot-revenue-btn {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.7);
    color: #c8ffdb;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    cursor: pointer;
    animation: pulseGlow 2s infinite alternate;
}

/* Shared market card base, used by the Farmer's Market (the old Trading Post styles were removed, #70) */
.market-modal-card {
    max-width: 820px;
}
.market-item-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.market-item-details {
    flex: 1;
}

/* ==========================================================================
   SIMPHONE OS & SOCIAL RELATIONSHIPS MANAGEMENT MODAL
   ========================================================================== */
#simPhoneModal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 20, 0.75);
    backdrop-filter: blur(8px);
}

.phone-chassis {
    width: 390px;
    max-width: 95vw;
    height: 640px;
    max-height: 90vh;
    background: linear-gradient(165deg, #1e272e 0%, #0f1419 100%);
    border: 3.5px solid #3d4a58;
    border-radius: 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 0 16px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f1f2f6;
    font-family: inherit;
    position: relative;
    animation: phonePopUp 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes phonePopUp {
    from { opacity: 0; transform: scale(0.88) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Phone Top Speaker & Camera Notch */
.phone-notch {
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
}

.notch-speaker {
    width: 46px;
    height: 4px;
    background: #2f3640;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.notch-camera {
    width: 7px;
    height: 7px;
    background: #1e272e;
    border: 1px solid #353b48;
    border-radius: 50%;
}

/* Phone Status Bar */
.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 18px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a4b0be;
    letter-spacing: 0.3px;
}

.phone-status-icons {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Phone App Header */
.phone-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.25), rgba(108, 92, 231, 0.25));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-app-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #74b9ff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.phone-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    color: #dfe6e9;
    font-weight: bold;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-close-btn:hover {
    background: #e74c3c;
    color: #fff;
}

/* Phone Tabs */
.phone-tabs {
    display: flex;
    background: rgba(15, 20, 25, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-tab-btn {
    flex: 1;
    padding: 10px 4px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #a4b0be;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.phone-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.phone-tab-btn.active {
    color: #0984e3;
    border-bottom-color: #0984e3;
    background: rgba(9, 132, 227, 0.1);
}

.tab-badge {
    background: #e74c3c;
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 800;
}

/* App Body & Scrollable Area */
.phone-app-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phone-app-body::-webkit-scrollbar {
    width: 5px;
}

.phone-app-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Contact Cards */
.phone-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phone-contact-card {
    background: rgba(30, 39, 46, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 42px 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
    transition: transform 0.15s, border-color 0.15s;
}

.phone-contact-card:hover {
    border-color: rgba(9, 132, 227, 0.4);
    transform: translateY(-1px);
}

.contact-avatar-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-name {
    font-size: 0.88rem;
    color: #fff;
}

.contact-tier-badge {
    font-size: 0.68rem;
    font-weight: 700;
}

.contact-sub {
    font-size: 0.7rem;
    color: #a4b0be;
}

.friendship-track {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.friendship-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.contact-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-btn {
    flex: 1;
    padding: 5px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
}

.phone-call-btn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: #fff;
    border-color: #55efc4;
}

.phone-call-btn:hover {
    filter: brightness(1.15);
}

.phone-text-btn {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
    color: #fff;
    border-color: #74b9ff;
}

.phone-text-btn:hover {
    filter: brightness(1.15);
}

.phone-invite-btn {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border-color: #a29bfe;
}

.phone-invite-btn:hover:not(:disabled) {
    filter: brightness(1.15);
}

.phone-invite-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Visitors Management Tab */
.phone-visitors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visitor-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #55efc4;
}

.dismiss-all-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    background: #e74c3c;
    border-color: #c0392b;
}

.phone-visitor-card {
    background: rgba(30, 39, 46, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.visitor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2f3640;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.visitor-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.visitor-info strong {
    font-size: 0.85rem;
    color: #fff;
}

.visitor-info small {
    font-size: 0.7rem;
    color: #a4b0be;
}

.visitor-status {
    font-size: 0.66rem;
    color: #f1c40f;
}

.dismiss-visitor-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
    background: linear-gradient(135deg, #d63031, #c0392b);
    border-color: #e74c3c;
}

/* Empty State */
.phone-empty-state {
    text-align: center;
    padding: 40px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.phone-empty-state .empty-icon {
    font-size: 2.8rem;
    opacity: 0.8;
}

.phone-empty-state h3 {
    margin: 0;
    color: #dfe6e9;
    font-size: 1.05rem;
}

.phone-empty-state p {
    margin: 0;
    color: #a4b0be;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 280px;
}

/* Quick Services Tab */
.phone-services-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-card {
    background: rgba(30, 39, 46, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: 44px 1fr;
    column-gap: 10px;
    row-gap: 8px;
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.service-info strong {
    font-size: 0.9rem;
    color: #fff;
}

.service-info p {
    margin: 0;
    font-size: 0.72rem;
    color: #a4b0be;
    line-height: 1.35;
}

.service-price {
    font-weight: 800;
    color: #2ecc71;
    font-size: 0.82rem;
    margin-top: 4px;
}

.service-order-btn {
    grid-column: 1 / -1;
    padding: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0984e3, #00cec9);
    border-color: #55efc4;
}

/* ==========================================================================
   FEATURE 1: CULINARY ARTS & RECIPE COOKBOOK SYSTEM
   ========================================================================== */
.cooking-modal-card {
    max-width: 680px;
    width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, rgba(22, 33, 44, 0.96), rgba(15, 23, 30, 0.98));
    border: 2px solid rgba(243, 156, 18, 0.4);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 32px rgba(243, 156, 18, 0.15);
    border-radius: 20px;
    overflow: hidden;
}

.cooking-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.2), rgba(211, 84, 0, 0.1));
    padding: 12px 18px;
    border-bottom: 1px solid rgba(243, 156, 18, 0.25);
    gap: 12px;
    flex-wrap: wrap;
}

.kitchen-stations-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.kitchen-station-chip {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    color: #94a3b8;
    transition: all 0.2s ease;
}

.kitchen-station-chip.active {
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.4);
}

.kitchen-station-chip.missing {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.cooking-skill-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f39c12;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.cooking-body-scroll {
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: center;
    transition: all 0.2s ease;
}

.recipe-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(243, 156, 18, 0.4);
    transform: translateY(-2px);
}

.recipe-card.locked {
    opacity: 0.55;
    filter: grayscale(0.5);
    border-color: rgba(255, 255, 255, 0.05);
}

.recipe-card.locked:hover {
    transform: none;
}

.recipe-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.2), rgba(230, 126, 34, 0.1));
    border: 1.5px solid rgba(243, 156, 18, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.recipe-details-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recipe-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-title-text {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.recipe-level-pill {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(243, 156, 18, 0.18);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.recipe-desc-text {
    font-size: 0.74rem;
    color: #cbd5e1;
    line-height: 1.3;
}

.recipe-tools-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.recipe-tools-title {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 700;
}

.recipe-tool-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recipe-tool-pill.has-tool {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.recipe-tool-pill.missing-tool {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.recipe-card.tools-missing {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
}

.recipe-motive-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.recipe-motive-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.recipe-action-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.recipe-cost-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #2ecc71;
}

.cook-recipe-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e67e22, #d35400);
    border-color: #f39c12;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cook-recipe-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    transform: scale(1.04);
}

.cook-recipe-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #4a5568;
    border-color: #718096;
}

/* ==========================================================================
   FEATURE 2: SIMRADIO & STEREO JUKEBOX TUNER
   ========================================================================== */
.radio-tuner-card {
    max-width: 520px;
    width: 92vw;
    background: linear-gradient(145deg, #2b1d0c, #160f06);
    border: 3px solid #8d5524;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.15);
    padding: 20px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.radio-faceplate {
    background: linear-gradient(180deg, #1c1308, #2a1b0b);
    border: 2px solid #5a3818;
    border-radius: 16px;
    padding: 16px;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-dial-window {
    background: #0d0a05;
    border: 2px solid #3d2610;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 0 16px rgba(255, 177, 66, 0.15);
}

.radio-station-display {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.radio-station-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffb142;
    text-shadow: 0 0 10px rgba(255, 177, 66, 0.5);
}

.radio-station-sub {
    font-size: 0.74rem;
    color: #d1ccc0;
}

.eq-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 32px;
    padding: 4px;
}

.eq-bar {
    width: 6px;
    background: #ffb142;
    border-radius: 3px;
    height: 4px;
    transition: height 0.15s ease;
}

.eq-bar.active {
    animation: eqBounce 0.5s infinite alternate ease-in-out;
}

.eq-bar:nth-child(1) { animation-delay: 0.1s; }
.eq-bar:nth-child(2) { animation-delay: 0.3s; }
.eq-bar:nth-child(3) { animation-delay: 0.05s; }
.eq-bar:nth-child(4) { animation-delay: 0.25s; }
.eq-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes eqBounce {
    0% { height: 6px; }
    50% { height: 28px; }
    100% { height: 14px; }
}

.radio-stations-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.radio-station-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 12px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.radio-station-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffb142;
    transform: translateY(-2px);
}

.radio-station-btn.active {
    background: linear-gradient(135deg, rgba(255, 177, 66, 0.3), rgba(204, 142, 53, 0.2));
    border-color: #ffb142;
    box-shadow: 0 0 12px rgba(255, 177, 66, 0.4);
    color: #fffa65;
}

.radio-station-btn.turn-off {
    grid-column: 1 / -1;
    justify-content: center;
    background: rgba(235, 77, 75, 0.15);
    border-color: rgba(235, 77, 75, 0.35);
    color: #ff7979;
}

.radio-station-btn.turn-off:hover {
    background: rgba(235, 77, 75, 0.3);
    border-color: #eb4d4b;
}

/* ==========================================================================
   FEATURE 3: 📷 PHOTO MODE & MEMORIES ALBUM
   ========================================================================== */
.photo-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.6);
}

.viewfinder-brackets {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 96px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.bracket {
    position: absolute;
    width: 32px;
    height: 32px;
    border-color: rgba(255, 255, 255, 0.85);
    border-style: solid;
}

.bracket.top-left {
    top: 0;
    left: 0;
    border-width: 3px 0 0 3px;
}

.bracket.top-right {
    top: 0;
    right: 0;
    border-width: 3px 3px 0 0;
}

.bracket.bottom-left {
    bottom: 0;
    left: 0;
    border-width: 0 0 3px 3px;
}

.bracket.bottom-right {
    bottom: 0;
    right: 0;
    border-width: 0 3px 3px 0;
}

.viewfinder-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 33.333% 33.333%;
    display: block;
}

.viewfinder-header-info {
    position: absolute;
    top: 14px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.simcam-lot-pill {
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.photo-mode-bottom-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    padding: 8px 22px;
    border-radius: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

.photo-mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.photo-mode-btn.exit-photo-btn {
    background: rgba(235, 77, 75, 0.2);
    border-color: rgba(235, 77, 75, 0.5);
    color: #ff7675;
}

.photo-mode-btn.exit-photo-btn:hover {
    background: rgba(235, 77, 75, 0.4);
}

.photo-shutter-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.photo-shutter-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

.photo-shutter-btn:active {
    transform: scale(0.94);
}

.shutter-inner-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #0f172a;
    background: #f8fafc;
}

/* Flash overlay */
.photo-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.08s ease-out;
}

.photo-flash-overlay.flashing {
    opacity: 0.95;
    transition: none;
}

/* Photo Memories Album Gallery Modal */
.memories-modal-card {
    max-width: 820px;
    width: 95vw;
    max-height: 88vh;
    background: linear-gradient(145deg, rgba(20, 24, 33, 0.96), rgba(12, 16, 22, 0.98));
    border: 2px solid rgba(224, 86, 253, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 32px rgba(224, 86, 253, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.memories-gallery-scroll {
    overflow-y: auto;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.memory-polaroid-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px 10px 14px 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    color: #2d3436;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.memory-polaroid-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

.memory-thumbnail-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.memory-thumbnail-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.memory-meta-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.memory-lot-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
}

.memory-timestamp {
    font-size: 0.68rem;
    color: #64748b;
}

.memory-actions-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.memory-action-btn {
    flex: 1;
    padding: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.memory-action-btn:hover {
    opacity: 0.85;
}

.download-memory-btn {
    background: #0984e3;
    color: #fff;
}

.delete-memory-btn {
    background: #eb4d4b;
    color: #fff;
}

.memories-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.memories-empty-icon {
    font-size: 3.5rem;
}

/* ============================================================
   IN-GAME SCREENSHOT / PHOTO LIGHTBOX VIEWER MODAL
   ============================================================ */
.screenshot-lightbox-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 120000 !important;
    background: rgba(3, 7, 18, 0.94) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    cursor: pointer;
}

.screenshot-lightbox-modal.active {
    display: flex !important;
}

.screenshot-lightbox-container {
    max-width: 1040px;
    width: 95vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(155deg, rgba(18, 24, 38, 0.98), rgba(9, 13, 22, 0.99));
    border: 2px solid rgba(0, 180, 216, 0.55);
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 180, 216, 0.25);
    overflow: hidden;
    cursor: default;
    animation: zoomLightboxIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomLightboxIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.screenshot-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.screenshot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.screenshot-lot-pill {
    font-weight: 800;
    font-size: 0.95rem;
    color: #f8fafc;
    letter-spacing: -0.2px;
}

.screenshot-time-pill {
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.screenshot-counter-pill {
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
}

.screenshot-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-shrink: 0;
}

.screenshot-close-btn:hover {
    background: #ef4444;
    transform: scale(1.12);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.75);
}

.screenshot-close-btn:active {
    transform: scale(0.96);
}

.screenshot-image-frame {
    position: relative;
    flex: 1;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #000;
    overflow: hidden;
    user-select: none;
}

.screenshot-lightbox-img {
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85);
    display: block;
}

.screenshot-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    z-index: 10;
}

.screenshot-nav-btn:hover {
    background: rgba(0, 180, 216, 0.9);
    border-color: #00b4d8;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.6);
}

.screenshot-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.screenshot-nav-btn.prev-btn {
    left: 20px;
}

.screenshot-nav-btn.next-btn {
    right: 20px;
}

.screenshot-lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
    flex-wrap: wrap;
}

.screenshot-footer-left,
.screenshot-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.screenshot-action-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
}

.screenshot-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.screenshot-action-btn:active {
    transform: translateY(0);
}

.screenshot-action-btn.back-album-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}
.screenshot-action-btn.back-album-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.screenshot-action-btn.download-btn {
    background: #0984e3;
    border-color: #74b9ff;
}
.screenshot-action-btn.download-btn:hover {
    background: #00cec9;
}

.screenshot-action-btn.delete-btn {
    background: rgba(235, 77, 75, 0.25);
    border-color: #eb4d4b;
    color: #ff7675;
}
.screenshot-action-btn.delete-btn:hover {
    background: #eb4d4b;
    color: #fff;
}

.screenshot-action-btn.close-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #ff7979;
    font-weight: 800;
}
.screenshot-action-btn.close-btn:hover {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
    box-shadow: 0 0 16px rgba(231, 76, 60, 0.6);
}

/* ============================================================
   WEATHER & ATMOSPHERIC SYSTEM HUD
   ============================================================ */
.clock-weather-badge {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
}
.clock-weather-badge:hover {
    transform: scale(1.05);
    background: rgba(30, 41, 59, 0.9);
}

/* ============================================================
   SIMS 4 STYLE MOODLETS & EMOTIONAL BUFFS TRAY
   ============================================================ */
.hud-moodlets-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    max-width: 250px;
    margin-left: 8px;
    padding: 2px 4px;
}

.moodlet-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.88);
    border: 1.5px solid var(--moodlet-color, #2ecc71);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.moodlet-chip:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.moodlet-chip .moodlet-icon {
    font-size: 0.85rem;
}

.moodlet-chip .moodlet-name {
    letter-spacing: 0.2px;
}

.moodlet-chip .moodlet-timer {
    font-size: 0.62rem;
    opacity: 0.85;
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
}

/* Placement HUD Rotate button */
#hudRotateBuildBtn, #hudRotateBtn {
    background: linear-gradient(135deg, #0984e3, #6c5ce7) !important;
    border-color: #74b9ff !important;
    color: #ffffff !important;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(9, 132, 227, 0.4);
}

#hudRotateBuildBtn:hover, #hudRotateBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(9, 132, 227, 0.6);
}

/* ============================================================
   SIM BACKPACK & INVENTORY SYSTEM STYLES
   ============================================================ */
.inv-modal-card {
    max-width: 780px;
    width: 94vw;
    max-height: 88vh;
    background: linear-gradient(155deg, rgba(17, 24, 39, 0.98), rgba(10, 15, 26, 0.99));
    border: 2px solid rgba(243, 156, 18, 0.45);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95), 0 0 30px rgba(243, 156, 18, 0.2);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.inv-tabs-header {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}

.inv-tab-btn {
    padding: 6px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.inv-tab-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    border-color: #f39c12;
    color: #fff;
}

.inv-tab-btn.active {
    background: linear-gradient(135deg, #e67e22, #f39c12);
    border-color: #f1c40f;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.inv-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 240px;
    max-height: 55vh;
}

.inv-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.inv-item-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1.5px solid var(--rarity-border, rgba(255, 255, 255, 0.15));
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.inv-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), 0 0 14px var(--rarity-border);
}

.inv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inv-item-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.inv-item-qty {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffd166;
}

.inv-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.inv-rarity-pill {
    align-self: flex-start;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 6px;
}

.inv-item-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
    flex: 1;
    margin: 4px 0;
}

.inv-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 4px;
}

.inv-item-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2ecc71;
}

.inv-actions {
    display: flex;
    gap: 6px;
}

.inv-use-btn {
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    border-color: #2ecc71 !important;
    color: #fff !important;
    font-weight: 700 !important;
}

.inv-sell-btn {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
    background: rgba(231, 76, 60, 0.2) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
    color: #ff7675 !important;
}

.inv-sell-btn:hover {
    background: #e74c3c !important;
    color: #fff !important;
}

.inv-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: #94a3b8;
}

.inv-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

/* -------------------------------------------------------------------------
   ASPIRATIONS, TRAITS, DYNAMIC WHIMS & REWARDS STORE STYLES
   ------------------------------------------------------------------------- */
.hud-whims-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
    z-index: 1000;
    pointer-events: none; /* the whim bubbles catch clicks */
    max-width: 360px;
}

.whim-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 25, 35, 0.92);
    border: 2px solid rgba(245, 158, 11, 0.65);
    border-radius: 20px;
    padding: 6px 12px;
    color: #ffffff;
    font-size: 0.73rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 8px rgba(245, 158, 11, 0.2);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    max-width: 280px;
    position: relative;
    user-select: none;
}

.whim-bubble:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: #fbbf24;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(245, 158, 11, 0.35);
}

.whim-bubble.pinned {
    border-color: #38bdf8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(56, 189, 248, 0.35);
}

.whim-icon-wrap {
    position: relative;
    font-size: 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whim-pin-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.65rem;
}

.whim-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.2;
}

.whim-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
    word-break: break-word;
    color: #f1f5f9;
}

.whim-reward {
    font-size: 0.66rem;
    color: #f59e0b;
    font-weight: 700;
    margin-top: 1px;
}

.whim-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.whim-pin-btn, .whim-dismiss-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.whim-pin-btn:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
}

.whim-dismiss-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.hud-satisfaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffd166;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.hud-satisfaction-chip:hover {
    background: rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Modal Dialog */
.aspiration-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.aspiration-modal-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: 20px;
    width: 900px;
    max-width: 95vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.15);
    overflow: hidden;
    color: #ffffff;
}

.aspiration-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aspiration-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asp-star-emblem {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7));
}

.aspiration-header-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aspiration-header-title p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.aspiration-points-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
}

.asp-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.asp-close-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.aspiration-tabs-nav {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 18px;
    gap: 8px;
}

.asp-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 18px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.asp-tab-btn:hover {
    color: #f1f5f9;
}

.asp-tab-btn.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
}

.aspiration-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Current Aspiration Layout */
.asp-main-view {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.asp-active-card {
    background: rgba(30, 41, 59, 0.65);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.asp-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.asp-card-badge {
    font-size: 2.2rem;
    background: rgba(245, 158, 11, 0.2);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: 16px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.asp-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
}

.asp-card-header p {
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

.asp-tier-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.asp-tier-reward {
    color: #fbbf24;
    font-size: 0.85rem;
}

.asp-objectives-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asp-objective-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.15s ease;
}

.asp-objective-row.completed {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
}

.asp-obj-status {
    font-size: 1.1rem;
}

.asp-obj-info {
    flex: 1;
}

.asp-obj-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8fafc;
}

.asp-obj-progress {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

.asp-bonus-trait-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.05));
    border: 1.5px dashed rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
}

.asp-trait-badge {
    font-size: 0.8rem;
    font-weight: 800;
    color: #fbbf24;
    display: block;
    margin-bottom: 4px;
}

.asp-bonus-trait-box p {
    margin: 0;
    font-size: 0.78rem;
    color: #e2e8f0;
    line-height: 1.4;
}

/* Switcher Column */
.asp-switcher-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asp-switcher-col h4 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.asp-selector-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 480px;
}

.asp-selector-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 41, 59, 0.45);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    color: #ffffff;
    transition: all 0.15s ease;
}

.asp-selector-card:hover {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(245, 158, 11, 0.4);
}

.asp-selector-card.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.asp-sel-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.asp-sel-meta strong {
    display: block;
    font-size: 0.82rem;
    color: #f8fafc;
}

.asp-sel-meta small {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Traits Picker Grid */
.traits-main-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.traits-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.traits-header-row h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.traits-header-row p {
    margin: 3px 0 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.traits-count-pill {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.8rem;
}

.traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.trait-picker-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.18s ease;
}

.trait-picker-card.active-trait {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.trait-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trait-card-icon {
    font-size: 1.6rem;
}

.trait-card-top strong {
    display: block;
    font-size: 0.88rem;
    color: #f8fafc;
}

.trait-cat-tag {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.trait-card-desc {
    margin: 0;
    font-size: 0.75rem;
    color: #cbd5e1;
    line-height: 1.35;
    flex: 1;
}

.trait-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.trait-toggle-btn.btn-active {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
}

/* Rewards Store Grid */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.reward-store-card {
    background: rgba(30, 41, 59, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.18s ease;
}

.reward-store-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(30, 41, 59, 0.8);
}

.reward-store-card.owned {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.08);
}

.reward-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reward-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.reward-meta strong {
    display: block;
    font-size: 0.88rem;
    color: #f8fafc;
}

.reward-cat-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

.reward-cat-tag.consumable {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.reward-cat-tag.perk {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.reward-desc {
    margin: 0;
    font-size: 0.76rem;
    color: #cbd5e1;
    line-height: 1.35;
    flex: 1;
}

.reward-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.reward-cost {
    font-weight: 800;
    color: #fbbf24;
    font-size: 0.82rem;
}

.reward-buy-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reward-buy-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: translateY(-1px);
}

.reward-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reward-buy-btn.btn-owned {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

/* ==========================================================================
   GARDENING, PLANT CULTIVATION & VALLEY FARMER'S MARKET MODALS
   ========================================================================== */
.seed-modal-card {
    max-width: 680px;
    width: 90%;
    background: linear-gradient(145deg, #1b3320 0%, #0d1e13 100%);
    border: 2px solid #2ecc71;
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(46, 204, 113, 0.25);
}

.seeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding: 16px;
}

.seed-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.seed-card:hover {
    background: rgba(46, 204, 113, 0.12);
    border-color: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.seed-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.seed-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    color: #ffffff;
}

.seed-cat {
    font-size: 0.72rem;
    color: #2ecc71;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.seed-info p {
    margin: 6px 0;
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.3;
}

.seed-stock {
    font-size: 0.82rem;
    color: #ffd166;
    margin-top: 4px;
}

.empty-seeds-notice {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: #cbd5e1;
}

.empty-seeds-notice p {
    margin: 8px 0;
    font-size: 0.95rem;
}

/* --- FARMER'S MARKET MODAL --- */
.market-modal-card {
    max-width: 820px;
    width: 92%;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #10b981;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(16, 185, 129, 0.25);
    overflow: hidden;
}

.market-funds {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
}

.market-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.market-tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-tab-btn.active, .market-tab-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.market-body {
    padding: 16px;
    max-height: 540px;
    overflow-y: auto;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.market-seed-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-seed-card:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
}

.market-item-icon {
    font-size: 1.8rem;
}

.market-item-details h4 {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    color: #ffffff;
}

.market-badge {
    font-size: 0.7rem;
    color: #38bdf8;
    text-transform: uppercase;
    font-weight: 700;
}

.market-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #34d399;
    margin-top: 4px;
}

.market-sell-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.market-sell-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sell-icon {
    font-size: 2rem;
}

.sell-details {
    flex: 1;
}

.sell-details strong {
    font-size: 1rem;
    color: #ffffff;
}

.sell-premium {
    font-size: 0.78rem;
    color: #34d399;
    font-weight: 700;
    margin-top: 2px;
}

.market-empty-box {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

/* --- BOTANICAL ALMANAC --- */
.almanac-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.almanac-header-stats {
    display: flex;
    gap: 16px;
}

.almanac-stat-box {
    flex: 1;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.almanac-stat-box span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.almanac-stat-box strong {
    font-size: 1.15rem;
    color: #34d399;
}

.almanac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.almanac-crop-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.almanac-crop-card.locked {
    opacity: 0.45;
    filter: grayscale(0.8);
    border-style: dashed;
}

.almanac-crop-card.unlocked {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.almanac-crop-icon {
    font-size: 2rem;
}

.almanac-crop-info h4 {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    color: #ffffff;
}

.almanac-badge {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 700;
}

.almanac-badge.unlocked-badge {
    color: #34d399;
}

.almanac-crop-info p {
    margin: 6px 0;
    font-size: 0.75rem;
    color: #cbd5e1;
    line-height: 1.3;
}

.almanac-stats {
    font-size: 0.72rem;
    color: #ffd166;
    margin-top: 4px;
}

/* ==========================================================================
   FULLSCREEN LANDSCAPE & ORIENTATION CONTROLS
   ========================================================================== */
.landscape-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    transition: all 0.2s ease !important;
}

.landscape-btn:hover {
    background: linear-gradient(135deg, #0369a1, #075985) !important;
    border-color: #7dd3fc !important;
}

.landscape-btn.active {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
}

/* Floating Landscape Toast */
.landscape-toast {
    position: fixed;
    top: calc(18px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 24, 40, 0.92);
    border: 1.5px solid rgba(56, 189, 248, 0.6);
    border-radius: 20px;
    padding: 8px 20px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.4);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Forced Landscape CSS Fallback (for iOS Safari and orientation-locked mobile devices) */
body.forced-landscape {
    width: 100vh !important;
    height: 100vw !important;
    transform: rotate(90deg) !important;
    transform-origin: top left !important;
    position: fixed !important;
    top: 0 !important;
    left: 100vw !important;
    overflow: hidden !important;
}

/* Mobile Modes Drawer Header */
.mobile-modes-drawer-header {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(80, 160, 220, 0.3);
    color: #ffffff;
    font-size: 0.88rem;
}

.mobile-modes-close-btn {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid #e74c3c;
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
}

/* ==========================================================================
   MOBILE DEVICE COMPATIBILITY & RESPONSIVE SUBSYSTEM
   Strictly scoped to mobile devices (max-width: 768px) and touch viewports.
   Normal PC desktop browsers (> 768px with mouse) remain 100% UNTOUCHED.
   ========================================================================== */

/* 1. Desktop Exclusion: ensure mobile elements never appear on PC */
@media (min-width: 769px) and (min-height: 501px) {
    .mobile-only {
        display: none !important;
    }
}

/* 2. Mobile Responsive Layout & Touch Ergonomics */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    /* Safe Area insets for modern mobile displays with notches */
    :root {
        --safe-top: env(safe-area-inset-top, 0px);
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-left: env(safe-area-inset-left, 0px);
        --safe-right: env(safe-area-inset-right, 0px);
    }

    body {
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* TOP HEADER & NAVIGATION ON MOBILE */
    .game-header {
        top: calc(8px + var(--safe-top)) !important;
        left: calc(8px + var(--safe-left)) !important;
        right: calc(8px + var(--safe-right)) !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }

    .current-lot-hud {
        padding: 4px 7px !important;
        gap: 5px !important;
        border-radius: 14px !important;
        max-width: 120px !important;
        flex-shrink: 1 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
    }

    .lot-pin-icon {
        font-size: 1rem !important;
    }

    .lot-hud-name {
        font-size: 0.78rem !important;
        max-width: 110px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .district-pill {
        font-size: 0.58rem !important;
        padding: 1px 5px !important;
    }

    .lot-hud-details-row {
        display: none !important; /* Conceal secondary lot meta on mobile header to preserve viewport */
    }

    /* TOP TOOLBAR ON MOBILE */
    .top-toolbar {
        max-width: fit-content !important;
        align-items: flex-end !important;
        gap: 4px !important;
    }

    .top-toolbar-row.utility-row {
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        gap: 4px !important;
    }

    .top-toolbar-row.utility-row .camera-group {
        display: none !important; /* Concealed in top toolbar on mobile: Quick-Cam thumb cluster & multi-touch gestures handle camera */
    }

    .landscape-group {
        gap: 4px !important;
    }

    .landscape-group .landscape-btn {
        padding: 4px 8px !important;
        font-size: 0.72rem !important;
        border-radius: 12px !important;
    }

    .travel-group {
        gap: 4px !important;
    }

    .travel-group .sims-btn {
        padding: 4px 7px !important;
        font-size: 0.72rem !important;
        border-radius: 12px !important;
    }

    .camera-group {
        padding: 2px 3px !important;
        border-radius: 14px !important;
        gap: 2px !important;
    }

    .camera-group .cam-ctrl-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.75rem !important;
    }

    .system-group {
        gap: 4px !important;
    }

    #freeWillToggleBtn {
        display: none !important; /* Concealed in mobile top bar */
    }

    #audioToggleBtn {
        padding: 4px 7px !important;
        font-size: 0.72rem !important;
    }

    /* Mobile Modes Toggle Pill */
    .mobile-modes-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
        padding: 4px 9px !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, #0984e3, #6c5ce7) !important;
        border: 1.5px solid #74b9ff !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 8px rgba(9, 132, 227, 0.45);
        color: #ffffff !important;
        cursor: pointer;
    }

    /* MODES ROW -> SLIDE-OUT MOBILE ACTION DRAWER */
    .top-toolbar-row.modes-row {
        display: none;
        position: fixed !important;
        top: calc(56px + var(--safe-top)) !important;
        left: calc(10px + var(--safe-left)) !important;
        right: calc(10px + var(--safe-right)) !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(82vh - 60px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        background: rgba(12, 28, 46, 0.97) !important;
        border: 2px solid var(--sims-border) !important;
        border-radius: 20px !important;
        padding: 14px 12px !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
        z-index: 400 !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }

    .top-toolbar-row.modes-row.mobile-expanded {
        display: flex !important;
        animation: mobileDrawerSlide 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
    }

    @keyframes mobileDrawerSlide {
        from { opacity: 0; transform: translateY(-12px) scale(0.96); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .top-toolbar-row.modes-row .primary-modes-dock {
        display: contents !important;
    }

    .top-toolbar-row.modes-row .hud-more-btn {
        display: none !important;
    }

    .top-toolbar-row.modes-row .hud-more-menu {
        display: contents !important;
    }

    .top-toolbar-row.modes-row .sims-btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-width: 130px !important;
        min-height: 42px !important;
        font-size: 0.82rem !important;
        padding: 9px 8px !important;
        border-radius: 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: nowrap !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
    }

    /* BOTTOM MASTER HUD ON MOBILE */
    #bottomHUD {
        bottom: calc(8px + var(--safe-bottom)) !important;
        left: calc(8px + var(--safe-left)) !important;
        right: calc(8px + var(--safe-right)) !important;
        align-items: flex-end !important;
        gap: 6px !important;
    }

    .sim-hud-left-cluster {
        gap: 6px !important;
    }

    .sim-profile-card {
        padding: 6px 10px !important;
        border-radius: 18px !important;
        gap: 8px !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
    }

    .sim-portrait-wrap {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.5rem !important;
        border-width: 2px !important;
    }

    .plumbob-icon-badge {
        font-size: 0.85rem !important;
        top: -6px !important;
        right: -3px !important;
    }

    .sim-info-col {
        min-width: auto !important;
        gap: 2px !important;
    }

    .sim-name {
        font-size: 0.88rem !important;
        line-height: 1.1;
    }

    .sim-emotion-badge {
        font-size: 0.65rem !important;
    }

    .sim-wallet {
        font-size: 0.82rem !important;
    }

    .hud-career-chip,
    .hud-satisfaction-chip {
        display: none !important; /* Conceal secondary chips on small mobile card */
    }

    .mobile-needs-btn {
        display: inline-flex !important;
        padding: 3px 8px !important;
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
        border: 1px solid #2ecc71 !important;
        border-radius: 10px !important;
        color: #ffffff !important;
        margin-top: 2px !important;
        cursor: pointer;
    }

    /* ACTION QUEUE BAR ON MOBILE */
    .action-queue-bar {
        min-height: 38px !important;
        margin-bottom: 4px !important;
        gap: 4px !important;
    }

    .active-activity-card {
        padding: 3px 8px 3px 4px !important;
        border-radius: 16px !important;
        gap: 6px !important;
    }

    .active-activity-icon-slot {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.95rem !important;
    }

    .activity-title {
        font-size: 0.72rem !important;
    }

    .activity-cancel-x {
        width: 16px !important;
        height: 16px !important;
        font-size: 0.65rem !important;
    }

    /* NEEDS PANEL -> MOBILE POPUP DRAWER */
    .needs-panel {
        display: none;
        position: fixed !important;
        bottom: calc(76px + var(--safe-bottom)) !important;
        left: calc(10px + var(--safe-left)) !important;
        right: calc(10px + var(--safe-right)) !important;
        width: auto !important;
        max-width: 360px !important;
        margin: 0 auto !important;
        z-index: 350 !important;
        background: rgba(14, 34, 54, 0.97) !important;
        border: 2px solid var(--sims-border) !important;
        border-radius: 20px !important;
        padding: 12px 16px !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
    }

    .needs-panel.mobile-active {
        display: flex !important;
        z-index: 350 !important;
        animation: mobileNeedsSlide 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
    }

    @keyframes mobileNeedsSlide {
        from { opacity: 0; transform: translateY(16px) scale(0.96); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* MULTIPLAYER CHAT WINDOW ON MOBILE */
    #chatContainer {
        position: fixed !important;
        left: calc(8px + var(--safe-left)) !important;
        right: calc(8px + var(--safe-right)) !important;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        z-index: 60 !important;
    }

    #chatContainer.collapsed {
        bottom: calc(175px + var(--safe-bottom)) !important;
        left: calc(8px + var(--safe-left)) !important;
        width: fit-content !important;
        max-width: 210px !important;
        height: 32px !important;
        min-height: 32px !important;
        border-radius: 16px !important;
        padding: 5px 8px !important;
    }

    #chatContainer:not(.collapsed) {
        bottom: calc(175px + var(--safe-bottom)) !important;
        height: 180px !important;
        max-height: 34vh !important;
        border-radius: 16px !important;
    }

    #chatContainer .chat-resize-handle {
        display: none !important;
    }

    .chat-header {
        cursor: default !important;
        touch-action: auto !important;
    }

    .chat-tab-btn {
        padding: 2px 7px !important;
        font-size: 0.7rem !important;
    }

    #chatInput {
        font-size: 16px !important; /* Critical to avoid iOS auto-zoom */
    }

    /* PIE MENU ON MOBILE */
    #pieMenuContainer {
        width: 190px !important;
        height: 190px !important;
    }

    .pie-center-disc {
        width: 74px !important;
        height: 74px !important;
        font-size: 0.65rem !important;
        padding: 4px !important;
    }

    .pie-slice-btn {
        width: 78px !important;
        height: 38px !important;
        font-size: 0.72rem !important;
        touch-action: manipulation;
    }

    .pie-slice-btn span {
        font-size: 0.85rem !important;
    }

    /* ALL MODALS ON MOBILE */
    .sims-modal {
        padding: 8px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-card,
    .auth-modal-card,
    .career-modal-card,
    .skills-modal-card,
    .market-modal-card,
    .inventory-modal-card,
    .almanac-modal-card,
    .vip-modal-card,
    .buy-modal-card {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 92vh !important;
        padding: 12px 14px !important;
        border-radius: 16px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box !important;
    }

    .buy-catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        grid-auto-rows: minmax(260px, auto) !important;
        gap: 10px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* iOS Safari auto-zoom prevention */
        min-height: 38px;
    }

    /* WORLD MAP ON MOBILE */
    .neighborhood-screen {
        padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom)) 10px !important;
    }

    .neighborhood-header {
        padding-bottom: 8px !important;
        margin-bottom: 8px !important;
        gap: 8px !important;
    }

    .neighborhood-title-group h2 {
        font-size: 1.15rem !important;
    }

    .lots-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* MOBILE FLOATING QUICK CAMERA THUMB BAR */
    .mobile-quick-cam {
        position: fixed;
        right: calc(8px + var(--safe-right));
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 6px;
        z-index: 45;
        pointer-events: auto;
    }

    .quick-cam-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(14, 34, 54, 0.88);
        border: 1.5px solid var(--sims-border);
        color: #ffffff;
        font-size: 1rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        cursor: pointer;
        user-select: none;
        touch-action: manipulation;
        transition: transform 0.1s, background 0.1s;
    }

    .quick-cam-btn:active {
        transform: scale(0.92);
        background: rgba(46, 204, 113, 0.35);
        border-color: #2ecc71;
    }

    .mobile-modes-drawer-header {
        display: flex !important;
    }

    /* LANDSCAPE TOAST ON MOBILE */
    .landscape-toast {
        top: calc(10px + var(--safe-top)) !important;
        font-size: 0.76rem !important;
        padding: 6px 14px !important;
        max-width: 90% !important;
        text-align: center !important;
    }

    /* Profile stack alignment on mobile */
    .sim-profile-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
}

/* Extra small viewport optimizations (under 530px) */
@media (max-width: 530px) {
    .district-pill {
        display: none !important;
    }

    .current-lot-hud {
        max-width: 105px !important;
    }

    .landscape-group {
        display: none !important;
    }

    .hud-whims-container {
        display: none !important;
    }

    .travel-group .sims-btn {
        padding: 3px 6px !important;
        font-size: 0.7rem !important;
    }
}

/* =========================================================================
   MELSSCAPE (OSRS MMO VR HOLODECK) RETRO CLIENT STYLES
   ========================================================================= */
.melsscape-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 250000 !important;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
    overflow: hidden;
}

/* MelsScape client (server-authoritative rewrite, #35). Fixed-size slots: item names never render inside a slot. */
.ms-root { position: absolute; inset: 0; font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; color: #ff981f; }
.ms-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
.ms-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ms-hover {
    position: absolute; top: 8px; left: 110px; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 1px 1px 0 #000;
    pointer-events: none; white-space: nowrap; max-width: calc(100% - 400px); overflow: hidden; text-overflow: ellipsis;
}
.ms-hover small { color: #ddd; font-weight: 400; }
.ms-area { position: absolute; top: 30px; left: 110px; font-size: 12px; color: #fde68a; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.ms-exit { position: absolute; top: 8px; left: 8px; background: #3e3529; color: #ff981f; border: 2px solid #1f1a14; border-radius: 4px; padding: 5px 10px; font-weight: 700; cursor: pointer; z-index: 5; }

.ms-mi-act { color: #fff; }
.ms-mi-tgt { color: #00ffff; }
.ms-mi-tgt.npc { color: #ffff00; }
.ms-mi-tgt.obj { color: #00ffff; }
.ms-mi-tgt.item { color: #ff9040; }
.ms-mi-tgt.player { color: #ffffff; }

/* Minimap + orbs */
.ms-minimap-wrap { position: absolute; top: 8px; right: 8px; width: 210px; height: 160px; }
.ms-minimap { position: absolute; right: 0; top: 0; width: 152px; height: 152px; border-radius: 50%; border: 3px solid #3e3529; cursor: pointer; background: #111; }
.ms-orbs { position: absolute; left: 0; top: 18px; display: flex; flex-direction: column; gap: 8px; }
.ms-orb {
    --fill: 100%; width: 50px; height: 26px; border-radius: 13px; background: #2b241b; border: 2px solid #1f1a14; display: flex; align-items: center; gap: 4px; padding: 0 6px;
    font-size: 13px; font-weight: 700; color: #00ff00; text-shadow: 1px 1px 0 #000; user-select: none;
}
.ms-orb.hp { background: linear-gradient(90deg, #7f1d1d var(--fill), #2b241b var(--fill)); }
.ms-orb.run { cursor: pointer; color: #ffff00; }
.ms-orb.run.on { box-shadow: 0 0 0 2px #facc15 inset; }
.ms-orb-ic { font-size: 12px; }
/* Compass (click to face north) and world map button by the minimap (#101) */
.ms-compass { position: absolute; right: 128px; top: -2px; width: 34px; height: 34px; border-radius: 50%; background: #3e3529; border: 2px solid #1f1a14; color: #ff981f; cursor: pointer; padding: 0; z-index: 2; }
.ms-compass span { display: block; font-weight: 800; font-size: 13px; line-height: 14px; }
.ms-compass span::after { content: ''; display: block; width: 0; height: 0; margin: 1px auto 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 9px solid #dc2626; }
.ms-mapbtn { position: absolute; left: 0; top: 112px; width: 44px; height: 40px; border-radius: 50%; background: #3e3529; border: 2px solid #1f1a14; font-size: 20px; cursor: pointer; }
.ms-mapbtn:hover, .ms-compass:hover { border-color: #ff981f; }
.ms-worldmap { position: absolute; inset: 40px 240px 150px 40px; z-index: 20; display: flex; flex-direction: column; background: #2b241b; border: 3px solid #1f1a14; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.ms-wm-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #3e3529; color: #ff981f; font-size: 14px; }
.ms-wm-head b { font-size: 15px; }
.ms-wm-where { flex: 1; color: #ffff00; font-weight: 600; }
.ms-wm-head button { background: #2b241b; color: #ff981f; border: 1px solid #1f1a14; border-radius: 4px; padding: 3px 8px; cursor: pointer; font-weight: 700; }
.ms-wm-head button:hover { border-color: #ff981f; }
.ms-wm-canvas { flex: 1; width: 100%; min-height: 0; cursor: grab; display: block; }
.ms-wm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 5px 10px; font-size: 12px; color: #e5e7eb; background: #3e3529; }
.ms-wm-legend i { font-style: normal; font-weight: 700; }
.ms-wm-hint { margin-left: auto; opacity: 0.7; }
@media (max-width: 760px) { .ms-worldmap { inset: 50px 8px 8px 8px; } }
.ms-wild { position: absolute; right: 30px; top: 158px; color: #ffff00; font-weight: 700; text-shadow: 1px 1px 0 #000; display: none; }

/* Side panel: stone interface */
.ms-side {
    position: absolute; right: 8px; bottom: 8px; width: 204px; background: #3e3529; border: 3px solid #1f1a14; border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6); user-select: none;
}
.ms-tabs { display: flex; border-bottom: 2px solid #1f1a14; }
.ms-tabs button { flex: 1; height: 34px; background: #4b4032; border: none; border-right: 1px solid #1f1a14; font-size: 16px; cursor: pointer; }
.ms-tabs button.active { background: #6b2a1b; }
.ms-panel { padding: 6px; min-height: 262px; }
.ms-inv { display: grid; grid-template-columns: repeat(4, 42px); grid-auto-rows: 36px; gap: 3px 4px; justify-content: center; }
.ms-slot {
    position: relative; width: 42px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 3px; cursor: pointer; overflow: hidden; box-sizing: border-box;
}
.ms-slot:hover { background: rgba(255, 255, 255, 0.07); }
.ms-slot.empty { cursor: default; }
.ms-slot.empty:hover { background: none; }
.ms-slot[data-sel="1"] { outline: 2px solid #fff; }
.ms-ic { font-size: 22px; line-height: 1; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.7)); }
.ms-tier { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; border-radius: 2px; opacity: 0.9; }
.ms-cnt { position: absolute; top: 0; left: 2px; font-size: 11px; font-weight: 700; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.ms-cnt.yellow { color: #ffff00; }
.ms-cnt.white { color: #ffffff; }
.ms-cnt.green { color: #00ff80; }
.ms-hint { font-size: 11px; color: #d6c3a1; margin-top: 6px; text-align: center; }

.ms-equip { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 4px; }
.ms-eq-row { display: flex; gap: 8px; }
.ms-slot.eq, .ms-equip .ms-slot { background: #2b241b; border: 1px solid #1f1a14; }
.ms-slot.spacer { visibility: hidden; }
.ms-ph { font-size: 18px; opacity: 0.25; }
.ms-bonus { margin-top: 10px; font-size: 12px; color: #ff981f; display: flex; flex-direction: column; gap: 2px; padding: 0 6px; }
.ms-bonus b { float: right; color: #fff; }

.ms-skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.ms-skill { display: flex; align-items: center; justify-content: space-between; background: #2b241b; border: 1px solid #1f1a14; border-radius: 3px; padding: 4px 5px; font-size: 12px; cursor: default; }
.ms-skill b { color: #ffff00; text-shadow: 1px 1px 0 #000; }
.ms-total { margin-top: 8px; text-align: center; font-size: 12px; }
.ms-total b { color: #ffff00; }

.ms-combat { display: flex; flex-direction: column; gap: 5px; }
.ms-cb-head { display: flex; flex-direction: column; font-size: 12px; margin-bottom: 4px; }
.ms-cb-head b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-style { display: flex; justify-content: space-between; align-items: center; background: #2b241b; border: 2px solid #1f1a14; color: #ff981f; padding: 6px 8px; border-radius: 3px; cursor: pointer; font-size: 12px; }
.ms-style.on { border-color: #b91c1c; background: #4a1d14; }
.ms-style small { color: #d6c3a1; }

/* Chat */
.ms-chat { position: absolute; left: 8px; bottom: 8px; width: min(500px, calc(100% - 240px)); background: rgba(62, 53, 41, 0.92); border: 3px solid #1f1a14; border-radius: 6px; display: flex; flex-direction: column; }
.ms-chat-log { height: 120px; overflow-y: auto; padding: 4px 8px; font-size: 12px; line-height: 1.35; }
.ms-line { color: #000; color: #e5e7eb; word-break: break-word; }
.ms-line.game { color: #f5f5f4; }
.ms-line.public { color: #93c5fd; }
.ms-line.red { color: #ff6b6b; }
.ms-line.levelup { color: #00ffff; font-weight: 700; }
.ms-chat-input { border: none; border-top: 2px solid #1f1a14; background: #2b241b; color: #fff; padding: 5px 8px; font-size: 12px; outline: none; }

/* Floating */
.ms-splat { position: absolute; transform: translate(-50%, -50%); min-width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 #000; }
.ms-splat.dmg { background: #b91c1c; }
.ms-splat.miss { background: #1d4ed8; }
.ms-overhead { position: absolute; transform: translate(-50%, -100%); color: #ffff00; font-weight: 700; font-size: 13px; text-shadow: 1px 1px 0 #000; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.ms-xpdrops { position: absolute; right: 230px; top: 170px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; pointer-events: none; }
.ms-xp { color: #fff; font-weight: 700; text-shadow: 1px 1px 0 #000; font-size: 14px; animation: ms-rise 1.6s ease-out forwards; }
@keyframes ms-rise { from { transform: translateY(20px); opacity: 1; } to { transform: translateY(-30px); opacity: 0; } }
.ms-levelup { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: rgba(31, 26, 20, 0.92); border: 2px solid #ffff00; color: #ffff00; padding: 10px 18px; font-size: 18px; font-weight: 800; border-radius: 6px; pointer-events: none; }

/* Context menu */
.ms-menu { position: absolute; z-index: 20; background: #5d5447; border: 2px solid #000; min-width: 150px; font-size: 13px; user-select: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.ms-menu-title { background: #000; color: #5d5447; padding: 2px 6px; font-weight: 700; }
.ms-mi { padding: 3px 8px; cursor: pointer; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.ms-mi:hover { background: #2b241b; }

/* Modals */
/* The backdrop lets clicks through so the inventory stays usable while the bank/shop is open */
.ms-modal { position: absolute; inset: 0 230px 0 0; display: none; align-items: center; justify-content: center; z-index: 10; pointer-events: none; }
.ms-win { pointer-events: auto; width: min(520px, 94vw); max-height: 76vh; display: flex; flex-direction: column; background: #3e3529; border: 3px solid #1f1a14; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7); }
.ms-win-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 2px solid #1f1a14; color: #ff981f; }
.ms-win-head small { color: #d6c3a1; }
.ms-close { margin-left: auto; background: #6b2a1b; color: #fff; border: 1px solid #1f1a14; border-radius: 3px; cursor: pointer; padding: 2px 8px; }
.ms-bank-grid { display: grid; grid-template-columns: repeat(auto-fill, 46px); grid-auto-rows: 40px; gap: 4px; padding: 10px; overflow-y: auto; }
.ms-shop-cell { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.ms-shop-cell small { position: absolute; bottom: -2px; font-size: 9px; color: #ffff00; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.ms-win-foot { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-top: 2px solid #1f1a14; flex-wrap: wrap; }
.ms-win-foot button, .ms-recipe button, .ms-tierbar button, .ms-win.dialogue > button {
    background: #2b241b; color: #ff981f; border: 1px solid #1f1a14; border-radius: 3px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.ms-recipes { overflow-y: auto; padding: 6px 10px; }
.ms-recipe { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid #2b241b; font-size: 12px; }
.ms-recipe > span { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ms-recipe b { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-recipe small { color: #d6c3a1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-recipe.locked { opacity: 0.45; }
.ms-recipe button:disabled { cursor: not-allowed; }
.ms-tierbar { display: flex; gap: 4px; padding: 8px 10px 0; flex-wrap: wrap; }
.ms-tierbar button.on { background: #6b2a1b; color: #fff; }
.ms-win.dialogue { width: min(460px, 94vw); }
.ms-dlg { padding: 12px 14px; color: #fff; font-size: 14px; line-height: 1.45; margin: 0; }
.ms-win.dialogue > button { margin: 0 14px 12px auto; }

@media (max-width: 760px) {
    .ms-chat { width: calc(100% - 228px); }
    .ms-chat-log { height: 80px; }
    .ms-hover { display: none; }
}

/* ==========================================================================
   LIGHTING CONTROLS & AMBIENT COLOR PICKER MODAL
   ========================================================================== */
.light-control-card {
    max-width: 480px;
    width: 92vw;
    background: linear-gradient(145deg, #1f242d, #14181f);
    border: 2px solid #f1c40f;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 20px rgba(241, 196, 15, 0.2);
    padding: 22px;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.light-control-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.light-power-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    border-radius: 12px;
}

.light-power-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ecf0f1;
}

.light-toggle-btn {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 24px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.light-toggle-btn.is-on {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    color: #111;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.5);
}

.light-toggle-btn.is-off {
    background: #34495e;
    color: #bdc3c7;
}

.light-section-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1c40f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.light-dimmer-buttons {
    display: flex;
    gap: 8px;
}

.dimmer-btn {
    flex: 1;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.dimmer-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.dimmer-btn.active {
    background: rgba(241, 196, 15, 0.22);
    border-color: #f1c40f;
    color: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.35);
}

.light-swatches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.light-swatch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s ease;
    text-align: left;
}

.light-swatch-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.light-swatch-btn.active {
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.25);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

.swatch-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    display: inline-block;
}

.custom-color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.85rem;
}

.custom-color-picker-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-hex-tag {
    font-family: monospace;
    font-size: 0.85rem;
    color: #f1c40f;
    font-weight: 700;
}

.light-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.close-light-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #2ecc71;
    color: #fff;
    padding: 8px 24px;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
}

/* ==========================================================================
   DAILY LOGIN REWARDS & LIVE-OPS SEASON PASS STYLES
   ========================================================================== */
.daily-pass-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 78, 59, 0.4));
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #f8fafc;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 700;
}
.daily-pass-chip-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(6, 78, 59, 0.6));
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.daily-pass-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2px solid #0f172a;
}
.daily-pass-badge.pulse {
    animation: beaconPulse 1.5s infinite;
}
@keyframes beaconPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.daily-rewards-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 15, 28, 0.85);
    backdrop-filter: blur(8px);
}
.daily-rewards-modal-overlay.hidden { display: none !important; }
.daily-rewards-card {
    width: 92%;
    max-width: 820px;
    max-height: 88vh;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
}
.daily-rewards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.8));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-icon-flare {
    font-size: 2rem;
    filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.4));
}
.daily-tabs-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 16px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.daily-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.daily-tab-btn.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.tab-chip-alert {
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
}

.daily-tab-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

/* 7-Day Streak Grid */
.streak-overview-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.streak-counter {
    display: flex;
    align-items: center;
    gap: 12px;
}
.flame-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}
.streak-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f59e0b;
}
.streak-meta {
    font-size: 0.78rem;
    color: #94a3b8;
}
.claim-mega-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    font-size: 0.95rem !important;
    padding: 10px 22px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
    cursor: pointer;
}
.streak-claimed-badge {
    font-size: 0.84rem;
    color: #10b981;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.streak-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}
.streak-day-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
    position: relative;
}
.streak-day-card.current-day {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}
.streak-day-card.jackpot-card {
    border-color: #f59e0b;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.15), rgba(30, 41, 59, 0.8));
}
.streak-day-card.is-claimed {
    opacity: 0.65;
}
.day-num-header {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.day-icon {
    font-size: 1.8rem;
    margin: 4px 0;
}
.day-reward-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
}
.day-reward-value {
    font-size: 0.72rem;
    color: #38bdf8;
    line-height: 1.2;
    margin-bottom: 6px;
    min-height: 28px;
}
.day-xp-badge {
    font-size: 0.68rem;
    color: #10b981;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 6px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.day-stamp {
    font-size: 0.66rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
.day-stamp.claimed { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.day-stamp.claimable { background: #10b981; color: #fff; }
.day-stamp.completed { background: rgba(16, 185, 129, 0.25); color: #10b981; }
.day-stamp.locked { background: rgba(0, 0, 0, 0.3); color: #64748b; }

/* Season Tab */
.season-progress-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.season-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.season-total-xp strong { color: #10b981; font-size: 1.15rem; }
.season-main-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 16px;
}
.season-main-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #06b6d4);
    border-radius: 5px;
    transition: width 0.4s ease;
}
.season-tiers-track {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.tier-node {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.74rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tier-node.unlocked { border-color: #10b981; background: rgba(16, 185, 129, 0.1); }
.tier-node.claimed { opacity: 0.6; }
.tier-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin: 6px 0;
}
.tier-node.unlocked .tier-circle { background: #10b981; color: #fff; }
.tier-name { font-weight: 700; color: #f8fafc; margin-bottom: 2px; }
.tier-reward { color: #38bdf8; font-size: 0.68rem; margin-bottom: 6px; }

/* Quests */
.quests-list-grid { display: flex; flex-direction: column; gap: 8px; }
.quest-row-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
}
.quest-row-card.quest-ready { border-color: #10b981; background: rgba(16, 185, 129, 0.08); }
.quest-row-card.quest-claimed { opacity: 0.55; }
.quest-icon { font-size: 1.8rem; }
.quest-info { flex: 1; min-width: 0; }
.quest-title-row { display: flex; justify-content: space-between; font-size: 0.86rem; margin-bottom: 2px; }
.quest-desc { font-size: 0.74rem; color: #94a3b8; margin-bottom: 6px; }
.quest-bar-bg { width: 100%; height: 6px; background: rgba(0, 0, 0, 0.3); border-radius: 3px; overflow: hidden; }
.quest-bar-fill { height: 100%; background: #10b981; border-radius: 3px; }
.quest-reward-col { display: flex; flex-direction: column; gap: 4px; }
.reward-pill { font-size: 0.7rem; font-weight: 700; color: #10b981; background: rgba(16, 185, 129, 0.12); padding: 2px 8px; border-radius: 10px; text-align: center; }
.reward-pill.money { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.reward-pill.diamond { color: #06b6d4; background: rgba(6, 182, 212, 0.12); }
.quest-action-col button { padding: 6px 16px; font-size: 0.8rem; cursor: pointer; }
.quest-done-lbl { font-size: 0.75rem; color: #94a3b8; font-weight: 700; }
.quest-locked-lbl { font-size: 0.75rem; color: #64748b; }

/* ==========================================================================
   CREATE-A-MEL 2.0: WARDROBE STYLIST & CAS SALON STYLES
   ========================================================================== */
.wardrobe-salon-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 15, 28, 0.85);
    backdrop-filter: blur(8px);
}
.wardrobe-salon-modal-overlay.hidden { display: none !important; }
.wardrobe-salon-card {
    width: 92%;
    max-width: 820px;
    max-height: 88vh;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
}
.salon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(15, 23, 42, 0.85));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.salon-branding { display: flex; align-items: center; gap: 12px; }
.salon-icon-badge { font-size: 2rem; filter: drop-shadow(0 2px 8px rgba(236, 72, 153, 0.4)); }

.salon-name-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.salon-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.salon-input-group input, .salon-input-group select {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
}
.salon-tabs-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 16px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.salon-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
}
.salon-tab-btn.active {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.35);
}
.salon-tab-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}
.salon-sub-section { margin-bottom: 18px; }
.salon-sub-section h4 {
    margin: 0 0 10px 0;
    color: #f8fafc;
    font-size: 0.95rem;
}
.hairstyles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.hairstyle-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.hairstyle-card:hover {
    border-color: #f472b6;
    background: rgba(236, 72, 153, 0.1);
}
.hairstyle-card.active {
    border-color: #f472b6;
    background: rgba(236, 72, 153, 0.18);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}
.hair-icon { font-size: 1.6rem; margin-bottom: 4px; }
.hair-name { font-size: 0.82rem; margin-bottom: 2px; }
.hair-desc { font-size: 0.7rem; color: #94a3b8; }

.swatches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-swatch-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}
.color-swatch-circle:hover {
    transform: scale(1.18);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}
.color-swatch-circle.active {
    border-color: #ffffff;
    box-shadow: 0 0 12px #f472b6, 0 0 0 2px #fff;
    transform: scale(1.12);
}
.color-swatch-circle.mini {
    width: 26px;
    height: 26px;
}

.skin-tones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.skin-tone-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.skin-tone-card:hover { border-color: #f472b6; background: rgba(236, 72, 153, 0.1); }
.skin-tone-card.active { border-color: #f472b6; background: rgba(236, 72, 153, 0.2); }
.skin-color-orb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.skin-tone-name { font-size: 0.78rem; font-weight: 700; }

.outfit-slots-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.outfit-slot-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 6px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s;
}
.outfit-slot-btn.active {
    background: rgba(236, 72, 153, 0.25);
    border-color: #f472b6;
    color: #f472b6;
}
.wardrobe-pieces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.piece-color-col h5 {
    margin: 0 0 8px 0;
    font-size: 0.84rem;
    color: #94a3b8;
}

.salon-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.save-salon-btn {
    background: linear-gradient(135deg, #ec4899, #db2777) !important;
    border-color: #ec4899 !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4) !important;
    cursor: pointer;
}

/* ==========================================================================
   PET COMPANIONS & CREATURE SANCTUARY ENGINE
   ========================================================================== */
.pet-sanctuary-modal .modal-card {
    max-width: 780px;
    width: 95%;
    background: radial-gradient(circle at 15% 15%, #1e1b4b 0%, #0f172a 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(245, 158, 11, 0.2);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pet-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pet-badge-pill {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.pet-nav-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pet-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.pet-tab.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.pet-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.pet-care-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}
@media (max-width: 680px) {
    .pet-care-grid { grid-template-columns: 1fr; }
}

.pet-preview-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pet-avatar-hero {
    font-size: 4rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}
.pet-preview-box h3 { margin: 0; font-size: 1.25rem; color: #fff; }
.pet-breed-label { font-size: 0.8rem; color: #94a3b8; margin: 4px 0 14px 0; }

.collar-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 6px 0 14px 0;
}
.collar-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s;
}
.collar-swatch:hover { transform: scale(1.2); }
.collar-swatch.active { border-color: #ffffff; transform: scale(1.15); box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }

.pet-rename-row {
    display: flex;
    gap: 8px;
    width: 100%;
}
.pet-rename-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.pet-motives-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
}
.pet-motives-panel h4 { margin: 0 0 14px 0; color: #f59e0b; font-size: 1rem; }
.pet-motive-bar-wrap { margin-bottom: 12px; }
.motive-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 4px;
    color: #e2e8f0;
}
.motive-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
}
.motive-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.fill-hunger { background: linear-gradient(90deg, #ef4444, #f59e0b); }
.fill-energy { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.fill-affection { background: linear-gradient(90deg, #ec4899, #f43f5e); }

.pet-actions-quick-row {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.pet-actions-quick-row button {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 0.82rem;
    cursor: pointer;
}

.pet-stats-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #94a3b8;
}
.pet-stats-box strong { color: #f59e0b; }

.pet-tricks-container { display: flex; flex-direction: column; gap: 14px; }
.trick-level-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 12px 18px;
    border-radius: 12px;
}
.trick-xp-badge {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
}
.tricks-list { display: flex; flex-direction: column; gap: 10px; }
.trick-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.trick-card.unlocked { border-color: rgba(245, 158, 11, 0.35); }
.trick-icon { font-size: 1.8rem; }
.trick-info { flex: 1; }
.trick-info h4 { margin: 0 0 4px 0; color: #fff; font-size: 0.95rem; }
.trick-info p { margin: 0; font-size: 0.8rem; color: #94a3b8; }
.trick-req-pill {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    margin-left: 6px;
}

.pet-adopt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.adopt-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.adopt-card.current-pet {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}
.adopt-icon { font-size: 3rem; margin-bottom: 6px; }
.adopt-card h3 { margin: 0 0 4px 0; color: #fff; font-size: 1.1rem; }
.adopt-breed { color: #f59e0b; font-size: 0.8rem; font-weight: 700; margin-bottom: 8px; }
.adopt-desc { font-size: 0.78rem; color: #94a3b8; margin-bottom: 8px; flex: 1; }
.adopt-food { font-size: 0.76rem; color: #cbd5e1; margin-bottom: 12px; }
.active-pet-tag { color: #10b981; font-weight: 800; font-size: 0.84rem; }

/* ==========================================================================
   OPEN FOR BUSINESS: RETAIL SHOPS & COMMERCE SIMULATOR
   ========================================================================== */
.business-shop-modal .modal-card {
    max-width: 840px;
    width: 95%;
    background: radial-gradient(circle at 15% 15%, #064e3b 0%, #0f172a 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(16, 185, 129, 0.2);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.business-header-info { display: flex; align-items: center; gap: 12px; }
.business-type-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}
.business-header-controls { display: flex; align-items: center; gap: 10px; }
.btn-store-open {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #34d399 !important;
    color: #fff !important;
    font-weight: 700;
    cursor: pointer;
}
.btn-store-closed {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #f87171 !important;
    color: #fff !important;
    font-weight: 700;
    cursor: pointer;
}

.business-tabs-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.business-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.business-tab.active {
    color: #10b981;
    border-bottom-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.business-tab-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.biz-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 600px) {
    .biz-kpi-grid { grid-template-columns: 1fr; }
}
.kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.kpi-icon { font-size: 2rem; }
.kpi-info { display: flex; flex-direction: column; }
.kpi-label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; }
.kpi-value { font-size: 1.25rem; color: #fff; }

.biz-dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 680px) {
    .biz-dashboard-sections { grid-template-columns: 1fr; }
}
.biz-recent-sales, .biz-quick-actions {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
}
.biz-recent-sales h3, .biz-quick-actions h3 {
    margin: 0 0 12px 0;
    color: #10b981;
    font-size: 0.95rem;
}
.sales-list { display: flex; flex-direction: column; gap: 8px; }
.sale-entry {
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.8fr 0.8fr;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #cbd5e1;
}
.sale-price { color: #10b981; font-weight: 700; text-align: right; }
.sale-time { color: #64748b; font-size: 0.72rem; text-align: right; }

.store-rename-form { margin-bottom: 16px; }
.store-rename-form label, .store-markup-selector label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 6px;
}
.form-row { display: flex; gap: 8px; }
.form-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.markup-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.markup-pill {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.markup-pill.active {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #10b981;
    font-weight: 700;
}

.stock-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.stock-header-row h3 { margin: 0 0 4px 0; color: #fff; }
.stock-header-row p { margin: 0; font-size: 0.8rem; color: #94a3b8; }
.shelf-stock-table-wrap { overflow-x: auto; }
.shelf-stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.shelf-stock-table th {
    text-align: left;
    padding: 10px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.shelf-stock-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}
.stock-cat-pill {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    text-transform: capitalize;
}
.stock-count-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
}
.stock-count-badge.out-of-stock {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.reviews-feed { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.review-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
}
.review-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.review-author { color: #f59e0b; font-size: 0.88rem; }
.review-stars { font-size: 0.85rem; }
.review-date { font-size: 0.72rem; color: #64748b; }
.review-quote { margin: 0; font-size: 0.82rem; color: #cbd5e1; font-style: italic; }

.perks-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.perk-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.perk-card.perk-unlocked {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.06);
}
.perk-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.perk-title-row h4 { margin: 0; color: #fff; font-size: 0.95rem; }
.perk-status { font-size: 0.75rem; font-weight: 700; color: #10b981; }
.perk-card.perk-locked .perk-status { color: #f59e0b; }
.perk-body p { margin: 0; font-size: 0.8rem; color: #94a3b8; }
.perk-progress-wrap {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}
.perk-progress-bar { height: 100%; background: #f59e0b; border-radius: 3px; }
.perk-progress-text { font-size: 0.7rem; color: #64748b; margin-top: 2px; display: block; }

/* ==========================================================================
   FISHING, MARINE ECOLOGY & VALLEY AQUARIUM SYSTEM (v73)
   ========================================================================== */
.marine-ecology-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 15, 29, 0.78);
    backdrop-filter: blur(10px);
    z-index: 9500;
    align-items: center;
    justify-content: center;
}
.marine-ecology-modal.active,
.marine-ecology-modal:not(.hidden):not([style*="display: none"]) {
    display: flex;
}
.marine-modal-card {
    width: 900px;
    max-width: 95vw;
    max-height: 88vh;
    background: linear-gradient(145deg, rgba(14, 28, 48, 0.96), rgba(8, 18, 33, 0.98));
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e2e8f0;
}
.marine-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.marine-header-info h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #38bdf8;
    font-weight: 800;
}
.marine-rank-badge {
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.marine-tabs-nav {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.marine-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.marine-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.marine-tab.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.marine-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.marine-journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.fish-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, border-color 0.2s;
}
.fish-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.4);
}
.fish-card.locked {
    opacity: 0.55;
    filter: grayscale(0.5);
}
.fish-card.tier-legendary {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(255, 255, 255, 0.02));
}
.fish-icon-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fish-icon {
    font-size: 2rem;
}
.tier-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}
.tier-common .tier-pill { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.tier-uncommon .tier-pill { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.tier-rare .tier-pill { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.tier-epic .tier-pill { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.tier-legendary .tier-pill { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.fish-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.fish-habitat {
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
}
.fish-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #cbd5e1;
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 0;
}
.fish-desc {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.35;
}
.stock-fish-btn {
    margin-top: 4px;
    font-size: 0.78rem;
    padding: 6px 12px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #38bdf8;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}
.tank-showcase-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    padding: 20px;
}
.tank-showcase-card h3 {
    margin-top: 0;
    color: #38bdf8;
}
.stocked-fish-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.stocked-fish-chip {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0f2fe;
}
.ranks-ladder {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}
.rank-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}
.rank-card.achieved {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.06);
}
.rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rank-header strong {
    color: #fff;
    font-size: 0.9rem;
}
.rank-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}
.rank-card.achieved .rank-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.rank-perk {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Tension Reel Minigame Overlay */
.fishing-reel-overlay {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 47, 0.92);
    border: 2px solid #38bdf8;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 16px 24px;
    z-index: 9600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.reel-instructions {
    font-size: 0.85rem;
    font-weight: 700;
    color: #38bdf8;
}
.tension-bar-track {
    width: 260px;
    height: 18px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 9px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.tension-sweet-spot {
    position: absolute;
    left: 35%;
    width: 30%;
    height: 100%;
    background: rgba(34, 197, 94, 0.35);
    border-left: 2px solid #22c55e;
    border-right: 2px solid #22c55e;
}
.tension-needle {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transform: translateX(-50%);
    transition: left 0.05s ease-out;
}
.reel-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 1px solid #38bdf8;
    color: #fff;
    padding: 8px 24px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s;
}
.reel-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   RELATIONSHIPS 2.0: ROMANCE & MARRIAGE SYSTEM (v73)
   ========================================================================== */
.relationship-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 9, 23, 0.78);
    backdrop-filter: blur(10px);
    z-index: 9500;
    align-items: center;
    justify-content: center;
}
.relationship-modal.active,
.relationship-modal:not(.hidden):not([style*="display: none"]) {
    display: flex;
}
.rel-modal-card {
    width: 900px;
    max-width: 95vw;
    max-height: 88vh;
    background: linear-gradient(145deg, rgba(32, 14, 38, 0.96), rgba(20, 8, 25, 0.98));
    border: 1px solid rgba(244, 114, 182, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(244, 114, 182, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fce7f3;
}
.rel-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rel-header-info h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #f472b6;
    font-weight: 800;
}
.rel-family-badge {
    background: rgba(244, 114, 182, 0.18);
    border: 1px solid rgba(244, 114, 182, 0.4);
    color: #f472b6;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.relationship-tabs-nav {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rel-tab {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.rel-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.rel-tab.active {
    color: #f472b6;
    background: rgba(244, 114, 182, 0.15);
    border: 1px solid rgba(244, 114, 182, 0.3);
}
.relationship-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.rel-contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}
.rel-contact-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, border-color 0.2s;
}
.rel-contact-card:hover {
    transform: translateY(-2px);
    border-color: rgba(244, 114, 182, 0.4);
}
.contact-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.contact-icon {
    font-size: 2rem;
}
.contact-info {
    flex: 1;
}
.contact-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
}
.contact-sub {
    font-size: 0.75rem;
    color: #f472b6;
}
.rel-tier-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}
.rel-meter-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #e2e8f0;
}
.rel-track {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
}
.rel-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #f43f5e);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.contact-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.social-act-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.social-act-btn:hover {
    background: rgba(244, 114, 182, 0.2);
    border-color: #f472b6;
    color: #fbcfe8;
}
.milestone-act-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    border: 1px solid #f472b6;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s;
}
.milestone-act-btn:hover {
    box-shadow: 0 0 10px rgba(244, 114, 182, 0.5);
}
.matrimony-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(244, 114, 182, 0.25);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}
.matrimony-rings {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.matrimony-card h3 {
    margin: 0 0 8px 0;
    color: #f472b6;
    font-size: 1.3rem;
}
.spousal-perks-box,
.how-to-marry-box {
    margin-top: 20px;
    text-align: left;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.spousal-perks-box h4,
.how-to-marry-box h4 {
    margin: 0 0 8px 0;
    color: #fbcfe8;
}
.spousal-perks-box ul,
.how-to-marry-box ol {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* ==========================================================================
   MelsVoid (EVE-style space game)
   ========================================================================== */
.melsvoid-container {
    position: fixed;
    inset: 0;
    z-index: 250000 !important;
    background: #02030a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #cbd5e1;
    user-select: none;
    overflow: hidden;
}
.mv-root { position: absolute; inset: 0; }
.mv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mv-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mv-label {
    position: absolute; transform: translate(-50%, -150%); font-size: 11px; white-space: nowrap; pointer-events: auto; cursor: pointer;
    padding: 1px 6px; border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(2, 6, 23, 0.55); border-radius: 3px;
}
.mv-label.npc { color: #fca5a5; border-color: rgba(248, 113, 113, 0.6); }
.mv-label.player { color: #93c5fd; }
.mv-label.celestial { color: #e2e8f0; opacity: 0.8; }
.mv-label.sel { border-color: #fbbf24; color: #fde68a; }
.mv-label.locked { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.8); }

.mv-header, .mv-overview, .mv-hud, .mv-log, .mv-target, .mv-st-panel {
    background: rgba(8, 13, 28, 0.82); border: 1px solid rgba(100, 116, 139, 0.45); border-radius: 6px;
    backdrop-filter: blur(4px);
}
.mv-header { position: absolute; top: 12px; left: 12px; padding: 8px 12px; min-width: 240px; }
.mv-sys { font-size: 18px; color: #f1f5f9; }
.mv-sys span { margin-left: 8px; font-weight: 700; }
.mv-sub { font-size: 12px; opacity: 0.8; margin: 2px 0 6px; }
.mv-wallet { font-size: 14px; color: #fde68a; font-weight: 600; }
.mv-exit {
    position: absolute; top: 12px; right: 12px; background: #7f1d1d; color: #fff; border: 1px solid #ef4444;
    border-radius: 6px; padding: 6px 12px; cursor: pointer; z-index: 5;
}
.mv-warp-banner {
    position: absolute; top: 30%; left: 50%; transform: translateX(-50%); font-size: 26px; letter-spacing: 8px;
    color: #7dd3fc; text-shadow: 0 0 18px #0ea5e9; pointer-events: none;
}

.mv-overview { position: absolute; top: 56px; right: 12px; width: 380px; max-height: calc(100vh - 290px); min-height: 160px; display: flex; flex-direction: column; overflow: hidden; z-index: 6; }
.mv-tabs { display: flex; border-bottom: 1px solid rgba(100, 116, 139, 0.4); }
.mv-tabs button, .mv-st-tabs button {
    flex: 1; background: none; border: none; color: #94a3b8; padding: 6px 4px; cursor: pointer; font-size: 12px;
}
.mv-tabs button.active, .mv-st-tabs button.active { color: #f8fafc; border-bottom: 2px solid #38bdf8; }
.mv-overview-list { overflow-y: auto; flex: 1; min-height: 80px; }
.mv-row { display: grid; grid-template-columns: 22px 1fr 86px 74px; gap: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.mv-row:hover { background: rgba(56, 189, 248, 0.08); }
.mv-row.sel { background: rgba(251, 191, 36, 0.14); }
.mv-row.hostile .mv-name { color: #fca5a5; }
.mv-type { opacity: 0.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-dist { text-align: right; color: #e2e8f0; }
.mv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-selected { border-top: 1px solid rgba(100, 116, 139, 0.4); padding: 8px; font-size: 12px; }
.mv-sel-title { font-size: 14px; color: #f8fafc; margin-bottom: 4px; display: flex; justify-content: space-between; }
.mv-sel-title span { opacity: 0.7; font-size: 12px; }
.mv-sel-btns { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.mv-root button { font-family: inherit; }
.mv-sel-btns button, .mv-services button, .mv-mkt button, .mv-ship button, .mv-undock, .mv-stop {
    background: #1e293b; color: #e2e8f0; border: 1px solid #475569; border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 12px;
}
.mv-root button:hover:not(:disabled) { border-color: #38bdf8; }
.mv-root button.primary { background: #0c4a6e; border-color: #38bdf8; }
.mv-root button:disabled { opacity: 0.4; cursor: not-allowed; }
.mv-root kbd { font-size: 10px; opacity: 0.6; margin-left: 2px; }
.mv-range select, .mv-fit-row select { background: #0f172a; color: #e2e8f0; border: 1px solid #475569; border-radius: 4px; padding: 2px 4px; }
.mv-hint { opacity: 0.6; }

.mv-bars { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.mv-bar { height: 6px; background: rgba(51, 65, 85, 0.7); border-radius: 3px; overflow: hidden; flex: 1; }
/* In the stacked (column) bars, flex:1 would zero the height: keep the bars 6px tall */
.mv-bars .mv-bar { flex: none; }
.mv-t-pct { display: flex; justify-content: space-between; font-size: 10px; margin-top: 2px; }
.mv-t-pct .s { color: #7dd3fc; }
.mv-t-pct .a { color: #fcd34d; }
.mv-t-pct .h { color: #fca5a5; }
.mv-menu { position: absolute; z-index: 100000; min-width: 170px; background: rgba(8, 13, 28, 0.96); border: 1px solid #475569; border-radius: 4px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); font-size: 12px; user-select: none; }
.mv-menu-title { padding: 5px 10px; color: #f8fafc; font-weight: 600; border-bottom: 1px solid #334155; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-mi { padding: 5px 10px; color: #cbd5e1; cursor: pointer; white-space: nowrap; }
.mv-mi:hover { background: rgba(56, 189, 248, 0.15); color: #fff; }
.mv-bar i { display: block; height: 100%; }
.mv-bar.shield i { background: #38bdf8; }
.mv-bar.armor i { background: #f59e0b; }
.mv-bar.hull i { background: #ef4444; }
.mv-bar.cap i { background: #fde047; }

.mv-hitflash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 10; }
.mv-hitflash.shield { animation: mvShieldFlash 0.35s ease-out; }
.mv-hitflash.hull { animation: mvHullFlash 0.5s ease-out; }
@keyframes mvShieldFlash { 0% { opacity: 0.6; box-shadow: inset 0 0 90px rgba(56, 189, 248, 0.65); } 100% { opacity: 0; } }
@keyframes mvHullFlash { 0% { opacity: 0.8; box-shadow: inset 0 0 120px rgba(239, 68, 68, 0.85); } 100% { opacity: 0; } }

.mv-targets {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    min-width: 170px; max-width: calc(100vw - 24px); min-height: 50px;
    display: flex; flex-direction: column; overflow: hidden;
    z-index: 8;
}
.mv-targets.empty { opacity: 0.85; }
.mv-tg-head {
    display: flex; align-items: center; gap: 6px; padding: 4px 8px;
    background: rgba(15, 23, 42, 0.75); border-bottom: 1px solid rgba(100, 116, 139, 0.35);
    font-size: 11px; cursor: move; user-select: none;
}
.mv-tg-grip { opacity: 0.45; font-size: 13px; cursor: move; }
.mv-tg-title { color: #f8fafc; font-weight: 600; white-space: nowrap; }
.mv-tg-sort {
    margin-left: auto; background: #0f172a; color: #cbd5e1; border: 1px solid #475569;
    border-radius: 3px; font-size: 10px; padding: 1px 4px; outline: none; cursor: pointer;
}
.mv-tg-sort:hover { border-color: #38bdf8; }
.mv-tg-reset {
    background: none !important; border: none !important; color: #94a3b8 !important;
    padding: 0 4px !important; font-size: 12px !important; cursor: pointer;
}
.mv-tg-reset:hover { color: #38bdf8 !important; }
.mv-tg-list {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 6px;
    overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 38px;
}
.mv-tg-empty {
    font-size: 11px; opacity: 0.65; padding: 4px 6px; white-space: nowrap;
}
.mv-target {
    width: 136px; padding: 6px 8px; font-size: 11px; cursor: pointer;
    user-select: none; border-radius: 4px; transition: transform 0.1s ease, border-color 0.15s ease;
    flex-shrink: 0;
}
.mv-target:hover { border-color: #38bdf8; }
.mv-target.active { border-color: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.mv-target.locking { opacity: 0.6; border-style: dashed; }
.mv-target.hostile { border-color: rgba(239, 68, 68, 0.45); }
.mv-target.hostile .mv-t-name { color: #fca5a5; }
.mv-target.dragging { opacity: 0.35; border-style: dashed; transform: scale(0.96); }
.mv-targets.reordering .mv-target { cursor: grabbing; }
.mv-t-name { color: #f8fafc; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-t-type { font-size: 10px; opacity: 0.65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.mv-t-dist, .mv-t-ore { opacity: 0.75; font-size: 10px; }
.mv-tg-resize {
    position: absolute; right: 0; bottom: 0; width: 14px; height: 14px;
    cursor: nwse-resize; z-index: 2;
}
.mv-tg-resize::after {
    content: ''; position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px;
    border-right: 2px solid rgba(148, 163, 184, 0.6); border-bottom: 2px solid rgba(148, 163, 184, 0.6);
}

.mv-hud { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 8px 12px; width: min(720px, 94vw); }
.mv-hud-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mv-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.mv-stat label { width: 40px; opacity: 0.75; }
.mv-stat span { width: 70px; text-align: right; opacity: 0.85; }
.mv-hud-mid { display: flex; gap: 16px; align-items: center; font-size: 12px; margin: 6px 0; }
.mv-speed { color: #f8fafc; font-weight: 600; }
/* EVE-style speedometer: fill = current speed, marker = the speed you set (#93) */
.mv-speedbar { position: relative; flex: 1; min-width: 180px; max-width: 320px; height: 18px; background: rgba(51, 65, 85, 0.7); border: 1px solid #475569; border-radius: 4px; cursor: ew-resize; overflow: hidden; touch-action: none; }
.mv-speedbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #0e7490, #38bdf8); opacity: 0.75; }
.mv-speedbar b { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.mv-speedbar span { position: relative; font-size: 11px; color: #f8fafc; padding-left: 6px; line-height: 18px; white-space: nowrap; text-shadow: 0 1px 2px #000; pointer-events: none; }
.mv-nav { color: #7dd3fc; }
.mv-stop { margin-left: auto; }
.mv-rack { display: flex; gap: 6px; flex-wrap: wrap; }
/* Combat status, drones and resists (#127) */
.mv-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; }
.mv-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.5); background: rgba(15, 23, 42, 0.8); }
.mv-chip.warn { color: #fde68a; border-color: rgba(251, 191, 36, 0.7); }
.mv-chip.danger { color: #fecaca; border-color: rgba(239, 68, 68, 0.9); background: rgba(127, 29, 29, 0.55); animation: mvPulse 1s infinite alternate; }
@keyframes mvPulse { from { opacity: 0.75; } to { opacity: 1; } }
.mv-drones { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 11px; }
.mv-drones-h { opacity: 0.7; }
.mv-drones button { font-size: 11px; padding: 2px 6px; }
.mv-drones-bay, .mv-drones-space { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mv-drone { display: inline-grid; grid-template-columns: auto 30px auto; grid-template-rows: repeat(3, 3px); column-gap: 4px; align-items: center; padding: 2px 4px; border: 1px solid rgba(100, 116, 139, 0.5); border-radius: 4px; }
.mv-drone > :first-child { grid-row: 1 / 4; }
.mv-drone i { display: block; height: 3px; grid-column: 2; }
.mv-drone i.s { background: #38bdf8; } .mv-drone i.a { background: #f59e0b; } .mv-drone i.h { background: #ef4444; }
.mv-drone small { grid-column: 3; grid-row: 1 / 4; opacity: 0.7; }
.mv-drone.attack { border-color: rgba(239, 68, 68, 0.7); }
.mv-drone.mine { border-color: rgba(45, 212, 191, 0.7); }
.mv-resists { margin-top: 8px; border-collapse: collapse; font-size: 11px; }
.mv-resists th, .mv-resists td { padding: 1px 6px; text-align: right; }
.mv-resists th:first-child { text-align: left; }
.mv-inv-bay { margin-top: 10px; }
/* Killboard and rigs (#128) */
.mv-km { display: grid; grid-template-columns: 1.6fr 1fr 70px 110px 130px; gap: 6px; padding: 4px 2px; border-bottom: 1px solid rgba(51, 65, 85, 0.5); cursor: pointer; font-size: 12px; }
.mv-km:hover { background: rgba(56, 189, 248, 0.06); }
.mv-km.loss b { color: #fca5a5; }
.mv-km.kill b { color: #86efac; }
.mv-km-detail { font-size: 11px; padding: 4px 8px 8px 20px; opacity: 0.85; display: grid; gap: 2px; }
.mv-slot.rig { color: #c4b5fd; }
/* Fleets and chat (#129) */
.mv-row.fleet .mv-name, .mv-label.fleet { color: #a5b4fc; }
.mv-label.fleet { border-color: rgba(129, 140, 248, 0.7); }
.mv-neocom button { position: relative; }
.mv-badge { position: absolute; top: -4px; right: -4px; min-width: 14px; padding: 0 3px; border-radius: 7px; background: #ef4444; color: #fff; font-size: 9px; line-height: 14px; }
.mv-badge:empty { display: none; }
.mv-fl-inv { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px; margin-bottom: 8px; border: 1px solid rgba(251, 191, 36, 0.5); border-radius: 4px; }
.mv-fl-mem { display: grid; grid-template-columns: 1fr 1.2fr 28px; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid rgba(51, 65, 85, 0.5); font-size: 12px; }
.mv-fl-mem.off { opacity: 0.5; }
.mv-fl-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mv-fl-invite, .mv-chat-say { display: flex; gap: 6px; margin-top: 8px; }
.mv-fl-invite input, .mv-chat-say input { flex: 1; min-width: 0; }
.mv-chat-list { height: calc(100% - 80px); min-height: 120px; overflow-y: auto; font-size: 12px; }
.mv-chat-line { padding: 1px 0; word-break: break-word; }
.mv-chat-line.bc { color: #fde68a; }
.mv-chat-line.bc.help { color: #fca5a5; }
/* Factions, standings, missions (#130) */
.mv-holder { margin-left: 6px; font-size: 11px; font-weight: 700; }
.mv-fa-card { padding: 8px; margin-bottom: 8px; border: 1px solid rgba(100, 116, 139, 0.45); border-radius: 4px; }
.mv-fa-card.mine { border-color: rgba(251, 191, 36, 0.6); }
.mv-wz { display: grid; grid-template-columns: 80px 1fr 90px; gap: 8px; align-items: center; font-size: 12px; margin: 3px 0; }
.mv-wz-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #ef4444, #475569 50%, #38bdf8); position: relative; }
.mv-wz-bar i { position: absolute; top: -3px; width: 3px; height: 14px; background: #fff; transform: translateX(-1px); }
.mv-fa-st > div { display: grid; grid-template-columns: 1fr 140px 80px; gap: 8px; align-items: center; font-size: 12px; margin: 3px 0; }
.mv-standing { position: relative; display: inline-block; width: 120px; height: 12px; border-radius: 6px; background: rgba(51, 65, 85, 0.6); overflow: hidden; vertical-align: middle; }
.mv-standing i { position: absolute; inset: 0 auto 0 0; background: rgba(148, 163, 184, 0.5); }
.mv-standing.pos i { background: rgba(56, 189, 248, 0.6); }
.mv-standing.neg i { background: rgba(239, 68, 68, 0.6); }
.mv-standing b { position: relative; font-size: 9px; padding-left: 4px; }
.mv-lp { display: grid; grid-template-columns: 1fr 80px 100px auto; gap: 6px; align-items: center; font-size: 12px; margin: 3px 0; }
.mv-ms { padding: 6px; margin: 6px 0; border: 1px solid rgba(100, 116, 139, 0.45); border-radius: 4px; }
.mv-ms.offer { border-color: rgba(56, 189, 248, 0.5); }
.mv-ms button { margin-right: 6px; }
/* Station hangars and courier contracts (#131) */
.mv-ship.far { opacity: 0.6; }
.mv-ct { padding: 6px; margin: 6px 0; border: 1px solid rgba(100, 116, 139, 0.45); border-radius: 4px; font-size: 12px; }
.mv-ct button { margin-top: 4px; margin-right: 6px; }
.mv-ct-new label { display: inline-flex; gap: 4px; align-items: center; margin: 6px 10px 6px 0; font-size: 12px; }
.mv-ct-new input[type=number] { width: 110px; }
.mv-ct-pick { max-height: 180px; overflow-y: auto; }
.mv-ct-pick > div { display: grid; grid-template-columns: 1fr 90px auto; gap: 6px; align-items: center; font-size: 12px; margin: 2px 0; }
/* Star map and scanner (#131) */
.mv-map { width: 100%; height: auto; max-height: 340px; background: radial-gradient(ellipse at center, rgba(30, 41, 59, 0.6), rgba(2, 6, 23, 0.9)); border-radius: 6px; }
.mv-map line { stroke: rgba(148, 163, 184, 0.45); stroke-width: 2; }
.mv-map line.route { stroke: #fbbf24; stroke-width: 4; }
.mv-map-sys { cursor: pointer; }
.mv-map-sys circle { stroke: rgba(15, 23, 42, 0.9); stroke-width: 2; }
.mv-map-sys.here circle { stroke: #fff; stroke-width: 3; }
.mv-map-sys.sel circle { stroke: #fbbf24; stroke-width: 3; }
.mv-map-sys text { fill: #e2e8f0; font-size: 11px; text-anchor: middle; pointer-events: none; }
.mv-map-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mv-sc-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.mv-sig { display: grid; grid-template-columns: 70px 1fr 90px 40px 60px; gap: 6px; align-items: center; font-size: 12px; padding: 3px 0; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
.mv-sig-code { font-family: monospace; color: #93c5fd; }
.mv-chip button { font-size: 10px; padding: 0 4px; margin-left: 4px; }
@media (max-width: 700px) { .mv-km { grid-template-columns: 1fr 1fr; } }
.mv-mod {
    position: relative; width: 50px; height: 50px; border-radius: 50%; background: #0f172a; border: 2px solid #334155;
    color: #e2e8f0; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.mv-mod.high { border-color: #475569; }
.mv-mod.mid { border-color: #1e40af; }
.mv-mod.low { border-color: #3f3f46; }
.mv-mod.on { border-color: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.6); }
.mv-mod.passive { opacity: 0.55; cursor: default; }
.mv-mod-ic { font-size: 18px; }
.mv-mod-key { font-size: 9px; opacity: 0.6; }
.mv-cycle { position: absolute; bottom: 0; left: 0; height: 4px; background: #22c55e; }

.mv-log { position: absolute; bottom: 12px; left: 12px; width: 340px; padding: 6px 8px; font-size: 11px; max-height: 170px; overflow: hidden; }
.mv-log-line span { opacity: 0.5; }
.mv-log-line.warn { color: #fcd34d; }
.mv-log-line.danger { color: #fca5a5; }
.mv-log-line.success { color: #86efac; }

.mv-station { position: absolute; inset: 70px 12px 200px 72px; display: flex; justify-content: center; }
.mv-st-panel { width: min(1000px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.mv-st-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid rgba(100, 116, 139, 0.4); }
.mv-st-head h3 { margin: 0; font-size: 16px; color: #f8fafc; }
.mv-st-tabs { display: flex; flex: 1; max-width: 360px; }
.mv-undock { margin-left: auto; padding: 8px 18px !important; font-size: 14px !important; }
.mv-st-body { overflow-y: auto; padding: 10px 14px; }
.mv-st-body h4 { margin: 10px 0 6px; color: #e2e8f0; font-size: 13px; }
.mv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mv-ship { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid rgba(100, 116, 139, 0.3); border-radius: 4px; margin-bottom: 4px; font-size: 13px; }
.mv-ship.active { border-color: #38bdf8; }
.mv-ship button, .mv-tag { margin-left: auto; }
.mv-tag { font-size: 10px; color: #38bdf8; letter-spacing: 1px; }
.mv-fit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.mv-slot { width: 60px; text-transform: uppercase; font-size: 10px; opacity: 0.7; }
.mv-mkt { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
.mv-mkt.small { font-size: 11px; }
.mv-mkt small { opacity: 0.6; }
.mv-services { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

@media (max-width: 1150px) {
    .mv-log { bottom: 170px; width: 300px; }
}

/* ---- MelsVoid: Overview header, sortable columns, Neocom and windows (#91) ---- */
.mv-ov-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; cursor: move; border-bottom: 1px solid rgba(100, 116, 139, 0.4); font-size: 12px; }
.mv-ov-title { color: #f8fafc; font-weight: 600; flex: 1; }
.mv-ov-gear { background: none !important; border: none !important; color: #94a3b8; cursor: pointer; font-size: 14px; padding: 0 2px; }
.mv-ov-gear:hover { color: #38bdf8; }
.mv-tabs { flex-wrap: wrap; }
.mv-tabs button { flex: 1 1 auto; min-width: 54px; }
.mv-ov-cols { display: grid; gap: 4px; padding: 3px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; border-bottom: 1px solid rgba(100, 116, 139, 0.3); }
.mv-ov-cols span { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-ov-cols span:hover, .mv-ov-cols span.sorted { color: #f8fafc; }
.mv-row.pilot .mv-name { color: #93c5fd; }
.mv-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-dim { opacity: 0.65; }
.mv-ov-hp { display: flex; gap: 3px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.mv-ov-hp b { font-weight: 500; min-width: 26px; text-align: right; }
.mv-ov-hp .s { color: #7dd3fc; } .mv-ov-hp .a { color: #fcd34d; } .mv-ov-hp .h { color: #fca5a5; }
.mv-ov-status { text-align: center; }
.mv-ov-empty { padding: 10px; }
.mv-ov-empty a, .mv-root a[data-ui] { color: #38bdf8; cursor: pointer; text-decoration: underline; }
/* Resize handles on every edge and corner (js/melsVoidUi.js makeMovable) */
.mv-edge { position: absolute; z-index: 4; }
.mv-edge-n, .mv-edge-s { left: 10px; right: 10px; height: 7px; cursor: ns-resize; }
.mv-edge-e, .mv-edge-w { top: 10px; bottom: 10px; width: 7px; cursor: ew-resize; }
.mv-edge-n { top: -2px; } .mv-edge-s { bottom: -2px; } .mv-edge-e { right: -2px; } .mv-edge-w { left: -2px; }
.mv-edge-ne, .mv-edge-nw, .mv-edge-se, .mv-edge-sw { width: 14px; height: 14px; }
.mv-edge-ne { top: -2px; right: -2px; cursor: nesw-resize; } .mv-edge-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.mv-edge-nw { top: -2px; left: -2px; cursor: nwse-resize; } .mv-edge-se { bottom: -2px; right: -2px; cursor: nwse-resize; }
.mv-edge:hover { background: rgba(56, 189, 248, 0.35); }
.mv-edge-se::after, .mv-edge-sw::after { content: ''; position: absolute; bottom: 4px; width: 7px; height: 7px; border-bottom: 2px solid #64748b; }
.mv-edge-se::after { right: 4px; border-right: 2px solid #64748b; }
.mv-edge-sw::after { left: 4px; border-left: 2px solid #64748b; }

.mv-neocom { position: absolute; left: 12px; top: 112px; display: flex; flex-direction: column; gap: 6px; z-index: 7; }
.mv-neocom button {
    width: 50px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: rgba(8, 13, 28, 0.82); border: 1px solid rgba(100, 116, 139, 0.45); border-radius: 6px; color: #e2e8f0; cursor: pointer; font-size: 18px;
}
.mv-neocom button small { font-size: 9px; opacity: 0.7; }
.mv-neocom button:hover { border-color: #38bdf8; }

.mv-win {
    position: absolute; display: flex; flex-direction: column; overflow: hidden; min-width: 320px; min-height: 200px; font-size: 12px;
    background: rgba(8, 13, 28, 0.94); border: 1px solid rgba(100, 116, 139, 0.6); border-radius: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.mv-win-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; cursor: move; background: rgba(30, 41, 59, 0.8); border-bottom: 1px solid rgba(100, 116, 139, 0.45); color: #f8fafc; font-weight: 600; }
.mv-win-head button { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 14px; }
.mv-win-head button:hover { color: #f87171; }
.mv-win-body { flex: 1; overflow: auto; padding: 8px 10px; }
.mv-win h4 { margin: 10px 0 4px; font-size: 12px; color: #cbd5e1; display: flex; align-items: center; gap: 8px; }
.mv-win h4 small { opacity: 0.6; font-weight: 400; }
.mv-win input, .mv-win select { background: #0f172a; color: #e2e8f0; border: 1px solid #475569; border-radius: 4px; padding: 2px 5px; font-size: 12px; }
.mv-win input[type="number"] { width: 72px; }
.mv-win button { background: #1e293b; color: #e2e8f0; border: 1px solid #475569; border-radius: 4px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.mv-win button.active { border-color: #38bdf8; color: #f8fafc; }
.mv-win button.mv-danger { border-color: #7f1d1d; color: #fca5a5; }
.mv-win button.mv-linkbtn { background: none; border: none; text-align: left; padding: 2px 0; flex: 1; }
.mv-win-tabs { display: flex; margin: -2px 0 6px; border-bottom: 1px solid rgba(100, 116, 139, 0.4); }
.mv-win-tabs button { background: none; border: none; border-radius: 0; }
.mv-win .mv-tag { font-size: 10px; color: #38bdf8; border: 1px solid #38bdf8; border-radius: 3px; padding: 0 4px; }
.mv-st-tabs button { white-space: nowrap; }
.mv-st-tabs button[data-ui] { flex: 0 0 auto; color: #7dd3fc; }

/* Inventory */
.mv-inv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mv-inv-col { border: 1px solid rgba(100, 116, 139, 0.35); border-radius: 5px; padding: 6px; min-height: 160px; display: flex; flex-direction: column; }
.mv-inv-col h4 { margin-top: 0; }
.mv-inv-list { flex: 1; overflow-y: auto; max-height: 300px; }
.mv-inv-row { display: grid; grid-template-columns: 22px 1fr auto 70px; gap: 6px; align-items: center; padding: 3px 4px; border-radius: 3px; }
.mv-inv-row[draggable="true"] { cursor: grab; }
.mv-inv-row:hover { background: rgba(56, 189, 248, 0.08); }
.mv-inv-row.sel { background: rgba(251, 191, 36, 0.12); }
.mv-inv-row .mv-name { cursor: pointer; }
.mv-inv-acts { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 0 2px 28px; }
.mv-inv-empty { padding: 12px 4px; }
.mv-cap { position: relative; height: 14px; background: rgba(51, 65, 85, 0.7); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.mv-cap i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #0e7490, #38bdf8); }
.mv-cap span { position: relative; font-size: 10px; padding-left: 6px; }

/* Market */
.mv-mkt-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 10px; height: calc(100% - 34px); min-height: 0; }
.mv-mkt-tree { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.mv-mkt-tree input { width: 100%; box-sizing: border-box; }
.mv-mkt-treelist { overflow-y: auto; flex: 1; }
.mv-mkt-gh { cursor: pointer; padding: 3px 2px; color: #e2e8f0; }
.mv-mkt-gh small { opacity: 0.5; }
.mv-mkt-item { cursor: pointer; padding: 2px 4px 2px 18px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-mkt-item:hover { background: rgba(56, 189, 248, 0.08); }
.mv-mkt-item.sel { background: rgba(251, 191, 36, 0.14); color: #fde68a; }
/* Pilot skills window (#126) */
.mv-sk-head { display: flex; gap: 18px; flex-wrap: wrap; padding: 4px 0 8px; font-size: 12px; }
.mv-sk-head b { color: #86efac; }
.mv-sk-wrap { grid-template-columns: 250px 1fr; }
.mv-sk-item { cursor: pointer; padding: 2px 4px 2px 18px; border-radius: 3px; display: flex; justify-content: space-between; align-items: center; gap: 6px; white-space: nowrap; }
.mv-sk-item span:first-child { overflow: hidden; text-overflow: ellipsis; }
.mv-sk-item:hover { background: rgba(56, 189, 248, 0.08); }
.mv-sk-item.sel { background: rgba(251, 191, 36, 0.14); color: #fde68a; }
.mv-sk-item.nobook { opacity: 0.65; }
.mv-sk-item small { opacity: 0.55; }
.mv-sk-pips { display: inline-flex; gap: 2px; flex: none; }
.mv-sk-pips i { width: 8px; height: 8px; border: 1px solid rgba(148, 163, 184, 0.6); background: transparent; }
.mv-sk-pips i.on { background: #38bdf8; border-color: #38bdf8; }
.mv-sk-pips i.q { background: rgba(251, 191, 36, 0.45); border-color: #fbbf24; }
.mv-sk-req.ok { color: #86efac; }
.mv-sk-req.short { color: #fca5a5; }
.mv-sk-act { margin-top: 10px; }
.mv-sk-need { display: block; font-size: 11px; color: #fca5a5; }
.mv-mkt-detail { overflow-y: auto; min-height: 0; }
.mv-mkt-title { font-size: 15px; color: #f8fafc; }
.mv-mkt-title small { font-size: 11px; opacity: 0.6; }
.mv-ord { display: grid; grid-template-columns: 90px 70px 1fr 150px; gap: 6px; align-items: center; padding: 3px 4px; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
.mv-ord input[type="number"] { width: 64px; margin-right: 4px; }
.mv-ord-h { font-size: 10px; text-transform: uppercase; color: #94a3b8; border-bottom-color: rgba(100, 116, 139, 0.6); }
.mv-ord.mine { background: rgba(56, 189, 248, 0.06); }
.mv-ord.far { opacity: 0.55; }
.mv-ord small { opacity: 0.55; }
.mv-ord-my { grid-template-columns: 46px 1fr 80px 110px 1fr 70px; }
.mv-buy { color: #4ade80; font-weight: 600; } .mv-sell { color: #f87171; font-weight: 600; }
.mv-src { margin-left: auto; font-weight: 400; font-size: 11px; display: flex; gap: 4px; align-items: center; }
.mv-place > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; }
.mv-place b { width: 76px; }

/* Industry */
.mv-ref-row { display: grid; grid-template-columns: 1.1fr 70px 2fr 90px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
.mv-ref-row small { opacity: 0.55; }
.mv-minerals { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.mv-minerals small { opacity: 0.55; }
.mv-ind-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 10px; }
.mv-bp-list { max-height: 360px; overflow-y: auto; }
.mv-bp { cursor: pointer; padding: 4px; border-radius: 3px; }
.mv-bp:hover { background: rgba(56, 189, 248, 0.08); }
.mv-bp.sel { background: rgba(251, 191, 36, 0.14); }
.mv-bp small { opacity: 0.6; }
.mv-mat { display: grid; grid-template-columns: 1fr 90px 90px; gap: 6px; padding: 2px 0; }
.mv-mat-h { font-size: 10px; text-transform: uppercase; color: #94a3b8; margin-top: 6px; }
.mv-mat.ok .mv-num:last-child { color: #4ade80; }
.mv-mat.short .mv-num:last-child { color: #f87171; }
.mv-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.mv-job { display: grid; grid-template-columns: 1.4fr 1fr 64px auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
.mv-job small { opacity: 0.55; }
.mv-job-bar { height: 8px; background: rgba(51, 65, 85, 0.7); border-radius: 4px; overflow: hidden; }
.mv-job-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a16207, #fbbf24); }
.mv-job-left { text-align: right; font-variant-numeric: tabular-nums; }

/* Overview settings */
.mv-ovs { display: grid; grid-template-columns: 190px 1fr; gap: 14px; }
.mv-ovs label { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }
.mv-ovs-tabrow { display: flex; align-items: center; gap: 3px; padding: 1px 4px; border-radius: 3px; }
.mv-ovs-tabrow.sel { background: rgba(251, 191, 36, 0.14); }
.mv-ovs-tabrow button:not(.mv-linkbtn) { padding: 0 5px; font-size: 10px; }
.mv-ovs-tabs > button { margin-top: 6px; display: block; }
.mv-ovs-name input { flex: 1; }
.mv-ovs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mv-ovs-colrow { display: flex; align-items: center; gap: 3px; }
.mv-ovs-colrow label { flex: 1; }
.mv-ovs-colrow button { padding: 0 5px; font-size: 10px; }
@media (max-width: 760px) {
    .mv-overview { width: calc(100vw - 24px); top: auto; bottom: 230px; max-height: 32vh; }
    .mv-neocom { top: auto; bottom: 230px; flex-direction: row; left: 12px; }
    .mv-win { left: 8px !important; top: 60px !important; width: calc(100vw - 16px) !important; height: calc(100vh - 80px) !important; }
    .mv-inv, .mv-mkt-wrap, .mv-ind-wrap, .mv-ovs, .mv-ovs-cols { grid-template-columns: 1fr; }
    .mv-station { inset: 70px 12px 200px 12px; }
    .mv-log { display: none; }
    .mv-cols { grid-template-columns: 1fr; }
    .mv-hud-top { grid-template-columns: repeat(2, 1fr); }
}

/* Planned server restart banner (game.js handleRestartNotice) */
.server-restart-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(12, 24, 42, 0.95);
    border: 1.5px solid #f39c12;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
    font-size: 0.9rem;
    pointer-events: none;
}

.server-restart-banner .restart-icon.spinning {
    display: inline-block;
    animation: restartSpin 1.2s linear infinite;
}

@keyframes restartSpin {
    to { transform: rotate(360deg); }
}

/* Accept / Decline prompt for another player's romance or friend request (#86) */
.social-request-prompt {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    z-index: 9000;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(236, 72, 153, 0.6);
    border-radius: 14px;
    padding: 14px 18px;
    color: #f8fafc;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    max-width: min(420px, calc(100vw - 32px));
    text-align: center;
}
.social-request-prompt .social-request-text { font-weight: 600; margin-bottom: 10px; }
.social-request-prompt .social-request-actions { display: flex; gap: 10px; justify-content: center; }

/* ==========================================================================
   MELSBRAWL (ARCADE PLATFORM FIGHTER) CLIENT STYLES
   ========================================================================== */
.melsbrawl-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 250000 !important;
    background: radial-gradient(ellipse at center, #160b33 0%, #06030f 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e2e8f0;
    user-select: none;
    overflow: hidden;
}

.melsbrawl-container .mb-stage3d {
    position: absolute;
    inset: 0;
}
.melsbrawl-container .mb-stage3d canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.melsbrawl-container .mb-screen {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.melsbrawl-container .mb-panel {
    background: rgba(13, 8, 36, 0.92);
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(45, 212, 191, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 28px 32px;
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.melsbrawl-container .mb-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    background: linear-gradient(90deg, #2dd4bf, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.melsbrawl-container .mb-subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.melsbrawl-container .mb-controls-hint {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    padding: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 8px;
}

.melsbrawl-container .mb-room-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.melsbrawl-container .mb-empty {
    text-align: center;
    color: #64748b;
    padding: 24px 8px;
    font-style: italic;
}

.melsbrawl-container .mb-room-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 27, 75, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
}

.melsbrawl-container .mb-room-name { font-weight: 700; flex: 1; }
.melsbrawl-container .mb-room-meta { color: #94a3b8; font-size: 12px; }

.melsbrawl-container .mb-room-state {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.melsbrawl-container .mb-room-state.open { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.melsbrawl-container .mb-room-state.busy { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.melsbrawl-container .mb-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.melsbrawl-container .mb-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
.melsbrawl-container .mb-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.melsbrawl-container .mb-btn-small { padding: 5px 10px; font-size: 12px; }
.melsbrawl-container .mb-btn-primary {
    background: linear-gradient(135deg, #0d9488, #14b8a6) !important;
    border-color: #2dd4bf !important;
}
.melsbrawl-container .mb-btn-go {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    border-color: #4ade80 !important;
}
.melsbrawl-container .mb-btn-danger {
    background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
    border-color: #f87171 !important;
}

.melsbrawl-container .mb-slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.melsbrawl-container .mb-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 27, 75, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
}

.melsbrawl-container .mb-chip {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.melsbrawl-container .mb-slot-name { font-weight: 700; flex: 1; }

.melsbrawl-container .mb-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 1px;
}
.melsbrawl-container .mb-badge.you { background: rgba(45, 212, 191, 0.25); color: #2dd4bf; }
.melsbrawl-container .mb-badge.host { background: rgba(250, 204, 21, 0.2); color: #facc15; }
.melsbrawl-container .mb-badge.ai { background: rgba(167, 139, 250, 0.25); color: #a78bfa; }

.melsbrawl-container .mb-wins { color: #facc15; font-size: 13px; }
.melsbrawl-container .mb-hint { text-align: center; color: #64748b; font-size: 12px; }

/* Fight HUD */
.melsbrawl-container .mb-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    z-index: 12;
    pointer-events: none;
}
.melsbrawl-container .mb-hud .mb-leave-match { pointer-events: auto; }

.melsbrawl-container .mb-timer {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 14px rgba(45, 212, 191, 0.8);
    background: rgba(13, 8, 36, 0.7);
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 12px;
    padding: 4px 18px;
}

.melsbrawl-container .mb-percent-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 14px;
    z-index: 12;
    pointer-events: none;
}

.melsbrawl-container .mb-pbox {
    background: rgba(13, 8, 36, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 8px 16px;
    min-width: 110px;
    text-align: center;
}
.melsbrawl-container .mb-pbox.out { opacity: 0.35; filter: grayscale(1); }

.melsbrawl-container .mb-pname {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
}

.melsbrawl-container .mb-pct { font-size: 30px; font-weight: 900; font-style: italic; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000; line-height: 1.1; }
.melsbrawl-container .mb-pct small { font-size: 16px; }
.melsbrawl-container .mb-pct.hit { animation: mbPctHit 0.35s ease-out; }
@keyframes mbPctHit { 0% { transform: scale(1.35) translateX(-3px); } 25% { transform: scale(1.2) translateX(3px); } 50% { transform: scale(1.1) translateX(-2px); } 100% { transform: none; } }
.melsbrawl-container .mb-stocks { display: flex; gap: 4px; justify-content: center; min-height: 10px; }
.melsbrawl-container .mb-stocks i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,0.6); }
/* Fighter portrait in the damage box (#107) */
.melsbrawl-container .mb-pbox { position: relative; padding-left: 52px; text-align: left; }
.melsbrawl-container .mb-pic { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4); }
.melsbrawl-container .mb-pbox .mb-pname { justify-content: flex-start; }
.melsbrawl-container .mb-pbox .mb-stocks { justify-content: flex-start; }

/* Big-hit / KO screen flash */
.melsbrawl-container .mb-flash { position: absolute; inset: 0; pointer-events: none; background: #fff; opacity: 0; z-index: 5; }
.melsbrawl-container .mb-flash.on { animation: mbFlash 0.22s ease-out; }
@keyframes mbFlash { 0% { opacity: 0.35; } 100% { opacity: 0; } }

/* Controls card during a match */
.melsbrawl-container .mb-controls-card { position: absolute; left: 12px; top: 56px; z-index: 6; max-width: 430px; font-size: 12px; line-height: 1.6; color: #cbd5e1; background: rgba(13, 8, 36, 0.78); border: 1px solid rgba(45, 212, 191, 0.3); border-radius: 10px; padding: 8px 12px; }
.melsbrawl-container .mb-controls-card kbd { background: #1e1b4b; border: 1px solid #4c1d95; border-radius: 4px; padding: 0 5px; font-size: 11px; color: #f8fafc; }
.melsbrawl-container .mb-controls-card .mb-x { float: right; background: none; border: none; color: #94a3b8; cursor: pointer; }

/* Character select (#107) */
.melsbrawl-container .mb-panel-wide { width: min(980px, calc(100vw - 40px)); }
.melsbrawl-container .mb-char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.melsbrawl-container .mb-char-card { --c: #94a3b8; text-align: left; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, #0d0824), #0d0824 70%); border: 2px solid rgba(148, 163, 184, 0.25); border-radius: 12px; padding: 10px; color: #e2e8f0; cursor: pointer; font-family: inherit; transition: transform 0.12s, border-color 0.12s; }
.melsbrawl-container .mb-char-card:hover { transform: translateY(-2px); border-color: var(--c); }
.melsbrawl-container .mb-char-card.sel { border-color: var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 60%, transparent); }
.melsbrawl-container .mb-char-ic { font-size: 28px; }
.melsbrawl-container .mb-char-name { font-size: 16px; font-weight: 800; }
.melsbrawl-container .mb-char-title { font-size: 11px; color: var(--c); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.melsbrawl-container .mb-char-stats { display: grid; grid-template-columns: 44px 1fr; gap: 2px 6px; align-items: center; margin: 6px 0; font-size: 10px; color: #94a3b8; }
.melsbrawl-container .mb-char-stats b { height: 5px; background: rgba(148,163,184,0.2); border-radius: 3px; overflow: hidden; }
.melsbrawl-container .mb-char-stats b i { display: block; height: 100%; background: var(--c); }
.melsbrawl-container .mb-char-blurb { font-size: 11px; color: #cbd5e1; min-height: 30px; }
.melsbrawl-container .mb-char-specials { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.melsbrawl-container .mb-char-specials span { font-size: 10px; background: rgba(30, 27, 75, 0.8); border-radius: 4px; padding: 1px 5px; color: #e2e8f0; }
.melsbrawl-container .mb-slot-char { font-weight: 700; min-width: 90px; }
.melsbrawl-container .mb-select { background: #1e1b4b; color: #e2e8f0; border: 1px solid #4c1d95; border-radius: 6px; padding: 3px 6px; font-size: 12px; }

/* Toast + results */
.melsbrawl-container .mb-toast {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 8, 36, 0.92);
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 12px;
    padding: 10px 22px;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    z-index: 20;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.melsbrawl-container .mb-standings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.melsbrawl-container .mb-standing-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 27, 75, 0.5);
    border-radius: 8px;
    padding: 8px 12px;
}

.melsbrawl-container .mb-standing-stat { color: #94a3b8; font-size: 12px; }

@media (max-width: 640px) {
    .melsbrawl-container .mb-panel { padding: 18px; }
    .melsbrawl-container .mb-title { font-size: 22px; }
    .melsbrawl-container .mb-percent-bar { flex-wrap: wrap; gap: 8px; }
    .melsbrawl-container .mb-pbox { min-width: 84px; padding: 6px 10px; }
    .melsbrawl-container .mb-pct { font-size: 20px; }
    .melsbrawl-container .mb-pbox { padding-left: 40px; min-width: 0; }
    .melsbrawl-container .mb-pic { width: 26px; height: 26px; font-size: 14px; left: 6px; }
    .melsbrawl-container .mb-pname { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76px; }
    .melsbrawl-container .mb-controls-card { top: auto; bottom: 100px; left: 8px; right: 8px; max-width: none; font-size: 11px; }
    .melsbrawl-container .mb-toast { top: 64px; font-size: 14px; max-width: calc(100vw - 32px); text-align: center; }
    .melsbrawl-container .mb-char-grid { grid-template-columns: repeat(2, 1fr); }
    .melsbrawl-container .mb-slot-row { flex-wrap: wrap; row-gap: 6px; }
    .melsbrawl-container .mb-panel { overflow-x: hidden; }
}
