﻿/* 스탯스토리 — 장비 화면(무기·모자·갑옷·반지·목걸이)과 새 장비 알림 */

/* ---------- 장비 화면(js/screens.js 의 screens.inventory) ----------
   넓은 화면: 왼쪽 캐릭터 카드, 오른쪽 장비 카드(탭 · 칸 목록 | 고른 장비 설명·강화).
   장비 카드가 좁으면(태블릿 세로·휴대폰) 설명·강화가 칸 목록 위로 온다. 장비 카드는 크기 기준(container)이라 카드 폭으로 배치를 바꾼다. */
.inv-screen .wrap.inv-grid { max-width: 1200px; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 18px; padding-block: 18px 32px; }

/* 캐릭터 카드: 무대 · 낀 장비 다섯 칸 · 능력치 */
.inv-screen .char-card { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.inv-screen .char-card .stagebox { height: 250px; }
.inv-measuring .idle { animation: none !important; } /* 주인공 크기를 잴 때 숨쉬기를 잠깐 멈춘다 */
/* 펫은 가장 멀리 걸어 나간 자리(css/pets.css 의 pet-pace 70%)에 세워 잰다: 좁은 휴대폰 무대에서도 주인공과 펫이 함께 들어가게 */
.inv-measuring .pet-orbit { animation: none !important; transform: translateX(70%) !important; }
.inv-measuring .pet-face, .inv-measuring .pet-bob { animation: none !important; }
.inv-screen .pedestal.pop .idle { animation: inv-pop .55s cubic-bezier(.2, 1.5, .4, 1); } /* 장비를 바꾸면 살짝 튀어 오른다 */
/* 레벨 오라(js/pixelfx.js, 전투와 같은 도트 효과): 뒤 캔버스(고리·빛기둥·뒤쪽 빛줄기)는 주인공(.pedestal, z 2) 뒤, 앞 캔버스(앞쪽 구슬·반짝이)는 앞 */
.inv-screen .stagebox canvas.px { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.inv-screen .stagebox canvas.px.back { z-index: 1; }
.inv-screen .stagebox canvas.px.front { z-index: 3; }
@keyframes inv-pop { 0% { transform: scale(.92, 1.06); filter: brightness(1.7); } 45% { transform: scale(1.05, .96); } 100% { transform: none; filter: none; } }
.inv-eqrow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 10px 12px 12px; background: var(--paper-2); border-bottom: 3px solid var(--ink); }
.inv-eq {
  position: relative; min-width: 0; height: 50px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); transition: transform .08s;
}
.inv-eq .item-pic { width: 34px; height: 34px; }
.inv-eq.empty { background: repeating-linear-gradient(45deg, #faf3e3 0 5px, #f2e8d2 5px 10px); border-style: dashed; box-shadow: none; }
.inv-eq .gl { display: block; width: 26px; height: 26px; opacity: .4; filter: grayscale(1); }
.inv-eq .gl svg { width: 100%; height: 100%; }
.inv-eq.on { border-color: var(--violet); box-shadow: 0 0 0 3px #e3dbff, 0 3px 0 var(--violet-deep); }
.inv-eq .plus { position: absolute; right: 3px; bottom: 2px; font-family: var(--f-num); font-size: 11px; line-height: 1; color: var(--orange-deep); text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff; }
.inv-eq:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.inv-eq:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.inv-screen .statlist .r { flex-wrap: wrap; gap: 0 8px; }
.inv-screen .statlist .r b { margin-left: auto; text-align: right; }

/* 장비 카드 */
.inv-screen .items-card { container-type: inline-size; align-content: start; gap: 12px; padding: 16px; }
.inv-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.inv-screen .items-card .inv-head h2 { line-height: 1.1; }
.inv-tot { font-family: var(--f-ui); font-size: 14.5px; color: var(--ink-2); white-space: nowrap; }
.inv-tot b { font-family: var(--f-num); font-weight: 400; font-size: 19px; color: var(--ink); }

/* 탭: 고른 탭은 금빛(모험 기록의 탭과 같은 모양). 칸 목록을 내려도 위에 붙어 있다 */
.inv-tabbar { position: sticky; top: 0; z-index: 6; margin: -4px -13px 0; padding: 8px 13px 10px; background: var(--paper); border-bottom: 2.5px solid var(--paper-line); }
.inv-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; } /* 무기·모자·갑옷·반지·목걸이·펫 */
.inv-tab {
  min-width: 0; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 2px 5px; cursor: pointer;
  font-family: var(--f-ui); color: var(--ink); line-height: 1.1;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 13px; box-shadow: 0 4px 0 var(--ink), inset 0 -3px 0 #e4d4b2; transition: transform .08s;
}
.inv-tab .g { display: none; }
.inv-tab .tx { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.inv-tab .t { font-size: 15px; white-space: nowrap; }
.inv-tab .n { font-family: var(--f-num); font-weight: 400; font-size: 13px; line-height: 1; color: var(--ink-soft); white-space: nowrap; }
.inv-tab[aria-selected="true"] { background: linear-gradient(180deg, #fff6c2 0%, var(--gold) 72%); box-shadow: 0 4px 0 var(--ink), inset 0 -4px 0 var(--gold-deep), inset 0 2px 0 rgba(255, 255, 255, .6); }
.inv-tab[aria-selected="true"] .n { color: #7a4d00; }
.inv-tab:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.inv-tab:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
@container (min-width: 640px) { /* 탭 여섯 개에 그림까지 들어갈 만큼 넓을 때 */
  .inv-tabs { gap: 8px; }
  .inv-tab { gap: 7px; padding: 5px 6px 6px; }
  .inv-tab .g { display: block; width: 26px; height: 26px; flex: none; }
  .inv-tab .g svg { width: 100%; height: 100%; }
  .inv-tab .tx { align-items: flex-start; }
  .inv-tab .t { font-size: 17px; }
  .inv-tab .n { font-size: 13.5px; }
}

/* 고른 장비(설명·착용·강화) + 칸 목록. 넓은 카드에서는 칸 목록 오른쪽에 설명이 붙어 따라 내려온다 */
.inv-body { display: grid; gap: 14px; min-width: 0; }
.inv-side, .inv-list { display: grid; gap: 12px; align-content: start; min-width: 0; }
.inv-note { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
@container (min-width: 600px) {
  .inv-body { grid-template-columns: minmax(0, 1fr) minmax(0, 270px); grid-template-areas: "list side"; align-items: start; }
  .inv-list { grid-area: list; }
  .inv-side { grid-area: side; position: sticky; top: calc(var(--inv-tabs-h, 70px) + 10px); }
}
@media (max-height: 640px) { .inv-screen .inv-side { position: static; } } /* 낮은 화면에서는 설명·강화 칸이 화면보다 길 수 있어 따라 내려오지 않는다 */

/* 모자 그림: 키 큰 모자(가발·투구·고깔)도 칸 안에 비율대로 넣는다(이름 글씨를 덮지 않게).
   문제 글의 ŷ 모자 기호(css/game.css 의 .hat::before)가 모자 그림 위에 ^ 로 붙지 않게 한다. */
.inv-screen .item-pic.hat img, .reward-notice .item-pic.hat img { height: 100%; object-fit: contain; }
.inv-screen .item-pic.hat::before, .reward-notice .item-pic.hat::before { content: none; }

/* 칸 목록: 얻은 장비는 그림·이름(무기는 +강화), 못 얻은 장비는 줄무늬 종이에 검은 그림자·???·귀띔 */
.inv-screen .inv-slots { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 12px 8px; padding-top: 6px; }
.inv-cell { min-width: 0; min-height: 104px; align-content: start; gap: 3px; padding: 9px 4px 8px; }
.inv-cell .ico { width: 54px; height: 58px; display: grid; place-items: center; } /* 비스듬히 든 무기 끝이 이름에 닿지 않게 위아래로 조금 띄운다 */
.inv-screen .inv-cell .ico .item-pic, .inv-screen .inv-cell .ico > svg { width: 50px; height: 50px; }
.inv-cell .nm { max-width: 100%; font-size: 13px; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.inv-cell .plus, .inv-cell .eq { z-index: 2; } /* 장비 그림보다 위에 */
.inv-cell .plus { text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.inv-cell { transition: transform .12s; }
.inv-cell:active { transform: translateY(2px); }
@media (hover: hover) { .inv-cell:hover, .inv-eq:hover { transform: translateY(-2px); } }
.inv-cell.locked { background: repeating-linear-gradient(45deg, #faf3e3 0 6px, #f2e8d2 6px 12px); border-style: dashed; box-shadow: none; color: var(--ink-soft); }
.inv-cell.locked .nm { letter-spacing: 2px; }
.inv-cell.locked .ico img, .inv-cell.locked .ico svg { filter: brightness(0); opacity: .26; }
.inv-cell .hint { max-width: 100%; font-size: 11.5px; line-height: 1.2; color: var(--ink-2); word-break: keep-all; overflow-wrap: anywhere; }
.inv-mbar, .inv-bbar { display: flex; align-items: center; gap: 4px; min-width: 0; }
.inv-mbar { width: 100%; padding: 0 3px; }
.inv-mbar .bar, .inv-bbar .bar { position: relative; flex: 1; min-width: 0; height: 9px; border: 2px solid var(--ink); border-radius: 6px; background: #efe5cf; overflow: hidden; }
.inv-mbar .bar i, .inv-bbar .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #a6f3dc 0%, var(--mint) 55%, var(--mint-deep) 100%); }
.inv-mbar .bar u, .inv-bbar .bar u { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--violet-deep); } /* 목표 눈금(반지 80%) */
.inv-mbar b { font-family: var(--f-num); font-weight: 400; font-size: 11px; line-height: 1; color: var(--ink-2); white-space: nowrap; }
.inv-bbar { gap: 8px; }
.inv-bbar .bar { height: 14px; border-width: 2.5px; border-radius: 8px; }
.inv-bbar .bar i { background: linear-gradient(180deg, #fff3b0 0%, var(--exp) 50%, var(--exp-deep) 100%); }
.inv-bbar .bar u { width: 3px; margin-left: -1.5px; }
.inv-bbar b { font-family: var(--f-num); font-weight: 400; font-size: 15px; white-space: nowrap; }

/* 고른 장비 설명: 위에 그림·이름, 아래에 설명·능력치·비교·단추 */
.inv-screen .inv-detail { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 12px; scroll-margin-top: calc(var(--inv-tabs-h, 70px) + 10px); }
.inv-screen .inv-detail > .ico { width: 64px; height: 64px; border-radius: 12px; }
.inv-screen .inv-detail > .ico .item-pic, .inv-screen .inv-detail > .ico > svg { width: 52px; height: 52px; }
.inv-detail > :nth-child(n + 3) { grid-column: 1 / -1; }
.inv-dh { display: grid; gap: 3px; min-width: 0; }
.inv-screen .inv-detail .nm { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 19px; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.inv-kind { font-family: var(--f-ui); font-size: 13.5px; line-height: 1.3; color: var(--ink-soft); }
.inv-screen .inv-detail .ds { margin: 0; font-size: 13.5px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.inv-detail .ds .sub { font-family: var(--f-ui); font-size: 13px; color: var(--ink-soft); }
.inv-screen .inv-detail .st { margin: 0; align-items: center; }
.inv-detail .st .k { font-family: var(--f-ui); font-size: 13px; color: var(--ink-soft); }
.inv-cmp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 7px 10px; background: rgba(255, 255, 255, .72); border-radius: 10px; font-family: var(--f-ui); font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.inv-cmp .k { color: var(--violet-deep); }
.inv-cmp b { font-family: var(--f-num); font-weight: 400; font-size: 15px; }
.inv-cmp .up b { color: #0f6a3a; }
.inv-cmp .down b { color: var(--bad); }
.inv-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inv-act .btn { min-height: 44px; }
.inv-act .btn.small { padding-inline: 16px; }
.inv-act .pill { padding-block: 4px 5px; }
.inv-detail.locked { background: repeating-linear-gradient(45deg, #faf3e3 0 7px, #f4ead5 7px 14px); border-style: dashed; }
.inv-screen .inv-detail.locked > .ico { background: #f6efdf; border-style: dashed; }
.inv-detail.locked > .ico img, .inv-detail.locked > .ico svg { filter: brightness(0); opacity: .26; }
.inv-detail.locked .nm { color: var(--ink-soft); letter-spacing: 3px; }

/* ---------- 휴대폰: 캐릭터 카드를 가로로(왼쪽 무대, 오른쪽 능력치, 아래 낀 장비) ---------- */
@media (max-width: 760px) {
  .inv-screen .wrap.inv-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-block: 12px 28px; }
  .inv-screen .char-card { grid-template-columns: 136px minmax(0, 1fr); }
  .inv-screen .char-card .stagebox { grid-column: 1; grid-row: 1; height: auto; min-height: 196px; border-bottom: 0; border-right: 3px solid var(--ink); }
  .inv-screen .char-card .statlist { grid-column: 2; grid-row: 1; align-content: center; gap: 4px; padding: 10px 12px; }
  .inv-screen .statlist .r { font-size: 14px; }
  .inv-screen .statlist .r b { font-size: 16.5px; }
  .inv-screen .inv-eqrow { grid-column: 1 / -1; grid-row: 2; padding: 9px 10px 11px; border-top: 3px solid var(--ink); border-bottom: 0; }
  .inv-screen .items-card { padding: 12px; }
  .inv-tabbar { margin-inline: -9px; padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .inv-screen .pedestal.pop .idle { animation: none; }
}

/* ---------- 새 장비 알림(js/ui.js 의 SS.ui.rewardNotice): 승리 창처럼 빛살·리본·장비 카드 ---------- */
.modal-back:has(> .reward-notice) { overflow-x: hidden; } /* 돌아가는 빛살이 좁은 화면에서 가로 스크롤을 만들지 않게 */
.modal.reward-notice { max-width: 440px; padding-top: 32px; }
.reward-notice h2 { line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.rn-list { display: grid; gap: 10px; min-width: 0; }
.rn-list.many { max-height: min(46vh, 360px); overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px; padding: 2px 8px 10px; } /* 한꺼번에 많이 얻으면 목록 안에서 내린다 */
.reward-notice .drop-card .tx { min-width: 0; }
.reward-notice .drop-card .t { line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.reward-notice .drop-card .d { word-break: keep-all; overflow-wrap: anywhere; }
.reward-notice .drop-card.mini { gap: 10px; padding: 7px 10px; box-shadow: 0 3px 0 var(--gold-deep); }
.reward-notice .drop-card.mini .ico { width: 48px; height: 48px; border-radius: 12px; }
.reward-notice .drop-card.mini .ico .item-pic { width: 40px; height: 40px; }
.reward-notice .drop-card.mini .t { font-size: 16px; }
.reward-notice .drop-card.mini .d { font-size: 13px; }
.reward-notice .modal-acts .btn { min-width: 132px; }
.reward-notice .rn-foot { margin: -4px 0 0; font-size: 13.5px; color: var(--ink-soft); word-break: keep-all; }
