/* ------------------------------------------------------------------
   당수신 — 화면 구석에 상주하는 마스코트 + 옷장
   ------------------------------------------------------------------ */
.mascot {
  position: fixed; right: 16px; bottom: 16px; z-index: 45;
  width: 132px; user-select: none; -webkit-user-select: none;
}
.mascot--sm { width: 92px; }
@media (max-width: 699px) { .mascot { width: 100px; } .mascot--sm { width: 72px; } }
.mascot[data-min="true"] { width: auto; }
.mascot[data-min="true"] .mascot__fig, .mascot[data-min="true"] .mascot__bubble, .mascot[data-min="true"] .mascot__bar { display: none; }
.mascot__min { display: none; }
.mascot[data-min="true"] .mascot__min { display: inline-grid; }

.mascot__fig { display: block; width: 100%; cursor: grab; touch-action: none; filter: drop-shadow(3px 3px 0 var(--accent)); }
.mascot.is-drag .mascot__fig { cursor: grabbing; }
.mascot__fig svg, .mascot__fig img { width: 100%; height: auto; display: block; overflow: visible; pointer-events: none; }
.mascot__body { animation: ms-bob 3.2s ease-in-out infinite; transform-origin: 60px 126px; }
.mascot__eyes { animation: ms-blink 5s infinite; transform-origin: 60px 52px; }
.mascot.is-jump .mascot__body { animation: ms-jump .55s var(--ease); }
@keyframes ms-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px) scaleX(1.012); } }
@keyframes ms-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes ms-jump { 0% { transform: translateY(0); } 40% { transform: translateY(-18px) rotate(-5deg); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .mascot__body, .mascot__eyes { animation: none !important; } }

.mascot__bubble {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  min-width: 170px; max-width: 250px; width: max-content;
  background: var(--ink); color: var(--paper); padding: 10px 12px;
  font-size: 13px; line-height: 1.55; word-break: keep-all;
  opacity: 0; transform: translateY(6px); transition: opacity var(--fast), transform var(--fast); pointer-events: none;
}
.mascot__bubble::after { content: ""; position: absolute; right: 44px; top: 100%; border: 7px solid transparent; border-top-color: var(--ink); }
.mascot__bubble--below { bottom: auto; top: calc(100% + 8px); }
.mascot__bubble--below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }
.mascot__bubble.is-on { opacity: 1; transform: none; }
.mascot__bubble b { display: block; color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 2px; }

.mascot__bar {
  position: absolute; right: calc(100% + 6px); bottom: 10px;
  display: flex; flex-direction: column; gap: 4px;
  opacity: 0; transition: opacity var(--fast);
}
.mascot:hover .mascot__bar, .mascot:focus-within .mascot__bar { opacity: 1; }
@media (pointer: coarse) { .mascot__bar { opacity: .95; } }
.mascot__bar button, .mascot__min {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 0 8px; min-height: 30px; min-width: 44px;
}
.mascot__bar button:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.mascot__min { place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; font-family: var(--font-display); box-shadow: 3px 3px 0 var(--accent); }
.mascot__min:hover { background: var(--accent); color: var(--accent-fg); }

/* 옷장 ---------------------------------------------------------------- */
.closet {
  position: fixed; right: 16px; bottom: 16px; z-index: 46;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg); color: var(--fg); border: 1.5px solid var(--fg); box-shadow: 6px 6px 0 var(--accent);
  display: none;
}
.closet[data-open="true"] { display: block; }
@media (max-width: 699px) { .closet { left: 16px; right: 16px; width: auto; } }
.closet__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--ink); color: var(--paper); }
.closet__title { font-family: var(--font-head); font-weight: 800; font-size: 15px; }
.closet__head .icon-btn { border-color: var(--paper); color: var(--paper); }
.closet__head .icon-btn:hover { background: var(--paper); color: var(--ink); }
.closet__body { padding: 12px; display: grid; gap: 12px; max-height: 70vh; overflow: auto; }
.closet__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.closet__item {
  border: 1.5px solid var(--line-2); padding: 6px 4px 6px; display: grid; gap: 4px; justify-items: center;
  background: var(--bg); min-height: 44px; transition: border-color var(--fast), box-shadow var(--fast);
}
.closet__item svg, .closet__item img { width: 58px; height: auto; }
.closet__item span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
.closet__item:hover { border-color: var(--fg); }
.closet__item[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.closet__row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.closet__foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
