body.mobile-layout {
    margin: 0;
    min-height: 100svh;
    overflow: hidden;
    background: #ffffff;
}

body.mobile-layout .app-shell--mobile {
    min-height: 100svh;
    height: 100svh;
    overflow: hidden;
}

.room-page--mobile,
.room-page--mobile * {
    box-sizing: border-box;
}

.room-page--mobile {
    --mobile-bg: #ffffff;
    --mobile-surface: #ffffff;
    --mobile-surface-soft: #f8f8fa;
    --mobile-border: #e8e8ee;
    --mobile-text: #111111;
    --mobile-muted: #6f7280;
    --mobile-accent: #ff2d7a;
    --mobile-accent-soft: #fff1f7;
    --mobile-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --mobile-radius: 16px;
    --mobile-stage: #0f1116;
    --mobile-stage-border: #232734;
    --mobile-stage-2: #39404f;
    --mobile-stage-3: #1c2029;
    --mobile-gap: 6px;
    --mobile-rail-width: 150px;
    --mobile-stage-top-height: clamp(148px, 22svh, 176px);
    --mobile-side-slot-height: calc((var(--mobile-stage-top-height) - var(--mobile-gap)) / 2);
    --mobile-bottom-slot-height: clamp(48px, 6.4svh, 56px);

    width: 100%;
    height: 100svh;
    min-height: 100svh;
    padding: 8px;
    background: var(--mobile-bg);
    color: var(--mobile-text);
    overflow: hidden;
}

.room-page--mobile .btn,
.room-page--mobile button,
.room-page--mobile input,
.room-page--mobile textarea {
    font: inherit;
}

.room-page--mobile .btn,
.room-page--mobile button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    outline: 0;
    box-shadow: none;
}

.room-page--mobile .card {
    background: var(--mobile-surface);
    border: 1px solid var(--mobile-border);
    border-radius: var(--mobile-radius);
    box-shadow: var(--mobile-shadow);
}

.room-page--mobile .mobile-room {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 6px;
    height: calc(100svh - 16px);
    max-height: calc(100svh - 16px);
    overflow: hidden;
}

/* üst bilgi alanı: tek satır */
.room-page--mobile .mobile-room__hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--mobile-border);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.room-page--mobile .mobile-room__hero-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.room-page--mobile .mobile-room__hero-main h1 {
    margin: 0;
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    color: var(--mobile-text);
    white-space: nowrap;
}

.room-page--mobile .mobile-room__hero-main p {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 11px;
    line-height: 1.1;
    color: var(--mobile-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-page--mobile .mobile-room__hero-side {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

.room-page--mobile .mobile-room__hero-count,
.room-page--mobile .mobile-room__hero-identity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}

.room-page--mobile .mobile-room__hero-count {
    background: #f3f4f6;
    color: var(--mobile-text);
    border: 1px solid #e5e7eb;
}

.room-page--mobile .mobile-room__hero-identity {
    background: var(--mobile-accent-soft);
    color: #c2185b;
    border: 1px solid #ffd7e7;
}

/* stage */
.room-page--mobile .mobile-room__stage {
    padding: 8px 9px 8px 8px;
    background: linear-gradient(180deg, #12151c 0%, #0d1016 100%);
    border: 1px solid var(--mobile-stage-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.room-page--mobile .mobile-room__stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--mobile-rail-width);
    grid-template-areas:
        "preview rail"
        "bottom bottom";
    column-gap: var(--mobile-gap);
    row-gap: var(--mobile-gap);
    align-items: start;
    min-width: 0;
}

.room-page--mobile .mobile-room__preview {
    grid-area: preview;
    position: relative;
    min-width: 0;
    width: 100%;
    height: var(--mobile-stage-top-height);
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    border: 1px solid #303746;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 10px 22px rgba(0, 0, 0, 0.25);
}

.room-page--mobile .mobile-room__stage-shell {
    display: contents;
}

.room-page--mobile .mobile-room__stage-rail {
    grid-area: rail;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: var(--mobile-side-slot-height);
    gap: var(--mobile-gap);
    align-content: start;
    width: 100%;
    min-width: 0;
    min-height: var(--mobile-stage-top-height);
    padding-right: 1px;
}

.room-page--mobile .mobile-room__stage-bottom {
    grid-area: bottom;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--mobile-gap);
    width: 100%;
    min-width: 0;
    align-content: start;
}

.room-page--mobile .mobile-room__stage-bottom .camera-slot {
    width: 100%;
    max-width: 100%;
}

.room-page--mobile .mobile-room__stage-rail--empty,
.room-page--mobile .mobile-room__stage-bottom--empty {
    display: none;
}

.room-page--mobile .camera-slot {
    position: relative;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, var(--mobile-stage-2) 0%, var(--mobile-stage-3) 100%);
    border: 1px solid #303746;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.room-page--mobile .mobile-room__stage-rail .camera-slot {
    min-height: var(--mobile-side-slot-height);
    height: var(--mobile-side-slot-height);
}

.room-page--mobile .mobile-room__stage-bottom .camera-slot {
    min-height: var(--mobile-bottom-slot-height);
    height: var(--mobile-bottom-slot-height);
}

.room-page--mobile .camera-slot[data-mobile-occupied="1"] {
    border-color: rgba(255, 255, 255, 0.16);
}

.room-page--mobile .camera-slot[data-mobile-occupied="1"]:active {
    transform: scale(0.985);
}

.room-page--mobile .camera-slot[data-mobile-selected="1"] {
    border-color: rgba(255, 45, 122, 0.9);
    box-shadow:
        0 0 0 1px rgba(255, 45, 122, 0.34),
        0 8px 18px rgba(255, 45, 122, 0.18);
}

.room-page--mobile .camera-slot__inner {
    position: absolute;
    inset: 0;
}

.room-page--mobile .camera-slot__inner > span {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    max-width: calc(100% - 12px);
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.62);
    color: #ffffff;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.room-page--mobile .camera-slot__speaker {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
    z-index: 4;
}

