/* /Pages/Game.razor.rz.scp.css */
.landscape-warning[b-2apohwzgja] {
    display: none;
}

/* True orientation-locking isn't available to a plain web page in most mobile browsers
   (notably iOS Safari) without being installed as a fullscreen PWA, so this blocks play with
   a rotate prompt instead — the practical equivalent from the player's perspective. Height is
   the signal, not orientation alone, so a wide desktop window is never mistaken for a phone. */
@media (orientation: landscape) and (max-height: 500px) {
    .landscape-warning[b-2apohwzgja] {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: var(--bs-body-bg);
    }
}

.container[b-2apohwzgja] {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 100%;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

/* Vertically, fills whatever room is left below the header instead of shrink-wrapping to the
   floor count and leaving dead space — capped well above the tallest common phone viewport so
   it doesn't balloon on desktop. Horizontally, it fills its container's full width: the grid
   below divides that width into the same reference columns regardless of difficulty, so filling
   width is what makes those columns come out a consistent size instead of arbitrary stretching. */
.building-wrapper[b-2apohwzgja] {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 70rem;
    width: 100%;
}

.building-body[b-2apohwzgja] {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Both grids below share the same 10-reference-column template — 3 for the corridor (see
   .corridor), 1 for floor-labels, up to 6 for shafts (hard mode's elevator count, the most the
   game ever has) — so a column always comes out the same width regardless of difficulty:
   fewer shafts just leave trailing columns empty rather than the rest stretching to fill them.
   minmax() keeps columns from vanishing on very narrow screens; overflow-x on the wrapper is the
   fallback if that floor is ever hit. flex-grow itself is set inline per-difficulty for
   .building (see Game.razor) so its vertical ratio against .building-filler can vary. */
.building[b-2apohwzgja],
.building-filler[b-2apohwzgja] {
    min-height: 0;
}

.building[b-2apohwzgja] {
    display: grid;
    grid-template-columns: repeat(10, minmax(2rem, 1fr));
}

.shaft-headers[b-2apohwzgja] {
    display: grid;
    grid-template-columns: repeat(10, minmax(2rem, 1fr));
    flex: 0 0 auto;
    padding-bottom: 0.25rem;
}

/* Spans the corridor + floor-labels columns (3 + 1) in the row below. */
.shaft-headers-spacer[b-2apohwzgja] {
    grid-column: span 4;
}

.shaft-headers-spacer.hud[b-2apohwzgja] {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    padding-left: 0.25rem;
}

.shaft-header[b-2apohwzgja] {
    grid-column: span 1;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.start-overlay[b-2apohwzgja] {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10;
    border-radius: 0.25rem;
}

.start-hint[b-2apohwzgja] {
    margin-top: 1rem;
    padding: 0 1.5rem;
    max-width: 18rem;
    text-align: center;
    color: #fff;
    font-size: 0.9rem;
}

.floor-labels[b-2apohwzgja] {
    display: flex;
    flex-direction: column;
    grid-column: span 1;
    border-right: 2px dashed var(--bs-border-color);
}

.floor-row[b-2apohwzgja] {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    box-sizing: border-box;
}

/* Reserves 3 of the building's 10 reference columns (see .building) for exactly 3 uniform
   passenger-chip slots — sized the same as a shaft column, at any difficulty. */
.corridor[b-2apohwzgja] {
    grid-column: span 3;
}

/* Its own 3-column grid for those chip slots. Each chip/badge is placed via an explicit
   grid-column (see Game.razor's CorridorLayoutAt) so occupied slots stay packed to the right
   regardless of how many are shown; grid's default stretch fills each cell's full width and
   height, with the same gap on every side as between chips. */
.corridor-row[b-2apohwzgja] {
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.2rem;
    padding: 0.2rem;
    overflow: hidden;
    box-sizing: border-box;
    border-bottom: 1px dotted var(--bs-border-color);
}

.passenger[b-2apohwzgja] {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    user-select: none;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.35rem;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Summarizes overflow beyond the 2 visible chips. Borderless on purpose — it isn't tappable,
   so it shouldn't read as a button like the real chips do. */
.passenger.overflow-badge[b-2apohwzgja] {
    cursor: default;
    border: none;
    color: var(--bs-secondary-color);
    font-weight: 600;
}

/* Hard mode has too many floors for a full-size tap target to fit every row without
   overflowing it, so it trades target size for actually fitting on a phone screen. */
.building-wrapper.compact .passenger[b-2apohwzgja] {
    font-size: 0.8rem;
}

.building-wrapper.compact .floor-row[b-2apohwzgja],
.building-wrapper.compact .shaft-header[b-2apohwzgja] {
    font-size: 0.7rem;
}

.building-wrapper.compact .pickup-marker[b-2apohwzgja] {
    font-size: 0.6rem;
}

.building-wrapper.compact .car-passenger[b-2apohwzgja] {
    font-size: 0.6rem;
    padding: 0 0.2rem;
}

.passenger.selected[b-2apohwzgja] {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    animation: pulse-b-2apohwzgja 0.3s ease;
}

@keyframes pulse-b-2apohwzgja {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.75);
    }
    100% {
        transform: scale(1);
    }
}

.shaft[b-2apohwzgja] {
    grid-column: span 1;
    border-left: 1px solid var(--bs-border-color);
    border-right: 1px solid var(--bs-border-color);
    cursor: pointer;
    box-sizing: border-box;
}

.shaft-floor-line[b-2apohwzgja] {
    border-bottom: 1px dotted var(--bs-border-color);
    box-sizing: border-box;
}

/* Previews how far the car will sweep in its current direction before it might reverse — behind
   the pickup markers and car (z-index) so it never competes with them for attention. */
.direction-chevron[b-2apohwzgja] {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    opacity: 0.3;
    font-size: 1rem;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 0;
}

.pickup-marker[b-2apohwzgja] {
    position: absolute;
    left: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0.2rem;
    animation: pulse-b-2apohwzgja 0.3s ease;
    box-sizing: border-box;
    z-index: 1;
}

.pickup-marker.up[b-2apohwzgja] {
    background: rgba(var(--bs-success-rgb), 0.35);
    color: var(--bs-success);
}

.pickup-marker.down[b-2apohwzgja] {
    background: rgba(var(--bs-danger-rgb), 0.35);
    color: var(--bs-danger);
}

.car[b-2apohwzgja] {
    position: absolute;
    z-index: 2;
    left: 2px;
    right: 2px;
    color: #fff;
    border-radius: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    box-sizing: border-box;
    overflow: hidden;
    transition: bottom 0.1s linear, background-color 0.2s ease;
}

.car.idle[b-2apohwzgja] {
    background: var(--bs-secondary);
}

.car.moving-up[b-2apohwzgja] {
    background: var(--bs-success);
}

.car.moving-down[b-2apohwzgja] {
    background: var(--bs-danger);
}

.car-passengers[b-2apohwzgja] {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 0.15rem;
}

.car-passenger[b-2apohwzgja] {
    background: #fff;
    color: var(--bs-dark);
    border-radius: 0.6rem;
    padding: 0.05rem 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
