/* ============================================================
   VR360 — Public viewer + Admin shared styles
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0b1020; color: #e8eaf2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
a { color: #6fb9ff; }

/* ============================================================
   PUBLIC VIEWER
   ============================================================ */
.vr-body { overflow: hidden; }

#viewer {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at center, #1a2040 0%, #050816 100%);
}
.psv-container { background: transparent !important; }

/* --- Splash overlay khởi động --- */
.splash {
    position: fixed; inset: 0; z-index: 1000;
    background:
      radial-gradient(ellipse at top, rgba(120,80,255,.25), transparent 60%),
      radial-gradient(ellipse at bottom right, rgba(0,180,255,.2), transparent 55%),
      linear-gradient(180deg, #0a0e25 0%, #050813 100%);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1);
}
.splash--hide { opacity: 0; transform: scale(1.04); pointer-events: none; }

/* Ảnh nền splash (admin upload, có blur + dim chỉnh được) */
.splash--has-bg { background: #050813; }
.splash__bg {
    position: absolute; inset: 0;
    background-image: var(--splash-bg);
    background-size: cover; background-position: center;
    filter: blur(var(--splash-blur, 8px));
    transform: scale(1.1); /* tránh viền trắng do blur */
    z-index: 0;
    animation: splashBgZoom 30s ease-in-out infinite alternate;
}
.splash__bg-overlay {
    position: absolute; inset: 0; z-index: 1;
    background:
      radial-gradient(ellipse at center, rgba(10,12,30, calc(var(--splash-dim, .55) * .7)) 0%, rgba(5,8,20, var(--splash-dim, .55)) 100%),
      linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.4));
}
.splash--has-bg .splash__inner { position: relative; z-index: 2; }
@keyframes splashBgZoom {
    0%   { transform: scale(1.08) translate(0,0); }
    100% { transform: scale(1.18) translate(-1%,1%); }
}
/* Ảnh nền là panorama 360 (equirectangular ~2:1) → pan ngang chậm 90s/vòng */
.splash__bg--pano {
    background-size: auto 100%;
    background-repeat: repeat-x;
    background-position: 0 center;
    transform: none;
    animation: splashBgPan 90s linear infinite;
}
/* Khi mount Photo Sphere Viewer thật vào splash bg */
.splash__bg--psv {
    background: #050813 !important;
    transform: none !important;
    animation: none !important;
    filter: none !important;
}
.splash__bg--psv .psv-container { background: transparent !important; }
.splash__bg--psv canvas { display: block; }
@keyframes splashBgPan {
    from { background-position: 0 center; }
    to   { background-position: var(--pano-shift, -200vh) center; }
}
.splash__inner {
    text-align: center; padding: 32px; max-width: 720px;
    animation: splashIn .8s cubic-bezier(.16,1,.3,1);
}
@keyframes splashIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.splash__partners {
    display: flex; gap: 28px; justify-content: center; align-items: center;
    flex-wrap: wrap; margin-bottom: 28px;
}
.splash__partners img {
    max-height: 84px; max-width: 180px; object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.5));
    transition: transform .3s ease;
}
.splash__partners img:hover { transform: scale(1.05); }