.room-page--mobile .mobile-room__preview .room-stage-user,
.room-page--mobile .camera-slot .room-stage-user {
    width: 100%;
    height: 100%;
    display: block;
}

.room-page--mobile .mobile-room__preview video,
.room-page--mobile .mobile-room__preview canvas,
.room-page--mobile .mobile-room__preview img,
.room-page--mobile .camera-slot video,
.room-page--mobile .camera-slot canvas,
.room-page--mobile .camera-slot img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.room-page--mobile .room-stage-user {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.room-page--mobile .room-stage-user__header {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 4;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.room-page--mobile .room-stage-user__name {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    max-width: 100%;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.62);
    color: #ffffff;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-page--mobile .room-stage-user__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 3;
    background: #000;
}

.room-page--mobile .room-stage-user__media video,
.room-page--mobile .room-stage-user__media canvas,
.room-page--mobile .room-stage-user__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    visibility: visible;
    opacity: 1;
    object-fit: cover;
    background: #000;
}

/* chat alanı görünür kalsın */
.room-page--mobile .mobile-room__chat-card {
    min-height: 0;
    padding: 8px;
    display: flex;
    overflow: hidden;
}

.room-page--mobile .chat-box {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.room-page--mobile .chat-box::-webkit-scrollbar,
.room-page--mobile .room-participant-list::-webkit-scrollbar,
.room-page--mobile .room-private-modal__thread::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.room-page--mobile .room-chat-message {
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--mobile-surface-soft);
    border: 1px solid #eceef2;
    color: var(--mobile-text);
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}

.room-page--mobile .room-chat-message__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
    color: var(--mobile-text);
    font-weight: 800;
}

.room-page--mobile .room-user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    overflow: hidden;
    border-radius: 50%;
}

.room-page--mobile .room-user-badge img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* participants panel */
.room-page--mobile .mobile-room__participants-card {
    position: fixed;
    top: 8px;
    right: 0;
    bottom: 8px;
    z-index: 60;
    width: min(86vw, 340px);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-left: 1px solid var(--mobile-border);
    border-radius: 22px 0 0 22px;
    box-shadow: -12px 0 28px rgba(15, 23, 42, 0.10);
    transform: translateX(104%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
    overflow: hidden;
}

.room-page--mobile .mobile-room__users-state:checked + .mobile-room .mobile-room__participants-card {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.room-page--mobile .mobile-room__participants-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
}

.room-page--mobile .mobile-room__participants-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.room-page--mobile .mobile-room__participants-top h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--mobile-text);
}

.room-page--mobile .mobile-room__users-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--mobile-text);
    font-size: 20px;
    line-height: 1;
    border: 1px solid #e5e7eb;
}

.room-page--mobile .mobile-room__participants-hint {
    font-size: 12px;
    line-height: 1.35;
    color: var(--mobile-muted);
}

.room-page--mobile .mobile-room__participants-search {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: var(--mobile-text);
    outline: 0;
}

.room-page--mobile .mobile-room__participants-search::placeholder {
    color: #9ca3af;
}

.room-page--mobile .simple-list,
.room-page--mobile .room-participant-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.room-page--mobile .room-participant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.room-page--mobile .room-participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 9px 11px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #eceef2;
}

.room-page--mobile .room-participant-item__main {
    min-width: 0;
    flex: 1 1 auto;
}

.room-page--mobile .room-participant-item__name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    color: var(--mobile-text);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
}

.room-page--mobile .room-participant-item__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.room-page--mobile .room-participant-item__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
}

.room-page--mobile .room-participant-item__menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--mobile-text);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid #e5e7eb;
}

