/* MakHome — «В стаята»: the room inside the 3D stage of the set windows (assets/js/room/room-scene.js).
   The stage's language: ink on warm paper, hairlines, paper-glass controls over the scene, sharp corners. */

.fc-roomv {
    --rv-ink: #0a0a0b;
    --rv-fg-2: rgba(10, 10, 11, .66);
    --rv-fg-3: rgba(10, 10, 11, .52);
    --rv-line: rgba(10, 10, 11, .12);
    --rv-line-strong: rgba(10, 10, 11, .3);
    --rv-glass: rgba(255, 255, 255, .8);
    --rv-bad: #b3261e;
    --rv-pad-x: clamp(24px, 3vw, 40px);
    --rv-pad-y: clamp(20px, 3vw, 36px);
    --rv-ease: cubic-bezier(.16, 1, .3, 1);
    position: absolute;
    inset: 0;
    pointer-events: none;
    font-size: 13px;
    line-height: 1.4;
    color: var(--rv-ink);
}

.fc-roomv,
.fc-roomv * {
    box-sizing: border-box;
    border-radius: 0 !important;
}

/* ---------- distances of the selected piece (cm), pinned to the floor */
.fc-roomv__labels {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.fc-roomv__dim {
    position: absolute;
    top: 0;
    left: 0;
    padding: 3px 6px;
    border: 1px solid var(--rv-ink);
    background: #fff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- room size + view, top right (under the stage head on a narrow stage) */
.fc-roomv__bar {
    position: absolute;
    top: clamp(24px, 3vw, 40px);
    right: var(--rv-pad-x);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    pointer-events: auto;
}

.fc-roomv__size,
.fc-roomv__seg {
    display: inline-flex;
    align-items: center;
    height: 38px;
    border: 1px solid var(--rv-line-strong);
    background: var(--rv-glass);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.fc-roomv__size {
    gap: 6px;
    padding: 0 6px 0 12px;
    color: var(--rv-fg-2);
}

.fc-roomv__size-label {
    margin-right: 2px;
}

.fc-roomv__size input {
    width: 60px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--rv-line-strong);
    background: #fff;
    color: var(--rv-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: border-color .2s ease;
}

.fc-roomv__size input::-webkit-inner-spin-button,
.fc-roomv__size input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.fc-roomv__size input:hover {
    border-color: var(--rv-ink);
}

.fc-roomv__size input:focus-visible {
    outline: 2px solid var(--rv-ink);
    outline-offset: 1px;
}

.fc-roomv__seg button {
    height: 100%;
    padding: 0 14px;
    border: 0;
    border-left: 1px solid var(--rv-line);
    background: none;
    color: var(--rv-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.fc-roomv__seg button:first-child {
    border-left: 0;
}

.fc-roomv__seg button:hover {
    background: rgba(10, 10, 11, .06);
}

.fc-roomv__seg button[aria-pressed="true"] {
    background: var(--rv-ink);
    color: #fff;
}

.fc-roomv__seg button:focus-visible {
    outline: 2px solid var(--rv-ink);
    outline-offset: -2px;
}

/* ---------- dock, bottom left: a hint, or the selected piece and what to do with it */
.fc-roomv__dock {
    position: absolute;
    left: var(--rv-pad-x);
    bottom: var(--rv-pad-y);
    width: min(520px, calc(100% - 2 * var(--rv-pad-x) - 330px));
    pointer-events: auto;
    transition: opacity .2s ease;
}

.fc-roomv__hint {
    margin: 0;
    max-width: 44ch;
    color: var(--rv-fg-3);
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
}

.fc-roomv__card {
    display: grid;
    gap: 6px;
    padding: 14px 16px 16px;
    border: 1px solid var(--rv-line-strong);
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px -24px rgba(10, 10, 11, .45);
    animation: fc-roomv-card .38s var(--rv-ease);
}

@keyframes fc-roomv-card {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.fc-roomv__card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.fc-roomv__card-head strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.fc-roomv__card-head span {
    flex-shrink: 0;
    color: var(--rv-fg-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fc-roomv__status {
    margin: 0;
    color: var(--rv-fg-2);
}

.fc-roomv__status.is-bad {
    color: var(--rv-bad);
    font-weight: 500;
}

.fc-roomv__acts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.fc-roomv__acts button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--rv-line-strong);
    background: #fff;
    color: var(--rv-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.fc-roomv__acts button svg {
    flex-shrink: 0;
}

.fc-roomv__acts button:hover {
    border-color: var(--rv-ink);
}

.fc-roomv__acts button[aria-pressed="true"] {
    border-color: var(--rv-ink);
    background: var(--rv-ink);
    color: #fff;
}

.fc-roomv__acts button.is-quiet {
    margin-left: auto;
    border-color: transparent;
    background: none;
    color: var(--rv-fg-2);
}

.fc-roomv__acts button.is-quiet:hover {
    border-color: var(--rv-bad);
    color: var(--rv-bad);
}

.fc-roomv__acts button:focus-visible {
    outline: 2px solid var(--rv-ink);
    outline-offset: 2px;
}

.fc-roomv.is-dragging .fc-roomv__dock {
    opacity: .35;
}

/* ---------- toast: what the room could not do */
.fc-roomv__toast {
    position: absolute;
    top: calc(clamp(24px, 3vw, 40px) + 50px);
    left: 50%;
    max-width: min(440px, calc(100% - 40px));
    padding: 10px 14px;
    background: var(--rv-ink);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    transform: translateX(-50%);
    animation: fc-roomv-card .3s var(--rv-ease);
}

.fc-roomv__toast[hidden] {
    display: none;
}

/* ---------- narrow stage (phones, small tablets): bar under the stage head, dock over its foot */
.fc-roomv.is-narrow .fc-roomv__bar {
    top: var(--rv-top, 120px);
    left: 20px;
    right: 20px;
    justify-content: space-between;
}

.fc-roomv.is-narrow .fc-roomv__dock {
    left: 20px;
    right: 20px;
    bottom: var(--rv-bottom, 80px);
    width: auto;
}

.fc-roomv.is-narrow .fc-roomv__hint {
    display: none;
}

.fc-roomv.is-narrow .fc-roomv__toast {
    top: calc(var(--rv-top, 120px) + 50px);
}

@media (prefers-reduced-motion: reduce) {
    .fc-roomv__card,
    .fc-roomv__toast {
        animation: none;
    }
}