.splash__title {
    font-size: clamp(22px, 3.4vw, 36px); font-weight: 700;
    margin: 0 0 10px; line-height: 1.25;
    background: linear-gradient(135deg, #fff 0%, #c8d4ff 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.splash__title span { display: block; }
.splash__title-2 { font-weight: 500; opacity: .9; font-size: .85em; }
.splash__name {
    font-size: clamp(18px, 2.4vw, 26px); font-weight: 500; margin: 18px 0 8px;
    color: #ffd479;
}
.splash__subtitle { color: #b8c1e0; margin: 0 0 36px; font-size: 15px; line-height: 1.6; }
.splash__empty { color: #b8c1e0; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border: none; border-radius: 999px; cursor: pointer;
    font-weight: 600; font-size: 15px; color: #fff;
    background: rgba(255,255,255,.08); backdrop-filter: blur(8px);
    transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.btn--primary {
    background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
    box-shadow: 0 10px 30px rgba(110,142,251,.4);
}
.btn--primary:hover { box-shadow: 0 14px 40px rgba(110,142,251,.55); transform: translateY(-2px); }
.btn--lg { padding: 16px 32px; font-size: 17px; }
.btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); }
.btn--danger { background: linear-gradient(135deg, #ff6a6a, #c8385d); }
.btn--sm { padding: 6px 12px; font-size: 13px; }

/* --- Top bar --- */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; gap: 16px;
    background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0; transition: opacity .5s ease;
}
.topbar.show { opacity: 1; }
.topbar > * { pointer-events: auto; }
.topbar__left { display: flex; align-items: center; gap: 14px; }
.topbar__logo { display: inline-flex; align-items: center; }
.topbar__logo img {
    max-height: 42px; max-width: 110px; object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
    transition: transform .25s;
}
.topbar__logo:hover img { transform: scale(1.06); }
.topbar__title { line-height: 1.25; }
.topbar__title strong { display: block; font-size: 16px; font-weight: 600; }
.topbar__title small { display: block; font-size: 12px; opacity: .75; margin-top: 2px; }

.topbar__right { display: flex; gap: 8px; }
.ctrl {
    position: relative;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(0,0,0,.45); color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    text-decoration: none;
    transition: background .2s, transform .15s, border-color .2s;
}
.ctrl:hover { background: rgba(110,142,251,.4); transform: translateY(-1px); border-color: rgba(110,142,251,.6); }
.ctrl:active { transform: scale(.95); }

/* Toggle icon hiển thị theo state */
.ctrl .ico-pause, .ctrl .ico-mute { display: none; }
.ctrl.is-on .ico-play { display: none; }
.ctrl.is-on .ico-pause { display: inline-block; }
.ctrl.is-muted .ico-vol { display: none; }
.ctrl.is-muted .ico-mute { display: inline-block; }
.ctrl.is-on { background: linear-gradient(135deg, rgba(110,142,251,.55), rgba(167,119,227,.55)); border-color: rgba(110,142,251,.8); }
.ctrl--gyro.is-on { background: linear-gradient(135deg, rgba(80,220,160,.55), rgba(110,142,251,.55)); border-color: rgba(80,220,160,.8); }

/* Progress ring quanh nút auto */
.ctrl--auto .progress-ring {
    position: absolute; inset: -2px; pointer-events: none;
    transform: rotate(-90deg);
}
.progress-ring__bg, .progress-ring__bar { fill: none; stroke-width: 2; }
.progress-ring__bg  { stroke: rgba(255,255,255,.1); }
.progress-ring__bar { stroke: #6fffb0; stroke-linecap: round;
    stroke-dasharray: 100.53; stroke-dashoffset: 100.53;
    transition: stroke-dashoffset .2s linear; }

/* --- Marker (hotspot) custom --- */
.psv-marker--info, .psv-marker--link { will-change: transform; }

.hs { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: transform .25s cubic-bezier(.16,1,.3,1), filter .2s ease, box-shadow .2s ease;
      box-sizing: border-box; }
.hs:hover { transform: scale(1.18); filter: brightness(1.15) saturate(1.2); z-index: 10; }
.hs:active { transform: scale(.95); transition-duration: .08s; }
.hs svg { width: 60%; height: 60%; pointer-events: none; }
.hs--ico svg { width: 55%; height: 55%; }

/* Halo phụ khi hover (lan toả) cho info & link tròn */
.hs--info-orange:hover, .hs--info-blue:hover, .hs--info-red:hover,
.hs--link-blue:hover, .hs--link-ring:hover {
    box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 36px 6px rgba(255,200,80,.85);
}
.hs--info-blue:hover, .hs--link-blue:hover, .hs--link-ring:hover {
    box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 36px 6px rgba(110,160,255,.95);
}
.hs--info-red:hover {
    box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 36px 6px rgba(255,80,80,1);
}
.hs--link-foot:hover  { filter: drop-shadow(0 0 14px rgba(255,255,255,.95)) drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.hs--link-portal:hover { filter: drop-shadow(0 0 22px rgba(140,200,255,1)); animation-duration: 2s; }
.hs--dot:hover { box-shadow: 0 0 0 3px rgba(255,200,80,1), 0 0 28px 8px rgba(255,200,80,.9); }

/* --- INFO variants --- */
.hs--info-orange {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,212,121,.95) 0%, rgba(255,140,0,.85) 100%);
    color: #1a1006; font-weight: 800; font-size: 20px; font-family: serif;
    box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 0 24px rgba(255,200,80,.7);
    animation: hsHalo 2.4s ease-in-out infinite;
}
.hs--info-blue {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140,180,255,.95) 0%, rgba(50,100,220,.9) 100%);
    color: #fff; font-weight: 800; font-size: 20px; font-family: serif;
    box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 0 24px rgba(110,160,255,.7);
    animation: hsHaloBlue 2.4s ease-in-out infinite;
}
.hs--info-red {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,120,120,.95) 0%, rgba(220,40,40,.9) 100%);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 0 24px rgba(255,80,80,.75);
    animation: hsHaloRed 2.2s ease-in-out infinite;
}
.hs--dot {
    width: 100%; height: 100%; border-radius: 50%;
    background: #fff; box-shadow: 0 0 0 2px rgba(255,200,80,.9), 0 0 14px rgba(255,200,80,.8);
    animation: hsDotPulse 1.4s ease-in-out infinite;
}

