/* ============================================================
   헬리콥터 세계관
   지식이 모이고, 가치는 퍼집니다 — 그 이동을 눈에 보이게.
   ============================================================ */

/* ── 기체 도장 ───────────────────────────────────────────
   배지가 기체의 생김새로 나타난다는 것을 화면에서도 알려 준다.
   ------------------------------------------------------- */

/* ══════════════════════════════════════════════════════════
   격납고 — 여러 대를 세워 두고 손보는 자리
   ══════════════════════════════════════════════════════════ */

.bay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }

.bay-slot {
    position: relative;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 12px, transparent 12px 24px),
        var(--hbc-dark-2);
    border: 1px solid var(--hbc-border);
    border-radius: 14px;
    padding: .85rem;
}
/* 지금 손에 잡고 있는 기체 */
.bay-slot.is-active {
    border-color: rgba(16,185,129,.55);
    box-shadow: 0 0 0 1px rgba(16,185,129,.25), 0 10px 26px rgba(0,0,0,.45);
}
.bay-slot.is-active::before {
    content: "조종 중"; position: absolute; top: -9px; left: 12px;
    padding: .05rem .5rem; border-radius: 999px;
    background: var(--hbc-gold-dark); color: #06120e;
    font-size: .64rem; font-weight: 800;
}
/* 뜨지 못하는 기체 */
.bay-slot.is-grounded { border-color: rgba(239,68,68,.45); }
.bay-slot.is-grounded::before {
    content: "이륙 불가"; position: absolute; top: -9px; left: 12px;
    padding: .05rem .5rem; border-radius: 999px;
    background: #b91c1c; color: #fff; font-size: .64rem; font-weight: 800;
}

.bay-head { display: flex; align-items: center; gap: .6rem; }
.bay-name { color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.2; }

/* 기체 상태 계기 */
.bay-gauge {
    height: 7px; border-radius: 999px; margin-top: .5rem;
    background: rgba(0,0,0,.45); border: 1px solid var(--hbc-border);
    overflow: hidden;
}
.bay-gauge span { display: block; height: 100%; transition: width .4s ease; }
.bay-cond {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .72rem; margin-top: .3rem;
}
.bay-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .7rem; }
.bay-actions .btn { font-size: .74rem; padding: .25rem .55rem; }

/* 새 기체 자리 */
.bay-slot.is-empty {
    border-style: dashed;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: var(--hbc-muted); min-height: 190px;
}
.bay-slot.is-locked { opacity: .6; }

/* 첫 화면의 내 기체 — 제자리에서 떠 있다 */
.heli-home-craft {
    width: clamp(160px, 46vw, 220px);
    line-height: 0;
    filter: drop-shadow(0 10px 24px rgba(0,0,0,.55));
}
.heli-home-craft svg { width: 100%; height: auto; overflow: visible; }
.heli-home-craft .heli-body-group { animation: heli-bob 2.8s ease-in-out infinite; }

/* 목록에 서 있는 작은 기체 — 남의 도장을 알아보는 자리 */
.heli-chip {
    display: inline-block; width: 52px; flex: 0 0 auto;
    line-height: 0;
}
.heli-chip svg { width: 100%; height: auto; overflow: visible; }
/* 목록에서는 로터가 천천히 돈다 — 여러 대가 빠르게 돌면 눈이 어지럽다 */
.heli-chip .heli-rotor-blades { animation-duration: 2.2s; }
.heli-chip .heli-tail-rotor   { animation-duration: 2.6s; }
.heli-chip .heli-downwash     { display: none; }
.heli-chip .heli-body-group   { animation: heli-bob 3.4s ease-in-out infinite; }

.heli-livery-tag {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .12rem .5rem; border-radius: 999px;
    border: 1px solid; font-size: .72rem; font-weight: 600;
}

.heli-livery-card {
    /* 도장 색은 위쪽 띠로만 드러낸다. 테두리까지 물들이려면 색을 반투명하게
       섞어야 하는데(color-mix), 못 읽는 브라우저에서 테두리가 사라진다. */
    border-color: rgba(16,185,129,.35);
    position: relative; overflow: hidden;
}
/* 도장 색이 카드 위쪽에 배어 나온다 */
.heli-livery-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--liv, #10b981), transparent);
    opacity: .75;
}

.heli-livery-traits { display: flex; flex-wrap: wrap; gap: .4rem; }
.heli-trait {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .28rem .6rem; border-radius: 999px;
    border: 1px dashed var(--hbc-border);
    color: #6f8a7d; font-size: .76rem;
}
.heli-trait small { opacity: .7; font-size: .68rem; }
/* 얻은 것은 실선으로 — 아직인 것과 한눈에 구분된다 */
.heli-trait.is-on {
    border-style: solid;
    border-color: rgba(16,185,129,.5);
    color: var(--hbc-gold-light);
    background: rgba(16,185,129,.07);
}

.heli-livery-next {
    padding: .55rem .75rem; border-radius: 8px;
    background: rgba(0,0,0,.25); border: 1px solid var(--hbc-border);
    color: var(--hbc-text); font-size: .82rem;
}

/* ══════════════════════════════════════════════════════════
   미션 — 무엇부터 해야 할지 손을 잡아 끄는 자리
   ══════════════════════════════════════════════════════════ */

.mission-call {
    position: relative;
    border: 1px solid rgba(245,158,11,.45);
    border-radius: 14px;
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(245,158,11,.14), transparent 60%),
        var(--hbc-dark-2);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.mission-call.is-newcomer { border-color: rgba(245,158,11,.7); }
.mission-call h6 { color: #fff; font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.mission-call .why { color: var(--hbc-muted); font-size: .82rem; line-height: 1.75; }

.mission-reward {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .15rem .55rem; border-radius: 999px;
    border: 1px solid rgba(245,158,11,.5); color: #fcd34d;
    font-size: .74rem; font-weight: 700;
}

.mission-bar {
    height: 6px; border-radius: 999px; margin-top: .6rem;
    background: rgba(0,0,0,.45); border: 1px solid var(--hbc-border); overflow: hidden;
}
.mission-bar span {
    display: block; height: 100%;
    background: linear-gradient(90deg, #b45309, #fcd34d);
    transition: width .4s ease;
}

.mission-item {
    border: 1px solid var(--hbc-border); border-radius: 12px;
    background: var(--hbc-dark-2); padding: .9rem 1rem;
}
.mission-item.is-done { opacity: .62; border-color: rgba(16,185,129,.4); }

/* 나를 찾아온 남의 기체 */
.guest-craft {
    display: flex; align-items: center; gap: .6rem;
    border: 1px solid rgba(96,165,250,.4);
    border-radius: 12px; padding: .7rem .85rem;
    background: rgba(30,79,122,.12);
}
.guest-craft .who { color: #93c5fd; font-size: .76rem; }

/* 짐칸에서 손님이 실은 짐 */
.cargo-guest-tag {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .05rem .4rem; border-radius: 999px;
    border: 1px solid rgba(96,165,250,.5); color: #93c5fd;
    font-size: .68rem;
}

/* ── 헬리콥터 구역 안내 ──────────────────────────────────── */

.heli-nav {
    display: flex; gap: .35rem; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
    margin-bottom: 1.25rem;
    padding-bottom: .2rem;
    /* 손가락을 떼면 칸에 맞춰 선다 — 반쯤 걸친 채로 멈추지 않는다 */
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.heli-nav::-webkit-scrollbar { display: none; }
.heli-nav-item { scroll-snap-align: start; scroll-margin-left: .35rem; }

/* 옆으로 더 있다는 표시.
   좁은 화면에서 다섯 칸이 다 안 들어가는데 잘린 티가 나지 않으면,
   여기가 전부인 줄 알고 나머지 화면을 영영 찾지 못한다. */
.heli-nav-wrap { position: relative; }
.heli-nav-wrap::after {
    content: '';
    position: absolute; top: 0; right: 0; bottom: .2rem; width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--hbc-dark));
    opacity: 0; transition: opacity .18s;
}
.heli-nav-wrap.has-more::after { opacity: 1; }
.heli-nav-item {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .45rem .85rem; border-radius: 999px;
    border: 1px solid var(--hbc-border);
    background: var(--hbc-dark-2);
    color: var(--hbc-muted); font-size: .82rem;
    text-decoration: none; white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s;
}
.heli-nav-item:hover { color: var(--hbc-gold-light); border-color: rgba(16,185,129,.4); }
.heli-nav-item.is-active {
    color: var(--hbc-gold); border-color: var(--hbc-gold);
    background: rgba(16,185,129,.10);
}

/* ── 하늘 ─────────────────────────────────────────────────── */

.heli-sky {
    position: relative;
    height: 210px;
    border-radius: var(--hbc-radius, 16px);
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 50% 120%, rgba(16,185,129,.14), transparent 60%),
        linear-gradient(180deg, #071410 0%, #0a1a14 45%, #0d2019 100%);
    border: 1px solid var(--hbc-border);
}

/* 별 — 아주 옅게 깔아 하늘에 깊이를 준다 */
.heli-sky::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.35), transparent),
        radial-gradient(1px 1px at 68% 14%, rgba(255,255,255,.28), transparent),
        radial-gradient(1px 1px at 84% 38%, rgba(255,255,255,.22), transparent),
        radial-gradient(1px 1px at 32% 47%, rgba(255,255,255,.18), transparent),
        radial-gradient(1px 1px at 51% 8%,  rgba(255,255,255,.30), transparent);
    pointer-events: none;
}

