/* ============================================================================
   AnywhereRD 뷰어 — inspinia 테마 위에 얹는 화면별 CSS
   ⚠ 모바일에서도 원격 조작이 되어야 한다(수석님 지시) — 터치 막대와 반응형이 핵심이다.
   ============================================================================ */

html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bs-body-bg); }

.arc-view { height: 100%; display: flex; flex-direction: column; }
.arc-view.d-none { display: none !important; }

/* ══════════════ 로그인 ══════════════ */
.arc-login {
    position: relative;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: auto;
    background: #0f1021;
    min-height: 100%;
}

/* ⚠ absolute 로 두면 내용이 짧을 때 배경이 화면을 다 못 채운다(실측) → fixed */
.arc-login-bg {
    position: fixed; inset: 0; overflow: hidden;
    background:
        radial-gradient(120% 90% at 15% 10%, #211a4d 0%, transparent 55%),
        radial-gradient(100% 80% at 90% 80%, #2a1650 0%, transparent 60%),
        linear-gradient(160deg, #0f1021 0%, #16132e 100%);
}
.arc-glow {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
}
.arc-glow.a { width: 420px; height: 420px; left: -80px; top: -120px; background: #4f46e5; }
.arc-glow.b { width: 380px; height: 380px; right: -60px; bottom: -110px; background: #7c3aed; }

/* 격자 — 무대 바닥 */
.arc-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(167, 139, 250, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 139, 250, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(90% 70% at 50% 45%, #000 20%, transparent 78%);
}

/* 빛이 주기적으로 쓸고 지나간다 */
.arc-sweep {
    position: absolute; top: 0; bottom: 0; width: 45%;
    background: linear-gradient(100deg, transparent, rgba(139, 122, 255, .10), transparent);
    animation: arcSweep 9s ease-in-out infinite;
}
@keyframes arcSweep {
    0%   { left: -50%; opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { left: 105%; opacity: 0; }
}

/* ══════════════ 로그인 연출 ══════════════
   "멀리 있는 PC 가 내 기기에 그대로 뜬다" 를 보여준다.
   ⚠ 장식이므로 접근성 트리에서 빠져 있고(aria-hidden), 애니메이션을 끈 사용자는 정지 상태로 본다. */
.arc-stage-art {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 26px 0 30px;
    height: 150px;
}

.arc-art-pc { position: relative; flex-shrink: 0; }
.arc-art-screen {
    width: 158px; height: 100px;
    border-radius: 8px;
    background: linear-gradient(150deg, #1b1b3a, #26224d);
    border: 2px solid rgba(167, 139, 250, .5);
    box-shadow: 0 0 26px rgba(124, 58, 237, .28);
    padding: 12px 11px;
    position: relative; overflow: hidden;
}
.arc-art-stand {
    width: 46px; height: 7px; margin: 5px auto 0;
    border-radius: 0 0 5px 5px;
    background: rgba(167, 139, 250, .35);
}
.arc-art-label {
    text-align: center; font-size: 11px; color: #a9abc9; margin-top: 7px;
}
.arc-art-label.sm { font-size: 10px; margin-top: 4px; }

.arc-art-ln {
    display: block; height: 5px; border-radius: 3px;
    background: rgba(167, 139, 250, .34);
    margin-bottom: 7px;
    animation: arcType 5s ease-in-out infinite;
}
.arc-art-ln.w50 { width: 50%; animation-delay: .5s; }
.arc-art-ln.w70 { width: 70%; }
.arc-art-ln.w80 { width: 80%; animation-delay: .9s; }
.arc-art-ln.w90 { width: 90%; animation-delay: .25s; }
@keyframes arcType {
    0%, 100% { opacity: .34; }
    45%      { opacity: .95; }
}

/* 커서가 화면 안을 돈다 — 원격으로 조작 중이라는 신호 */
.arc-art-cursor {
    position: absolute;
    width: 0; height: 0;
    border-left: 9px solid #fff;
    border-top: 5px solid transparent;
    border-bottom: 10px solid transparent;
    transform: rotate(-16deg);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6));
    animation: arcCursor 6s ease-in-out infinite;
}
@keyframes arcCursor {
    0%   { left: 22%; top: 24%; }
    28%  { left: 64%; top: 40%; }
    46%  { left: 58%; top: 66%; }
    72%  { left: 30%; top: 58%; }
    100% { left: 22%; top: 24%; }
}

/* 연결선 — 신호가 흘러간다 */
.arc-art-link {
    position: relative;
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, rgba(167, 139, 250, .45), rgba(167, 139, 250, .12));
    border-radius: 2px;
    min-width: 34px;
}
.arc-art-pulse {
    position: absolute; top: -3px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #a78bfa;
    box-shadow: 0 0 12px 3px rgba(167, 139, 250, .75);
    animation: arcFlow 2.4s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes arcFlow {
    0%   { left: -4px; opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { left: calc(100% - 4px); opacity: 0; }
}

/* 내 기기들 — 같은 화면이 뜬다 */
.arc-art-mine { display: flex; align-items: flex-end; gap: 12px; flex-shrink: 0; }

.arc-art-phone .arc-art-mini {
    width: 42px; height: 68px; border-radius: 7px;
    border: 2px solid rgba(167, 139, 250, .45);
    background: linear-gradient(150deg, #1b1b3a, #26224d);
    padding: 8px 6px;
    animation: arcMirror 6s ease-in-out infinite;
}
.arc-art-laptop .arc-art-mini {
    width: 74px; height: 48px; border-radius: 6px 6px 0 0;
    border: 2px solid rgba(167, 139, 250, .45);
    border-bottom: 0;
    background: linear-gradient(150deg, #1b1b3a, #26224d);
    padding: 7px 6px;
    animation: arcMirror 6s ease-in-out infinite .4s;
}
.arc-art-base {
    width: 92px; height: 5px; margin-left: -9px;
    border-radius: 0 0 5px 5px;
    background: rgba(167, 139, 250, .35);
}
.arc-art-mini .arc-art-ln { height: 3px; margin-bottom: 4px; }

/* 원격 화면이 내 기기에 "도착"하는 느낌 */
@keyframes arcMirror {
    0%, 100% { box-shadow: 0 0 0 rgba(124, 58, 237, 0); }
    35%      { box-shadow: 0 0 18px rgba(124, 58, 237, .5); }
}

/* 움직임을 줄여 달라고 한 사용자에게는 정지 화면으로 */
@media (prefers-reduced-motion: reduce) {
    .arc-sweep, .arc-art-ln, .arc-art-cursor, .arc-art-pulse,
    .arc-art-phone .arc-art-mini, .arc-art-laptop .arc-art-mini { animation: none; }
    .arc-art-cursor { left: 40%; top: 45%; }
}

.arc-login-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 56px;
    width: 100%;
    max-width: 980px;
}

.arc-login-lead { flex: 1; color: #e8e9f5; }
.arc-login-lead h1 { font-size: 34px; font-weight: 800; line-height: 1.3; margin-bottom: 14px; letter-spacing: -.5px; }
.arc-login-lead p { font-size: 15px; color: #a9abc9; margin-bottom: 26px; }
.arc-points { list-style: none; padding: 0; margin: 0; }
.arc-points li {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: #c7c9e2; padding: 7px 0;
}
.arc-points i { color: #a78bfa; font-size: 18px; }

.arc-login-card { width: 100%; max-width: 400px; flex-shrink: 0; }
.arc-login-card .card { background: #fff; }
.arc-pin-input {
    font-family: var(--bs-font-monospace);
    font-size: 22px; letter-spacing: 8px; text-align: center;
}

/* ══════════════ 상단바 ══════════════ */
.arc-topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    /* 반투명 + 블러 — 아래 내용이 스크롤될 때 유리판 위에 얹힌 느낌이 난다.
       ⚠ backdrop-filter 를 못 쓰는 브라우저를 위해 배경색을 **먼저** 깔아 둔다. */
    background: var(--bs-secondary-bg);
    background: color-mix(in srgb, var(--bs-secondary-bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 65%, transparent);
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 20;
}
.arc-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--arc-grad); color: #fff;
    font-size: 12px; font-weight: 700;
    display: grid; place-items: center; flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(79, 70, 229, .3);
}

/* 아이콘만 있는 동그란 버튼(새로고침 등) */
.arc-icon-btn {
    width: 34px; height: 34px; padding: 0;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
    transition: .16s;
}
.arc-icon-btn:hover {
    color: var(--arc-indigo);
    border-color: color-mix(in srgb, var(--arc-indigo) 40%, transparent);
    transform: rotate(45deg);
}

/* ══════════════ 기기 목록 ══════════════
   ⚠ 예전에는 카드 배경이 `--bs-secondary-bg`(거의 흰색)라 **흰 페이지에 묻혀**
     아이콘과 글자만 떠 있는 것처럼 보였다. 이제 바탕에 옅은 색을 깔고
     카드는 흰색 + 다층 그림자로 **떠 보이게** 한다. */

/* 화면 바탕 — 아주 옅은 메시 그라데이션. 카드가 놓일 자리를 만들어 준다. */
.arc-home {
    flex: 1; overflow-y: auto;
    padding: 30px 20px 56px;
    max-width: 1180px; width: 100%; margin: 0 auto;
    position: relative;
}
.arc-home::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60rem 30rem at 12% -10%, rgba(79, 70, 229, .07), transparent 60%),
        radial-gradient(48rem 26rem at 92% 4%, rgba(124, 58, 237, .06), transparent 62%);
}

/* 섹션 제목 — 왼쪽에 그라데이션 악센트 바 */
.arc-sec-title {
    position: relative; padding-left: 14px;
    letter-spacing: -.01em;
}
.arc-sec-title::before {
    content: ''; position: absolute; left: 0; top: .18em; bottom: .18em;
    width: 4px; border-radius: 4px; background: var(--arc-grad);
}

.arc-dev {
    width: 100%; text-align: left;
    border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
    border-radius: 18px;
    /* ⚠ inspinia 에서 **카드는 `secondary-bg`(흰색)**, 페이지 바탕이 `body-bg`(#f1f2f7)다.
         둘을 바꿔 쓰면 카드가 바탕과 같은 색이 되어 사라져 보인다. */
    background: var(--bs-secondary-bg);
    padding: 20px;
    position: relative; overflow: hidden;
    /* 다층 그림자 — 한 겹짜리보다 훨씬 부드럽고 깊어 보인다 */
    box-shadow:
        0 1px 2px rgba(16, 24, 40, .04),
        0 4px 12px rgba(16, 24, 40, .05);
    transition: transform .18s cubic-bezier(.2, .7, .3, 1),
                box-shadow .18s ease, border-color .18s ease;
}
/* 카드 위쪽에 얇은 그라데이션 선 — 평소엔 숨고 호버에서 차오른다 */
.arc-dev::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: var(--arc-grad);
    transform: scaleX(0); transform-origin: left;
    transition: transform .28s cubic-bezier(.2, .7, .3, 1);
}
.arc-dev:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--arc-indigo) 42%, transparent);
    box-shadow:
        0 2px 4px rgba(16, 24, 40, .05),
        0 14px 32px rgba(79, 70, 229, .16);
    transform: translateY(-3px);
}
.arc-dev:hover:not(:disabled)::before { transform: scaleX(1); }
.arc-dev:active:not(:disabled) { transform: translateY(-1px); }

/* 오프라인 — 흐리게 하되 **카드의 윤곽은 반드시 남긴다.**
   ⛔ 여기서 배경을 페이지와 같은 색으로 주고 그림자를 없앴더니 **카드가 통째로 사라져 보였다**
     (2026-09-23 실측 — 아이콘과 글자만 허공에 떠 있었다).
     쉬고 있는 기기도 "여기 카드가 있다" 는 것은 보여야 한다. */
.arc-dev:disabled {
    cursor: default;
    background: var(--bs-secondary-bg);
    border-color: color-mix(in srgb, var(--bs-border-color) 55%, transparent);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .035);
}
.arc-dev:disabled .arc-n { color: var(--bs-secondary-color); }
.arc-dev:disabled .arc-s { opacity: .8; }

.arc-dev-ico {
    width: 46px; height: 46px; border-radius: 13px;
    background: var(--arc-grad); color: #fff;
    display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
    /* 아이콘 아래로 은은한 발광 — 브랜드 색을 한 번 더 드러낸다 */
    box-shadow: 0 6px 14px rgba(79, 70, 229, .28);
}
.arc-dev-ico.off {
    background: var(--bs-tertiary-bg); color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color); box-shadow: none;
}

/* 온라인 배지의 점이 천천히 숨 쉰다 — 살아 있다는 신호 */
.arc-dev .badge { font-weight: 600; letter-spacing: .01em; padding: .34em .6em; }
.arc-dev .badge .ti-circle-filled { animation: arcBreathe 2.4s ease-in-out infinite; }
@keyframes arcBreathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
    .arc-dev, .arc-dev::before { transition: none; }
    .arc-dev .badge .ti-circle-filled { animation: none; }
}

.arc-empty-ico {
    width: 66px; height: 66px; border-radius: 18px;
    background: var(--bs-tertiary-bg); color: var(--bs-secondary-color);
    display: grid; place-items: center; font-size: 30px; margin: 0 auto;
}

/* ══════════════ 세션 ══════════════ */
.arc-session { background: #0b0c0e; position: relative; }

.arc-sess-bar {
    display: flex; align-items: center; gap: 6px;
    height: 44px; padding: 0 8px;
    background: #17181b; border-bottom: 1px solid #2a2c31;
    flex-shrink: 0; color: #e8eaed;
}
.arc-sess-name { font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
.btn-dark-subtle {
    background: #2a2c31; border: 0; color: #c9ccd1;
    padding: 5px 10px; border-radius: 7px; font-size: 12.5px;
}
.btn-dark-subtle:hover { background: #3a3d44; color: #fff; }
.btn-dark-subtle.active { background: var(--arc-indigo); color: #fff; }

.arc-mon-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.arc-mon-tabs::-webkit-scrollbar { display: none; }
.arc-mon-tab {
    background: transparent; border: 0; color: #9aa0a6;
    padding: 5px 11px; border-radius: 7px; font-size: 12.5px; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.arc-mon-tab:hover { background: #2a2c31; color: #e8eaed; }
.arc-mon-tab.on { background: #2a2c31; color: #fff; font-weight: 600; }
.arc-mon-tab .n {
    width: 16px; height: 16px; border-radius: 4px; background: #5f6368;
    font-size: 10px; font-weight: 700; display: grid; place-items: center; color: #fff;
}
.arc-mon-tab.on .n { background: var(--arc-indigo); }

.arc-stat { font-size: 11.5px; color: #9aa0a6; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.arc-pulse { width: 7px; height: 7px; border-radius: 50%; background: #fdd663; }
.arc-pulse.ok { background: #81c995; }
.arc-pulse.bad { background: #f28b82; }

.arc-stage { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; }
#remoteVideo { max-width: 100%; max-height: 100%; display: block; background: #000; touch-action: none; }
#remoteVideo.fit-cover { width: 100%; height: 100%; object-fit: cover; }
#remoteVideo.fit-none { max-width: none; max-height: none; }

.arc-stage-msg {
    position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
    background: rgba(11, 12, 14, .9); color: #c9ccd1; font-size: 13.5px; text-align: center; padding: 24px;
}
.arc-stage-msg[hidden] { display: none; }

/* ⛔ 전체 보기의 격자는 **클릭 영역일 뿐**이다. 그림은 그 아래 `<video>` 가 그린다
     (호스트가 화면들을 한 장으로 합쳐 보낸다). 그래서 **배경을 깔지 않는다** —
     예전처럼 `background: #17181b` 를 주면 합성 영상을 가려 **아무것도 안 보인다.**
   ⚠ 위치·크기는 `layoutWall()` 이 영상 박스에 맞춰 잡는다(`inset: 0` 을 쓰지 않는 이유).
     영상이 레터박스로 줄어들면 격자도 같이 줄어야 엉뚱한 칸이 눌리지 않는다. */
.arc-wall { position: absolute; left: 0; top: 0; display: grid; gap: 0; padding: 0; }
.arc-wall-cell {
    position: relative; overflow: hidden;
    border: 2px solid transparent; background: transparent; cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.arc-wall-cell:hover {
    border-color: var(--arc-indigo);
    background: rgba(79, 70, 229, .14);
}
/* 모니터가 없는 칸(3대인데 2x2 격자일 때 남는 칸) — 누를 수 없다 */
.arc-wall-cell.empty { cursor: default; pointer-events: none; }
.arc-wall-lb {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    background: rgba(0, 0, 0, .7); color: #fff; font-size: 10.5px;
    padding: 3px 8px; border-radius: 5px; display: flex; align-items: center; gap: 5px;
}
.arc-wall-lb .n {
    width: 13px; height: 13px; border-radius: 3px; background: var(--arc-indigo);
    font-size: 9px; font-weight: 800; display: grid; place-items: center;
}

/* ══════════════ 설정 패널 ══════════════ */
.arc-panel {
    position: absolute; right: 0; top: 44px; bottom: 0; width: 300px; z-index: 20;
    background: #17181b; border-left: 1px solid #2a2c31; color: #e8eaed;
    display: flex; flex-direction: column;
}
.arc-panel[hidden] { display: none; }
.arc-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid #2a2c31; flex-shrink: 0;
}
.arc-panel-body { padding: 14px; overflow-y: auto; flex: 1; }
.arc-panel-h {
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    color: #9aa0a6; font-weight: 700; margin-bottom: 9px;
}
.arc-mon-card {
    background: #2a2c31; border: 2px solid transparent; border-radius: 8px;
    padding: 8px; text-align: center; cursor: pointer; color: #c9ccd1; width: 100%;
}
.arc-mon-card.on { border-color: var(--arc-indigo); background: rgba(79, 70, 229, .16); color: #fff; }
.arc-mon-vis { height: 30px; border-radius: 4px; background: linear-gradient(140deg, #3a3d55, #4f46e5); margin-bottom: 6px; }
.arc-stats { background: #2a2c31; border-radius: 8px; padding: 11px; font-size: 11.5px; line-height: 1.9; color: #9aa0a6; }
.arc-stats b { color: #e8eaed; float: right; }
.arc-panel .form-check-label { color: #c9ccd1; }

/* ══════════════ 모바일 터치 막대 ══════════════ */
.arc-touchbar {
    display: flex; flex-shrink: 0;
    background: #17181b; border-top: 1px solid #2a2c31;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.arc-touchbar .btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: transparent; border: 0; color: #9aa0a6; padding: 7px 2px; border-radius: 8px;
}
.arc-touchbar .btn i { font-size: 19px; }
.arc-touchbar .btn small { font-size: 10px; }
.arc-touchbar .btn.on { background: var(--arc-indigo); color: #fff; }
.arc-touchbar .btn:active { background: #2a2c31; }

/* 모바일 자판을 띄우기 위한 숨은 입력칸 — 화면에는 안 보이지만 포커스는 받는다 */
.arc-hidden-input {
    position: fixed; left: -9999px; top: 0; width: 1px; height: 1px;
    opacity: 0; border: 0; padding: 0;
}

/* ══════════════ 토스트 ══════════════ */
.arc-toast {
    position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
    background: rgba(23, 24, 27, .96); color: #e8eaed;
    padding: 10px 18px; border-radius: 9px; font-size: 13px; z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45); max-width: 90vw; text-align: center;
}
.arc-toast[hidden] { display: none; }

/* ══════════════ 반응형 ══════════════ */
@media (max-width: 991.98px) {
    .arc-login-inner { justify-content: center; }
    .arc-login-card { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 575.98px) {
    .arc-home { padding: 16px 12px 32px; }
    .arc-topbar { padding: 9px 12px; }
    .arc-sess-name { max-width: 22vw; }
    .arc-panel { width: min(300px, 88vw); }
    .arc-login { padding: 12px; }
    .arc-login-card .card-body { padding: 26px 20px !important; }
}