@keyframes hsHalo {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 0 18px rgba(255,200,80,.6); }
    50%      { box-shadow: 0 0 0 6px rgba(255,212,121,0),  0 0 32px rgba(255,200,80,.95); }
}
@keyframes hsHaloBlue {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 0 18px rgba(110,160,255,.6); }
    50%      { box-shadow: 0 0 0 6px rgba(140,180,255,0),  0 0 32px rgba(110,160,255,.95); }
}
@keyframes hsHaloRed {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 0 18px rgba(255,80,80,.7); }
    50%      { box-shadow: 0 0 0 6px rgba(255,120,120,0),  0 0 36px rgba(255,80,80,1); }
}
@keyframes hsDotPulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 2px rgba(255,200,80,.9), 0 0 0 0 rgba(255,200,80,.6); }
    50%      { transform: scale(1.25); box-shadow: 0 0 0 2px rgba(255,200,80,.9), 0 0 0 14px rgba(255,200,80,0); }
}

/* --- LINK variants --- */
.hs--link-blue {
    border-radius: 50%;
    background: rgba(110,142,251,.85);
    border: 2px solid rgba(255,255,255,.7);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
    animation: hsPulse 1.8s ease-in-out infinite;
}
/* --- Sàn nhà 3D (mũi tên di chuyển dán xuống mặt sàn) --- */
.hs--link-floor {
    --floor-tilt: 60deg;        /* nghiêng dán xuống sàn */
    --floor-rot: 0deg;          /* hướng mũi tên (0=lên, 90=phải, 180=xuống, -90=trái) */
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,.9) 0%, rgba(110,142,251,.55) 45%, rgba(110,142,251,0) 80%);
    color: #fff;
    transform: perspective(160px) rotateX(var(--floor-tilt)) rotateZ(var(--floor-rot));
    transform-origin: 50% 70%;
    transform-style: preserve-3d;
    animation: hsFloor 2s ease-in-out infinite;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.55));
    transition: transform .35s cubic-bezier(.16,1,.3,1), filter .25s ease;
}
.hs--link-floor:hover {
    transform: perspective(160px) rotateX(var(--floor-tilt)) rotateZ(var(--floor-rot)) scale(1.18);
    filter: drop-shadow(0 0 22px rgba(140,200,255,1)) drop-shadow(0 8px 16px rgba(0,0,0,.6));
}
.hs--link-floor svg {
    width: 70%; height: 70%;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.7));
    animation: hsFloorArrow 1.4s ease-in-out infinite;
}
/* hướng mũi tên trên sàn — chỉ xoay container; svg tự đi theo */
.hs--link-floor-up    { --floor-rot: 0deg;   }
.hs--link-floor-right { --floor-rot: 90deg;  --floor-tilt: 60deg; }
.hs--link-floor-down  { --floor-rot: 180deg; --floor-tilt: 55deg; }
.hs--link-floor-left  { --floor-rot: -90deg; --floor-tilt: 60deg; }
/* Các mũi tên cạnh thì điểm tựa nên đẩy về mép tương ứng để khỏi đè vật thể giữa */
.hs--link-floor-left, .hs--link-floor-right { transform-origin: 50% 50%; }
.hs--link-foot {
    color: #fff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
    animation: hsFootBob 2s ease-in-out infinite;
}
.hs--link-foot svg { width: 90%; height: 90%; }
.hs--link-portal {
    color: #8ab4ff;
    filter: drop-shadow(0 0 12px rgba(110,142,251,.9));
    animation: hsPortalSpin 6s linear infinite;
}
.hs--link-portal svg { width: 100%; height: 100%; }
.hs--link-ring {
    position: relative;
    border-radius: 50%;
    background: rgba(110,142,251,.25);
    border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.hs--link-ring::before, .hs--link-ring::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(110,180,255,.85);
    animation: hsRingExp 2s ease-out infinite;
}
.hs--link-ring::after { animation-delay: 1s; }
.hs--link-ring span {
    position: absolute; inset: 30%; border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #6e8efb 100%);
    box-shadow: 0 0 12px rgba(255,255,255,.9);
}