/* 지평선 */
.heli-horizon {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 46px;
    background: linear-gradient(180deg, transparent, rgba(16,185,129,.10));
    border-top: 1px solid rgba(16,185,129,.22);
}

/* 흘러가는 구름 — 헬리콥터가 아니라 배경이 움직여야 전진하는 느낌이 난다 */
.heli-cloud {
    position: absolute;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
    animation: heli-drift linear infinite;
    pointer-events: none;
}
@keyframes heli-drift {
    from { transform: translateX(115%); }
    to   { transform: translateX(-115%); }
}

/* ── 항로 ─────────────────────────────────────────────────── */

/* 항로의 좌우 여백은 기체 절반보다 넓어야 한다.
   비율(%)로 두면 화면이 좁아질 때 여백이 같이 줄어 기수가 잘린다.
   그래서 기체 크기와 같은 단위(px)로 잡는다. */
.heli-route {
    position: absolute;
    left: 74px; right: 74px; top: 50%;
    height: 2px;
    transform: translateY(-50%);
}
.heli-route-line {
    position: absolute; inset: 0;
    border-top: 2px dashed rgba(255,255,255,.14);
}
.heli-route-done {
    position: absolute; left: 0; top: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--hbc-gold));
    box-shadow: 0 0 12px rgba(16,185,129,.6);
    transition: width .9s linear;
}
.heli-endpoint {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--hbc-dark);
    border: 2px solid rgba(255,255,255,.35);
}
.heli-endpoint.is-home { border-color: var(--hbc-gold); box-shadow: 0 0 14px rgba(16,185,129,.55); }
.heli-endpoint.start { left: 0; }
.heli-endpoint.end   { left: 100%; }

.heli-endpoint-label {
    position: absolute; top: 22px;
    transform: translateX(-50%);
    font-size: .7rem; color: var(--hbc-muted);
    white-space: nowrap; max-width: 120px;
    overflow: hidden; text-overflow: ellipsis;
}

/* ── 기체 ─────────────────────────────────────────────────── */

/* 기체는 항로(.heli-route) 안에 놓는다.
   하늘 전체를 기준으로 두면 진행률 100%에서 기수가 화면 밖으로 나가 잘린다. */
.heli-craft {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    width: clamp(96px, 26vw, 132px);
    transition: left .9s linear;
    will-change: transform, left;
    pointer-events: none;
}
.heli-craft svg { display: block; width: 100%; height: auto; overflow: visible; }
/* 제자리 부양 — 로터가 도는 기체는 결코 완전히 멈춰 있지 않다 */
.heli-craft.is-hovering .heli-body-group { animation: heli-bob 2.6s ease-in-out infinite; }
/* 전진 중에는 기수를 살짝 숙인다. 실제 헬리콥터가 앞으로 가는 방식이다 */
.heli-craft.is-flying  .heli-body-group { animation: heli-cruise 1.7s ease-in-out infinite; }

@keyframes heli-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-5px) rotate(-.6deg); }
}
@keyframes heli-cruise {
    0%, 100% { transform: translateY(0) rotate(-7deg); }
    50%      { transform: translateY(-3px) rotate(-8.5deg); }
}

/* 메인 로터 — 얕은 각도에서 본 원반이라 세로로 눌러 준다.
   이 눌림(scaleY)이 없으면 회전이 팽이처럼 보여 단번에 가짜가 된다. */
.heli-rotor-disc { transform-origin: 62px 13px; transform: scaleY(.16); }
.heli-rotor-blades { transform-origin: 62px 13px; animation: heli-spin .16s linear infinite; }
.heli-tail-rotor   { transform-origin: 15px 22px; animation: heli-spin .11s linear infinite; }

@keyframes heli-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 로터 다운워시 */
.heli-downwash {
    animation: heli-wash 1.1s ease-out infinite;
    transform-origin: 62px 34px;
}
@keyframes heli-wash {
    0%   { opacity: .28; transform: scaleY(.6) translateY(0); }
    100% { opacity: 0;   transform: scaleY(1.5) translateY(12px); }
}

/* 착륙해 있을 때는 로터가 천천히 돈다 */
.heli-craft.is-parked .heli-rotor-blades { animation-duration: 2.4s; }
.heli-craft.is-parked .heli-tail-rotor   { animation-duration: 3s; }
.heli-craft.is-parked .heli-downwash     { display: none; }

/* 움직임을 줄이고 싶은 사람에게는 회전을 멈춘다 */
@media (prefers-reduced-motion: reduce) {
    .heli-rotor-blades, .heli-tail-rotor, .heli-downwash,
    .heli-cloud, .heli-craft.is-hovering .heli-body-group,
    .heli-craft.is-flying .heli-body-group {
        animation: none !important;
    }
    .heli-craft, .heli-route-done { transition: none !important; }
}

/* ── 상태 표시 ────────────────────────────────────────────── */

.heli-status-chip {
    position: absolute; top: 12px; left: 14px;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .2rem .6rem; border-radius: 999px;
    background: rgba(0,0,0,.45); border: 1px solid var(--hbc-border);
    font-size: .74rem; color: var(--hbc-text);
    backdrop-filter: blur(4px);
}
.heli-status-chip .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--hbc-gold);
    animation: heli-pulse 1.6s ease-in-out infinite;
}
@keyframes heli-pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.heli-eta {
    position: absolute; top: 12px; right: 14px;
    font-size: .74rem; color: var(--hbc-muted);
    font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   지도 위의 비행
   ══════════════════════════════════════════════════════════ */

.heli-map-stage {
    position: relative;
    height: clamp(300px, 52vh, 460px);
    border-radius: var(--hbc-radius, 16px);
    overflow: hidden;
    border: 1px solid var(--hbc-border);
    background: var(--hbc-dark-3);
}

/* 지도 위에 얹히는 기체 — 오버레이라 지도 좌표를 따라 움직인다.
   기체만 눌리게 하고 나머지는 지도로 클릭이 통과하도록 둔다. */
.heli-map-craft {
    position: relative;
    width: 108px;
    pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.55));
}
.heli-map-craft-tilt {
    pointer-events: auto;
    cursor: pointer;
    transition: transform .35s ease-out;   /* 기울기가 툭툭 꺾이지 않게 */
}
/* 좌우 반전 전용 겹. 흔들림 애니메이션과 같은 요소에 두면
   애니메이션이 transform 을 차지해 반전이 무시된다. */
