/* START town.css */

/* === SCENE WRAPPER (handles scroll on mobile) === */
.town-scene-wrap {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

/* === SCENE CONTAINER === */
.town-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 1227 / 108;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--t-sky1, #050510), var(--t-sky2, #0a0a20));
    margin-bottom: 0;
    user-select: none;
}

/* === STREET LABEL STRIP (between scene and residents) === */
.town-street-label {
    background: #111;
    border-left: 2px solid #2a2a2a;
    border-right: 2px solid #2a2a2a;
    padding: 4px 16px;
    display: flex;
    align-items: center;
}

/* === GROUND === */
/* === STREET SIGN === */
.town-sign-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: rotate(-2deg);
}

.town-sign {
    background: rgba(10,10,20,0.9);
    color: #ccc;
    border: 1px solid #555;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1.5px;
    border-radius: 2px;
    white-space: nowrap;
}

.town-sign-pole {
    width: 2px;
    height: 8px;
    background: #666;
}

/* === WANDERERS === */
.town-wanderer {
    position: absolute;
    bottom: 0;
    height: 92%;
    aspect-ratio: 1;
    cursor: pointer;
    transform-origin: bottom center;
    z-index: 4;
    transition: filter 0.15s;
}

.town-wanderer img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 4px;
    display: block;
}

.town-wanderer span {
    font-size: 2em;
    line-height: 1;
}

.town-wanderer:hover {
    filter: brightness(1.4) drop-shadow(0 0 6px rgba(255,255,255,0.5));
    z-index: 10;
}

/* === RESIDENT CARDS ROW (below the scene) === */
.town-residents {
    background: var(--surface);
    border: 2px solid #2a2a2a;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 14px 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a transparent;
}

.town-residents-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: min-content;
}

.town-resident-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    width: 120px;
    transition: transform 0.15s;
}

.town-resident-card:hover { transform: translateY(-4px); }

.town-resident-empty { opacity: 0.3; cursor: default; }
.town-resident-empty:hover { transform: none; }

/* --- Locked neighbor --- */
.town-resident-locked { cursor: default; opacity: 0.85; }
.town-resident-locked:hover { transform: none; }
.town-resident-locked:hover .town-resident-portrait { border-color: #3a3a3a; }

.town-resident-portrait-locked {
    position: relative;
    border-color: #2a2a2a !important;
}

/* Pixelate + blur the portrait image */
.neighbor-locked-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Scale down then up to force pixel blocks */
    image-rendering: pixelated;
    filter: blur(2px) brightness(0.45) saturate(0.2);
    transform: scale(1.06); /* hide blur edge bleed */
}

/* Lock icon centered over the portrait */
.neighbor-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, transparent 70%);
}

.town-resident-portrait {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #3a3a3a;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    color: #555;
}

.town-resident-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.town-resident-card:hover .town-resident-portrait {
    border-color: var(--primary);
}

.town-resident-name {
    font-size: 12px;
    color: #ccc;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.town-resident-level {
    font-size: 11px;
    color: #e57373;
}

/* === NAV === */
.town-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0 6px;
}

.town-nav-btn {
    background: var(--surface);
    border: 2px solid #3a3a3a;
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

.town-nav-btn:hover { border-color: var(--primary); color: var(--primary); }

.town-nav-dir {
    max-width: none;
    flex-shrink: 0;
    font-size: 12px;
}

/* === DIRECTORY MODAL === */
.town-dir-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.town-dir-chip {
    background: var(--surface);
    border: 2px solid #3a3a3a;
    color: var(--text);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-align: center;
}

.town-dir-chip:hover { border-color: var(--primary); color: var(--primary); }
.town-dir-chip-active { border-color: var(--primary) !important; color: var(--primary) !important; }

/* === MOBILE === */
@media (max-width: 600px) {
    .town-nav-btn { font-size: 11px; padding: 7px 10px; }
    .town-resident-portrait { width: 85px; height: 85px; }
    .town-resident-card { width: 94px; }

    /* Scrollable scene on mobile */
    .town-scene-wrap {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: none;
    }
    .town-scene-wrap::-webkit-scrollbar { display: none; }

    /* Fixed height, width expands from aspect-ratio → scrollable */
    .town-scene {
        width: auto;
        height: clamp(180px, 38vh, 280px);
        /* aspect-ratio kept — browser calculates width ≈ 2000px at 175px height */
        background-size: 100% 100%;
    }
}

/* === DEV TOOL: TOWN LAYOUT EDITOR === */
.tl-street {
    background: var(--background);
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px;
}

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

.tl-buildings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tl-building-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* === NOTICE BOARD === */
.nb-reset-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 0 auto 16px;
    max-width: 600px;
    font-size: 13px;
}

.nb-demands-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.nb-demand-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    transition: border-color 0.2s;
}

.nb-demand-card:hover {
    border-color: var(--primary);
}

.nb-demand-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nb-demand-info {
    flex: 1;
}

.nb-demand-name {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 4px;
}

.nb-base-price {
    color: var(--text-muted);
    font-size: 13px;
}

.nb-boost-price {
    color: #4caf50;
    font-weight: bold;
    font-size: 14px;
}

.nb-multiplier-badge {
    background: var(--primary);
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    border-radius: 8px;
    padding: 6px 12px;
    flex-shrink: 0;
}

/* === SELL TAB DEMAND INDICATORS === */
.nb-sell-banner {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text);
}

.nb-demand-highlight {
    border-color: #4caf50 !important;
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.3);
}

.nb-sell-badge {
    position: absolute;
    top: 8px;
    right: 36px;
    background: #4caf50;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 6px;
}

.nb-demand-tag {
    font-size: 11px;
    color: #4caf50;
    font-weight: bold;
}
/* END town.css */