@keyframes hsPulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 6px 20px rgba(0,0,0,.5), 0 0 0 0 rgba(110,142,251,.6); }
    50%      { transform: scale(1.12); box-shadow: 0 6px 20px rgba(0,0,0,.5), 0 0 0 18px rgba(110,142,251,0); }
}
@keyframes hsFloor {
    0%, 100% { filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
    50%      { filter: drop-shadow(0 6px 16px rgba(110,142,251,.9)); }
}
@keyframes hsFloorArrow {
    0%, 100% { transform: translateY(-2px); opacity: .8; }
    50%      { transform: translateY(4px);  opacity: 1; }
}
@keyframes hsFootBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
@keyframes hsPortalSpin {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}
@keyframes hsRingExp {
    0%   { transform: scale(.6); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Picker preview (admin) */
.hs-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 8px; }
.hs-preview-item { position: relative; padding: 14px 8px 28px; border: 2px solid rgba(255,255,255,.1); border-radius: 10px;
    background: linear-gradient(135deg, #1f2a4a 0%, #11162a 100%); cursor: pointer; transition: border-color .2s, transform .2s;
    display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 90px; }
.hs-preview-item:hover { border-color: rgba(110,142,251,.6); transform: translateY(-2px); }
.hs-preview-item.selected { border-color: #6e8efb; box-shadow: 0 0 0 3px rgba(110,142,251,.3); }
.hs-preview-item .hs { width: 40px; height: 40px; }
.hs-preview-item .hs--link-floor, .hs-preview-item .hs--link-portal { width: 48px; height: 48px; }
.hs-preview-item small { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center;
    font-size: 10px; color: #b8c1e0; line-height: 1.2; padding: 0 4px; }

/* --- Popup info --- */
.popup {
    position: fixed; inset: 0; z-index: 200;
    display: none; align-items: center; justify-content: center;
    padding: 24px;
}
.popup.show { display: flex; }
.popup__backdrop {
    position: absolute; inset: 0;
    background: rgba(5,8,20,.6); backdrop-filter: blur(8px);
    animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.popup__panel {
    position: relative; z-index: 1;
    max-width: 720px; width: 100%; max-height: 90vh; overflow: auto;
    background: linear-gradient(180deg, #1a2040 0%, #0e1430 100%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.7);
    padding: 28px;
    animation: popupIn .4s cubic-bezier(.16,1,.3,1);
}
@keyframes popupIn {
    from { opacity: 0; transform: scale(.92) translateY(20px); }
    to   { opacity: 1; transform: none; }
}
.popup__close {
    position: absolute; top: 12px; right: 12px;
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .2s;
}
.popup__close:hover { background: rgba(255,90,90,.6); transform: rotate(90deg); }

.popup__content h2 { margin: 0 0 16px; font-size: 24px; font-weight: 700;
    background: linear-gradient(135deg, #ffd479, #ff9c5a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popup__content img.popup__hero {
    display: block; max-width: 100%; max-height: 360px; margin: 0 auto 16px;
    border-radius: 12px; cursor: zoom-in;
    transition: transform .3s ease;
}
.popup__content img.popup__hero:hover { transform: scale(1.02); }
.popup__content .popup__html { color: #d8def0; line-height: 1.7; font-size: 15px; }
.popup__content .popup__html p:first-child { margin-top: 0; }
.popup__content .popup__html p:last-child { margin-bottom: 0; }

.popup__youtube {
    position: relative; padding-top: 56.25%; margin: 18px 0;
    border-radius: 12px; overflow: hidden; background: #000;
}
.popup__youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.popup__youtube-thumb {
    position: absolute; inset: 0; cursor: pointer;
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
}
.popup__youtube-thumb::before {
    content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.6));
}
.popup__youtube-thumb svg { position: relative; width: 80px; height: 80px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); }

.popup__audio {
    margin: 16px 0 0; display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: rgba(255,255,255,.05); border-radius: 12px;
}
.popup__audio audio { flex: 1; height: 36px; }

.popup__partners {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 22px; padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12px; color: #8b94b8;
}
.popup__partners img { max-height: 28px; max-width: 80px; object-fit: contain; opacity: .85; }

/* Lightbox cho ảnh hiện vật */
.lightbox {
    position: fixed; inset: 0; z-index: 300;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,.92); cursor: zoom-out;
    animation: fadeIn .25s ease;
}
.lightbox.show { display: flex; }
.lightbox img {
    max-width: 95vw; max-height: 95vh; object-fit: contain;
    border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.8);
    animation: popupIn .35s cubic-bezier(.16,1,.3,1);
}

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    padding: 12px 22px; background: rgba(0,0,0,.8); color: #fff;
    border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none;
    transition: opacity .3s, transform .3s; z-index: 500;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.hide { display: none !important; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-body { background: #0b1020; min-height: 100vh; overflow: auto !important; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }
.admin-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; margin-bottom: 24px;
    background: linear-gradient(135deg, #1a2040, #0e1430);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
}
.admin-head h1 { margin: 0; font-size: 20px; }
.admin-head nav { display: flex; gap: 8px; }
.admin-head nav a {
    padding: 8px 14px; border-radius: 8px; color: #c8d4ff; text-decoration: none;
    transition: background .2s;
}
.admin-head nav a:hover, .admin-head nav a.active { background: rgba(110,142,251,.3); color: #fff; }

.card {
    background: linear-gradient(180deg, #161b35, #11162a);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px; padding: 22px; margin-bottom: 20px;
}
.card h2 { margin: 0 0 18px; font-size: 17px; color: #ffd479; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; margin-bottom: 6px; color: #b8c1e0; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number],
.form-row textarea, .form-row select {
    width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(0,0,0,.3); color: #e8eaf2; font-size: 14px;
    font-family: inherit;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: none; border-color: #6e8efb; box-shadow: 0 0 0 3px rgba(110,142,251,.2);
}

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.scene-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.scene-card {
    background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; overflow: hidden;
    transition: transform .2s, border-color .2s;
}
.scene-card:hover { transform: translateY(-3px); border-color: rgba(110,142,251,.5); }
.scene-card__img { width: 100%; height: 130px; object-fit: cover; background: #050813; display: block; }
.scene-card__body { padding: 12px; }
.scene-card__name { margin: 0 0 4px; font-weight: 600; }
.scene-card__meta { font-size: 12px; color: #8b94b8; margin-bottom: 10px; }
.scene-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.scene-card__badge {
    display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 999px;
    background: rgba(255,212,121,.2); color: #ffd479; margin-left: 6px;
}

.partner-list { display: grid; gap: 12px; }
.partner-row {
    display: grid; grid-template-columns: 80px 1fr 1fr auto; gap: 10px; align-items: center;
    padding: 10px; background: rgba(0,0,0,.25); border-radius: 10px;
}
.partner-row img { max-width: 80px; max-height: 60px; object-fit: contain; background: rgba(255,255,255,.05); border-radius: 6px; padding: 4px; }

.alert {
    padding: 12px 16px; border-radius: 10px; margin-bottom: 18px;
    border: 1px solid;
}
.alert--err { background: rgba(255,80,80,.1); border-color: rgba(255,80,80,.4); color: #ffb4b4; }
.alert--ok  { background: rgba(80,255,160,.08); border-color: rgba(80,255,160,.3); color: #b4ffd0; }

.upload-input { display: flex; align-items: center; gap: 10px; }
.upload-input input[type=file] { color: #b8c1e0; font-size: 13px; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: linear-gradient(180deg, #1a2040, #0e1430);
    padding: 32px; border-radius: 18px; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card p { margin: 0 0 22px; color: #8b94b8; font-size: 13px; }

/* Scene editor */
#editor-viewer { position: relative; width: 100%; height: 70vh; border-radius: 14px; overflow: hidden; background: #050813; }
.editor-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 12px 16px; background: rgba(0,0,0,.4); border-radius: 10px; margin-bottom: 12px;
}
.editor-toolbar .hint { color: #ffd479; font-size: 13px; flex: 1; }

.hotspot-form-overlay {
    position: fixed; inset: 0; z-index: 400; display: none;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
    padding: 24px;
}
.hotspot-form-overlay.show { display: flex; }
.hotspot-form { background: linear-gradient(180deg, #1a2040, #0e1430); padding: 26px; border-radius: 16px;
    width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
    border: 1px solid rgba(255,255,255,.1);
    animation: popupIn .35s cubic-bezier(.16,1,.3,1); }
.hotspot-form h3 { margin: 0 0 18px; font-size: 18px; color: #ffd479; }

.hotspot-list { margin-top: 16px; }
.hotspot-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: rgba(0,0,0,.25); border-radius: 8px; margin-bottom: 6px;
    font-size: 13px;
}
.hotspot-item__type {
    width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #1a1006;
}
.hotspot-item__type--info { background: #ffd479; }
.hotspot-item__type--link { background: #6e8efb; color: #fff; }
.hotspot-item__name { flex: 1; }


/* ============================================================
   RESPONSIVE � Mobile / Tablet
   ============================================================ */
@media (max-width: 768px) {
    .splash__inner { padding: 20px 16px; }
    .splash__partners { gap: 14px; margin-bottom: 18px; }
    .splash__partners img { max-height: 56px; max-width: 110px; }
    .splash__title { font-size: clamp(18px, 5vw, 26px); }
    .splash__name  { font-size: clamp(15px, 4vw, 20px); margin: 12px 0 6px; }
    .splash__subtitle { font-size: 13px; margin-bottom: 24px; }
    .btn--lg { padding: 14px 24px; font-size: 15px; }

    .topbar { padding: 6px 8px; gap: 6px; flex-wrap: wrap; }
    .topbar__left  { gap: 6px; flex: 1 1 100%; min-width: 0; order: 1; }
    .topbar__right {
        gap: 6px; order: 2; margin-top: 4px;
        flex: 1 1 100%; min-width: 0;
        display: flex; flex-wrap: nowrap;
        overflow-x: auto; overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        justify-content: flex-start;
    }
    .topbar__right::-webkit-scrollbar { display: none; }
    .topbar__right .ctrl { flex: 0 0 auto; }
    .topbar__logo img { max-height: 32px; max-width: 70px; }
    .topbar__title strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; display: block; }
    .topbar__title small { font-size: 11px; }
    .ctrl { width: 40px; height: 40px; }
    .ctrl svg { width: 18px; height: 18px; }

    .popup { padding: 10px; }
    .popup__panel { width: 100%; max-height: 92vh; }
    .popup__partners { font-size: 11px; }
    .popup__partners img { max-height: 26px; }

    .hs-preview-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .form-grid { grid-template-columns: 1fr !important; }
    .card { padding: 16px !important; }
}
@media (max-width: 480px) {
    .splash__partners img { max-height: 44px; max-width: 90px; }
    .topbar__title strong { max-width: 50vw; }
    .ctrl { width: 38px; height: 38px; }
}

/* Tạm ẩn nhãn trên những nhút phụ khi màn hình rất hẹp */
@media (max-width: 360px) {
    .topbar__title small { display: none; }
    .ctrl { width: 36px; height: 36px; }
}

/* Hint scroll trên topbar (gradient mờ ở mép phải) */
@media (max-width: 768px) {
    .topbar__right {
        position: relative;
        -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%);
                mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%);
    }
}


/* Ph? m�n flash khi chuy?n c?nh (\u0111en/tr\u1eafng) */
.scene-flash {
    position: fixed; inset: 0; z-index: 9000; pointer-events: none;
    opacity: 0; background: #000;
}
.scene-flash.show { opacity: 1; }