.heli-map-craft-flip { transition: transform .2s ease-out; }

/* 비행 중의 흔들림. 제자리 부양보다 폭이 크고 주기가 어긋나야
   기계가 아니라 바람 속을 나는 것처럼 보인다. */
.heli-map-craft-body { animation: heli-fly-bob 2.15s ease-in-out infinite; }
.heli-map-craft svg { display: block; width: 100%; height: auto; overflow: visible; }

@keyframes heli-fly-bob {
    0%   { transform: translateY(0)     rotate(-1.2deg); }
    28%  { transform: translateY(-6px)  rotate(1deg); }
    55%  { transform: translateY(-2px)  rotate(-.6deg); }
    78%  { transform: translateY(-7px)  rotate(1.4deg); }
    100% { transform: translateY(0)     rotate(-1.2deg); }
}

/* 눌러서 멈춘 상태 */
.heli-map-craft.is-paused .heli-map-craft-body { animation-play-state: paused; }
.heli-map-craft.is-paused .heli-rotor-blades,
.heli-map-craft.is-paused .heli-tail-rotor { animation-duration: 1.6s; }
.heli-map-craft.is-paused .heli-map-cargo { animation-play-state: paused; }
.heli-map-craft.is-paused::after {
    content: "잠시 멈춤 · 눌러서 계속";
    position: absolute; left: 50%; top: -18px;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: .1rem .45rem; border-radius: 999px;
    background: rgba(0,0,0,.75); border: 1px solid rgba(16,185,129,.55);
    color: var(--hbc-gold-light); font-size: .66rem;
}

/* 기체 아래로 늘어뜨린 화물 */
.heli-map-sling {
    width: 1px; height: 12px; margin: -2px auto 0;
    background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.15));
}
.heli-map-cargo {
    display: flex; gap: 3px; justify-content: center;
    animation: heli-swing 3.1s ease-in-out infinite;
    transform-origin: top center;
}
.heli-map-cargo-chip {
    min-width: 26px; height: 26px; border-radius: 6px;
    background: rgba(13,32,25,.92);
    border: 1px solid rgba(16,185,129,.55);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: .72rem; color: var(--hbc-gold);
    box-shadow: 0 3px 10px rgba(0,0,0,.5);
    animation: heli-cargo-drop .5s ease-out backwards;
}
.heli-map-cargo-chip img { width: 26px; height: 26px; object-fit: cover; }

/* 글 화물은 아이콘이 아니라 글자를 보여준다.
   아이콘만 띄우면 글이 전부 같은 기호로 보여 무엇을 싣고 가는지 알 수 없다. */
.heli-map-cargo-chip.is-text {
    padding: 0 .3rem;
    max-width: 82px;
    color: #e2f4ec;
    font-size: .6rem; line-height: 1.1;
    letter-spacing: -.02em;
}
.heli-map-cargo-chip.is-text span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.heli-map-cargo-chip.is-more { font-weight: 700; font-size: .68rem; }

/* 따라가기 토글 */
.heli-map-follow {
    position: absolute; right: 10px; bottom: 10px; z-index: 20;
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .6rem; border-radius: 999px;
    background: rgba(10,26,20,.9); border: 1px solid var(--hbc-border);
    color: var(--hbc-muted); font-size: .74rem;
    backdrop-filter: blur(4px);
}
.heli-map-follow.is-on { color: var(--hbc-gold); border-color: rgba(16,185,129,.5); }
.heli-map-hint {
    position: absolute; left: 10px; bottom: 10px; z-index: 20;
    padding: .25rem .55rem; border-radius: 8px;
    background: rgba(10,26,20,.82); border: 1px solid var(--hbc-border);
    color: var(--hbc-muted); font-size: .7rem;
    pointer-events: none;
}

@keyframes heli-swing {
    0%, 100% { transform: rotate(-4deg); }
    50%      { transform: rotate(4deg); }
}
@keyframes heli-cargo-drop {
    from { opacity: 0; transform: translateY(-8px) scale(.7); }
    to   { opacity: 1; transform: none; }
}

/* 출발·도착 표시 */
.heli-map-pin {
    display: flex; flex-direction: column; align-items: center;
    pointer-events: none;
}
.heli-map-pin-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--hbc-dark); border: 3px solid rgba(255,255,255,.7);
    box-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.heli-map-pin.is-home .heli-map-pin-dot {
    border-color: var(--hbc-gold);
    box-shadow: 0 0 14px rgba(16,185,129,.9);
}
.heli-map-pin-label {
    margin-top: 4px; padding: .1rem .4rem; border-radius: 5px;
    background: rgba(10,26,20,.88); border: 1px solid var(--hbc-border);
    color: #e2f4ec; font-size: .7rem; white-space: nowrap;
    max-width: 130px; overflow: hidden; text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
    .heli-map-craft-body, .heli-map-cargo, .heli-map-cargo-chip { animation: none !important; }
    .heli-map-craft-tilt { transition: none !important; }
}

/* ══════════════════════════════════════════════════════════
   짐칸 — 실제로 적재하는 느낌
   ══════════════════════════════════════════════════════════ */

.heli-bay {
    border: 1px solid var(--hbc-border);
    border-radius: 14px;
    background:
        repeating-linear-gradient(45deg,
            rgba(255,255,255,.015) 0 10px, transparent 10px 20px),
        var(--hbc-dark-3);
    padding: .9rem;
}

.heli-bay-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; margin-bottom: .7rem; flex-wrap: wrap;
}

/* 적재량 게이지 */
.heli-bay-gauge {
    flex: 1 1 140px; min-width: 120px;
    height: 8px; border-radius: 999px;
    background: rgba(0,0,0,.45);
    border: 1px solid var(--hbc-border);
    overflow: hidden;
}
.heli-bay-gauge span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--hbc-gold-dark), var(--hbc-gold-light));
    transition: width .4s ease;
}
.heli-bay-gauge.is-full span { background: linear-gradient(90deg, #b45309, #f59e0b); }

/* 화물 슬롯 격자 — 빈 칸이 보여야 "적재" 느낌이 난다 */
.heli-bay-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: .5rem;
}
.heli-slot {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,.10);
    background: rgba(0,0,0,.22);
    display: flex; align-items: center; justify-content: center;
}
.heli-slot.is-empty::after {
    content: ""; width: 14px; height: 14px; border-radius: 3px;
    border: 1px dashed rgba(255,255,255,.14);
}
.heli-slot.is-loaded {
    border-style: solid;
    border-color: rgba(16,185,129,.4);
    background: var(--hbc-dark-2);
    cursor: pointer;
    overflow: hidden;
    animation: heli-load-in .45s cubic-bezier(.2,.9,.3,1.3) backwards;
}
.heli-slot.is-loaded:hover { border-color: var(--hbc-gold); }
.heli-slot.is-loaded img { width: 100%; height: 100%; object-fit: cover; }
.heli-slot-icon { font-size: 1.3rem; }
.heli-slot-label {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: .18rem .3rem;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.85));
    color: #dff3ea; font-size: .64rem; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.heli-slot-badge {
    position: absolute; top: 3px; right: 3px;
    width: 16px; height: 16px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; background: rgba(0,0,0,.65);
}

@keyframes heli-load-in {
    from { opacity: 0; transform: translateY(-14px) scale(.85); }
    to   { opacity: 1; transform: none; }
}