/* composer */
.room-page--mobile .mobile-room__composer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.room-page--mobile .mobile-room__icon-panel {
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--mobile-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.room-page--mobile .room-chat-gifts__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.room-page--mobile .room-chat-gifts__item {
    height: 40px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--mobile-text);
    border: 1px solid #e5e7eb;
    font-size: 20px;
}

.room-page--mobile .mobile-room__composer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--mobile-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.room-page--mobile .mobile-room__message-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 36px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--mobile-text);
    outline: 0;
    font-size: 14px;
}

.room-page--mobile .mobile-room__message-input::placeholder {
    color: #9ca3af;
}

.room-page--mobile .mobile-room__icon-toggle,
.room-page--mobile .mobile-room__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
}

.room-page--mobile .mobile-room__icon-toggle {
    background: #f3f4f6;
    color: var(--mobile-text);
    border: 1px solid #e5e7eb;
}

.room-page--mobile .mobile-room__send {
    background: var(--mobile-accent);
    color: #ffffff;
}

/* alt kontrol barı: kompakt */
.room-page--mobile .mobile-room__controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    min-height: 50px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 22px solid var(--mobile-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.room-page--mobile .mobile-room__control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 38px;
    padding: 4px 6px;
    border-radius: 12px;
    background: #f3f4f6;
    color: var(--mobile-text);
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    border: 1px solid #e5e7eb;
}

.room-page--mobile .mobile-room__control--users {
    cursor: pointer;
}

/* private modal */
.room-page--mobile .room-private-modal[hidden] {
    display: none !important;
}

.room-page--mobile .room-private-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.room-page--mobile .room-private-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.28);
}

.room-page--mobile .room-private-modal__dialog {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    max-height: min(78svh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--mobile-border);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
}

.room-page--mobile .room-private-modal__head,
.room-page--mobile .room-private-modal__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
}

.room-page--mobile .room-private-modal__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.1;
    color: var(--mobile-text);
}

.room-page--mobile .room-private-modal__meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--mobile-muted);
}

.room-page--mobile .room-private-modal__close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--mobile-text);
    font-size: 20px;
    border: 1px solid #e5e7eb;
}

.room-page--mobile .room-private-modal__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px 12px;
    min-height: 0;
}

.room-page--mobile .room-private-modal__thread {
    min-height: 180px;
    max-height: 34svh;
    overflow-y: auto;
    padding: 8px;
    border-radius: 14px;
    background: #f8f9fb;
    border: 1px solid #eceef2;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.room-page--mobile .room-private-modal__textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: var(--mobile-text);
    outline: 0;
}

.room-page--mobile .room-private-modal__button {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    white-space: nowrap;
}

@media (max-width: 390px) {
    .room-page--mobile {
        --mobile-rail-width: 88px;
        --mobile-stage-top-height: clamp(138px, 21svh, 166px);
        --mobile-side-slot-height: calc((var(--mobile-stage-top-height) - var(--mobile-gap)) / 2);
        --mobile-bottom-slot-height: 44px;
    }

    .room-page--mobile .mobile-room__hero {
        padding: 7px 8px;
        gap: 6px;
    }

    .room-page--mobile .mobile-room__hero-main h1 {
        font-size: 13px;
    }

    .room-page--mobile .mobile-room__hero-main p {
        font-size: 10px;
    }

    .room-page--mobile .mobile-room__hero-count,
    .room-page--mobile .mobile-room__hero-identity {
        min-height: 22px;
        padding: 0 7px;
        font-size: 10px;
    }

    .room-page--mobile .mobile-room__stage-bottom {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .room-page--mobile .mobile-room__control {
        font-size: 10px;
        min-height: 36px;
        padding: 4px;
    }

    .room-page--mobile .mobile-room__icon-toggle,
    .room-page--mobile .mobile-room__send {
        padding: 0 8px;
        font-size: 11px;
        height: 34px;
    }

    .room-page--mobile .mobile-room__message-input {
        height: 34px;
        font-size: 13px;
    }
}

@keyframes livben-speaker-pulse {
    0% {
        opacity: .75;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 14px 2px rgba(34, 197, 94, .30);
    }
    100% {
        opacity: .85;
        box-shadow: 0 0 8px 1px rgba(34, 197, 94, .18);
    }
}

.room-page--mobile .mobile-room__preview .room-stage-user[data-speaking="1"] .room-stage-user__media::after,
.room-page--mobile .mobile-room__preview .room-stage-user.is-speaking .room-stage-user__media::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(34, 197, 94, .95);
    border-radius: inherit;
    pointer-events: none;
    box-sizing: border-box;
    animation: livben-speaker-pulse .9s ease-in-out infinite;
}

.room-page--mobile .camera-slot .room-stage-user[data-speaking="1"] .room-stage-user__media::after,
.room-page--mobile .camera-slot .room-stage-user.is-speaking .room-stage-user__media::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(34, 197, 94, .95);
    border-radius: inherit;
    pointer-events: none;
    box-sizing: border-box;
}