/* 적재 서랍 */
.heli-loader {
    margin-top: .8rem;
    border: 1px solid var(--hbc-border);
    border-radius: 12px;
    background: var(--hbc-dark-2);
    overflow: hidden;
}
.heli-loader-tabs {
    display: flex; gap: 0; overflow-x: auto;
    border-bottom: 1px solid var(--hbc-border);
    scrollbar-width: none;
}
.heli-loader-tabs::-webkit-scrollbar { display: none; }
.heli-loader-tab {
    flex: 1 0 auto;
    padding: .6rem .7rem;
    background: transparent; border: none;
    color: var(--hbc-muted); font-size: .8rem;
    display: flex; align-items: center; justify-content: center; gap: .3rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.heli-loader-tab.active {
    color: var(--hbc-gold);
    border-bottom-color: var(--hbc-gold);
    background: rgba(16,185,129,.06);
}
.heli-loader-body { padding: .85rem; }

/* 파일 놓는 자리 */
.heli-drop {
    border: 1px dashed rgba(255,255,255,.18);
    border-radius: 10px;
    padding: 1.1rem .8rem;
    text-align: center;
    color: var(--hbc-muted);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.heli-drop:hover, .heli-drop.is-over {
    border-color: var(--hbc-gold);
    background: rgba(16,185,129,.07);
    color: var(--hbc-gold-light);
}
.heli-drop-pick { font-size: .78rem; word-break: break-all; }

/* ── 카드 · 목록 ──────────────────────────────────────────── */

.heli-place-card {
    display: block;
    background: var(--hbc-dark-2);
    border: 1px solid var(--hbc-border);
    border-radius: 14px;
    padding: .9rem 1rem;
    text-decoration: none;
    transition: border-color .18s, transform .18s;
    height: 100%;
}
.heli-place-card:hover { border-color: rgba(16,185,129,.4); transform: translateY(-2px); }

.heli-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .04em;
    font-size: .76rem;
    color: var(--hbc-gold);
}

.heli-cargo-item {
    border: 1px solid var(--hbc-border);
    border-radius: 12px;
    padding: .8rem .9rem;
    background: var(--hbc-dark-2);
}
.heli-cargo-item img { border-radius: 8px; max-height: 220px; object-fit: cover; width: 100%; }

.heli-type-badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .1rem .45rem; border: 1px solid; border-radius: 6px;
    font-size: .72rem; font-weight: 600;
}

/* 고향까지 되짚는 사슬 */
.heli-chain { list-style: none; padding: 0; margin: 0; }
.heli-chain li {
    position: relative;
    padding: .45rem 0 .45rem 1.4rem;
    font-size: .84rem;
    color: var(--hbc-text);
}
.heli-chain li::before {
    content: ""; position: absolute; left: 4px; top: .95rem;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--hbc-gold); opacity: .55;
}
.heli-chain li:not(:last-child)::after {
    content: ""; position: absolute; left: 7px; top: 1.5rem; bottom: -.2rem;
    width: 1px; background: rgba(16,185,129,.25);
}
.heli-chain li.is-home::before { opacity: 1; box-shadow: 0 0 10px rgba(16,185,129,.8); }

/* ── 소환 · 포스터 ────────────────────────────────────────── */

.heli-summon-hero {
    text-align: center;
    padding: 2.2rem 1rem 1.6rem;
}
.heli-summon-hero h1 {
    font-size: clamp(1.4rem, 5vw, 2.1rem);
    font-weight: 900; color: #fff; margin-bottom: .4rem;
}

.heli-qr {
    background: #fff; padding: 12px; border-radius: 14px;
    display: inline-block; line-height: 0;
}
.heli-qr svg { display: block; width: 100%; height: auto; }

/* 도착 알림 */
.heli-arrival-toast {
    position: fixed; left: 50%; bottom: 24px;
    transform: translateX(-50%) translateY(140%);
    z-index: 1080;
    max-width: min(92vw, 420px);
    background: var(--hbc-dark-3);
    border: 1px solid rgba(16,185,129,.5);
    box-shadow: 0 18px 50px rgba(0,0,0,.6);
    border-radius: 14px; padding: .9rem 1rem;
    transition: transform .4s cubic-bezier(.2,.9,.3,1.2);
}
.heli-arrival-toast.show { transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════
   본부 서고

   세상을 돌아온 것들이 마지막에 닿는 자리다. 목록 하나로 끝내면
   창고처럼 보인다. 깊이가 있는 공간을 먼저 세우고 그 안에 기록을 둔다.
   ══════════════════════════════════════════════════════════ */

.vault {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(16,185,129,.22);
    background:
        radial-gradient(120% 80% at 50% 0%,   rgba(16,185,129,.16), transparent 62%),
        radial-gradient(80% 60% at 50% 110%,  rgba(16,185,129,.10), transparent 60%),
        linear-gradient(180deg, #06120e 0%, #081a13 55%, #0a1f18 100%);
    padding: clamp(2rem, 6vw, 4rem) 1.25rem clamp(2.5rem, 7vw, 4.5rem);
    text-align: center;
    isolation: isolate;
}

/* 바닥 — 소실점으로 모이는 격자가 공간의 깊이를 만든다 */
.vault-floor {
    position: absolute; left: -25%; right: -25%; bottom: -2px; height: 46%;
    background-image:
        repeating-linear-gradient(90deg, rgba(16,185,129,.20) 0 1px, transparent 1px 68px),
        repeating-linear-gradient(0deg,  rgba(16,185,129,.14) 0 1px, transparent 1px 46px);
    transform: perspective(340px) rotateX(70deg);
    transform-origin: bottom center;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 55%);
            mask-image: linear-gradient(180deg, transparent, #000 55%);
    pointer-events: none;
    z-index: -2;
}

/* 천장에서 내려오는 빛기둥 */
.vault-beam {
    position: absolute; left: 50%; top: -10%;
    width: clamp(180px, 40vw, 420px); height: 85%;
    transform: translateX(-50%);
    background: linear-gradient(180deg,
        rgba(52,211,153,.28) 0%, rgba(16,185,129,.10) 45%, transparent 85%);
    -webkit-mask-image: radial-gradient(60% 100% at 50% 0%, #000 40%, transparent 78%);
            mask-image: radial-gradient(60% 100% at 50% 0%, #000 40%, transparent 78%);
    animation: vault-breathe 7s ease-in-out infinite;
    pointer-events: none;
    z-index: -2;
}
@keyframes vault-breathe {
    0%, 100% { opacity: .75; }
    50%      { opacity: 1; }
}

/* 떠다니는 티끌 — 공기가 있다는 표시 */
.vault-motes { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.vault-mote {
    position: absolute; bottom: -10px;
    width: 3px; height: 3px; border-radius: 50%;
    background: rgba(167,243,208,.75);
    box-shadow: 0 0 8px rgba(52,211,153,.8);
    animation: vault-rise linear infinite;
}
@keyframes vault-rise {
    0%   { transform: translateY(0) translateX(0) scale(.6); opacity: 0; }
    12%  { opacity: .9; }
    100% { transform: translateY(-340px) translateX(var(--drift, 14px)) scale(1); opacity: 0; }
}

/* 문장(crest) — 서고의 중심 */
.vault-crest {
    position: relative;
    width: clamp(132px, 30vw, 176px);
    aspect-ratio: 1;
    margin: 0 auto 1.4rem;
    display: grid; place-items: center;
}
.vault-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(16,185,129,.35);
}
.vault-ring::after {
    content: ""; position: absolute; inset: -4px;
    border-radius: 50%;
    border-top: 2px solid var(--hbc-gold);
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    border-left: 2px solid transparent;
    animation: vault-spin 9s linear infinite;
}
.vault-ring.inner { inset: 16%; border-color: rgba(16,185,129,.22); }
.vault-ring.inner::after { animation-duration: 14s; animation-direction: reverse;
                           border-top-color: var(--hbc-gold-light); }
@keyframes vault-spin { to { transform: rotate(360deg); } }

.vault-count {
    position: relative; z-index: 1;
    font-size: clamp(2.2rem, 8vw, 3.4rem);
    font-weight: 900; line-height: 1;
    color: #fff;
    text-shadow: 0 0 26px rgba(16,185,129,.65);
    font-variant-numeric: tabular-nums;
}
.vault-count-label {
    position: relative; z-index: 1;
    margin-top: .3rem;
    font-size: .72rem; letter-spacing: .22em;
    color: var(--hbc-gold-light);
}

.vault-title {
    font-size: clamp(1.35rem, 4.5vw, 2rem);
    font-weight: 900; color: #fff; margin-bottom: .5rem;
    letter-spacing: -.02em;
}
.vault-sub {
    color: var(--hbc-muted); font-size: .92rem; line-height: 1.8;
    max-width: 46ch; margin: 0 auto;
}
.vault-sub b { color: var(--hbc-gold-light); font-weight: 700; }

/* ── 도착하는 헬리콥터 ───────────────────────────────────
   숫자만 늘어놓으면 서고가 멈춰 있는 창고로 보인다. 기체가 실제로
   책을 안고 들어와 중앙에 내려놓아야 "지금도 모이고 있다"가 보인다.
   ------------------------------------------------------- */
.vault-air { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }

.vault-heli {
    position: absolute;
    width: 78px;
    animation: vault-cross linear infinite;
    will-change: transform;
}
.vault-heli .body { animation: heli-fly-bob 2.1s ease-in-out infinite; }
.vault-heli svg { display: block; width: 100%; height: auto; overflow: visible; }
.vault-heli.rtl { transform: scaleX(-1); }

/* 매달고 오는 책 */
.vault-heli .parcel {
    position: absolute; left: 50%; top: 76%;
    width: 12px; height: 15px; margin-left: -6px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--hbc-gold-light), var(--hbc-gold-dark));
    box-shadow: 0 2px 6px rgba(0,0,0,.6);
    transform-origin: top center;
    animation: heli-swing 2.6s ease-in-out infinite;
}
.vault-heli .line {
    position: absolute; left: 50%; top: 66%;
    width: 1px; height: 10px;
    background: rgba(255,255,255,.45);
}

@keyframes vault-cross {
    from { transform: translateX(-140px); }
    to   { transform: translateX(calc(100vw + 140px)); }
}

/* 중앙에 내려앉는 순간의 반짝임 */
.vault-drop {
    position: absolute; left: 50%; top: 50%;
    width: 10px; height: 10px; margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--hbc-gold-light);
    box-shadow: 0 0 18px 6px rgba(52,211,153,.55);
    animation: vault-land 1.1s ease-out forwards;
}
@keyframes vault-land {
    0%   { opacity: 0; transform: translateY(-70px) scale(.5); }
    45%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(0) scale(2.6); }
}

/* ── 최근 도착 흐름 ─────────────────────────────────────── */

.vault-ticker {
    margin-top: 1.6rem;
    border-top: 1px solid rgba(16,185,129,.16);
    border-bottom: 1px solid rgba(16,185,129,.16);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.vault-ticker-track {
    display: flex; gap: 2.2rem; width: max-content;
    padding: .55rem 0;
    animation: vault-scroll 34s linear infinite;
}
.vault-ticker:hover .vault-ticker-track { animation-play-state: paused; }
@keyframes vault-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.vault-ticker-item {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: var(--hbc-muted); white-space: nowrap;
}
.vault-ticker-item b { color: #eafff6; font-weight: 600; }
.vault-ticker-item .who { color: var(--hbc-gold-light); }

/* ── 활동 그래프 ────────────────────────────────────────── */

.vault-spark {
    display: flex; align-items: flex-end; gap: 3px;
    height: 40px; margin-top: .6rem;
}
.vault-spark i {
    flex: 1; min-width: 4px;
    background: linear-gradient(180deg, var(--hbc-gold-light), rgba(16,185,129,.25));
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
    animation: vault-grow .7s ease-out backwards;
}
.vault-spark i.empty { background: rgba(255,255,255,.07); }
@keyframes vault-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* 규모 — 서고가 스스로를 설명하는 숫자들 */
.vault-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .75rem;
    margin-top: 2rem;
    max-width: 720px; margin-left: auto; margin-right: auto;
}
.vault-stat {
    background: rgba(6,18,14,.55);
    border: 1px solid rgba(16,185,129,.18);
    border-radius: 12px;
    padding: .8rem .6rem;
    backdrop-filter: blur(3px);
}
.vault-stat {
    position: relative;
    transition: border-color .2s, transform .2s;
}
.vault-stat:hover { border-color: rgba(16,185,129,.45); transform: translateY(-2px); }
/* 지표마다 은은한 맥박 — 살아 있는 값이라는 표시 */
.vault-stat::after {
    content: ""; position: absolute; left: 50%; bottom: 6px;
    width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
    background: var(--hbc-gold);
    opacity: .5;
    animation: heli-pulse 2.6s ease-in-out infinite;
    animation-delay: var(--beat, 0s);
}
.vault-stat .n {
    font-size: 1.5rem; font-weight: 800; color: #fff;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}
.vault-stat .k { font-size: .72rem; color: var(--hbc-muted); margin-top: .15rem; }

/* ── 서가 입구 (사람 / 장소) ─────────────────────────────── */

.shelf-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.shelf-door {
    background: var(--hbc-dark-2);
    border: 1px solid var(--hbc-border);
    border-radius: 14px;
    padding: 1rem;
}
.shelf-door h6 { color: #fff; font-size: .9rem; font-weight: 700; margin-bottom: .1rem; }
.shelf-door .lead-note { color: var(--hbc-muted); font-size: .76rem; margin-bottom: .75rem; }
.shelf-door-list { display: flex; flex-direction: column; gap: .3rem; }
.shelf-door-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .4rem .55rem; border-radius: 8px;
    text-decoration: none; color: var(--hbc-text);
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.shelf-door-item:hover { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.3); }
.shelf-door-item .name { flex: 1; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-door-item .n { font-size: .74rem; color: var(--hbc-gold-light); }
/* 책등 몇 권을 미리 보여 준다 — 서가처럼 */
.shelf-door-item .peek { display: flex; gap: 2px; }
.shelf-door-item .peek span {
    width: 3px; height: 14px; border-radius: 1px; background: var(--hbc-gold);
    opacity: .5;
}

/* 지금 보고 있는 서가 */
.shelf-scope {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .45rem .9rem; border-radius: 999px;
    background: rgba(16,185,129,.10); border: 1px solid rgba(16,185,129,.4);
    color: var(--hbc-gold-light); font-size: .84rem;
    margin-bottom: .9rem;
}
.shelf-scope a { color: var(--hbc-muted); text-decoration: none; }
.shelf-scope a:hover { color: #fff; }

/* 대공간 양옆의 서가 실루엣 — 홀이 깊어 보이게 */
.vault-wings { position: absolute; inset: 0; pointer-events: none; z-index: -2; overflow: hidden; }
.vault-wing {
    position: absolute; top: 0; bottom: 0; width: 22%;
    background:
        repeating-linear-gradient(0deg,
            rgba(0,0,0,.55) 0 26px,
            rgba(16,185,129,.07) 26px 30px);
    -webkit-mask-image: linear-gradient(90deg, #000, transparent);
            mask-image: linear-gradient(90deg, #000, transparent);
}
.vault-wing.left  { left: 0;  transform: perspective(420px) rotateY(26deg); transform-origin: left center; }
.vault-wing.right { right: 0; transform: perspective(420px) rotateY(-26deg); transform-origin: right center;
                    -webkit-mask-image: linear-gradient(270deg, #000, transparent);
                            mask-image: linear-gradient(270deg, #000, transparent); }

/* ══════════════════════════════════════════════════════════
   서가 — 책등이 꽂힌 선반

   기록을 카드로만 늘어놓으면 목록이지 책방이 아니다. 책등으로 세워
   선반에 꽂아야 "많이 쌓였다"가 한눈에 보인다.
   ══════════════════════════════════════════════════════════ */

.shelf {
    position: relative;
    padding: 1.6rem 1rem .5rem;
    margin-bottom: 1.6rem;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(0,0,0,.25), transparent 40%),
        rgba(6,18,14,.4);
}
/* 선반 널 */
.shelf::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 10px; border-radius: 3px;
    background: linear-gradient(180deg, #1d4a3a, #0d2b21 60%, #06120e);
    box-shadow: 0 6px 18px rgba(0,0,0,.65), inset 0 1px 0 rgba(167,243,208,.25);
}
/* 선반 위로 떨어지는 조명 */
.shelf::before {
    content: ""; position: absolute; left: 8%; right: 8%; top: 0; height: 60%;
    background: radial-gradient(60% 100% at 50% 0%, rgba(52,211,153,.10), transparent 70%);
    pointer-events: none;
}

.shelf-row {
    display: flex; align-items: flex-end; gap: 5px;
    flex-wrap: wrap;
    position: relative; z-index: 1;
    min-height: 176px;
}

/* 책등 하나 */
.book {
    position: relative;
    width: 44px;
    height: var(--h, 168px);
    border: none;
    border-radius: 3px 3px 2px 2px;
    padding: .5rem .2rem .55rem;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    /* 왼쪽의 밝은 선과 오른쪽 그늘이 책등의 두께를 만든다.
       색 섞기는 검은 반투명 층으로 한다 — color-mix 를 못 읽는 브라우저에서도 같다. */
    background:
        linear-gradient(90deg,
            rgba(255,255,255,.16) 0 2px,
            rgba(0,0,0,.28) 2px 5px,
            transparent 5px),
        linear-gradient(180deg, transparent, rgba(0,0,0,.55)),
        var(--spine, #1d4a3a);
    box-shadow: inset -3px 0 6px rgba(0,0,0,.45), 0 3px 10px rgba(0,0,0,.5);
    transition: transform .18s ease-out, box-shadow .18s, filter .18s;
    overflow: hidden;
}
.book:hover, .book:focus-visible {
    transform: translateY(-12px);
    box-shadow: inset -3px 0 6px rgba(0,0,0,.45), 0 14px 26px rgba(0,0,0,.65);
    filter: brightness(1.15);
    outline: none;
}
/* 책등의 금박 띠 */
.book::before, .book::after {
    content: ""; position: absolute; left: 4px; right: 4px; height: 1px;
    background: rgba(255,255,255,.35);
}
.book::before { top: 12px; }
.book::after  { bottom: 14px; }

.book-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: .74rem; font-weight: 600; line-height: 1.1;
    color: #f2fbf7;
    text-shadow: 0 1px 2px rgba(0,0,0,.7);
    max-height: calc(100% - 42px);
    overflow: hidden;
    margin-top: 6px;
}
.book-mark {
    position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    font-size: .62rem; color: rgba(255,255,255,.7);
}
/* 사진 기록은 책등 위쪽에 표지 조각을 보인다 */
.book-cover {
    position: absolute; top: 0; left: 0; right: 0; height: 34px;
    object-fit: cover; width: 100%;
    opacity: .85;
}
.book.has-cover .book-title { margin-top: 34px; max-height: calc(100% - 70px); }

/* 비공개 — 나만 보이는 책 */
.book.is-private { opacity: .78; }
.book.is-private .book-mark { color: #fcd34d; }

/* 내가 꽂은 책 — 모두의 서가에서도 한눈에 찾을 수 있게 서표를 끼운다.
   ::after 는 이미 책등 아래 금박 띠가 쓰고 있어 가름끈은 실제 요소로 둔다. */
.book.is-mine { box-shadow: inset -3px 0 6px rgba(0,0,0,.45), 0 3px 10px rgba(0,0,0,.5),
                            0 0 0 1px rgba(52,211,153,.55); }
.book-ribbon {
    position: absolute; top: -1px; right: 6px; z-index: 2;
    width: 7px; height: 26px;
    background: linear-gradient(180deg, var(--hbc-gold-light), var(--hbc-gold-dark));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
    box-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* 남의 기체가 날라 준 책 — 책등 아래에 붙는 작은 손님 도장.
   가름끈(내 것)과 자리를 나누어, 한눈에 셋이 갈린다:
   가름끈 = 내가 실은 것, 손님 도장 = 남의 기체에 실어 보낸 것, 없음 = 남의 것. */
.book-guest {
    position: absolute; bottom: 6px; left: 6px; z-index: 2;
    width: 15px; height: 15px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(56,189,248,.9);
    color: #04283a;
    font-size: .55rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.55);
}

/* ── 내 서가 ─────────────────────────────────────────────── */

.myshelf {
    border: 1px solid rgba(16,185,129,.35);
    border-radius: 16px;
    background:
        radial-gradient(90% 120% at 50% -10%, rgba(16,185,129,.14), transparent 60%),
        var(--hbc-dark-2);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}
/* 서가에 붙은 이름패 */
.myshelf-plate {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .35rem .9rem; border-radius: 8px;
    background: linear-gradient(180deg, #1d4a3a, #0d2b21);
    border: 1px solid rgba(167,243,208,.28);
    box-shadow: inset 0 1px 0 rgba(167,243,208,.25), 0 3px 10px rgba(0,0,0,.5);
    color: #eafff6; font-weight: 700; font-size: .95rem;
}
.myshelf-nums {
    display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: .9rem;
}
.myshelf-num .n {
    font-size: 1.35rem; font-weight: 800; color: #fff;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}
.myshelf-num .k { font-size: .72rem; color: var(--hbc-muted); }

/* 내 서가의 선반은 색이 다르다 — 내 자리라는 표시 */
.shelf.is-mine::after {
    background: linear-gradient(180deg, #2f6f57, #17402f 60%, #06120e);
    box-shadow: 0 6px 18px rgba(0,0,0,.65), inset 0 1px 0 rgba(167,243,208,.4);
}

/* 서표 설명 */
.shelf-legend {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .74rem; color: var(--hbc-muted);
}
.shelf-legend .ribbon {
    display: inline-block; width: 7px; height: 14px;
    background: linear-gradient(180deg, var(--hbc-gold-light), var(--hbc-gold-dark));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

/* 서가가 비었을 때 */
.shelf-empty {
    color: var(--hbc-muted); font-size: .86rem;
    text-align: center; padding: 2.6rem 1rem;
}

/* 펼친 책 (모달) */
.book-open .modal-content {
    background: linear-gradient(180deg, #0b1f18, #06120e);
    border: 1px solid rgba(16,185,129,.3);
    border-radius: 16px;
    color: var(--hbc-text);
}
.book-open .modal-header, .book-open .modal-footer { border-color: var(--hbc-border); }
.book-open img.page-image {
    width: 100%; max-height: 46vh; object-fit: contain;
    border-radius: 10px; background: #04100c;
}
.book-open .page-text {
    white-space: pre-wrap; line-height: 1.9; color: #cfe6dc; font-size: .95rem;
}

@media (max-width: 576px) {
    .book { width: 38px; }
    .shelf-row { min-height: 150px; gap: 4px; }
    .vault-wing { display: none; }
}

/* ── 서가 (도구) ─────────────────────────────────────────── */

.vault-toolbar {
    display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
    margin: 2rem 0 1.25rem;
}
.vault-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .35rem .75rem; border-radius: 999px;
    border: 1px solid var(--hbc-border);
    background: var(--hbc-dark-2);
    color: var(--hbc-muted); font-size: .8rem;
    text-decoration: none;
    transition: border-color .15s, color .15s, background .15s;
}
.vault-chip:hover { border-color: rgba(16,185,129,.45); color: var(--hbc-gold-light); }
.vault-chip.is-active {
    border-color: var(--hbc-gold); color: var(--hbc-gold);
    background: rgba(16,185,129,.10);
}
.vault-chip .cnt { opacity: .65; font-size: .72rem; }

/* 기록 한 칸 — 서가에 꽂힌 하나 */
.vault-cell {
    position: relative;
    background: linear-gradient(180deg, var(--hbc-dark-2), #0a1c15);
    border: 1px solid var(--hbc-border);
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex; flex-direction: column;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.vault-cell::before {
    /* 위쪽 가장자리를 따라 흐르는 빛 — 종류 색을 띤다 */
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent, #10b981), transparent);
    opacity: .55;
}
.vault-cell:hover {
    border-color: rgba(16,185,129,.45);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.vault-cell-media { position: relative; background: #071410; }
.vault-cell-media img {
    width: 100%; max-height: 200px; object-fit: cover; display: block;
}
.vault-cell-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.vault-cell-title { color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.4; }
.vault-cell-text {
    color: #b9d3c8; font-size: .85rem; line-height: 1.65;
    white-space: pre-wrap; margin: .45rem 0 .6rem;
    flex: 1;
}

/* 어디서 실려 어떻게 왔는지 — 기록의 내력 */
.vault-trail {
    margin-top: auto;
    padding-top: .6rem;
    border-top: 1px dashed rgba(255,255,255,.08);
    font-size: .74rem; color: #8fb3a4;
    display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.vault-trail a { color: #8fb3a4; text-decoration: none; }
.vault-trail a:hover { color: var(--hbc-gold-light); }
.vault-hops {
    display: inline-flex; align-items: center; gap: .2rem;
    padding: .05rem .4rem; border-radius: 999px;
    border: 1px solid rgba(16,185,129,.3); color: var(--hbc-gold-light);
}

/* 서고를 채운 사람들 */
.vault-people { display: flex; flex-wrap: wrap; gap: .5rem; }
.vault-person {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .4rem .75rem; border-radius: 999px;
    background: var(--hbc-dark-2); border: 1px solid var(--hbc-border);
    font-size: .82rem; color: var(--hbc-text);
}
.vault-person .rank {
    width: 18px; height: 18px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(16,185,129,.15); color: var(--hbc-gold);
    font-size: .66rem; font-weight: 700;
}
.vault-person .n { color: var(--hbc-gold-light); font-size: .76rem; }

@media (prefers-reduced-motion: reduce) {
    .vault-mote, .vault-beam, .vault-ring::after { animation: none !important; }
    .vault-mote { opacity: .5; }
}

@media (max-width: 576px) {
    .vault { border-radius: 14px; }
    .vault-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── 주소 검색 ────────────────────────────────────────────── */

.heli-search-results {
    margin-top: .5rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--hbc-border);
    border-radius: 10px;
    background: var(--hbc-dark-2);
}
.heli-search-results:empty { display: none; }
.heli-search-item {
    display: block; width: 100%; text-align: left;
    padding: .55rem .75rem;
    background: transparent; border: none;
    border-bottom: 1px solid var(--hbc-border);
    color: var(--hbc-text);
}
.heli-search-item:last-child { border-bottom: none; }
.heli-search-item:hover { background: rgba(16,185,129,.08); }
.heli-search-item .name { font-size: .88rem; display: block; }
.heli-search-item .addr { font-size: .74rem; color: var(--hbc-muted); }

/* ══════════════════════════════════════════════════════════
   모바일
   화면이 좁아지면 지도와 짐칸이 먼저 넓어져야 한다.
   버튼은 손가락으로 누를 수 있는 크기를 지킨다.
   ══════════════════════════════════════════════════════════ */

@media (max-width: 576px) {
    .heli-map-stage { height: 62vh; min-height: 320px; border-radius: 12px; }
    .heli-sky { height: 168px; }

    /* 좁은 화면에서는 기체를 줄이고 여백도 그만큼 줄인다 */
    .heli-craft { width: 84px; }
    .heli-route { left: 48px; right: 48px; }

    .heli-map-craft { width: 84px; }
    .heli-map-cargo-chip { width: 22px; height: 22px; }
    .heli-map-pin-label { max-width: 96px; font-size: .66rem; }

    .heli-bay-slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .4rem; }
    .heli-bay { padding: .7rem; }

    /* 손가락 목표 크기 */
    .heli-action-bar .btn,
    .heli-action-bar .hbc-btn { min-height: 44px; }

    .heli-endpoint-label { max-width: 84px; font-size: .66rem; }
    .heli-summon-hero { padding: 1.4rem .5rem 1rem; }
}

/* 아래쪽에 고정되는 동작 바 — 엄지로 닿는 자리 */
.heli-action-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
.heli-action-bar > * { flex: 1 1 auto; }

/*
 * 좁은 화면에서는 두 칸씩 놓는다.
 *
 * 예전에는 한 줄에 모두 밀어 넣었다. 그러면 344px 에서 칸 하나가 80px 남짓이라
 * "어딘가로 보내기"가 "어딘가로 보 / 내기"로 잘렸다. 글자를 줄이는 대신
 * 줄을 하나 더 쓴다 — 버튼 이름은 무엇을 하는지 말해 주는 유일한 단서다.
 */
@media (max-width: 576px) {
    .heli-action-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .5rem;
    }
    .heli-action-bar > * { min-width: 0; }
    .heli-action-bar .btn, .heli-action-bar .hbc-btn {
        width: 100%;
        font-size: .82rem;
        padding-left: .5rem; padding-right: .5rem;
        white-space: nowrap;      /* 칸 안에서 또 접히지 않게 */
        word-break: keep-all;
    }
}

/* ── 인쇄 포스터 ──────────────────────────────────────────── */

@media print {
    body { background: #fff !important; color: #000 !important; }
    .no-print, nav, footer { display: none !important; }
    .heli-poster {
        width: 100%; min-height: 96vh;
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        text-align: center; color: #000;
        page-break-after: always;
    }
    .heli-poster * { color: #000 !important; }
}

/* ══════════════════════════════════════════════════════════
   격납고 창고 — 도착한 짐과 쌓아 둔 것
   ══════════════════════════════════════════════════════════ */

.parcel-card {
    border: 1px solid rgba(245,158,11,.4);
    border-radius: 14px;
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(245,158,11,.10), transparent 60%),
        var(--hbc-dark-2);
    padding: .9rem 1rem;
    margin-bottom: .75rem;
}
.parcel-card .who { color: #fcd34d; font-weight: 700; font-size: .86rem; }
.parcel-card .what { color: #fff; font-weight: 600; font-size: .95rem; margin-top: .15rem; }
.parcel-card .note {
    margin-top: .4rem; padding-left: .6rem;
    border-left: 2px solid rgba(245,158,11,.4);
    color: var(--hbc-muted); font-size: .82rem; line-height: 1.7;
}
.parcel-actions { display: flex; gap: .5rem; margin-top: .8rem; }
.parcel-actions form { flex: 1; }
.parcel-actions button { width: 100%; }

.storage-item {
    display: flex; gap: .7rem; align-items: flex-start;
    padding: .7rem .2rem;
    border-bottom: 1px solid var(--hbc-border);
}
.storage-item:last-child { border-bottom: none; }
.storage-item .icon {
    width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--hbc-dark-3); border: 1px solid var(--hbc-border);
}
.storage-item .body { min-width: 0; flex: 1; }
.storage-item .t {
    color: #fff; font-size: .9rem; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.storage-item .m { color: var(--hbc-muted); font-size: .74rem; margin-top: .15rem; }
.storage-item .thumb {
    width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: 0 0 auto;
}

/* 남이 보내 준 것 — 내가 만든 것과 갈려 보여야 한다 */
.storage-from-other {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .05rem .4rem; border-radius: 999px;
    background: rgba(56,189,248,.12); color: #7dd3fc;
    font-size: .68rem; font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   알림
   ══════════════════════════════════════════════════════════ */

.noti-item {
    display: flex; gap: .7rem; align-items: flex-start;
    padding: .8rem .2rem;
    border-bottom: 1px solid var(--hbc-border);
    text-decoration: none;
}
.noti-item:last-child { border-bottom: none; }
.noti-item .dot {
    width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--hbc-dark-3); border: 1px solid var(--hbc-border);
}
.noti-item .t { color: #fff; font-size: .89rem; font-weight: 600; }
.noti-item .b { color: var(--hbc-muted); font-size: .8rem; margin-top: .2rem; line-height: 1.65; }
.noti-item .w { color: var(--hbc-muted); font-size: .72rem; margin-top: .25rem; }
.noti-item.is-unread { background: rgba(16,185,129,.05); border-radius: 10px; }
.noti-item.is-unread .t::after {
    content: ''; display: inline-block; margin-left: .4rem;
    width: 6px; height: 6px; border-radius: 50%; background: var(--hbc-gold);
    vertical-align: middle;
}


/* ══════════════════════════════════════════════════════════
   정류장
   ══════════════════════════════════════════════════════════ */

.station-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .12rem .5rem; border-radius: 999px;
    border: 1px solid rgba(245,158,11,.5);
    background: rgba(245,158,11,.10);
    color: #fcd34d; font-size: .72rem; font-weight: 700;
}
.station-rewards {
    display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem;
}
.station-reward {
    display: flex; align-items: center; gap: .35rem;
    padding: .3rem .6rem; border-radius: 9px;
    border: 1px solid var(--hbc-border); background: var(--hbc-dark-3);
    font-size: .78rem;
}
.station-reward .n { font-weight: 700; }

/* 현장 방문 버튼 — 정류장 화면에서 가장 큰 손짓 */
.station-checkin {
    width: 100%; padding: .85rem;
    border-radius: 12px; border: 1px solid rgba(245,158,11,.55);
    background: linear-gradient(140deg, rgba(245,158,11,.18), rgba(245,158,11,.06));
    color: #fcd34d; font-weight: 700; font-size: .92rem;
    cursor: pointer;
}
.station-checkin:disabled { opacity: .6; cursor: default; }

/* ══════════════════════════════════════════════════════════
   격납고 화면의 모바일 차례

   짐칸은 이 화면에서 가장 자주 하는 일인데, 원래는 격납고·도장·
   통계·위치 카드를 모두 지나야 나왔다. 좁은 화면에서는 그 거리가
   화면 대여섯 개 분량이라 "적재하려면 끝까지 내려가야 하는" 화면이
   되어 있었다. 폭이 좁을 때만 짐칸을 기체 바로 아래로 끌어올린다.

   차례를 바꾸는 것이지 감추는 것이 아니다 — 격납고와 도장은
   짐칸 아래에 그대로 있다.
   ══════════════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
    .heli-hangar { display: flex; flex-direction: column; }

    /* 차례를 적지 않은 것(안내·기체·지도)은 0 이라 먼저 온다 */
    .heli-hangar > .heli-order-cargo { order: 2; }
    .heli-hangar > .heli-order-late  { order: 3; }

    /* 짐칸 안에서도 싣는 칸이 먼저다. 격실 그림과 실린 목록은 그 뒤. */
    .heli-bay-col { display: flex; flex-direction: column; }
    .heli-bay-col > .heli-loader-first { order: -1; }
}

/* 불러서 온 자리임을 잠깐 밝혀 준다 —
   눌렀는데 화면만 움직이면 무엇이 열렸는지 알기 어렵다. */
.heli-loader.is-called {
    animation: heli-loader-call 1.4s ease-out;
}
@keyframes heli-loader-call {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
    35%  { box-shadow: 0 0 0 6px rgba(16,185,129,.22); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

@media (prefers-reduced-motion: reduce) {
    .heli-loader.is-called { animation: none; border-color: var(--hbc-gold); }
}

/* 창고에 쌓인 글의 본문.
   "비공개"는 본부 서고에 내놓지 않았다는 뜻이지 나에게도 감춘다는 뜻이
   아니다. 내 창고의 내 글이 제목만 보이면 창고가 아니라 목록일 뿐이다. */
.storage-item .storage-text {
    margin-top: .35rem;
    padding-left: .55rem;
    border-left: 2px solid var(--hbc-border);
    color: var(--hbc-muted);
    font-size: .82rem;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: keep-all;
    /* 긴 글은 접어 둔다 — 창고 목록이 글 하나로 덮이면 안 된다 */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 한글은 낱말 안에서도 줄이 바뀐다.
   좁은 화면에서 칸이 눌리면 글자가 한 줄에 하나씩 세로로 쌓인다. */
@media (max-width: 767.98px) {
    .heli-place-card .name,
    .storage-item .t,
    .parcel-card .what,
    .noti-item .t,
    .heli-nav-item span { word-break: keep-all; }
}

/* ══════════════════════════════════════════════════════════
   구역 바로가기 — 세로로 긴 화면을 건너뛰어 다닌다

   격납고 화면은 짐칸·격납고·도장·통계·사슬·기록이 세로로 이어져
   화면 대여섯 개 분량이 된다. 무엇이 어디 있는지 한눈에 들어오지 않고,
   아래에 있는 것에 닿으려면 계속 밀어 내려야 했다.

   기체 아래에 붙여 두고, 스크롤을 내려도 위에 남아 따라온다.
   ══════════════════════════════════════════════════════════ */

.heli-sections {
    position: sticky;
    top: 62px;                 /* 상단 바 바로 아래 */
    z-index: 20;
    display: flex; gap: .35rem;
    overflow-x: auto; scrollbar-width: none;
    margin: .75rem 0 1rem;
    padding: .4rem;
    border-radius: 14px;
    border: 1px solid var(--hbc-border);
    background: rgba(10, 22, 18, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    scroll-snap-type: x proximity;
}
.heli-sections::-webkit-scrollbar { display: none; }

.heli-sections button {
    flex: 1 0 auto;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .45rem .8rem;
    border-radius: 10px; border: 1px solid transparent;
    background: transparent;
    color: var(--hbc-muted);
    font-size: .82rem; font-weight: 600;
    white-space: nowrap; cursor: pointer;
    scroll-snap-align: start;
    transition: color .15s, background .15s, border-color .15s;
}
.heli-sections button i { font-size: .95rem; }
.heli-sections button:hover { color: var(--hbc-gold-light); }
.heli-sections button.is-active {
    color: var(--hbc-gold);
    border-color: var(--hbc-gold);
    background: rgba(16,185,129,.12);
}

@media (max-width: 767.98px) {
    .heli-sections { top: 58px; padding: .35rem; }
    .heli-sections button { padding: .45rem .6rem; font-size: .78rem; }
    /* 좁으면 글자를 줄이지 않고 아이콘만 남기지도 않는다 —
       둘 다 있어야 무엇인지 안다. 대신 옆으로 민다. */
}

/* 방금 건너온 구역을 잠깐 밝혀 준다.
   눌렀는데 화면만 움직이면 어디에 닿았는지 알기 어렵다. */
.heli-jump-target {
    animation: heli-jump-flash 1.2s ease-out;
    border-radius: 14px;
}
@keyframes heli-jump-flash {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
    30%  { box-shadow: 0 0 0 5px rgba(16,185,129,.2); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ── 접히는 구역 ────────────────────────────────────────
   사슬과 항로는 날수록 길어지기만 한다. 펴 두면 그 아래 것들이
   화면 밖으로 밀려나므로, 접어 두고 볼 사람만 연다.
   ------------------------------------------------------- */

.heli-fold { overflow: hidden; }
.heli-fold > summary {
    position: relative;
    cursor: pointer;
    list-style: none;
    padding-right: 2.6rem;
}
.heli-fold > summary::-webkit-details-marker { display: none; }
.heli-fold > summary:hover { background: rgba(255,255,255,.02); }

.heli-fold-count {
    display: inline-block;
    margin-left: .4rem; padding: .05rem .45rem;
    border-radius: 999px;
    background: rgba(16,185,129,.15);
    border: 1px solid rgba(16,185,129,.35);
    color: var(--hbc-gold);
    font-size: .72rem; font-weight: 700;
    vertical-align: middle;
}

.heli-fold-arrow {
    position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%);
    color: var(--hbc-muted);
    transition: transform .2s;
}
.heli-fold[open] > summary .heli-fold-arrow {
    transform: translateY(-50%) rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .heli-jump-target { animation: none; }
    .heli-fold-arrow { transition: none; }
}
